/* Yarnball CDS 1.0.2 app surface extensions — ONLY tokens from the design system.
   Owned by the central design system under /_cds/. App code must NOT ship
   parallel stylesheets or invent colors/type outside tokens. */
body { margin: 0; }

/* R1 density fix (chat.js, both the empty-state and the real-conversation branch —
   see the comment above ChatScreen's return in chat.js for the full bk-8260f178
   history). Scoped to these two modifier classes ONLY: .yarnball-main itself (frozen,
   _ds_bundle.css) keeps justify-content:safe center for every other screen routed
   through it (Settings, History, Connections, Usage), which the centering genuinely
   helps. Chat specifically measured ~70% dead viewport at 1280x720 with content
   centered inside the full flex:1 height — this packs it from the top instead. No
   effect once real content overflows the container (flex-start === safe center once
   content is taller than available height), so long transcripts are unchanged. */
.yarnball-main-populated {
  justify-content: flex-start;
}
/* bk-yarnball5-usage-security-density (2026-07-18): re-measured live at 1280x720 — the
   flex-start override above still left a 379.7px (52.7%) dead gap between the last
   starter-chip and the composer, because .yarnball-main-compact inherited the frozen
   .yarnball-main's flex:1 (_ds_bundle.css) — the box itself still claims the FULL
   remaining height under the top bar, so no justify-content value fixes it: centering
   split the void above+below, flex-start just collapsed it to one gap below the
   content and above the composer (which sits OUTSIDE .yarnball-main as a sibling, so
   nothing inside .yarnball-main can pull it closer). The only change that actually closes
   that gap is letting the box SHRINK to its real content height (short hero +
   starter-chips) so .compwrap — the very next flex child in .yarnball-shell's column —
   sits right below it. (An earlier attempt at flex:0 1 auto was reverted per the
   comment on .yarnball-main-compact in _ds_bundle.css; re-tried here as the SCOPED
   app-extensions.css override in the SAME direction with the density math re-checked:
   any leftover height now trails after the composer as ordinary bottom page margin,
   not a void wedged between two functional controls — that's the actual defect this
   closes, not a global "zero whitespace anywhere" requirement.) */
.yarnball-main-compact {
  flex: 1;
  justify-content: flex-start;
}

/* YARNBALL-B-012: serif body for AI-served content (Ben's dense/serif/no-symbols standing
   rule) — this must apply to every Yarnball chat reply, not a gated "gui-mode" ancestor class
   that nothing in the app ever sets (that gate made this rule dead: the live chat bubble
   rendered sans-serif Inter via --ui regardless). Selector matches the actual DOM ChatRow
   renders for assistant messages (className "row " + from, from === 'yarnball' — see
   public/_cds/1.0.2/_ds_bundle.js ChatRow()). Does not touch .row.me (the user's own text). */
.row.yarnball .bub {
  font-family: var(--font-body-serif);
  font-size: 14.5px;
  line-height: 1.4;
}
.gui-items {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin: 0 0 8px;
}
.gui-item {
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.gui-item:last-child { border-bottom: 0; }
.gui-item-hd {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink-2);
}
.gui-item-hd:hover { background: var(--surface-2); }
.gui-item.marked {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.gui-item-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
}
.gui-item-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .03em;
  color: var(--faint);
  margin-top: 2px;
}
.gui-item-note {
  padding: 0 10px 8px;
  display: flex;
  gap: 6px;
}
.gui-item-note input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 5px 8px;
  font-family: Georgia, serif;
  font-size: 12px;
}
.gui-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 6px;
  font-family: var(--mono);
  font-size: 10px;
}
.gui-marker {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 3px 7px;
  border-radius: var(--r-pill);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gui-marker:hover { background: var(--surface-2); }
.mode-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
}
.mode-toggle.on {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}

/* Chat empty-state hero: tagline only, smaller than the default 40px Greeting */
.greet {
  font-size: 22px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 10px 0 0;
  max-width: 22em;
}
@media (max-width: 720px) {
  .greet { font-size: 18px; line-height: 1.3; }
}
@media (max-width: 380px) {
  .greet { font-size: 16px; }
}

/* YARNBALL-R-064: floating "Feedback" affordance — fixed corner pill, tokens only, sits under
   the modal backdrop (z-index 50 in _ds_bundle.css) so an open modal always covers it. */
