/* ------------------------------------------------------------------
   Chipotle Support Desk: shared shell, forms, chat.
   Flat dark neutral surfaces. One light primary action per view; colour is
   kept for status only (green worked, amber waiting, red failed).
------------------------------------------------------------------- */

:root {
  color-scheme: dark;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", monospace;

  --bg: #0b0b0d;
  --surface: #131316;
  --raised: #1b1b1f;
  --raised-hi: #25252a;
  --field: #0e0e11;
  --hover: rgba(255, 255, 255, .045);
  --selected: rgba(255, 255, 255, .08);

  --line: rgba(255, 255, 255, .085);
  --line-soft: rgba(255, 255, 255, .055);
  --line-strong: rgba(255, 255, 255, .15);

  --text: #ededf0;
  --muted: #a1a1aa;
  --faint: #6f6f79;

  --accent: #ededf0;
  --on-accent: #0b0b0d;
  --good: #5ecf95;
  --warn: #e5b062;
  --bad: #ee7d88;
  --agent: #e7a56c;
  --danger: #b8434f;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --ring: 0 0 0 3px rgba(255, 255, 255, .12);
  --shadow-pop: 0 18px 48px -14px rgba(0, 0, 0, .75), 0 0 0 1px rgba(0, 0, 0, .35);
  --scrollbar: rgba(255, 255, 255, .14) transparent;

  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  --icon-person: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM4.5 20a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E");
  --icon-headset: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2M4 14a2 2 0 0 1 2-2h1.5v6H6a2 2 0 0 1-2-2v-2Zm16 0a2 2 0 0 0-2-2h-1.5v6H18a2 2 0 0 0 2-2v-2ZM18 18c0 1.7-2 3-5 3h-1'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.6l3.1 3.1L12.8 5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
  --icon-bag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h14l-1 12H6L5 8Zm4 0V6.5a3 3 0 0 1 6 0V8'/%3E%3C/svg%3E");
  --icon-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.8-6.5-11a6.5 6.5 0 0 1 13 0c0 5.2-6.5 11-6.5 11Zm0-8.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3C/svg%3E");
  --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5.5' width='16' height='15' rx='2.5'/%3E%3Cpath d='M4 10h16M8.5 3.5v4M15.5 3.5v4'/%3E%3C/svg%3E");
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11v5M12 8v.01'/%3E%3C/svg%3E");
  --icon-receipt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3.5h10v17l-2.5-1.5-2.5 1.5-2.5-1.5L7 20.5v-17ZM10 8h4m-4 4h4'/%3E%3C/svg%3E");
  --icon-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5h3.2L8.8 6h6.4l1.6 2.5H20V19H4V8.5Zm8 2.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E");
  --icon-arrow-out: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E");
  --icon-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11M4.5 6.5h.01M4.5 12h.01M4.5 17.5h.01'/%3E%3C/svg%3E");
  --icon-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12 20 4l-6 16-3-7-7-1Z'/%3E%3C/svg%3E");

  font-family: var(--font);
  font-synthesis: none;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; overflow: hidden; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
button, a, input, select, textarea { transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease, opacity .14s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible,
summary:focus-visible { outline: 2px solid rgba(255, 255, 255, .55); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
svg { display: block; flex-shrink: 0; }
::selection { color: #fff; background: rgba(255, 255, 255, .22); }
code { padding: 1px 5px; border-radius: 4px; color: var(--text); background: rgba(255,255,255,.08); font: 12px/1.6 var(--font-mono); }
h1, h2, h3, h4 { font-family: var(--font-display); }
h1 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.4px; }
h2 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: -.25px; }

/* ---- Shell ------------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; max-width: 1500px; height: 100dvh; min-height: 0; margin: 0 auto; padding: 0 26px 24px; }
/* One header on every page: name and page links on the left, page status on
   the right. A hairline separates it from the work below. */
.app-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; flex-shrink: 0; min-height: 60px; margin: 0 0 18px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 600 14px/1 var(--font-display); letter-spacing: -.2px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--on-accent); background: var(--accent); }
.brand-mark svg { width: 15px; height: 15px; }
/* One flat bar: Overview, Chats, Orders, Accounts, Settings. Items that switch
   a view on the same page are buttons; the rest are links. */
