/* The shell: the page around every page (design-direction.md section 4).

   Two layouts, `layouts/light` and `layouts/console`, each a header (the masthead, or the
   rail and its top bar on a phone), the page's one <main>, and the footer. The rules that make
   them are mostly the ported ones in 10-globals.css (`.smast*`, `.rail*`, `.console-*`), which
   were written for the platform's own shell and are used as they are. This file adds what a
   layout in Rails needed that they did not have:

   * the two measures. The ported `.smast-bar` and `.console-main` had none, because the
     platform's shell set them in a utility class; they read `--page-w` and `--page-w-wide`;
   * the content wrapper that carries the device's safe-area insets at the edges of the page
     (a notch, a home indicator, a Hotwire Native bar), so the ported rules, which pad
     themselves, are not padded twice. `px-safe` and `pb-safe` are in 40-native.css, because
     the insets are physical and are the one place that file's rule applies;
   * the footer, the account block, and the little that a menu with nothing in it needs;
   * the assistant's pill and panel (last in this file): chrome that sits around every page.

   Tokens only (test/styles/tokens_test.rb) and logical properties (test/styles/
   components_test.rb), so the shell reads on both surfaces in both modes and mirrors in a
   right-to-left language. Heights are dvh. Linked after the components' stylesheets (35 to 37) and before
   40-native.css; it is numbered with them, so test/styles/components_test.rb reads it too. */

/* ── The brand ───────────────────────────────────────────────────────────
   The mark and the wordmark (`shared/_brand`), in the three sizes its views ask for: `sm` for
   the dense bars, `md` the default, `lg` the sign-in masthead. They were a style attribute on
   each element, which no theme, mode or surface can reach and which no stylesheet can
   override without `!important`; the numbers are the same, and now they are here. The tile
   colors are `--tsr-tile-*` (a theme's), and the gold tile is the mark. */
.tsr-wordmark {
  --tsr-tile-size: 11px;
  --tsr-mark-gap: 3px;
  --tsr-name-size: 1.375rem;
  --tsr-wordmark-gap: 14px;
  display: inline-flex;
  align-items: center;
  gap: var(--tsr-wordmark-gap);
}
.tsr-wordmark[data-size="sm"] {
  --tsr-tile-size: 8px;
  --tsr-mark-gap: 2px;
  --tsr-name-size: 1.0625rem;
  --tsr-wordmark-gap: 10px;
}
.tsr-wordmark[data-size="lg"] {
  --tsr-tile-size: 13px;
  --tsr-name-size: 1.75rem;
}
.tsr-wordmark .tsr-mark {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: repeat(3, var(--tsr-tile-size));
  grid-template-rows: repeat(3, var(--tsr-tile-size));
  gap: var(--tsr-mark-gap);
}
.tsr-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-inline-size: 0;
}

/* The brand gives way to its bar. A link and a wordmark are boxes that default to the width of
   what is in them, so in a bar with little room (a phone, a longer language, a long name beside it)
   they ran out of the bar instead of wrapping inside it. And the institution's name under the
   product's was `nowrap`, on purpose, so the masthead would not grow a line: it grows one now and
   loses nothing, which is the first option of the card that found it (a translated name, 40%
   longer, at 320px, took the page sideways: WCAG 1.4.10). */
.hc-brandlink,
.tsr-wordmark {
  min-inline-size: 0;
  max-inline-size: 100%;
}

.hc-brandlink {
  align-items: center;
  min-block-size: var(--target-min);
}
.tsr-name,
.tsr-descriptor {
  overflow-wrap: anywhere;
}
.tsr-descriptor {
  white-space: normal;
}
.tsr-name {
  font-family: var(--font-display);
  font-size: var(--tsr-name-size);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ── The light shell ──────────────────────────────────────────────────────
   Masthead, the page, footer. The masthead pads itself with the insets (`.smast`); the page
   and the footer sit in `.light-content`, which carries them. */
.light-frame {
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
  background: var(--surface);
}
.light-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
}
.light-main {
  flex: 1;
  inline-size: 100%;
  max-inline-size: var(--page-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-block-end: 5rem;
}

/* The masthead's bar stops at the page's measure while its background runs the full width. */
.smast-bar {
  max-inline-size: var(--page-w);
}

/* Keep everyday destinations within one tap in a narrow browser. The strip scrolls
   with the page, leaving only the existing masthead pinned above focused content. */
.student-mobile-links {
  display: none;
}
.smast--student .smast-tab,
.student-mobile-links .smast-tab {
  gap: var(--space-2);
  min-block-size: var(--target-min);
  white-space: normal;
  overflow-wrap: anywhere;
}
.smast--student .smast-tab .icon,
.student-mobile-links .smast-tab .icon {
  flex: none;
  inline-size: 1rem;
  block-size: 1rem;
}
@media (max-width: 1079px) {
  .student-mobile-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 var(--space-2);
    padding-inline: max(var(--page-gutter), var(--safe-left), var(--safe-right));
    border-block-end: 1px solid var(--rule);
    background: var(--surface-header);
  }
  .student-mobile-links .smast-tab {
    justify-content: center;
    min-inline-size: var(--target-min);
    max-inline-size: 100%;
    margin: 0;
    padding: var(--space-2);
  }
}