.feedback-fab {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.feedback-fab:hover { background: var(--surface-2); }
/* R1: at mobile widths (<=600px, matching _ds_bundle.css's composer breakpoint) the fixed
   feedback-fab (bottom:16px, right:16px) sat in the exact same bottom-right corner as the
   composer's Send button and its "Still replying…" wait-hint row (chat.js ChatComposer —
   that hint DOES render on mobile while waitHint is true, unlike the normal Enter-to-send
   hint which is desktop-only). .compwrap's own bottom padding (24px) plus the ~44px button
   row plus that occasional hint line put real interactive controls directly under the
   pill's fixed footprint. Lifting the pill above the composer's tallest state (button row +
   wait-hint line + padding) clears it with a CSS-only fix — no composer markup change
   needed. */
@media (max-width: 600px) {
  .feedback-fab {
    bottom: max(92px, calc(76px + env(safe-area-inset-bottom)));
  }
}

/* YARNBALL-R-065: small persistent alpha disclaimer on the main (home) page — dense one-line
   notice, tokens only. flex: 0 0 auto keeps it out of the shell column's flex-grow so the
   chat Composer's bottom-pin is unaffected. The link opens the YARNBALL-R-064 feedback modal. */
.alpha-disclaimer {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.alpha-disclaimer-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--mute);
}
.alpha-disclaimer-link {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* Shared app-shell chrome (main.js) — moved off inline style props onto DS-owned
   classes, tokens only. This chrome wraps the top bar shown on every screen,
   including Projects (YARNBALL-B-003). */
.not-loaded-note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--mute);
}
.brand-home-link {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.model-badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.model-badge-lock--lg {
  width: 28px;
  height: 28px;
}
.model-badge-label-btn {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  max-width: 220px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  /* YARNBALL-R-091: enough room for model id + tier token; the name span below is the only
     variable-length segment and truncates before the fixed "Fast · Secure" suffix. */
  max-width: 260px;
}
.model-badge-name {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-badge-tier {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .model-badge-label-btn {
    /* Narrower desktop/tablet row: keep the tier token readable, trim the budget for the
       model id itself rather than reverting to the old full-clip behavior. */
    max-width: 190px;
  }
}
.model-badge-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  /* YARNBALL-R-013: clamp to the viewport (8px margin each side) so a 300-340px menu
     can never force horizontal scroll at the 375px test viewport. The JS side
     (main.js ModelLockBadge) additionally offsets `left` so the clamped box stays
     fully on-screen regardless of where the anchor sits in the top bar. */
  min-width: min(300px, calc(100vw - 16px));
  max-width: min(340px, calc(100vw - 16px));
  max-height: 360px;
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-family: var(--sans, inherit);
  font-size: 12px;
  letter-spacing: normal;
}
.model-badge-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.model-badge-option.selected {
  background: var(--surface-2);
}
.model-badge-option-title {
  font-weight: 600;
  font-size: 12px;
}
.model-badge-option-meta {
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.model-badge-option-loc {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}
.model-badge-footer {
  padding: 8px 12px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--faint);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--line);
}
.model-badge-footer > div + div {
  margin-top: 2px;
}
.memory-vault-btn {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

/* YARNBALL-R-014 — guided first-run empty-state starter chips (dense, functional; no icons,
   no decorative chrome). Each chip either sends a real prompt immediately or opens a real
   Settings sub-view — never a placeholder/no-op. */
.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
  max-width: 40em;
}
.starter-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background-color .15s;
}
.starter-chip:hover { border-color: var(--accent); color: var(--ink); background: var(--surface-2); }
.starter-chip:disabled { opacity: .5; cursor: default; }

/* YARNBALL-B-006: .attestation-chip was used in chat.js with no DS rule backing it
   (allowlist-gate violation) — defining it here closes that gap. */
.attestation-chip {
  margin-top: 6px;
}

/* Memory galaxy — full-screen vault explorer (Settings list remains the control surface).
   Tokens only. Classes consumed by public/app/memory-space.js. */