.app-navigation { display: flex; align-items: center; gap: 2px; min-width: 0; }
.app-navigation .text-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.app-navigation .text-link:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.app-navigation [aria-current="page"] { color: var(--text); background: var(--selected); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.nav-dot[hidden] { display: none; }
.header-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-balance { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.header-balance[hidden] { display: none; }
/* Only present when a dashboard password is set (the server adds it). */
.sign-out { display: flex; margin: 0 0 0 auto; }
.header-tools ~ .sign-out { margin-left: 0; }
.sign-out button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.sign-out button:hover { color: var(--text); background: var(--hover); }
.sign-out svg { width: 17px; height: 17px; }

/* Orders is its own view: the chat tabs go, running-chat chips stay. */
.support-page[data-view="orders"] .workspace-tabs { display: none; }
.support-page[data-view="orders"] .support-toolbar:not(:has(#chat-switcher:not([hidden]), #chats-summary:not([hidden]))) { display: none; }
/* Support views: one segmented switch, running chats beside it. */
.support-toolbar { display: flex; align-items: center; gap: 12px; flex-shrink: 0; min-width: 0; margin: 0 0 16px; }
.workspace-tabs { display: flex; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.workspace-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 5px 14px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 500; white-space: nowrap; }
.workspace-tab:hover { color: var(--text); background: var(--hover); }
.workspace-tab[aria-pressed="true"] { color: var(--text); background: var(--raised-hi); }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.07); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.workspace-tab[aria-pressed="true"] .count-badge { color: var(--text); background: rgba(255,255,255,.12); }
.chats-summary { --tone: var(--good); display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; margin: 0 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chats-summary::before { content: ""; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); animation: soft-pulse 1.8s ease-in-out infinite; }
.chats-summary[data-waiting] { --tone: var(--warn); }
@keyframes soft-pulse { 50% { opacity: .4; } }

/* Request steps: numbered, so the order of Account, Order, Message is plain. */
/* New request is one screen: account and order side by side when the panel
   has room, the message under both, Start chat always at the bottom. */
.order-panel { container: request / inline-size; }
#order-pane-issue { margin-top: 18px; }
@container request (min-width: 640px) {
  #order-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; align-content: start; }
  #order-pane-issue { grid-column: 1 / -1; margin-top: 6px; }
}

/* ---- Panels ------------------------------------------------------ */
.workspace { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; }
.panel, .orders-workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.panel-heading { display: flex; align-items: center; gap: 11px; flex-shrink: 0; min-height: 60px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.section-icon { color: var(--muted); }
.section-icon svg { width: 20px; height: 20px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--faint); font-size: 12px; }
/* History names itself ("Conversations"), so the panel title would only repeat
   the tab it was opened from. */
.order-panel > .order-heading { display: none; }

/* ---- Forms ------------------------------------------------------- */
#order-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
#order-fields { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 18px; scrollbar-width: thin; scrollbar-color: var(--scrollbar); }
.form-section { min-width: 0; }
.form-section-title { margin: 0 0 16px; color: var(--text); font-family: var(--font-display); font-size: 15px; line-height: 1.5; font-weight: 600; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
#order-pane-contact .field-grid { display: block; }
#order-pane-contact > .field:first-child { margin-bottom: 18px; }
#order-pane-contact .disclosure { margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; min-width: 0; }
.field-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.field-status[data-state="error"] { color: var(--bad); }
label, legend { color: var(--muted); font-size: 13px; font-weight: 500; }

/* Accounts chosen for one order: one chat starts per chip. */
.account-batch { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.account-batch[hidden] { display: none; }
.account-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.account-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 30px; padding: 0 4px 0 3px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: var(--raised); font-size: 12.5px; font-weight: 500; line-height: 1; }
.account-chip:hover { border-color: var(--line-strong); }
.account-chip .account-chip-avatar { flex: 0 0 22px; width: 22px; height: 22px; font-size: 9px; letter-spacing: 0; }
.account-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip-remove { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; color: var(--faint); background: transparent; }
.account-chip-remove svg { width: 11px; height: 11px; }
.account-chip-remove:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,.1); }
.account-chip-remove:focus-visible { outline: none; box-shadow: var(--ring); }
.account-slots { font-variant-numeric: tabular-nums; }

input, select, textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); background: var(--field); font-size: 14px; line-height: 1.5; caret-color: var(--text); }
input, select { height: 42px; }
select { padding-right: 27px; }
input[type="date"], input[type="time"] { padding-right: 8px; }
input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; filter: invert(.85); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: rgba(255,255,255,.3); box-shadow: var(--ring); outline: none; }
input:disabled, select:disabled, textarea:disabled { color: var(--faint); background: rgba(255,255,255,.02); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--field) inset; caret-color: var(--text); }
textarea { min-height: 88px; resize: vertical; }
#issue { min-height: 120px; }
#requestedResolution { min-height: 76px; }

.disclosure { border-top: 1px solid var(--line-soft); }
.disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 10px 0; color: var(--muted); font-size: 13px; font-weight: 500; list-style: none; cursor: pointer; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: ""; flex-shrink: 0; width: 14px; height: 14px; background: var(--faint); -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat; transform: rotate(-90deg); transition: transform .2s ease; }
.disclosure[open] > summary::after { transform: none; }
.disclosure summary:hover { color: var(--text); }
.disclosure-content { padding-top: 8px; }
.disclosure-content .field:last-child { margin-bottom: 12px; }

.issue-presets { margin: 0 0 16px; }
.issue-presets legend { margin-bottom: 12px; }
.issue-options { display: flex; flex-wrap: wrap; gap: 6px; }
.issue-option { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); background: transparent; font-size: 12.5px; font-weight: 500; line-height: 1.4; cursor: pointer; transition: background-color .14s, border-color .14s, color .14s; }
.issue-option:hover { color: var(--text); border-color: var(--line-strong); background: var(--hover); }
.issue-option:has(input:checked) { color: var(--text); border-color: rgba(255,255,255,.28); background: var(--selected); }
/* Native checkboxes are bright white squares on Windows; these match the page. */
.issue-option input, .signup-options input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: 0 0 16px; width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--field); box-shadow: none; cursor: pointer; }
.issue-option input:hover:not(:disabled), .signup-options input[type="checkbox"]:hover:not(:disabled) { border-color: rgba(255,255,255,.35); }
.issue-option input:checked, .signup-options input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l3 3 6-6.4' fill='none' stroke='%230b0b0d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.issue-option:has(input:disabled) { cursor: not-allowed; opacity: .6; }

