/*
  VOSTAY — the assistant's draft panel.

  Sits between the conversation and the composer, so it reads as "here's a
  suggestion" rather than as a message that has already gone out. That
  distinction is the entire point of the surface: nothing here has reached the
  guest yet.

  Every value comes from tokens.css. Motion follows the same rules as the rest
  of the app: transform/opacity only, ease-out for anything entering, well
  under 300ms, and nothing animates that an operator will see hundreds of times
  a day.
*/

.draft {
  border: 1px solid hsl(var(--primary) / 0.28);
  background:
    linear-gradient(hsl(var(--primary) / 0.04), hsl(var(--primary) / 0.04)),
    hsl(var(--surface));
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  /* Enter from slightly below and 0.97 — never from scale(0); nothing in the
     real world appears out of nothing. */
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

@starting-style {
  .draft {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

/* A stopped draft is not a suggestion — colour carries that before any text
   is read. Never the only signal though: the pill and the reason say it too. */
.draft[data-status="blocked"] {
  border-color: hsl(var(--destructive) / 0.35);
  background:
    linear-gradient(hsl(var(--destructive) / 0.05), hsl(var(--destructive) / 0.05)),
    hsl(var(--surface));
}

.draft[data-status="escalated"] {
  border-color: hsl(var(--warning) / 0.4);
  background:
    linear-gradient(hsl(var(--warning) / 0.05), hsl(var(--warning) / 0.05)),
    hsl(var(--surface));
}

/* Leaving: faster than entering. The system responding should always feel
   quicker than the user deciding. */
.draft.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

/* ---- header ------------------------------------------------------------- */

.draft__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.draft__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-2xs);
  font-weight: 650;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.draft__pill {
  font-size: var(--text-3xs);
}

/* Provenance: which SOP section grounded the answer, and the guest's
   language. An operator deciding whether to trust a draft needs to know where
   it came from — far more useful than a confidence score. */
.draft__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  background: hsl(var(--surface-sunken));
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

/* ---- editable draft ------------------------------------------------------ */

.draft__text {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  font: inherit;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: hsl(var(--fg));
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.draft__text:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--ring-subtle));
}

.draft__hint {
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  margin-top: 6px;
}

.draft__reason {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: hsl(var(--fg));
}

.draft__reason svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: hsl(var(--warning-fg));
}

.draft[data-status="blocked"] .draft__reason svg {
  color: hsl(var(--destructive));
}

/* ---- actions ------------------------------------------------------------- */

.draft__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

/* Instant feedback that the press registered. Subtle — 0.97, not a bounce. */
.draft__actions .btn:active {
  transform: scale(0.97);
}

.draft__actions .btn {
  transition: transform 160ms var(--ease-out);
  /* Comfortable target on touch without making the desktop button huge. */
  min-height: 34px;
}

.draft__status {
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  min-height: 1em;
}

.draft__status.is-error {
  color: hsl(var(--destructive));
}

/* A send is a network round-trip to Beds24 — never leave the button looking
   idle while it happens. */
.draft.is-busy .draft__text,
.draft.is-busy .btn {
  pointer-events: none;
  opacity: 0.6;
}

/* ---- settings: per-category autonomy ------------------------------------- */

.auto-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid hsl(var(--border));
}

.auto-row:last-of-type {
  border-bottom: none;
}

.auto-row__body {
  flex: 1;
  min-width: 0;
}

/* The language rows are <label>s, so a whole row is clickable. */
label.auto-row { cursor: pointer; }

.auto-row__name {
  display: block;
  font-size: var(--text-ui);
  font-weight: 600;
}

.auto-row__desc {
  display: block;
  font-size: var(--text-xs);
  color: hsl(var(--fg-muted));
  margin-top: 2px;
  line-height: var(--leading-normal);
}

/* The locked row reads as deliberately unavailable rather than broken. */
.auto-row.is-locked {
  opacity: 0.72;
}