.memory-space {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.memory-space-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.memory-space-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.memory-space-hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(320px, calc(100vw - 32px));
  pointer-events: auto;
}
.memory-space-card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  padding: 12px 14px;
}
.memory-space-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 6px;
}
.memory-space-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.memory-space-sub {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.45;
  margin: 0;
}
.memory-space-sub kbd {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
.memory-space-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.memory-space-modes .btn {
  padding: 7px 12px;
  font-size: 11.5px;
  box-shadow: none;
}
.memory-space-modes .btn:hover {
  transform: none;
}
.memory-space-sheet {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  max-height: min(70vh, 520px);
  overflow: hidden;
}
.memory-space-sheet.open {
  display: flex;
}
.memory-space-sheet-h {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.memory-space-sheet-t {
  flex: 1;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.memory-space-sheet-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
.memory-space-sheet-x:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.memory-space-sheet-b {
  padding: 14px 16px 16px;
  overflow-y: auto;
}
.memory-space-body {
  font-family: var(--font-body-serif);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.memory-space-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.memory-space-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.memory-space-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-pill);
  padding: 4px 9px;
}
.memory-space-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.memory-space-actions .btn {
  box-shadow: none;
}
.memory-space-actions .memory-space-danger {
  margin-left: auto;
  border-color: color-mix(in srgb, var(--ink) 20%, var(--line));
  color: var(--ink-2);
  background: var(--surface-2);
}
.memory-space-actions .memory-space-danger:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: none;
}
.memory-space-empty,
.memory-space-status {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  pointer-events: none;
}
.memory-space-empty-card,
.memory-space-status-card {
  pointer-events: auto;
  max-width: 28em;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  /* R1 density: tightened from 22px 24px — real, small improvement, but honestly minor:
     this full-screen 3D vault view is a canvas visualization, not a list, so the actual
     "dead whitespace" here is the canvas background itself (by design, not a bug). The
     surface most people mean by "vault list" is Settings -> FlowState vault, which is
     settings.js-owned (excluded from this claim) and was returning a live backend error
     ("vault temporarily unavailable") during R1 testing, unrelated to this change. */
  padding: 18px 20px;
}
.memory-space-empty-card h2,
.memory-space-status-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.memory-space-empty-card p,
.memory-space-status-card p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--mute);
}
.memory-space-label {
  color: var(--ink);
  font: 600 11px/1.25 var(--ui);
  padding: 5px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -160%);
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-sm);
  letter-spacing: -0.01em;
}
.memory-space-label.show {
  opacity: 1;
}
.memory-space-label.hot {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 85%, var(--surface));
}
.memory-space-list-link {
  margin-top: 4px;
}
@media (max-width: 720px) {
  .memory-space-hud {
    left: 12px;
    bottom: 12px;
  }
  .memory-space-sheet {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: var(--r) var(--r) 0 0;
    max-height: 55vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .memory-space-label {
    transition: none;
  }
}

/* bk-yarnball5-mobile-header (2026-07-18): the mobile .top header (MobileTopRow, main.js)
   measured 156px tall, split into 3 stacked row-bands at 390x844. Two real causes,
   both fixed here:
   1) Stylesheet load-order collision, not a missing rule: _ds_bundle.css already
      hides the model-name/tier button at <=600px via `.model-badge-label{display:none}`
      (loads FIRST, see index.html), but this file's own unconditional
      `.model-badge-label-btn{display:inline-flex}` (same element, second class,
      EQUAL specificity, loads SECOND) wins the cascade and re-shows it — confirmed
      live: the badge-wrap measured 224px wide at 390px, containing the full
      "DeepSeek V4 Flash · Fast · Secure" button. That alone forced the icon row to
      overflow onto a 3rd line. Re-declared here, later in the same cascade position
      as the rule it needs to beat, so mobile keeps icon-only as originally intended.
   2) By design .top .sp gets flex-basis:100% at mobile (_ds_bundle.css) to force the
      brand onto its own row above the icon cluster — that alone is 2 rows, and the
      task's AC calls for ONE. With the label-btn fix above, the full icon cluster
      (lock + 4 round icon buttons) measures ~200px — comfortably under the ~362px
      available at 390px width alongside the ~95px brand mark — so collapsing back to
      a single flex row (no forced sp break, no wrap) fits with room to spare instead
      of needing a scroll/wrap fallback. */
@media (max-width: 600px) {
  .model-badge-label-btn {
    display: none;
  }
  .yarnball-app .top .sp {
    flex-basis: auto;
    height: auto;
  }
  .top {
    flex-wrap: nowrap;
  }
}

/* =============================================================================
   UNISON semantic surface roles (YARNBALL-CDS-STRICT, 2026-07-19)
   -----------------------------------------------------------------------------
   100% strict CDS: app/local files are ONLY pointers to the CDS. NO inline styles
   (not even --var handoffs), NO atomic/utility classes. Every app element carries a
   SEMANTIC role class defined here (or an existing DS component). Layout, spacing,
   geometry, and responsive behaviour live in the DS — never in app code.
   Dynamic geometry uses native semantic elements (<progress>) or CSS-only structure
   (a relative wrapper + absolutely-positioned child), never a JS-computed inline value.
   ========================================================================== */

/* Forms — inputs / textareas */
.form-field {
  width: 100%; font: inherit; box-sizing: border-box;
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 7px; padding: 8px 10px; margin-bottom: 6px;
}
.form-field.is-surface { background: var(--surface); padding: 11px 13px; margin-bottom: 11px; }
.form-textarea {
  width: 100%; font: inherit; box-sizing: border-box; color: var(--ink);
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 7px; padding: 8px 10px; margin-bottom: 8px;
  font-size: 13px; resize: vertical;
}
.field-stack { display: flex; flex-direction: column; gap: 8px; }
.field-grow { flex: 1 1 100%; min-width: 0; }
.field-grow.is-120 { flex: 1 1 auto; min-width: 120px; }
.field-grow.is-160 { flex: 1 1 auto; min-width: 160px; }

/* Rows of chips / actions / meta */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-row.is-end { align-items: center; justify-content: flex-end; gap: 10px; }
.meta-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); }