.receipt-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: transparent; }
.receipt-field > label, .receipt-field > .field-status { grid-column: 1 / -1; }
.receipt-preview { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; }
.receipt-preview a { display: block; flex: 0 0 56px; height: 56px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--field); }
.receipt-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.receipt-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; }
#receipt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#receipt-size { color: var(--muted); font-size: 11px; }
.receipt-controls { display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px; grid-column: 2; grid-row: 2; }
.receipt-controls .button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.receipt-field:has(#receipt-preview[hidden]) .receipt-controls { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
.receipt-field:has(#receipt-preview[hidden]) #choose-receipt { width: 100%; min-height: 46px; }
.order-number-field { margin-top: 16px; margin-bottom: 12px; }

.saved-orders-bar { display: flex; align-items: center; flex-shrink: 0; gap: 8px; margin-bottom: 16px; }
.saved-orders-bar .saved-orders-field { flex: 1; margin: 0; }
.saved-orders-bar select { height: 42px; font-size: 14px; }
/* The order chosen for this request: name, facts, attachments. */
.selected-order-summary { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.order-card-head { display: flex; align-items: center; gap: 12px; }
.order-card-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.07); }
.order-card-icon::before { content: ""; width: 17px; height: 17px; background: var(--muted); -webkit-mask: var(--icon-bag) center / contain no-repeat; mask: var(--icon-bag) center / contain no-repeat; }
.order-card-title { display: grid; gap: 1px; min-width: 0; }
.order-card-title strong { color: var(--text); font-family: var(--font-display); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.order-card-title small { color: var(--faint); font-size: 11.5px; }
.order-card-facts { display: grid; margin: 12px 0 0; padding: 0; }
.order-card-facts > div { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.order-card-facts > div + div { border-top: 1px solid var(--line-soft); }
.order-card-facts dt { flex-shrink: 0; width: 15px; height: 15px; margin-top: 2px; background: var(--faint); -webkit-mask: var(--fact-icon) center / contain no-repeat; mask: var(--fact-icon) center / contain no-repeat; }
.order-card-facts dd { margin: 0; color: var(--text); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.order-card-facts [data-fact="items"] { --fact-icon: var(--icon-bag); }
.order-card-facts [data-fact="store"] { --fact-icon: var(--icon-pin); }
.order-card-facts [data-fact="when"] { --fact-icon: var(--icon-calendar); }
.order-card-facts [data-fact="note"] { --fact-icon: var(--icon-info); }
.order-card-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.order-card-files .text-link { gap: 7px; padding: 5px 10px 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 12px; font-weight: 500; }
.order-card-files .text-link::before { content: ""; width: 14px; height: 14px; background: var(--good); -webkit-mask: var(--file-icon) center / contain no-repeat; mask: var(--file-icon) center / contain no-repeat; }
.order-card-files .text-link::after { content: ""; width: 11px; height: 11px; background: var(--faint); -webkit-mask: var(--icon-arrow-out) center / contain no-repeat; mask: var(--icon-arrow-out) center / contain no-repeat; }
.order-card-files .text-link:hover { border-color: var(--line-strong); background: var(--hover); }
.order-card-files [data-file="receipt"] { --file-icon: var(--icon-receipt); }
.order-card-files [data-file="foodPhoto"] { --file-icon: var(--icon-camera); }
#manage-orders { justify-content: flex-start; gap: 10px; width: 100%; color: var(--muted); border-style: dashed; background: transparent; }
#manage-orders::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--icon-list) center / contain no-repeat; mask: var(--icon-list) center / contain no-repeat; }
#manage-orders > span { margin-left: auto; }
#manage-orders:hover:not(:disabled) { color: var(--text); border-style: solid; background: var(--hover); }

.save-order-panel { padding: 14px; margin: 0 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); }
.save-order-panel label { display: block; margin-bottom: 8px; color: var(--text); }
.save-order-panel input { height: 40px; }
.save-name-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.save-name-controls .button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.save-name-controls .quiet { margin-left: auto; }

.order-actions { flex-shrink: 0; padding: 14px 22px; border-top: 1px solid var(--line-soft); }
.step-actions { display: flex; align-items: center; gap: 10px; }
.step-actions > .button { min-height: 42px; }
#start-live { flex: 1; }
#order-back { min-width: 74px; }
/* Continue is an arrow on its own: the numbered steps already say where it goes. */
#start-live::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--icon-send) center / contain no-repeat; mask: var(--icon-send) center / contain no-repeat; }
#start-live:disabled { opacity: .35; }
#order-step-error { margin-bottom: 12px; font-size: 12px; }
.order-save-controls { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 8px; }
.order-save-controls .button { min-height: 30px; padding: 4px 0 4px 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.order-save-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.order-save-status[data-state="error"] { color: var(--bad); margin-top: 10px; }
#initial-issue-fields > .field:first-child { margin-bottom: 16px; }
#issue-options[open] .issue-presets { margin-bottom: 12px; }

/* ---- Buttons ----------------------------------------------------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); background: var(--raised); font-size: 13px; font-weight: 500; line-height: 1.4; transition: background-color .14s ease, border-color .14s ease, color .14s ease, transform .08s ease; }
.button svg { width: 16px; height: 16px; }
.button:hover:not(:disabled) { border-color: rgba(255,255,255,.22); background: var(--raised-hi); }
.button:active:not(:disabled) { transform: translateY(1px); }
.primary { color: var(--on-accent); border-color: var(--accent); background: var(--accent); font-weight: 600; }
.primary:hover:not(:disabled) { color: var(--on-accent); border-color: #fff; background: #fff; }
.quiet { color: var(--muted); border-color: var(--line); background: transparent; }
.quiet:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.danger { color: #fff; border-color: var(--danger); background: var(--danger); font-weight: 600; }
.danger:hover:not(:disabled) { color: #fff; border-color: #c94f5b; background: #c94f5b; }
.icon-button { padding: 9px; background: transparent; }
.icon-button svg { width: 17px; height: 17px; }
.stop { color: var(--bad); border-color: rgba(238,125,136,.22); background: transparent; }
.stop:hover:not(:disabled) { color: #ffb4bc; border-color: rgba(238,125,136,.4); background: rgba(238,125,136,.08); }
/* Delete all (accounts and chat history): quiet until hovered. */
.delete-all-button { gap: 7px; min-height: 32px; padding: 5px 11px 5px 9px; border-color: transparent; color: var(--muted); background: transparent; font-size: 12px; }
.delete-all-button svg { width: 15px; height: 15px; }
.delete-all-button:hover:not(:disabled) { color: var(--bad); border-color: rgba(238,125,136,.3); background: rgba(238,125,136,.07); }
.delete-all-button:disabled { color: var(--faint); opacity: .5; }
#delete-order:hover:not(:disabled) { color: var(--bad); border-color: rgba(238,125,136,.4); background: rgba(238,125,136,.08); }
.start-button { width: 100%; min-height: 44px; font-size: 14px; }
.start-button svg { width: 18px; height: 18px; }
.start-button:disabled { opacity: .4; }
#start-live { width: auto; justify-content: center; font-size: 13px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px; border-radius: 6px; color: var(--muted); font-size: 12px; text-decoration: none; }
.text-link svg { width: 16px; height: 16px; }
.text-link:hover { color: var(--text); background: var(--hover); }

/* Bulk delete confirmation (accounts and chat history). */
.bulk-delete-dialog { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); outline: none; color: var(--text); background: var(--surface); box-shadow: var(--shadow-pop); }
.bulk-delete-dialog[open] { animation: pop-in .18s cubic-bezier(.2,.8,.2,1); }
.bulk-delete-dialog::backdrop { background: rgba(0,0,0,.66); }
.bulk-delete-dialog p { margin: 0; overflow-wrap: anywhere; }
.bulk-delete-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 20px; }
.bulk-delete-head { display: flex; align-items: flex-start; gap: 14px; }
.bulk-delete-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; color: var(--bad); background: rgba(238,125,136,.1); }
.bulk-delete-icon svg { width: 19px; height: 19px; }
.bulk-delete-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 1px; }
.bulk-delete-dialog h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.bulk-delete-progress { color: var(--muted); font-size: 12.5px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.bulk-delete-progress[data-state="busy"], .bulk-delete-progress[data-state="partial"] { color: var(--text); font-weight: 600; }
.bulk-delete-progress[data-state="done"] { color: var(--good); font-weight: 600; }
.bulk-delete-scope { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); list-style: none; }
.bulk-delete-scope-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.bulk-delete-scope-row + .bulk-delete-scope-row { border-top: 1px solid var(--line-soft); }
.bulk-delete-scope-row strong { display: block; margin-bottom: 1px; color: var(--text); font-size: 12.5px; font-weight: 600; }
.bulk-delete-scope-mark { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; }
.bulk-delete-scope-mark svg { width: 11px; height: 11px; }
.bulk-delete-scope-row[data-scope="removed"] .bulk-delete-scope-mark { color: var(--bad); background: rgba(238,125,136,.12); }
.bulk-delete-scope-row[data-scope="kept"] .bulk-delete-scope-mark { color: var(--good); background: rgba(94,207,149,.12); }
.bulk-delete-note { color: var(--faint); font-size: 12px; line-height: 1.5; }
/* Dialog error: icon chip, a lead sentence and a quieter follow-up, inline. */
.bulk-delete-dialog .field-status { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--raised); font-size: 12.5px; line-height: 1.55; animation: fade-up .2s ease-out; }
.bulk-delete-dialog .field-status[hidden] { display: none; }
.error-note-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; color: var(--bad); background: rgba(238,125,136,.12); }
.error-note-icon svg { width: 14px; height: 14px; }
.error-note-text { flex: 1; min-width: 0; padding-top: 2px; overflow-wrap: anywhere; }
.error-note-lead { color: var(--text); font-weight: 500; }
.error-note-rest { color: var(--muted); }
.bulk-delete-actions { padding: 14px 22px; border-top: 1px solid var(--line-soft); }
.bulk-delete-dialog .bulk-delete-actions .button { min-height: 36px; padding: 7px 16px; font-size: 13px; }
.bulk-delete-actions .danger[data-busy]::before { content: ""; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(-3px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Chat -------------------------------------------------------- */
.chat-header { display: flex; align-items: center; gap: 10px; min-height: 64px; flex-shrink: 0; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); }
.chat-avatar { position: relative; display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.07); }
.chat-avatar svg { width: 19px; height: 19px; }
.chat-avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--faint); }
.chat-header:has(.status[data-status="running"]) .chat-avatar::after,
.chat-header:has(.status[data-status="complete"]) .chat-avatar::after { background: var(--good); }
.chat-header:has(.status[data-status="error"]) .chat-avatar::after { background: var(--bad); }
.chat-heading { flex: 1; min-width: 0; }
.chat-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.chat-subtitle { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.4; }
.chat-subtitle:empty { display: none; }
/* Named human agent on the other end, once one has joined. */
.agent-badge { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-width: 0; padding: 4px 10px; border-radius: 999px; color: var(--agent); background: rgba(231,165,108,.1); font-size: 12px; font-weight: 600; white-space: nowrap; }
.agent-badge svg { width: 14px; height: 14px; }
.agent-badge > span { overflow: hidden; text-overflow: ellipsis; }
#download-transcript { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }

.status { --tone: var(--muted); display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 4px 10px; border-radius: 999px; color: var(--tone); background: color-mix(in srgb, var(--tone) 11%, transparent); white-space: nowrap; font-size: 12px; font-weight: 600; }
.status::before { content: ""; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-status="running"], .status[data-status="complete"] { --tone: var(--good); }
.status[data-status="complete"]::before, .status[data-done="failure"]::before { width: 11px; height: 11px; border-radius: 0; -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat; }
.status[data-done="failure"]::before { -webkit-mask-image: var(--icon-x); mask-image: var(--icon-x); }
.status[data-status="running"]::before, .status[data-status="starting"]::before { animation: soft-pulse 1.6s ease-in-out infinite; }
.status[data-status="starting"], .status[data-status="paused"], .status[data-status="waiting"] { --tone: var(--warn); }
.status[data-status="error"] { --tone: var(--bad); }

.chat-body { position: relative; display: flex; flex: 1; min-height: 0; overflow: hidden; }
.transcript-scroll { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 20px; scrollbar-width: thin; scrollbar-color: var(--scrollbar); scrollbar-gutter: stable; overscroll-behavior: contain; overflow-anchor: none; }
.latest-messages { position: absolute; bottom: 14px; left: 50%; z-index: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; max-width: calc(100% - 32px); padding: 6px 14px; transform: translateX(-50%); border: 0; border-radius: 999px; color: var(--on-accent); background: var(--accent); box-shadow: var(--shadow-pop); font-size: 12px; font-weight: 600; white-space: nowrap; }
.latest-messages:hover { background: #fff; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 30px 16px; text-align: center; }
.empty-art { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; color: var(--muted); border-radius: 18px; background: rgba(255,255,255,.05); }
.empty-art svg { width: 40px; height: 40px; }
.empty-bubble-back { fill: rgba(255,255,255,.04); stroke: rgba(255,255,255,.22); stroke-width: 1.5; }
.empty-bubble-front { fill: rgba(255,255,255,.08); stroke: rgba(255,255,255,.4); stroke-width: 1.5; }
.empty-state h3 { margin: 0 0 8px; color: var(--text); font-size: 17px; font-weight: 600; }
.empty-state p { max-width: 320px; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

/* A short conversation sits against the composer, not at the top. */
#transcript { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; min-height: 100%; list-style: none; margin: 0; padding: 0 0 3px; }
/* Dense transcript: no avatar circles on chat bubbles (the name line says who
   it is), tighter gaps and bubbles, so about twice as much fits on screen. */
.event-support > .event-avatar, .event-sent > .event-avatar, .event-user > .event-avatar { display: none; }
.event { display: flex; align-items: flex-end; gap: 10px; max-width: min(82%, 640px); min-width: 0; animation: event-in .22s ease-out; }
.event-avatar { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; margin-bottom: 1px; border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.07); font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.event-content { min-width: 0; flex: 1; }
.event-heading { display: flex; align-items: baseline; gap: 8px; margin: 2px 2px 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.event-heading time { color: var(--faint); white-space: nowrap; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.event-message { margin: 0; padding: 7px 12px; border: 1px solid var(--line); border-radius: 14px 14px 14px 5px; color: var(--text); background: var(--raised); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.event-support { align-self: flex-start; }
.event-user, .event-sent { flex-direction: row-reverse; align-self: flex-end; max-width: min(78%, 580px); }
.event-user .event-heading, .event-sent .event-heading { flex-direction: row-reverse; }
.event-sent .event-avatar { color: var(--on-accent); background: var(--accent); }
.event-sent .event-message { color: #fff; border-color: transparent; background: #2c2c33; border-radius: 14px 14px 5px 14px; }
/* Notes to the assistant never reach Chipotle, so they read as an outline. */
.event-user .event-message { color: #d4d4d8; border: 1px dashed var(--line-strong); background: transparent; border-radius: 14px 14px 5px 14px; }
.event-user .event-avatar { border: 1px dashed var(--line-strong); background: transparent; }
.event-agent .event-message { color: var(--muted); background: transparent; }

.event.is-continued { margin-top: -5px; }
.event.is-continued .event-heading { display: none; }
.event.has-next .event-avatar { visibility: hidden; }
.event-support.is-continued .event-message { border-top-left-radius: 5px; }
.event-support.has-next .event-message { border-bottom-left-radius: 5px; }
.event-sent.is-continued .event-message, .event-user.is-continued .event-message { border-top-right-radius: 5px; }

.event-action, .event-browser, .event-system, .event-start, .event-done { align-self: center; max-width: 94%; }
.event-action .event-avatar, .event-browser .event-avatar, .event-system .event-avatar, .event-start .event-avatar { display: none; }
.event-system .event-content { display: flex; align-items: baseline; gap: 9px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.04); }
.event-system .event-sender { display: none; }
.event-action .event-message, .event-browser .event-message, .event-system .event-message, .event-start .event-message { padding: 0; border: 0; border-radius: 0; color: var(--muted); background: transparent; font-size: 12px; line-height: 1.6; }
.event-action .event-heading, .event-browser .event-heading, .event-system .event-heading, .event-start .event-heading { flex-shrink: 0; gap: 0; margin: 0; color: var(--faint); font-size: 11px; }
/* The end-of-chat summary is the outcome, so it reads as a card. */
.event.event-done { align-items: flex-start; gap: 12px; width: min(100%, 720px); max-width: 100%; padding: 14px 18px 15px 14px; border: 1px solid rgba(94,207,149,.22); border-radius: var(--radius-lg); background: rgba(94,207,149,.05); }
.event-done .event-avatar { display: grid; flex: 0 0 26px; width: 26px; height: 26px; margin: 0; color: #0b1a12; background: var(--good); font-size: 0; }
.event-done .event-avatar::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat; }
.event-done .event-content { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; }
.event-done .event-heading { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 5px; color: var(--good); font-size: 13px; font-weight: 600; }
.event-done .event-sender { display: inline; }
.event-done .event-heading time { color: rgba(94,207,149,.6); }
.event-done .event-message { padding: 0; border: 0; border-radius: 0; color: #d5e9de; background: transparent; font-size: 13.5px; line-height: 1.65; }
.event-error { align-self: stretch; max-width: 100%; }
.event-error .event-content { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; }
.event-error .event-heading { margin: 0 3px 6px; }
.event-error .event-avatar { color: var(--bad); background: rgba(238,125,136,.12); }
.event-error .event-message { padding: 10px 14px; color: #f1c3c9; border: 1px solid rgba(238,125,136,.25); border-radius: var(--radius); background: rgba(238,125,136,.07); font-size: 13px; }
/* Who is speaking: a person beside your own messages, a headset beside a live
   agent's. The bot keeps the plain Chipotle label. */
.event-sender { display: inline-flex; align-items: center; gap: 5px; }
.event-sent .event-sender::before, .event-user .event-sender::before, .event-support.is-agent .event-sender::before { content: ""; flex-shrink: 0; width: 13px; height: 13px; background: currentColor; -webkit-mask: var(--icon-person) center / contain no-repeat; mask: var(--icon-person) center / contain no-repeat; opacity: .8; }
.event-support.is-agent .event-sender::before { -webkit-mask-image: var(--icon-headset); mask-image: var(--icon-headset); }
.event-support.is-agent .event-heading { color: var(--agent); }
.event-support.is-agent .event-avatar { color: var(--agent); background: rgba(231,165,108,.12); }
.event-support.is-agent .event-avatar:empty::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--icon-headset) center / contain no-repeat; mask: var(--icon-headset) center / contain no-repeat; }
@keyframes event-in { from { opacity: 0; transform: translateY(5px); } }

/* Run controls sit in the header beside the status they act on. */
.controls { display: flex; align-items: center; flex-shrink: 0; gap: 6px; margin-left: auto; }
.controls .button { min-height: 32px; padding: 5px 13px; font-size: 12px; }
.controls .button svg { width: 14px; height: 14px; }
.chat-header .status { margin-left: 0; }
.reply-form { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.reply-form label { display: block; max-height: 70px; overflow-y: auto; margin-bottom: 9px; color: var(--text); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-composer { display: flex; align-items: flex-end; gap: 9px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); }
.reply-composer:focus-within { border-color: rgba(255,255,255,.3); box-shadow: var(--ring); }
.reply-form textarea { flex: 1; width: 0; max-height: 140px; min-height: 55px; padding: 8px 9px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; line-height: 1.55; resize: vertical; }
.reply-form textarea:focus { border: 0; background: transparent; box-shadow: none; outline: none; }
.reply-form .button { flex-shrink: 0; margin: 0; min-height: 38px; padding: 7px 14px; font-size: 12.5px; }
.reply-form .button svg { width: 15px; height: 15px; }
.continue-prompt .event-message { padding: 0; border: 0; color: var(--warn); background: transparent; font-size: 13px; }
.continue-prompt .button { margin-top: 10px; }
.saved-chat-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.saved-chat-notice > p { flex: 1 1 280px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.saved-chat-notice > .field-status { flex-basis: 100%; color: var(--bad); }

/* ---- Chat switcher & history ------------------------------------- */
/* Running chats sit beside the view switch as pills you can scroll through. */
.chat-switcher { display: flex; flex: 1; min-width: 0; gap: 6px; padding: 1px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.chat-switcher::-webkit-scrollbar { display: none; }
.chat-switch { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; max-width: 260px; min-height: 34px; padding: 5px 13px 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; text-align: left; }
.chat-switch::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chat-switch:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); background: var(--hover); }
.chat-switch strong { min-width: 0; overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.chat-switch span { flex-shrink: 0; color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.chat-switch[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); background: var(--raised-hi); }
.chat-switch[aria-pressed="true"] span { color: var(--muted); }
.chat-switch[data-status="running"]::before, .chat-switch[data-status="starting"]::before { background: var(--good); }
.chat-switch[data-status="waiting"]::before, .chat-switch[data-status="paused"]::before { background: var(--warn); }
.chat-switch[data-status="error"]::before { background: var(--bad); }
.chat-switch[data-status="waiting"] span { color: var(--warn); }
.chat-switch[data-status="error"] span { color: var(--bad); }

.order-history-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 18px 14px 14px; }
/* Title and Delete all on one row; search and filter on the next. */
.history-heading { display: flex; flex-direction: column; gap: 12px; margin: 0 6px 12px; }
.history-heading h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.history-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.history-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.history-search { position: relative; flex: 1 1 170px; min-width: 0; }
.history-search::before { content: ""; position: absolute; top: 50%; left: 12px; z-index: 1; width: 15px; height: 15px; transform: translateY(-50%); background: var(--faint); -webkit-mask: var(--icon-search) center / contain no-repeat; mask: var(--icon-search) center / contain no-repeat; pointer-events: none; }
.history-search:focus-within::before { background: var(--text); }
#order-history-search { height: 38px; padding: 8px 12px 8px 35px; font-size: 13px; }
#history-status { padding: 0 6px 10px; }
/* Conversations are rows, not boxes: hover and selection tint the row. */
.order-history-list { display: flex; flex-direction: column; gap: 2px; overflow: auto; min-height: 0; padding: 0 2px 2px 0; scrollbar-width: thin; scrollbar-color: var(--scrollbar); }
/* Three lines per row: order and status; who, with the date on the right; the
   issue. The trash takes the preview line's right end on hover. */
.history-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; flex-shrink: 0; width: 100%; padding: 11px 14px 11px 16px; overflow: hidden; border: 0; border-radius: var(--radius); text-align: left; color: var(--text); background: transparent; }
.history-card:hover:not(:disabled) { background: var(--hover); }
.history-card[aria-pressed="true"] { background: var(--selected); }
/* Worked or failed shows as a thin bar on the row's edge. */
.history-card::before { content: ""; position: absolute; top: 13px; bottom: 13px; left: 4px; width: 3px; border-radius: 3px; background: transparent; }
.history-card[data-outcome="success"]::before { background: var(--good); }
.history-card[data-outcome="failure"]::before { background: var(--bad); }
/* Delete sits in the row's corner, any confirmation opens underneath. */
.history-entry { display: grid; grid-template-columns: minmax(0, 1fr); flex-shrink: 0; }
.history-entry > .history-card { grid-area: 1 / 1; }
.history-entry > .history-delete-confirm { grid-area: 2 / 1; }
.history-delete { position: relative; z-index: 1; grid-area: 1 / 1; align-self: end; justify-self: end; display: grid; place-items: center; width: 28px; height: 28px; margin: 0 8px 7px 0; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--faint); line-height: 1; }
.history-delete:hover:not(:disabled) { color: var(--bad); background: rgba(238,125,136,.1); }
.history-delete:disabled { opacity: .35; cursor: not-allowed; }
.history-delete svg { width: 15px; height: 15px; }
@media (hover: hover) { .history-entry:not(:hover):not(:focus-within) .history-delete { opacity: 0; } }
.history-delete-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 4px 0 6px; padding: 12px; border: 1px solid rgba(238,125,136,.25); border-radius: var(--radius); background: rgba(238,125,136,.06); animation: fade-up .18s ease-out; }
.history-delete-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; color: var(--bad); background: rgba(238,125,136,.12); }
.history-delete-icon svg { width: 16px; height: 16px; }
.history-delete-text { display: flex; flex: 1 1 160px; flex-direction: column; gap: 2px; min-width: 0; }
.history-delete-text strong { color: var(--text); font-size: 13px; font-weight: 600; }
.history-delete-text small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-delete-actions { display: flex; flex-shrink: 0; gap: 6px; margin-left: auto; }
.history-delete-confirm .button { min-height: 32px; padding: 5px 13px; font-size: 12px; }
.history-card-heading { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 10px; }
.history-card-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.history-card-heading .history-mark { display: grid; place-items: center; flex-shrink: 0; width: 16px; height: 16px; margin-right: auto; border-radius: 50%; }
.history-card-heading:has(.history-mark) strong { flex: 0 1 auto; }
.history-mark svg { width: 10px; height: 10px; }
.history-mark[data-outcome="success"] { color: #0b1a12; background: var(--good); }
.history-mark[data-outcome="failure"] { color: #fff; background: var(--danger); }
/* Status reads as coloured text with a dot, not a pill. */
.history-status { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.5; text-transform: capitalize; }
.history-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.history-status[data-status="running"], .history-status[data-status="complete"] { color: var(--good); }
.history-status[data-status="waiting"], .history-status[data-status="paused"], .history-status[data-status="interrupted"] { color: var(--warn); }
.history-status[data-status="error"] { color: var(--bad); }
.history-status[data-done]::before { width: 11px; height: 11px; border-radius: 0; -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat; }
.history-status[data-done="failure"]::before { -webkit-mask-image: var(--icon-x); mask-image: var(--icon-x); }
.history-contact { display: flex; grid-column: 1; grid-row: 2; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; color: var(--muted); font-size: 12.5px; }
.history-person, .history-agent { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.history-person::before, .history-agent::before { content: ""; flex-shrink: 0; width: 13px; height: 13px; background: currentColor; -webkit-mask: var(--icon-person) center / contain no-repeat; mask: var(--icon-person) center / contain no-repeat; opacity: .7; }
.history-person.history-order::before { -webkit-mask-image: var(--icon-receipt); mask-image: var(--icon-receipt); }
.history-agent { color: var(--agent); font-size: 12px; font-weight: 600; }
.history-agent::before { width: 12px; height: 12px; opacity: 1; -webkit-mask-image: var(--icon-headset); mask-image: var(--icon-headset); }
.history-preview { display: -webkit-box; grid-column: 1 / -1; grid-row: 3; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; padding-right: 30px; color: var(--faint); font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }
.history-date { display: flex; grid-column: 2; grid-row: 2; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 10px; min-height: 18px; color: var(--faint); font-size: 11.5px; }
.history-ref { padding: 1px 7px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.06); font-size: 10.5px; line-height: 1.6; }
.history-when { display: inline-flex; align-items: center; gap: 5px; }
.history-when svg { width: 12px; height: 12px; }
/* Nothing to list: one centred prompt with one way forward. */
.history-empty { display: flex; flex-direction: column; align-items: center; max-width: 320px; margin: auto; padding: 36px 16px 48px; text-align: center; }
.history-empty[hidden] { display: none; }
.history-empty-art { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 18px; color: var(--muted); background: rgba(255,255,255,.05); }
.history-empty-art svg { width: 40px; height: 40px; }
.history-empty-art .empty-bubble-back, .history-empty-art .empty-bubble-front { stroke-linejoin: round; }
.history-empty-search { display: none; width: 30px !important; height: 30px !important; color: var(--muted); }
.history-empty[data-reason="filtered"] .history-empty-chat { display: none; }
.history-empty[data-reason="filtered"] .history-empty-search { display: block; }
.history-empty-title { margin: 0 0 6px; color: var(--text); font-size: 16px; font-weight: 600; }
.history-empty-text { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.history-empty-text:empty { display: none; }
.history-empty-title:has(+ .history-empty-text:empty) { margin-bottom: 16px; }
.history-empty-action { min-height: 36px; padding: 7px 18px; font-size: 13px; }
.history-empty[data-reason="filtered"] .history-empty-action { color: var(--text); border-color: var(--line-strong); background: var(--raised); }
.history-empty[data-reason="filtered"] .history-empty-action:hover:not(:disabled) { background: var(--raised-hi); }
.order-history-panel.is-empty .history-tools { display: none; }
.order-history-panel.is-empty .history-delete-all { visibility: hidden; }

/* ---- Alerts ------------------------------------------------------ */
/* Destructive confirmations: cancel first, the dangerous action last. */
.confirmation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.confirmation-actions .button { min-height: 34px; padding: 6px 14px; font-size: 12.5px; }
.alert { flex-shrink: 0; padding: 10px 14px; margin: 0 0 14px; border: 1px solid rgba(229,176,98,.28); border-radius: var(--radius); color: var(--warn); background: rgba(229,176,98,.07); font-size: 13px; line-height: 1.6; }
.notification { --tone: var(--warn); position: fixed; bottom: 24px; left: 50%; z-index: 10; display: flex; align-items: flex-start; gap: 12px; max-width: 560px; width: calc(100% - 32px); padding: 13px 12px 15px 14px; overflow: hidden; transform: translateX(-50%); border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: var(--raised); box-shadow: var(--shadow-pop); animation: toast-in .26s cubic-bezier(.2,.9,.25,1.1); }
.notification[data-tone="success"] { --tone: var(--good); }
.notification[data-tone="error"] { --tone: var(--bad); }
.notification-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.notification-icon svg { width: 14px; height: 14px; }
.notification-message { flex: 1; min-width: 0; margin: 0; padding-top: 2px; color: var(--text); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.notification-close { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; margin-top: -1px; padding: 0; border: 0; border-radius: 7px; color: var(--faint); background: transparent; }
.notification-close:hover { color: var(--text); background: var(--hover); }
.notification-close svg { width: 14px; height: 14px; }
/* Notices (Accounts banner, Support toast): tinted icon chip, the lead
   sentence in full colour, the rest quieter on the same line. */
.notice-icon { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; color: var(--bad); background: rgba(238,125,136,.13); }
.notice-icon svg { width: 14px; height: 14px; }
.notice-text { flex: 1; min-width: 0; margin: 0; padding-top: 2px; color: var(--text); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.notice-lead { color: var(--text); font-weight: 500; }
.notice-rest { color: var(--muted); }
.notice-close { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; margin-top: -1px; padding: 0; border: 0; border-radius: 7px; color: var(--faint); background: transparent; }
.notice-close:hover { color: var(--text); background: var(--hover); }
.notice-close svg { width: 14px; height: 14px; }
.notification-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--tone); opacity: .45; transform-origin: left; animation: toast-timer var(--notify-ms, 9s) linear forwards; }
.notification:hover .notification-timer { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* ---- View states ------------------------------------------------- */
.chat-active .step-actions, .chat-active .order-save-controls, .chat-active #delete-order { display: none; }
.chat-active #clear-order { display: inline-flex; }
.chat-active .order-actions { padding: 0; border: 0; }
.chat-active .step-count { color: var(--muted); }
.new-request-view .chat-heading, .new-request-view .chat-avatar { opacity: .75; }
.workspace.request-only { grid-template-columns: minmax(0, 760px); justify-content: center; align-content: start; }
.request-only .order-panel { height: auto; min-height: 0; max-height: 100%; }
.request-only #order-form, .request-only #order-fields { flex: initial; }
#empty-transcript { display: none; }

/* ---- Responsive -------------------------------------------------- */
@media (min-width: 761px) {
  .history-open .workspace { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  /* With no chat selected, history gets the full height and a readable width. */
  .history-open .workspace.request-only { grid-template-columns: minmax(0, 760px); align-content: stretch; }
  .history-open .request-only .order-panel { height: 100%; max-height: 100%; }
  .disclosure summary { min-height: 39px; padding-top: 8px; padding-bottom: 8px; }
  .issue-section .field { margin-bottom: 14px; }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .app-shell { padding: 0 16px 16px; }
  .workspace { grid-template-columns: minmax(340px, 42%) minmax(0, 1fr); gap: 14px; }
  .chat-header, .transcript-scroll { padding-left: 18px; padding-right: 18px; }
  .event { max-width: 96%; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100dvh; padding: 0 12px 12px; }
  .app-header { gap: 8px 14px; min-height: 52px; margin-bottom: 12px; padding: 8px 0; }
  h1 { font-size: 18px; }
  .app-navigation .text-link { padding: 7px 10px; font-size: 12.5px; }
  .support-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
  .workspace-tabs { flex: 1 1 100%; display: grid; grid-template-columns: 1fr auto 1fr; }
  .workspace-tab { padding: 6px 10px; font-size: 12.5px; }
  .chats-summary { max-width: none; padding: 0 3px; font-size: 11.5px; text-align: left; }
  .workspace { display: flex; flex-direction: column; gap: 14px; flex: initial; }
  .workspace.request-only { align-items: stretch; }
  .panel { height: auto; }
  .order-panel { min-height: min(610px, calc(100dvh - 85px)); }
  .request-only .order-panel { width: 100%; min-height: 0; }
  #order-fields { flex: initial; overflow: visible; padding: 20px 18px; }
  .order-actions { margin-top: auto; padding-left: 18px; padding-right: 18px; }
  input, select, textarea { font-size: 16px; }
  .chat-panel { height: 650px; }
  .support-page:not(.has-conversation) .chat-panel { display: none; }
  .chat-active .chat-panel { order: -1; height: calc(100dvh - 144px); min-height: 430px; }
  .chat-header { flex-wrap: wrap; min-height: 60px; padding: 11px 14px; gap: 9px; }
  /* Name on its own row; Pause, Stop and status wrap underneath. */
  .chat-heading { flex: 1 1 calc(100% - 45px); }
  .chat-avatar { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
  .chat-avatar svg { width: 17px; height: 17px; }
  .chat-heading h2 { font-size: 14.5px; }
  .transcript-scroll { padding: 16px 13px; }
  #transcript { gap: 14px; }
  .event { max-width: 96%; gap: 6px; }
  .event-user, .event-sent { max-width: 92%; }
  .event-avatar { width: 23px; height: 23px; flex-basis: 23px; font-size: 9px; }
  .event-message { padding: 9px 12px; }
  .event-heading { gap: 11px; font-size: 11px; }
  .reply-form { padding-left: 13px; padding-right: 13px; }
  .controls .button { padding-left: 11px; padding-right: 11px; }
  .reply-form textarea { min-height: 52px; font-size: 16px; }
  .reply-form .button { min-height: 38px; padding: 7px 10px; }
  .chat-switch { min-height: 34px; padding: 5px 12px 5px 10px; max-width: 190px; }
  .chat-switch span { display: none; }
  .order-history-panel { min-height: 350px; padding: 14px 10px 10px; }
  .order-history-list { max-height: 430px; }
  .history-open .order-panel { order: -2; min-height: 0; height: auto; }
  .history-open .order-history-panel { min-height: 0; }
  .history-open .order-history-list { max-height: 200px; }
}
@media (max-width: 360px) {
  .app-shell { padding: 0 8px 8px; }
  .brand > span:last-child { display: none; }
  .field-grid, .issue-options { grid-template-columns: 1fr; }
  #order-fields, .order-actions { padding-left: 14px; padding-right: 14px; }
  .chat-avatar { display: none; }
}
@media (min-width: 761px) and (max-height: 640px) {
  body.support-page { overflow: hidden; }
  .support-page .app-shell { height: 100dvh; min-height: 0; padding-bottom: 12px; }
  .support-page .app-header { min-height: 50px; margin-bottom: 10px; padding: 6px 0; }
  .support-page .support-toolbar { margin: 0 0 10px; }
  .support-page .workspace { flex: 1; align-items: stretch; }
  .order-panel { min-height: 0; }
  #order-fields { overflow-y: auto; padding-top: 16px; padding-bottom: 12px; }
  .order-actions { padding-top: 12px; padding-bottom: 10px; }
  .chat-panel { height: 100%; }
  .chat-header { min-height: 58px; padding-top: 10px; padding-bottom: 10px; }
  .reply-form { padding-top: 11px; padding-bottom: 10px; }
  .reply-form label { max-height: 52px; }
  .reply-form textarea { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  button, a, input, select, textarea, .issue-option { transition: none; }
  .status::before, .chats-summary::before, .history-delete-confirm, .event, .notification, .bulk-delete-dialog[open], .bulk-delete-dialog .field-status, .bulk-delete-actions .danger[data-busy]::before { animation: none; }
}

/* ---- Usage (selected conversation) ------------------------------- */
.chat-usage { container: usage / inline-size; flex-shrink: 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
.chat-usage summary { display: flex; align-items: center; gap: 12px; padding: 8px 20px; cursor: pointer; list-style: none; user-select: none; }
.chat-usage summary::-webkit-details-marker { display: none; }
.chat-usage summary:hover { color: var(--text); background: rgba(255,255,255,.025); }
.chat-usage summary:focus { outline: none; }
.chat-usage summary:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: -2px; border-radius: 6px; }
.usage-title { display: inline-flex; flex: 1; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.usage-title svg { flex-shrink: 0; width: 14px; height: 14px; color: var(--faint); }
.usage-glance { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-total { color: var(--text); font-weight: 600; }
.usage-total:empty { display: none; }
.usage-cost-summary { color: var(--good); font-size: 12px; font-weight: 600; }
.usage-calls { color: var(--faint); font-size: 11.5px; }
.usage-chevron { flex-shrink: 0; width: 16px; height: 16px; color: var(--faint); transition: transform .2s ease; }
.chat-usage[open] .usage-chevron { transform: rotate(180deg); }
.usage-body { padding: 2px 20px 14px; }
.usage-grid { display: grid; grid-template-columns: minmax(100px, .6fr) minmax(210px, 1.4fr) minmax(140px, 1fr) minmax(150px, 1fr); gap: 10px; margin: 0; }
.usage-stat { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(255,255,255,.02); }
.usage-stat dt { color: var(--faint); font-size: 11px; font-weight: 500; }
.usage-stat dd { margin: 0; }
.usage-value { color: var(--text); font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.usage-stat .usage-meter { display: flex; height: 4px; margin-top: 2px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.usage-bar { display: block; height: 100%; transition: width .4s ease; }
.usage-bar-cached, .usage-key-cached { background: #d4d4d8; }
.usage-bar-writes, .usage-key-writes { background: #71717a; }
.usage-bar-reasoning, .usage-key-reasoning { background: var(--good); }
.usage-stat .usage-per-call { color: var(--faint); }
.usage-per-call:empty { display: none; }
.usage-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.usage-sub > span:not(.usage-key):not(.usage-share) { color: var(--text); }
.usage-key { flex-shrink: 0; width: 6px; height: 6px; border-radius: 2px; }
.usage-share { color: var(--faint); }
.usage-note { margin: 10px 2px 0; color: var(--faint); font-size: 11px; line-height: 1.5; }
.usage-note a { color: var(--muted); text-underline-offset: 2px; }
.usage-cost-stat .usage-sub { line-height: 1.45; }
@media (max-width: 900px) { .usage-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .usage-stat-wide { grid-column: 1 / -1; order: 3; } .usage-cost-stat { grid-column: 1 / -1; order: 4; } }
@container usage (max-width: 700px) { .usage-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .usage-stat-wide { grid-column: 1 / -1; order: 3; } .usage-cost-stat { grid-column: 1 / -1; order: 4; } }
@media (max-width: 520px) { .usage-glance { gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .usage-glance .usage-total { display: none; } }
@media (prefers-reduced-motion: reduce) { .usage-bar, .usage-chevron, .disclosure summary::after { transition: none; } }

/* Top bar on phones. Kept last so it wins over the older page-level rules. */
@media (max-width: 640px) {
  .app-header { flex-wrap: nowrap; gap: 8px; }
  .app-header .brand > span:last-child { display: none; }
  .app-navigation { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
  .app-navigation::-webkit-scrollbar { display: none; }
  .app-navigation .text-link { padding: 7px 9px; font-size: 12.5px; }
  .header-balance { display: none; }
}
/* Narrow phones: the logo gives way so all five sections fit without scrolling. */
@media (max-width: 420px) {
  .app-header .brand { display: none; }
  .app-navigation { gap: 0; }
  .app-navigation .text-link { padding: 7px 5px; }
}