.auto-row__locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-3xs);
  font-weight: 600;
  color: hsl(var(--fg-subtle));
  white-space: nowrap;
}

/* Coarse pointers get a full 44px target — a 34px button is comfortable
   under a mouse and fiddly under a thumb. Keyed off the pointer, not the
   viewport, so a touch laptop gets it too. */
@media (pointer: coarse) {
  .draft__actions .btn {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .draft__actions {
    /* Full-width targets where thumbs are doing the work. */
    flex-direction: column;
    align-items: stretch;
  }
  .draft__status {
    text-align: center;
  }
}

/* ---- teach: correcting the assistant in place ---------------------------- */
/* Collapsed by default so it never competes with Send — the common action
   stays the obvious one. */

.draft__teach {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid hsl(var(--border));
}

.draft__teach[hidden] {
  display: none;
}

.draft__teach > label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: hsl(var(--fg-muted));
  margin-bottom: 6px;
}

.draft__teach-input {
  width: 100%;
  font: inherit;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: hsl(var(--fg));
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  resize: vertical;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.draft__teach-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--ring-subtle));
}

.draft__teach-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.draft__teach-row .select {
  flex: 1;
  min-width: 160px;
}

@media (pointer: coarse) {
  .draft__teach-row .btn {
    min-height: 44px;
  }
}

/* ---- settings: the "finish your SOP first" gate --------------------------
   Deliberately not styled as an error. Nothing has gone wrong — the host
   simply hasn't finished a setup step, and red would tell them otherwise
   every time they open this page. Warning tones, and the list reads as a
   to-do rather than a complaint. */

.sop-gate {
  border: 1px solid hsl(var(--warning) / 0.28);
  background: hsl(var(--warning-bg));
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.sop-gate__head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.sop-gate__head svg {
  color: hsl(var(--warning));
  flex: none;
  margin-top: 1px;
}

.sop-gate__title {
  font-size: var(--text-ui);
  font-weight: 600;
  color: hsl(var(--warning));
}

.sop-gate__lede {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: hsl(var(--fg-muted));
  margin: 2px 0 0;
}

.sop-gate__list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: hsl(var(--warning) / 0.18);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sop-gate__item {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: hsl(var(--surface));
}

.sop-gate__name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: hsl(var(--fg));
  text-decoration: none;
  white-space: nowrap;
}

.sop-gate__name:hover {
  text-decoration: underline;
}

.sop-gate__missing {
  font-size: var(--text-3xs);
  color: hsl(var(--fg-muted));
  min-width: 0;
}

/* Tabular so the counts line up down the column and can be scanned as
   progress rather than read one at a time. */
.sop-gate__count {
  font-size: var(--text-3xs);
  font-variant-numeric: tabular-nums;
  color: hsl(var(--fg-subtle));
  white-space: nowrap;
}

/* One row per line on a phone; three columns would each be too narrow to
   read and the section names are the whole point. */
@media (max-width: 560px) {
  .sop-gate__item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .sop-gate__missing {
    grid-column: 1 / -1;
  }
}

/* ---- AI messaging page ---------------------------------------------------
   Five cards in the order a host builds an assistant up: how it sounds, what
   it must never do, what they taught it, how much goes out unattended, and
   which language.

   Almost everything here is the app's existing vocabulary — .card,
   .card-header, .data-table, .segmented, .switch, .field, .btn. What follows
   is only the handful of things that genuinely did not exist yet. */

/* Consistent rhythm between cards, so the page reads as one sequence. */
.stack { margin-bottom: var(--space-5); }

/* The supporting line under a .card-title. .card-header is a flex row, so the
   text needs its own block to sit under the title rather than beside it. */
.card-sub {
  font-size: var(--text-xs);
  color: hsl(var(--fg-muted));
  line-height: var(--leading-normal);
  margin: 3px 0 0;
  max-width: 64ch;
}