/* With no destinations there is no menu, and below 1080px the menu is where the account goes.
   The account stays in the row, at every width, so a phone can still sign out. */
.smast[data-menu="none"] .smast-account {
  display: flex;
}

/* On a phone the brand and the account (a name, and the way out) do not always fit in one row, and the ported bar is a grid whose
   brand column may shrink to nothing: the wordmark then broke into one letter a line. The brand keeps its own width and the account
   wraps under it when there is no room, so the way out is never lost and nothing scrolls sideways (WCAG 1.4.4, 1.4.10). At 1080px
   and wider the bar has room again, and the ported grid is the row. */
@media (max-width: 1079px) {
  .smast[data-menu="none"] .smast-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
  }
  .smast[data-menu="none"] .smast-brand {
    flex: 0 0 auto;
  }
  .smast[data-menu="none"] .smast-tools {
    flex: 0 1 auto;
    min-inline-size: 0;
  }
}

/* ── The console ─────────────────────────────────────────────────────────
   The rail, then a body of the phone's top bar, the page and the footer. */
.console-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
}
.console-main {
  max-inline-size: var(--page-w-wide);
}

/* ── Focus under a sticky bar ────────────────────────────────────────────
   The masthead, and the console's top bar on a phone, stick to the top of the page. When the
   keyboard scrolls to something (Shift+Tab back up a long page, a skip link, an anchor), the
   browser scrolls it to the edge of the window, which is under the bar. The scroll padding is
   the bar's height and a little, plus the device's top inset, so what has focus is never
   covered (WCAG 2.4.11 Focus Not Obscured, new in 2.2). Block-start and not top: the inset
   is the device's, but the bar is at the start of the block axis. */
html:has(.smast, .rail-topbar) {
  scroll-padding-block-start: calc(4.75rem + var(--safe-top));
}

/* ── The footer ──────────────────────────────────────────────────────────
   The institution's name, from configuration, and the light and dark switch. A hairline and
   the sunken surface, so it reads as the end of the page and not as more of it. */