/* Inline text action (accent mono link-button) */
.inline-action {
  color: var(--accent); font-family: var(--mono); font-size: 11px;
  white-space: nowrap; background: none; border: none; padding: 0; cursor: pointer;
}
.inline-action.is-disabled { cursor: default; opacity: .5; }

/* A section separated from the one above by a hairline */
.section-divided { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

/* Settings surface */
.settings-wrap { max-width: 584px; margin-inline: auto; width: 100%; padding-bottom: 32px; }
@media (max-width: 600px) { .settings-wrap { padding-inline: 16px; } }
.settings-row-pad { padding: 10px 14px; min-width: 0; }
.settings-row-pad.is-divided { border-top: 1px solid var(--line-soft); }
.settings-narrow { max-width: 380px; }

/* Voice surface */
.voice-screen { display: flex; flex-direction: column; align-items: center; gap: 14px; position: relative; padding: 34px 0 30px; }
.voice-ring { width: 116px; height: 116px; border-radius: 50%; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.voice-error { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.voice-gear { position: absolute; top: 0; right: 0; }

/* Usage meter — native <progress>, value set by the value/max attributes (NO inline style) */
.usage-meter { width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--line-soft); appearance: none; -webkit-appearance: none; }
.usage-meter::-webkit-progress-bar { background: var(--line-soft); border-radius: 3px; }
.usage-meter::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.usage-meter::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

/* Model-badge dropdown — CSS-only positioning under its anchor (NO JS-computed left) */
.model-badge-anchor { position: relative; }
.model-badge-menu.is-anchored { position: absolute; top: 100%; left: 0; }

/* Modal shell — shared close button + its positioning context */
.mcard-anchor { position: relative; }
.modal-close-btn { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* Pricing surface */
.plan-price { font-size: 30px; margin-top: 4px; margin-bottom: 6px; }
.plan-cta { margin-top: 10px; width: 100%; }
.pricing-shell { max-width: 1040px; }
.pricing-top { padding-top: 4px; max-width: none; }
.pricing-retry-btn { margin-top: 8px; }
.pricing-grid { margin-top: 14px; }
.pricing-footnote { margin-top: 18px; }
.brand-home-link { text-decoration: none; }

/* Auth surface */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px; position: relative; overflow: hidden; }
/* Full-viewport background video + light overlay, behind the sign-in card (z-index 0/1);
   the card content (.settings-narrow inside .auth-page) is lifted to z-index 2 below.
   2026-07-20 (Ben): overlay changed from a dark/gray scrim to a soft white wash — the
   red-line video stays visible underneath a light veil instead of being dimmed dark/gray. */
.auth-video-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.auth-video-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, 0.32); z-index: 1; }
.auth-page > .settings-narrow { position: relative; z-index: 2; }
.auth-consent-row { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; margin-top: 2px; margin-bottom: 4px; }
.auth-consent-check { margin-top: 2px; }
.auth-trust-row { justify-content: center; margin-top: 14px; }
/* Card definition over the now-light video backdrop: the card's own opaque surface +
   default DS shadow already separate it from the page, but the hairline border needed a
   touch more weight to read clearly against a light background (it was tuned for a dark
   scrim before). Token-based (--line-soft -> a slightly stronger ink-mixed line), not a
   one-off hex. */