.card-header > div:first-child { min-width: 0; }

/* Form footers: one place, so every Save on the page sits identically. */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ---- voice --------------------------------------------------------------- */

.voice-picker { margin-bottom: var(--space-4); }
/* Four account names don't fit one 340px row; two per row, full names. */
@media (max-width: 640px) {
  .voice-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .voice-picker button { justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* "This account is still on the default voice" — worth seeing from the
   picker without opening each account in turn. */
.voice-picker__dot,
.voice-picker button.is-dirty::after {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: var(--radius-full);
  vertical-align: middle;
}

.voice-picker__dot { background: hsl(var(--warning)); }

/* Unsaved edits, so switching accounts doesn't feel like losing them. */
.voice-picker button.is-dirty::after {
  content: "";
  background: hsl(var(--primary));
}

/* ---- rule tables --------------------------------------------------------- */

/* A table inside a .card already has the card's border and radius, so the
   usual .table-wrap would draw a second one. */
.card > .data-table { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card > .data-table thead th:first-child,
.card > .data-table tbody td:first-child { padding-left: var(--space-5); }
.card > .data-table thead th:last-child,
.card > .data-table tbody td:last-child { padding-right: var(--space-5); }

.rule-cell {
  max-width: 52ch;
  line-height: var(--leading-normal);
}

/* Actions stay on one line and don't stretch the row. */
.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}

.row-actions form { display: inline-flex; }

/* Destructive intent only on hover: a row of red bins reads as a warning
   about the rules themselves. */
.icon-btn--danger:hover {
  background: hsl(var(--destructive-bg));
  color: hsl(var(--destructive));
}

/* A switched-off rule still reads, but reads as inactive. Not hidden: the
   point of off-not-deleted is that you can still see why it existed. */
.data-table tr.is-retired td { opacity: 0.5; }
.data-table tr.is-retired td:nth-child(3),
.data-table tr.is-retired td:last-child { opacity: 1; }

/* The host's own words under the assistant's version of them. This is the
   trust mechanism for the whole feature: a rewrite you cannot check is a
   rewrite you cannot trust. */
.taught__raw {
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  margin-top: 3px;
  font-style: italic;
}

.taught__pill { margin-top: 6px; }

.table-empty {
  padding: var(--space-4) 0;
  font-size: var(--text-xs);
  color: hsl(var(--fg-muted));
}

/* ---- add / edit forms ---------------------------------------------------- */

.rule-add,
.rule-edit {
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--surface-sunken));
}

/* The row editor sits inside a table cell, so it carries its own spacing
   rather than the card padding the add-form gets. */
.rule-edit {
  margin: var(--space-3) 0 var(--space-1);
  padding: var(--space-3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
}

.rule-edit__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.apt-picker { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid hsl(var(--border)); }
/* Label left, "all" on the right — the same header shape the scheduled-message
   form uses, so the two apartment pickers in the app read as one control. */
.apt-picker__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.apt-picker__all { font-size: 12.5px; color: hsl(var(--fg-muted)); }
.apt-picker .apt-checklist[hidden] { display: none; }

/* ---- "not used as rules" ------------------------------------------------- */

.not-rules { background: hsl(var(--surface-sunken)); }

.not-rules__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid hsl(var(--border));
}

.not-rules__row:first-of-type { margin-top: var(--space-3); }

.not-rules__text { font-size: var(--text-xs); color: hsl(var(--fg-muted)); }

.not-rules__why {
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  margin-top: 2px;
}

/* ---- autonomy & language ------------------------------------------------- */

.section-label { margin-top: var(--space-5); }

/* The language choices reuse .auto-row so they line up with the autonomy
   switches directly above them — same row height, same description style,
   with a radio where the switch goes. */
.radio-mark {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  accent-color: hsl(var(--primary));
}

/* A language code and a delay in seconds are both short values. A full-width
   control implies a long answer is expected. */