.shell-foot {
  border-block-start: 1px solid var(--rule);
  background: var(--surface-sunken);
}
.shell-foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-inline-size: var(--page-w);
  margin-inline: auto;
  padding: 1.25rem 1.5rem 2rem;
}
[data-surface="console"] .shell-foot-in {
  max-inline-size: var(--page-w-wide);
}
.shell-foot-by {
  margin: 0;
  color: var(--fg3);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

/* ── The account ─────────────────────────────────────────────────────────
   Who is signed in and the way out, in the masthead, its menu and the rail's foot. The name
   wraps and never widens the bar. */
.shell-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-inline-size: 0;
}
.shell-who-name {
  min-inline-size: 0;
  color: var(--fg1);
  font-size: 0.8125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
/* The rail's foot is narrow: the name has the line to itself and the two quiet buttons (the phones, sign out) sit side by side under it. In the masthead's bar all three stay on one line. */
.rail-foot .shell-who-name {
  flex: 1 1 100%;
}

/* ── The assistant ────────────────────────────────────────────────────────
   (AssistantComponent, assistant_controller.js; docs/data_model/09-agentic-layer.md section 9; design-direction.md section 3, the pill and its slide-over).

   A pill at the bottom edge of every signed-in page and a panel that slides in from the end edge. The panel is a native <dialog> opened with showModal(), so the page behind it is
   inert and the browser draws its own backdrop (::backdrop): there is no scrim element to paint.

   These replace the platform's rules for the same class names, which were written for a different shell in physical properties and vw and which nothing in this edition drew
   (they were removed from 10-globals.css with this file). What is the same is the look: the pill with a dot and a shortcut hint, the panel with a head, a log, a form, the
   suggestions, the tool line, the thinking dots.

   The rules this file keeps, each tested (test/styles): tokens only (no color written here, so every rule reads in light and dark on both surfaces, and the pairs it uses are ones
   config/contrast_pairs.yml measures: text on the raised surface and on the accent wash, the tone pair of an error, the control edge, the focus ring); logical properties only, so a
   right-to-left language mirrors; no vh (the panel is dvh, which follows a phone's browser bars); the safe areas honored on everything pinned to an edge; targets at the touch floor
   by the rules of 40-native.css (the pill and every button are buttons); motion off when asked.

   It is in this file, the shell's, because the pill and the panel are chrome that sit around every page, and because the stylesheets are numbered from 35 to 40, each with its own
   number (test/styles/stylesheet_test.rb), and the numbers of the components' files are all taken. */

@keyframes assistant-in {
  from { transform: translateX(var(--assistant-slide, 1.5rem)); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes assistant-pulse {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* ── The pill ─────────────────────────────────────────────────────────────
   Always drawn, on a phone too: the shortcut is a convenience, and this is the way in. It is pinned to the corner of the screen, so it clears a notch and a home bar
   (the safe-area insets are the device's and physical, so the larger of the two sides is used and the pill keeps its distance from the edge in either direction of text). A page
   that has it leaves room at the foot (below), and scrolls a focused control clear of it (scroll-padding), so it never covers what a person is reading or tabbing to
   (WCAG 2.4.11). */
.assistant-fab {
  position: fixed;
  inset-block-end: calc(1.25rem + var(--safe-bottom));
  inset-inline-end: calc(1.25rem + max(var(--safe-left), var(--safe-right)));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding-block: 0.6rem;
  padding-inline: 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--surface-raised);
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms ease;
}
.assistant-fab:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.assistant-fab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.assistant-fab-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.assistant-kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding-block: 0.05rem;
  padding-inline: 0.3rem;
}
/* A shortcut is for a keyboard: on a screen that is touched (a coarse pointer, or no hover at all, as on a phone), the hint is not drawn, and the pill is its name alone (ref2 N7). */
@media (pointer: coarse), (hover: none) {
  .assistant-kbd { display: none; }
}

/* Room at the foot of a page that has the pill, so the last of it is not under it, and a focused control is scrolled clear of it: the pill's own height (at least a 44px touch target),
   the gap below it and the safe area, and a little air (ref2 N7). The main column ends there, so nothing a page draws last is covered on a phone. */
.assistant-fab {
  min-block-size: var(--target-min);
}
body:has(.assistant-fab) {
  --assistant-room: calc(var(--target-min) + 1.25rem + 0.75rem + var(--safe-bottom));
}
/* The room is the footer's, under its own content and inside its own background, and not the wrapper's: on the wrapper it left a strip of the page's canvas under the
   footer, so the footer looked like it ended in the middle of the screen. The pill floats over the footer's lower edge, and the footer is still the end of the page. A console page in a
   browser holds the pill in its top bar or its rail (below), so it floats over nothing and needs no room. */
body:has(.assistant-fab):is([data-native], :not(:has(.rail-topbar))) .shell-foot {
  padding-block-end: var(--assistant-room);
}
html:has(.assistant-fab):not(:has(body:not([data-native]) .rail-topbar)) {
  scroll-padding-block-end: calc(5rem + var(--safe-bottom));
}
@media (max-width: 1079px) {
  body:has(.assistant-fab):is([data-native], :not(:has(.rail-topbar))) :is(main, .console-main) {
    padding-block-end: max(var(--space-7), var(--assistant-room));
  }
}

/* A console page in a browser: a floating pill covered words the page draws (a case's guide, a sheet's help line, Home's "Report a concern") at any scroll and any width. Where the
   top bar is drawn (below 1080px, or the rail hidden by choice) the pill sits at the bar's end, as a round button with the sparkles (the shells' face for it) and its words for a
   screen reader; where the rail is a column it sits at the column's foot, under the account, which leaves it room. The sparkles are a mask filled with the text color. Not in a
   Hotwire Native shell, which has no top bar and places the button itself (95-native-shell.css). */
body:not([data-native]):has(.rail-topbar) .assistant-fab {
  inset-block: calc(var(--safe-top) + 0.55rem) auto;
  inset-inline-end: calc(1rem + max(var(--safe-left), var(--safe-right)));
  inline-size: var(--target-min);
  block-size: var(--target-min);
  justify-content: center;
  gap: 0;
  padding: 0;
  color: var(--accent-text);
  box-shadow: none;
}
body:not([data-native]):has(.rail-topbar) .assistant-fab::before {
  content: "";
  inline-size: 1.25rem;
  block-size: 1.25rem;
  background: currentColor;
  forced-color-adjust: none;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 2 11.4 8.6 18 10.5 11.4 12.4 9.5 19 7.6 12.4 1 10.5 7.6 8.6z'/%3E%3Crect x='17.25' y='2' width='1.5' height='5' rx='.75'/%3E%3Crect x='15.5' y='3.75' width='5' height='1.5' rx='.75'/%3E%3Crect x='18.25' y='14' width='1.5' height='5' rx='.75'/%3E%3Crect x='16.5' y='15.75' width='5' height='1.5' rx='.75'/%3E%3C/svg%3E") center / contain no-repeat;
}
body:not([data-native]):has(.rail-topbar) :is(.assistant-fab-dot, .assistant-kbd) {
  display: none;
}
body:not([data-native]):has(.rail-topbar) .assistant-fab-label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (min-width: 1080px) {
  body:not([data-native]):has(.console-frame:not([data-rail="collapsed"])) .assistant-fab {
    inset-block: auto calc(1.25rem + var(--safe-bottom));
    inset-inline: calc(1rem + max(var(--safe-left), var(--safe-right))) auto;
    inline-size: auto;
    justify-content: flex-start;
    gap: 0.55rem;
    padding-block: 0.6rem;
    padding-inline: 0.95rem;
    color: var(--fg1);
    box-shadow: var(--shadow-lift);
  }
  body:not([data-native]):has(.console-frame:not([data-rail="collapsed"])) .assistant-fab::before {
    content: none;
  }
  body:not([data-native]):has(.console-frame:not([data-rail="collapsed"])) .assistant-fab-dot {
    display: inline-block;
  }
  body:not([data-native]):has(.console-frame:not([data-rail="collapsed"])) .assistant-fab-label {
    position: static;
    inline-size: auto;
    block-size: auto;
    overflow: visible;
    clip-path: none;
  }
  @media (hover: hover) and (pointer: fine) {
    body:not([data-native]):has(.console-frame:not([data-rail="collapsed"])) .assistant-kbd {
      display: inline;
    }
  }
  body:not([data-native]):has(.assistant-fab) .console-frame:not([data-rail="collapsed"]) .rail-foot {
    padding-block-end: calc(var(--target-min) + 1.25rem + 0.85rem);
  }
}

/* ── The panel ────────────────────────────────────────────────────────────
   A column the full height of the screen at the end edge, up to 460px wide, the whole width at 320px. A dialog is centered and padded by the browser, so every part of that is
   undone first. The head and the form sit at its ends and the log takes the rest and scrolls. Everything pinned to an edge carries the insets. */
.assistant-panel {
  position: fixed;
  inset-block: 0;
  inset-inline: auto 0;
  margin: 0;
  padding: 0;
  border: 0;
  inline-size: min(28.75rem, 100%);
  max-inline-size: 100%;
  block-size: 100dvh;
  max-block-size: 100dvh;
  background: var(--surface-raised);
  color: var(--fg1);
  border-inline-start: 1px solid var(--rule);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  padding-block: var(--safe-top) var(--safe-bottom);
  padding-inline-end: max(var(--safe-left), var(--safe-right));
}
.assistant-panel[open] {
  display: flex;
  flex-direction: column;
  animation: assistant-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
html[dir="rtl"] .assistant-panel { --assistant-slide: -1.5rem; }
.assistant-panel::backdrop {
  background: var(--scrim-soft);
}

.assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem 0.9rem;
  padding-inline: 1.25rem;
  border-block-end: 1px solid var(--rule);
}
.assistant-heading { min-inline-size: 0; }
.assistant-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.2;
}
.assistant-sub {
  margin: 0.3rem 0 0;
  font-size: var(--text-xs);
  color: var(--fg2);
  line-height: 1.5;
  max-inline-size: 40ch;
}

/* ── The conversation ─────────────────────────────────────────────────────
   A region that is read as it grows and that scrolls, so it can be reached and scrolled by keyboard (the focus ring is drawn for it). */
.assistant-log {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block: 1.1rem;
  padding-inline: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.assistant-log:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.assistant-empty p {
  font-size: var(--text-sm);
  color: var(--fg2);
  line-height: 1.6;
  margin: 0 0 1rem;
}
.assistant-suggest {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.assistant-suggest button {
  inline-size: 100%;
  text-align: start;
  padding-block: 0.55rem;
  padding-inline: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--control-line);
  background: transparent;
  color: var(--fg1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.assistant-suggest button:hover {
  background: var(--surface-tint);
  border-color: var(--accent);
}
.assistant-suggest button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.assistant-msg {
  display: grid;
  gap: 0.4rem;
}
/* Who is speaking is said to a screen reader and shown by where the message sits and how it is drawn (WCAG 1.4.1: the position and the shape are not the only signal, the name is). */
.assistant-who {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.assistant-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.assistant-user .assistant-body {
  justify-self: end;
  max-inline-size: 88%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  border-end-end-radius: 3px;
  padding-block: 0.6rem;
  padding-inline: 0.85rem;
  font-size: var(--text-sm);
  color: var(--fg1);
}
.assistant-assistant .assistant-body {
  font-size: var(--text-sm);
  color: var(--fg1);
  line-height: 1.65;
}
/* An answer is drawn as lines, headings and lists (assistant_controller.js, drawAnswer): spaced like a short document, never wider than the panel. */
.assistant-assistant .assistant-body {
  display: grid;
  gap: var(--space-2);
  white-space: normal;
}
.assistant-assistant .assistant-body > p,
.assistant-assistant .assistant-body > ul {
  margin: 0;
}
.assistant-assistant .assistant-body > ul {
  display: grid;
  gap: var(--space-1);
  padding-inline-start: var(--space-5);
  list-style: disc outside;
}
.assistant-assistant .assistant-body li::marker {
  color: var(--fg2);
}
.assistant-assistant .assistant-body .assistant-heading {
  margin-block-start: var(--space-2);
  color: var(--fg1);
}
.assistant-assistant .assistant-body .assistant-heading:first-child {
  margin-block-start: 0;
}
/* A person the answer named: a link to their page, drawn as a small button-sized chip, each at the touch floor on touch. */
.assistant-people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.assistant-person {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.75rem;
  padding-block: 0.15rem;
  padding-inline: 0.65rem;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.assistant-person:hover { text-decoration: underline; }
.assistant-person:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
@media (pointer: coarse) {
  .assistant-person { min-block-size: var(--target-min); }
}

/* The draft of a job (CND-A1): a mark in words before it is read, because what the assistant writes is not a record until a person makes it one. The same pill as a person it named, so it needs no new colour. */
.assistant-draft-mark {
  justify-self: start;
  padding-block: 0.15rem;
  padding-inline: 0.65rem;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 650;
}

/* The buttons under a draft: "Use this draft", and, for a draft that becomes a referral (TF-E), the one that opens the sheet with it. They wrap, so a long label stays whole at 320 CSS pixels and in a longer language. */
.assistant-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

/* Work is going on, said in words and in three dots that pulse; with motion off the dots hold still and the words remain. */
.assistant-thinking {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--fg2);
}
.assistant-thinking[hidden] { display: none; }
.assistant-thinking > span[aria-hidden] {
  inline-size: 5px;
  block-size: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: assistant-pulse 1.1s infinite ease-in-out;
}
.assistant-thinking > span[aria-hidden]:nth-child(2) { animation-delay: 0.16s; }
.assistant-thinking > span[aria-hidden]:nth-child(3) { animation-delay: 0.32s; margin-inline-end: 0.3rem; }

.assistant-error {
  margin: 0;
  padding-block: 0.6rem;
  padding-inline: 0.85rem;
  border: 1px solid var(--tone-bad-line);
  border-radius: var(--radius-md);
  background: var(--tone-bad-bg);
  color: var(--tone-bad-fg);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ── The form ─────────────────────────────────────────────────────────────
   The field is the shared one (Forms::LongTextComponent): its label, its edge and its focus are the form fields' everywhere. */
.assistant-form {
  flex: 0 0 auto;
  display: grid;
  gap: 0.6rem;
  padding-block: 0.85rem 1.1rem;
  padding-inline: 1.25rem;
  border-block-start: 1px solid var(--rule);
}
.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
/* Send is reenabled as soon as an answer ends. Switch its text and fill together:
   interpolating between the disabled and enabled pairs loses text contrast. */
.assistant-actions .btn[type="submit"] {
  transition-property: box-shadow, transform;
}
.assistant-note {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--fg3);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .assistant-panel[open] { animation: none; }
  .assistant-fab { transition: none; }
  .assistant-fab:hover { transform: none; }
  .assistant-thinking > span[aria-hidden] { animation: none; opacity: 1; }
}