.auth-page .authc { border-color: color-mix(in srgb, var(--ink) 12%, var(--line)); }

/* Chat surface */
.memory-extras { margin: 2px 0 20px; }
.msg-icon-line { display: inline-flex; align-items: center; gap: 6px; }
.attestation-detail { margin-top: 6px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; }
.file-input-hidden { display: none; }

/* Feedback surface */
.feedback-status { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-bottom: 10px; }
.feedback-preview-box { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; margin-bottom: 10px; max-height: 150px; overflow: auto; }
.feedback-kicker { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); margin-bottom: 6px; }
.feedback-preview-line { font-size: 12px; margin-bottom: 4px; }
.feedback-console-tail { font-size: 10px; margin: 0; white-space: pre-wrap; color: var(--faint); }
.feedback-empty-note { font-size: 11px; color: var(--faint); margin: 0; }
.feedback-consent-row { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; margin-bottom: 10px; }
.feedback-consent-checkbox { margin-top: 2px; }

/* Modals surface (automations / schedule / webhooks / notifications / invites) */
.recap-results { margin-top: 12px; }
.recap-list { margin: 0; padding-left: 18px; line-height: 1.7; }
.recap-meta { margin-top: 10px; }
.select-inherit { font: inherit; }
.btn-compact { padding: 4px 10px; }
.srv-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.srv-stack.is-tight { gap: 4px; }
.field-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.webhook-url-field { font-family: var(--mono); font-size: 11px; }
.run-row-clickable { cursor: pointer; }
.field-full { width: 100%; margin-bottom: 6px; }
.automation-schedule-row { display: flex; gap: 6px; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.notif-prefs-row { display: flex; gap: 14px; }
.invite-channel-email { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--mute); margin: 4px 0 6px; }
.invite-channel-sms { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--mute); margin-bottom: 6px; }
.invite-channel-whatsapp { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--mute); margin-bottom: 10px; }
.invite-result { margin-top: 10px; font-size: 12px; }
.invite-link-text { font-family: var(--mono); word-break: break-all; }
.invite-list-wrap { margin-top: 14px; }
.invite-row-label { min-width: 0; }
.invite-status-open { color: var(--teal); }
.invite-code { font-family: var(--mono); font-size: 10px; color: var(--faint); flex: none; margin-left: 10px; }