.lang-own,
.auto-delay { margin-top: var(--space-5); max-width: 260px; }

.auto-delay__input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.auto-delay__input .input { max-width: 110px; }

@media (pointer: coarse) {
  .checkbox-row { min-height: 44px; }
  .row-actions .icon-btn { width: 44px; height: 44px; }
}

/* ==========================================================================
   AI MESSAGING — page identity
   The page was a stack of identical white cards with no indication of what
   the assistant is currently doing. These settings only make sense against
   that state, so the state comes first.
   ========================================================================== */

/* ---- status band ---- */
.ai-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl); padding: var(--space-6);
  /* Ramp steps, NOT --primary: this band is dark in both themes by design, and
     --primary lightens to 62% in dark mode, which would put white text on a
     light ground. Same trap as the sidebar and the cleaner payout hero. */
  background: linear-gradient(145deg, hsl(var(--petrol-700)), hsl(var(--petrol-950)));
  color: white; margin-bottom: var(--space-5);
  box-shadow: 0 18px 44px -20px hsl(190 60% 8% / .55);
}
/* A soft coral bloom, so the one AI-owned page reads as the accent colour
   without tinting anything that has to stay legible. */
.ai-hero::after {
  content: ""; position: absolute; inset: auto -12% -70% auto; width: 62%; aspect-ratio: 1;
  background: radial-gradient(circle, hsl(var(--accent) / .42), transparent 68%);
  pointer-events: none;
}
.ai-hero__inner { position: relative; z-index: 1; }
.ai-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }

.ai-state {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 13px;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 700;
  letter-spacing: .01em; background: hsl(0 0% 100% / .14); color: white;
  border: 1px solid hsl(0 0% 100% / .2);
}
.ai-state__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ai-state--live { background: hsl(var(--success) / .26); border-color: hsl(var(--success) / .5); }
.ai-state--live .ai-state__dot { background: hsl(152 60% 72%); }
.ai-state--draft .ai-state__dot { background: hsl(var(--accent-bright, 10 100% 65%)); }
.ai-state--off { background: hsl(0 0% 100% / .1); color: hsl(0 0% 100% / .72); }
@media (prefers-reduced-motion: no-preference) {
  .ai-state--live .ai-state__dot { animation: ai-pulse 2.2s var(--ease-in-out) infinite; }
  @keyframes ai-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
}

.ai-hero__headline {
  font-size: clamp(19px, 2.2vw, 24px); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.25; margin-top: var(--space-4); max-width: 34ch; color: white;
}
.ai-hero__sub { font-size: 13.5px; line-height: 1.55; color: hsl(0 0% 100% / .74); margin-top: 8px; max-width: 56ch; }

/* Four numbers that say whether this thing has actually been taught anything. */
.ai-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-top: var(--space-6); }
@media (max-width: 760px) { .ai-stats { grid-template-columns: repeat(2, 1fr); } }
.ai-stat { background: hsl(0 0% 100% / .08); border: 1px solid hsl(0 0% 100% / .12); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.ai-stat__v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; color: white; }
/* .66 measured 4.22:1 against the tile once the tile's own 8% white is
   composited over the gradient. */
.ai-stat__l { font-size: 11.5px; color: hsl(0 0% 100% / .78); margin-top: 2px; }

/* ---- section headers ----
   An icon tile per card, so the page reads as five distinct jobs rather than
   five identical boxes. Same visual language as .menu-row__icon. */
.card-head {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
}
.card-head__icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: hsl(var(--primary-soft)); color: hsl(var(--primary-soft-fg));
}
.card-head__icon svg { width: 17px; height: 17px; }
.card-head__icon--accent { background: hsl(var(--accent-soft)); color: hsl(var(--accent-soft-fg)); }
.card-head__icon--success { background: hsl(var(--success-bg)); color: hsl(var(--success)); }
.card-head__icon--warning { background: hsl(var(--warning-bg)); color: hsl(var(--warning)); }
.card-head__body { flex: 1; min-width: 0; }
.card-head__body .card-title { font-size: 15px; }
.card-head__body .card-sub { margin-top: 3px; }
.card-head__aside { flex-shrink: 0; }
/* Phones: the icon and title keep their row; an action button drops under
   them at full width instead of squeezing the description into a column. */
