/* Yumi 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: .yumi-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. */
.yumi-main-populated {
  justify-content: flex-start;
}
/* bk-yumi5-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 .yumi-main-compact inherited the frozen
   .yumi-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 .yumi-main as a sibling, so
   nothing inside .yumi-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 .yumi-shell's column —
   sits right below it. (An earlier attempt at flex:0 1 auto was reverted per the
   comment on .yumi-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.) */
.yumi-main-compact {
  flex: 0 1 auto;
  justify-content: flex-start;
}

/* YUMI-B-012: serif body for AI-served content (Ben's dense/serif/no-symbols standing
   rule) — this must apply to every Yumi 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 === 'yumi' — see
   public/_cds/1.0.2/_ds_bundle.js ChatRow()). Does not touch .row.me (the user's own text). */
.row.yumi .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; }
}

/* YUMI-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)));
  }
}

/* YUMI-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 YUMI-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 (YUMI-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;
  /* YUMI-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;
  /* YUMI-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;
}

/* YUMI-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; }

/* YUMI-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-yumi5-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;
  }
  .yumi-app .top .sp {
    flex-basis: auto;
    height: auto;
  }
  .top {
    flex-wrap: nowrap;
  }
}