/* Settings surface (detailed sub-views) */
.select-native { font: inherit; }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-slider { width: 100px; }
.truncate-inline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-caption { margin-bottom: 8px; font-family: var(--mono); font-size: 11px; }
.field-flush { margin-bottom: 0; }
.row-split-start { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.clamp-2-lines { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta-sub { margin-top: 2px; font-size: 11px; }
.vault-frame { display: block; width: 100%; height: min(78vh, 900px); min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.vault-actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.inline-checkbox { margin-left: 8px; }
.field-block { width: 100%; }
.disclosure-body { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.usage-meter-row { margin-top: 10px; }
.section-header-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.picker-row-btn { width: 100%; text-align: left; }
.field-row-6 { display: flex; gap: 6px; }
.field-basis-90 { flex: 0 0 90px; }
.file-pick-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.field-grow-140 { flex: 1 1 auto; min-width: 140px; }
.stack-gap-top { margin-top: 8px; }
.pairing-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.srv-stack-stretch { flex-direction: column; align-items: stretch; gap: 6px; }
.row-split { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.truncatable-flex { min-width: 0; }
.flex-static { flex: none; }
.connector-fields { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.inline-edit-row { display: flex; gap: 8px; align-items: center; }
.row-actions-tight { display: flex; gap: 10px; align-items: center; flex: none; }
.instructions-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.section-gap-18 { margin-top: 18px; }
.settings-wrap-wide { max-width: 1200px; margin-inline: auto; width: 100%; padding-bottom: 24px; padding-inline: 16px; }
@media (max-width: 600px) { .settings-wrap-wide { padding-inline: 12px; } }
.mt-4-block { margin-top: 4px; }

/* Security-path surface */
.sec-panel { padding: 12px 14px; }
.sec-verify.is-verifying { margin-right: 6px; }
.sec-err { margin-top: 8px; }
.sec-rows { margin-top: 12px; }
.sec-actions { margin-top: 12px; }

/* ============================================================================
   YumYum admin console (admin.js) — semantic role classes (YARNBALL-CDS-ADMINJS) */
.admin-create-row { display: flex; gap: 8px; align-items: center; padding: 12px 15px; flex-wrap: wrap; }
.admin-add-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.admin-ask-row { display: flex; gap: 8px; padding: 12px 15px; align-items: center; }
.admin-field-row-top { display: flex; gap: 8px; align-items: flex-start; }
.admin-comment-row { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 8px; }
.admin-modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.admin-field-w120 { width: 120px; }
.admin-field-w130 { width: 130px; }
.admin-field-w140 { width: 140px; }
.admin-field-w150 { width: 150px; }
.admin-field-w160 { width: 160px; }
.admin-field-w180 { width: 180px; }
.admin-field-w200 { width: 200px; }
.admin-field-w220 { width: 220px; }
.admin-field-w240 { width: 240px; }
.admin-field-w260 { width: 260px; }
.admin-field-w300 { width: 300px; }
.admin-field-w320 { width: 320px; }
.admin-field-w340 { width: 340px; }
.admin-field-w360 { width: 360px; }
.admin-field-flex { flex: 1; }
.admin-textarea-full { width: 100%; min-width: 320px; font: inherit; }
.admin-textarea-full-pre { width: 100%; min-width: 320px; font: inherit; white-space: pre-wrap; }
.admin-textarea-flex { flex: 1; min-width: 320px; font: inherit; }
.admin-subhead { margin-top: 18px; margin-bottom: 6px; font-weight: 600; }
.admin-note { margin: 0 0 10px; }
.admin-note-indented { margin: 2px 0 10px; }
.admin-note-loose { margin: 0 0 14px; }
.admin-note-tight { margin: 0 0 6px; }
.admin-note-flush { margin: 0; }
.admin-note-top { margin: 10px 0 0; }
.admin-note-mt10 { margin-top: 10px; }
.admin-note-mt4 { margin-top: 4px; }
.admin-note-xs { margin: 0 0 4px; }
.admin-note-inset { margin: 0 15px 8px; }
.admin-legend-note { margin: 0 0 10px; font-size: 12px; line-height: 1.5; }
.admin-panel-note { margin: 0; padding: 12px 15px; }
.admin-panel-pad-bottom { padding: 0 15px 12px; }
.admin-geo-note { font-size: 11px; margin: 6px 0 10px; }
.admin-inline-note { margin: 2px 0; }
.admin-pre-flush { margin: 0; white-space: pre-wrap; }
.admin-block-gap { margin: 4px 0 8px; }
.admin-action-spacer { margin-top: 14px; }
.admin-delete-row { margin-top: 12px; }
.admin-label-gap { margin-right: 14px; }
.admin-inline-hint { margin-left: 8px; }
.admin-links-block { margin-top: 4px; }
.admin-link-block { display: block; word-break: break-all; }
.admin-cell-sm { font-size: 11px; }
.admin-cell-wrap { white-space: pre-wrap; max-width: 420px; }
.admin-cell-pre { white-space: pre-wrap; }
.admin-feedback-shot { max-width: 360px; max-height: 240px; border: 1px solid var(--line); border-radius: 6px; }
.admin-pre-block { max-height: 200px; overflow: auto; font-size: 10px; white-space: pre-wrap; }
.admin-pre-block-lg { max-height: 240px; overflow: auto; font-size: 10px; white-space: pre-wrap; }
.admin-marketing-subnav { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 0; margin-bottom: 10px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; }
.admin-invite-preview-frame { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); margin-top: 10px; }
.admin-invite-check-label { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.admin-invite-result { margin: 0 15px 12px; font-size: 12px; }
.admin-table-scroll { overflow-x: auto; }
.admin-login-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px; }
.admin-login-box { width: 400px; }
.admin-login-footer { margin-top: 12px; font-size: 12px; text-align: center; }
.admin-login-back-link { color: var(--mute); }

.auth-legal { margin: 14px 0 0; text-align: center; font-size: 11px; letter-spacing: 0.02em; color: var(--muted, #8a8f98); }