@media (max-width: 640px) {
  .card-head { flex-wrap: wrap; padding: var(--space-4); }
  .card-head__body { flex-basis: calc(100% - var(--space-10) - var(--space-3)); }
  .card-head > .btn, .card-head > .card-head__aside { flex-basis: 100%; justify-content: center; }
}

/* ---- language choice as selectable cards ----
   Two radios with a paragraph each is a form. These are a choice, and should
   look like one. */
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 720px) { .lang-grid { grid-template-columns: 1fr; } }
.lang-card {
  position: relative; display: block; cursor: pointer;
  border: 1.5px solid hsl(var(--border)); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4) var(--space-4) 44px;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.lang-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.lang-card__mark {
  position: absolute; left: var(--space-4); top: var(--space-4);
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid hsl(var(--border-strong));
  transition: border-color var(--dur-fast) var(--ease-out);
}
.lang-card__mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: hsl(var(--primary)); transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.lang-card:has(input:checked) { border-color: hsl(var(--primary)); background: hsl(var(--primary-soft) / .55); box-shadow: 0 0 0 1px hsl(var(--primary)); }
.lang-card:has(input:checked) .lang-card__mark { border-color: hsl(var(--primary)); }
.lang-card:has(input:checked) .lang-card__mark::after { transform: scale(1); }
.lang-card:has(input:focus-visible) { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .lang-card:hover { border-color: hsl(var(--border-strong)); } }
.lang-card__t { display: block; font-size: 14px; font-weight: 600; color: hsl(var(--fg)); }
.lang-card__d { display: block; font-size: var(--text-sm); color: hsl(var(--fg-muted)); line-height: 1.5; margin-top: 4px; }
.lang-card__extra { margin-top: var(--space-3); }

/* ---- "always check with me about…" --------------------------------------
   A list of exceptions to the switches above it. */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  overflow: hidden;
}

.subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: hsl(var(--surface));
  cursor: pointer;
  min-height: 44px;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.subject-row:hover { background: hsl(var(--surface-sunken)); }

.subject-row__name {
  font-size: var(--text-ui);
  font-weight: 500;
  min-width: 0;
}

.subject-note { display: block; margin-top: var(--space-3); }

/* Why a finished draft is still waiting. Informational, not a warning — the
   host chose this, and colouring it as a problem would make their own
   setting look like a fault. */
.draft__hold {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  margin: var(--space-2) 0 0;
}

.draft__hold svg { flex: none; }

.draft__hold a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- "try it" ------------------------------------------------------------ */

.run-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.run-now__body { min-width: 0; flex: 1; }

/* The button takes a few seconds of real model calls, so it must not look
   idle while it works. */
.run-now form button[disabled] { opacity: 0.5; }

/* ---- a starting point on an escalation -----------------------------------
   Visually a quotation, not a form field. A textarea would imply this is the
   reply being sent; it is text the system decided NOT to send. */

.draft__suggestion {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-left: 2px solid hsl(var(--border-strong));
  background: hsl(var(--surface-sunken));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.draft__suggestion-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-3xs);
  font-weight: 600;
  color: hsl(var(--fg-subtle));
  margin-bottom: 6px;
}

.draft__suggestion-text {
  font-size: var(--text-ui);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-3);
  white-space: pre-wrap;
}

/* ---- reading the draft in your own language ------------------------------ */

.draft__source--toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.draft__source--toggle:hover { background: hsl(var(--surface-sunken)); }

.draft__source--toggle.is-on {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.25);
  color: hsl(var(--primary));
}

/* Visibly not a form field — this view cannot be edited, and it should not
   look like it invites typing. */
.draft__translation {
  border: 1px dashed hsl(var(--border-strong));
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: hsl(var(--surface-sunken));
}

.draft__translation-text {
  font-size: var(--text-ui);
  line-height: var(--leading-normal);
  margin: 0;
  white-space: pre-wrap;
}

.draft__translation-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-3xs);
  color: hsl(var(--fg-subtle));
  margin: var(--space-2) 0 0;
}

/* The untranslated original sits in the page so "Use this" can copy it —
   the guest must receive what the assistant wrote, not a translation of a
   translation. Never shown. */
.draft__suggestion-original { display: none; }

/* ---- settings: which properties the assistant works on -------------------
   One row per property, its own switch. "Waiting" is a to-do, not an error,
   so it wears the warning tone the old whole-account gate used. */

.props-ai { margin-bottom: var(--space-5); }

.props-ai__list {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
}

.props-ai__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid hsl(var(--border));
  min-height: 44px;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.props-ai__row:last-child { border-bottom: none; }
.props-ai__row.is-saving { opacity: 0.6; }

.props-ai__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-width: 0;
}

.props-ai__name {
  font-size: var(--text-ui);
  font-weight: 600;
  color: hsl(var(--fg));
  text-decoration: none;
}

.props-ai__name:hover { text-decoration: underline; text-underline-offset: 2px; }
.props-ai__name:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: var(--radius-sm); }
.props-ai__row.is-off .props-ai__name { color: hsl(var(--fg-muted)); }

.props-ai__missing {
  flex-basis: 100%;
  font-size: var(--text-xs);
  color: hsl(var(--fg-muted));
}

.props-ai__form { flex: none; display: flex; align-items: center; gap: var(--space-2); }

/* ---- settings: skip the learning period ----------------------------------
   Tucked in a disclosure at the foot of the autonomy card: rare, deliberate,
   and it should take a second look to reach. Warning tone when on — it is a
   choice the host made, not a fault. */

.skip-learning {
  border-top: 1px solid hsl(var(--border));
  padding: var(--space-4) var(--space-5);
}

.skip-learning.is-on {
  background: hsl(var(--warning-bg));
  border-top-color: hsl(var(--warning) / 0.3);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.skip-learning__head { display: flex; gap: var(--space-3); align-items: flex-start; }
.skip-learning__icon { color: hsl(var(--warning)); flex: none; margin-top: 2px; }
.skip-learning__title { font-size: var(--text-ui); font-weight: 600; color: hsl(var(--fg)); }
.skip-learning.is-on .skip-learning__title { color: hsl(var(--warning)); }

.skip-learning__text {
  display: block;
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: hsl(var(--fg-muted));
  margin: 2px 0 0;
}

.skip-learning__actions { margin-top: var(--space-3); padding-left: calc(var(--space-3) + 16px); }

.skip-learning__details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  min-height: 44px;
  justify-content: center;
}

.skip-learning__details > summary::-webkit-details-marker { display: none; }
.skip-learning__details > summary .skip-learning__title::after { content: " ›"; color: hsl(var(--fg-muted)); }
.skip-learning__details[open] > summary .skip-learning__title::after { content: " ⌄"; }
.skip-learning__details > summary:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: var(--radius-sm); }

.skip-learning__warn {
  display: flex;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid hsl(var(--warning) / 0.3);
  background: hsl(var(--warning-bg));
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: hsl(var(--fg));
}

.skip-learning__warn svg { color: hsl(var(--warning)); flex: none; margin-top: 2px; }
.skip-learning__form { display: flex; flex-direction: column; gap: var(--space-3); max-width: 420px; }
.skip-learning__form .checkbox-row { align-items: flex-start; line-height: var(--leading-normal); }
.skip-learning__form .checkbox-row input { margin-top: 2px; flex: none; }
