/* Rob Dashboard shared shell. Tokens mirror index.html so every page matches. */
:root {
  --bg: #faf9f5;
  --panel: #ffffff;
  --panel-2: #f2f0e9;
  --line: #e6e2d7;
  --text: #22303a;
  --muted: #677683;
  --teal: #52616c;
  --teal-deep: #3c4a54;
  --teal-dim: rgba(60, 74, 84, 0.10);
  --amber: #a16207;
  --red: #b5473a;
  --green: #2e7d4f;
  --radius: 14px;
}

/* ---------- Cross-page nav strip ---------- */
/* Folder tabs: a continuous 1px baseline is painted on the nav itself;
   inactive tabs carry their own baseline segment (inset shadow), and the
   active tab's opaque page-colored background covers the line so it opens
   into the content below. No negative margins, so horizontal scrolling on
   small screens keeps working. */
.rd-nav {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 14px 0; margin: 0;
  background: linear-gradient(to top, var(--line) 0, var(--line) 1px, transparent 1px);
  scrollbar-width: none;
}
.rd-nav::-webkit-scrollbar { display: none; }
.rd-nav a {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 8px 14px 9px; border-radius: 10px 10px 0 0; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-bottom: none;
  box-shadow: inset 0 -1px 0 var(--line);
  color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.rd-nav a:hover { color: var(--text); }
.rd-nav a.current {
  background: var(--bg); color: var(--teal-deep); font-weight: 700;
  box-shadow: none;
}
.rd-nav a .e { font-size: 15px; }

/* ---------- Page shell for dashboard pages ---------- */
.rd-page * { box-sizing: border-box; margin: 0; padding: 0; }
.rd-page {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh; line-height: 1.45;
}
.rd-page button { font-family: inherit; cursor: pointer; }
.rd-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(253, 252, 248, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  display: flex; align-items: center; gap: 10px;
}
.rd-header .mini-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  overflow: hidden;
}
.rd-header .mini-mark img { width: 100%; height: 100%; display: block; }
.rd-header h1 { font-size: 18px; font-weight: 700; flex: 1; }
.rd-header .rd-home { display: contents; color: inherit; text-decoration: none; }
.rd-header .sub { font-size: 12px; color: var(--muted); font-weight: 400; display: block; margin-top: -2px; }
.rd-refresh {
  background: var(--panel); border: 1px solid var(--line); color: var(--teal);
  border-radius: 12px; min-width: 48px; min-height: 44px; font-size: 18px;
}
.rd-refresh.spinning svg { animation: rd-spin 0.9s linear infinite; }
@keyframes rd-spin { to { transform: rotate(360deg); } }

.rd-main { max-width: 640px; margin: 0 auto; padding: 10px 14px calc(env(safe-area-inset-bottom) + 40px); }
.rd-meta { color: var(--muted); font-size: 12.5px; margin: 4px 2px 12px; }

.rd-skeleton { border-radius: var(--radius); background: var(--panel); height: 80px; margin-bottom: 10px; position: relative; overflow: hidden; }
.rd-skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04), transparent);
  animation: rd-shimmer 1.2s infinite;
}
@keyframes rd-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.rd-error {
  background: #fdf2f1; border: 1px solid #eccfcb; color: var(--red);
  border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin-bottom: 12px;
}

/* ---------- Verdict banner ---------- */
.rd-verdict {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  border: 1px solid var(--line); background: var(--panel);
}
.rd-verdict .vline { font-size: 17px; font-weight: 800; letter-spacing: 0.3px; }
.rd-verdict .vwhy { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.rd-verdict.green { background: #eef7f1; border-color: #cde5d6; }
.rd-verdict.green .vline { color: var(--green); }
.rd-verdict.yellow { background: #fbf6ea; border-color: #ecdfc2; }
.rd-verdict.yellow .vline { color: var(--amber); }
.rd-verdict.red { background: #fdf2f1; border-color: #eccfcb; }
.rd-verdict.red .vline { color: var(--red); }

/* ---------- Sections & cards ---------- */
.rd-group { margin-bottom: 18px; }
.rd-group h2 { font-size: 15px; font-weight: 700; margin: 0 2px 8px; }
.rd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .rd-grid { grid-template-columns: repeat(3, 1fr); } }
.rd-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 13px; min-height: 74px;
}
.rd-card .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; gap: 5px; align-items: center; }
.rd-card .v { font-size: 22px; font-weight: 800; margin-top: 2px; }
.rd-card .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.rd-card .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rd-card.wide { grid-column: 1 / -1; min-height: 0; }

/* ---------- Sparkline cards ---------- */
.rd-spark { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; }
.rd-spark .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.rd-spark .row { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.rd-spark .v { font-size: 18px; font-weight: 800; min-width: 52px; }
.rd-spark svg { flex: 1; height: 34px; }
.rd-spark svg { overflow: visible; }
.rd-spark .d { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rd-sparks { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .rd-sparks { grid-template-columns: 1fr 1fr; } }

/* ---------- Labs / list rows ---------- */
.rd-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rd-row { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; display: flex; gap: 10px; align-items: baseline; }
.rd-row:last-child { border-bottom: none; }
.rd-row .date { flex: none; width: 72px; color: var(--muted); font-size: 12px; }
.rd-row .what { flex: 1; }
.rd-row .what .sub2 { color: var(--muted); font-size: 12px; }
.rd-row .flag { flex: none; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #fbf6ea; color: var(--amber); border: 1px solid #ecdfc2; white-space: nowrap; }
.rd-empty { padding: 16px 14px; color: var(--muted); font-size: 13.5px; }

/* ---------- Placeholder / coming-soon pages ---------- */
.rd-soon {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.rd-soon .big { font-size: 52px; margin-bottom: 10px; }
.rd-soon img { width: min(260px, 64vw); height: auto; margin-bottom: 14px; }
.rd-soon h2 { color: var(--text); font-size: 24px; margin-bottom: 6px; }
.rd-soon p { max-width: 420px; margin: 0 auto; font-size: 14.5px; }
.rd-soon .badge {
  display: inline-block; margin-top: 14px; padding: 6px 16px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--line); color: var(--teal-deep);
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
}


/* ---------- Tappable metrics ---------- */
.tap { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 0.08s, box-shadow 0.12s; position: relative; }
.tap:hover { box-shadow: 0 2px 10px rgba(34, 48, 58, 0.08); }
.tap:active { transform: scale(0.985); }
.tap.chev::after { content: "›"; position: absolute; top: 9px; right: 12px; color: #c2ccd4; font-size: 15px; font-weight: 700; }

/* ---------- Detail sheet (bottom sheet on mobile, modal on desktop) ---------- */
.rd-sheet-back {
  position: fixed; inset: 0; z-index: 40; background: rgba(20, 30, 40, 0.38);
  opacity: 0; transition: opacity 0.18s;
  display: flex; align-items: flex-end; justify-content: center;
}
.rd-sheet-back.open { opacity: 1; }
.rd-sheet {
  background: var(--bg); width: 100%; max-height: 88dvh;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  transform: translateY(26px); transition: transform 0.2s;
  box-shadow: 0 -8px 40px rgba(20, 30, 40, 0.25);
}
.rd-sheet-back.open .rd-sheet { transform: none; }
.rd-sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 8px; }
.rd-sheet-head .t { flex: 1; font-size: 17px; font-weight: 800; }
.rd-sheet-head .t .s { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.rd-sheet-head .x {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.rd-sheet-body { overflow-y: auto; padding: 4px 16px calc(env(safe-area-inset-bottom) + 20px); }
@media (min-width: 700px) {
  .rd-sheet-back { align-items: center; }
  .rd-sheet { width: 580px; border-radius: 18px; max-height: 84dvh; transform: translateY(14px) scale(0.98); }
}

/* ---------- Range chips ---------- */
.rd-chips { display: flex; gap: 6px; margin: 6px 0 12px; flex-wrap: wrap; }
.rd-chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 16px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.rd-chip.active { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }

/* ---------- Big chart ---------- */
.rd-chart {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 12px 4px; user-select: none; -webkit-user-select: none;
}
.rd-chart svg { width: 100%; height: 190px; display: block; overflow: visible; }
.rd-chart .ymax, .rd-chart .ymin {
  position: absolute; left: 15px; font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, 0.75); padding: 0 4px; border-radius: 5px; pointer-events: none; z-index: 1;
}
.rd-chart .ymax { top: 11px; }
.rd-chart .ymin { bottom: 32px; }
.rd-chart .xl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); padding: 4px 2px 4px; }
.rd-guide { position: absolute; top: 12px; bottom: 26px; width: 1px; background: var(--teal-deep); opacity: 0.55; display: none; pointer-events: none; }
.rd-tip {
  position: absolute; top: 8px; transform: translateX(-50%);
  background: var(--teal-deep); color: #fff; font-size: 11.5px; line-height: 1.5;
  border-radius: 9px; padding: 6px 10px; display: none; pointer-events: none; white-space: nowrap; z-index: 2;
  box-shadow: 0 3px 12px rgba(20, 30, 40, 0.25);
}
.rd-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin: 8px 2px 0; }
.rd-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

/* ---------- Stats strip ---------- */
.rd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.rd-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; }
.rd-stat .l { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.rd-stat .n { font-size: 15.5px; font-weight: 800; margin-top: 1px; }
.rd-sheet-note { font-size: 11.5px; color: var(--muted); margin: 10px 2px 0; }
.rd-sheet-body .rd-list { margin-top: 12px; }

/* ---------- Shared domain chat (Today-style wireframe for data pages) ---------- */
#rcView { display: none; flex-direction: column; position: relative; }
/* Voice mic: styled to match the attach button so it reads as a real control. */
.rc-mic {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--teal-deep);
  font-size: 18px; cursor: pointer; padding: 0; line-height: 1;
}
.rc-mic:active { background: var(--panel-2); }
#rcLog { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 84px; }
.rc-b { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-b.user { align-self: flex-end; background: var(--teal-deep); color: #fff; border-bottom-right-radius: 5px; }
.rc-b.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.rc-b.think { color: var(--muted); font-style: italic; }
/* Snoop Rob mascot atop each chat, intro as his speech bubble. */
.rc-mascot { text-align: center; padding: 20px 0 2px; }
.rc-mascot img { width: 112px; height: 112px; }
.rc-intro {
  position: relative; color: var(--text); font-size: 14px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 16px; margin: 12px 18px 10px; line-height: 1.5;
}
.rc-intro::before {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: var(--panel-2);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
}
#rcForm {
  position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 62px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; z-index: 11;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  max-width: 640px; margin: 0 auto;
}
#rcStrip { display: none; width: 100%; gap: 8px; flex-wrap: wrap; }
#rcStrip.has { display: flex; margin-bottom: 2px; }
.rc-att { position: relative; }
.rc-att img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.rc-att-rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal-deep); color: #fff; border: 2px solid #fff; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
#rcAttach {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--teal-deep);
  font-size: 18px; cursor: pointer; padding: 0; line-height: 1;
}
#rcAttach:active { background: var(--panel-2); }
#rcView.rc-drag { outline: 2px dashed var(--teal-deep); outline-offset: -6px; }
#rcInput {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 22px; padding: 0 15px; font-size: 14.5px; outline: none;
  min-height: 46px; line-height: 44px; resize: none; font-family: inherit;
  /* Never soft-wrap: placeholder + short input stay on one line even when the bar
     is narrow (e.g. the 360px desktop chat panel); long input scrolls sideways.
     The wrap="off" attribute (set in JS) does the real work; these back it up. */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#rcInput:focus { border-color: var(--teal-deep); }
#rcSend {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--teal-deep); border: none; color: #fff; font-size: 19px; font-weight: 700; cursor: pointer;
}
#rcSend:disabled { opacity: 0.4; }
.rc-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom);
}
.rc-tabbar button {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 10px 0 12px; min-height: 60px; cursor: pointer;
}
.rc-tabbar button .ico { display: block; font-size: 20px; margin-bottom: 2px; }
.rc-tabbar button.active { color: var(--teal); }
body.has-chat .rd-main { padding-bottom: calc(env(safe-area-inset-bottom) + 150px); }
@media (min-width: 1000px) {
  .rc-tabbar { display: none; }
  body.has-chat .rd-main {
    max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 360px;
    gap: 26px; align-items: start; padding-bottom: 30px;
  }
  body.has-chat #content { min-width: 0; }
  #rcView {
    display: flex !important; position: sticky; top: 78px;
    /* Height accounts for header + nav above the card (the lesson of the
       clipped Today chat): fits at scroll zero. */
    height: calc(100dvh - 148px); min-height: 260px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; overflow: hidden;
  }
  #rcLog { overflow-y: auto; padding-bottom: 8px; }
  #rcForm { position: static; padding: 10px 0 0; background: none; border-top: 1px solid var(--line); margin-top: 8px; max-width: none; backdrop-filter: none; }
}

/* Logout button in the masthead */
.rd-logout {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 12px; min-width: 44px; min-height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.rd-logout:active { color: var(--teal-deep); background: var(--panel-2); }

/* ---------- Markdown inside chat bubbles (v29) ---------- */
.rc-b .md-h, .ab .md-h, .fcb .md-h, .bubble .md-h { display: block; font-weight: 800; margin: 3px 0 1px; }
.rc-b .md-li, .ab .md-li, .fcb .md-li, .bubble .md-li { color: var(--teal-deep); font-weight: 700; }
.rc-b.user .md-li, .ab.user .md-li, .fcb.user .md-li, .bubble.user .md-li { color: #fff; }
.rc-b code, .ab code, .fcb code, .bubble code {
  background: rgba(20, 30, 40, 0.07); border-radius: 5px; padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
}
.rc-b a, .ab a, .fcb a, .bubble a { color: var(--teal-deep); font-weight: 600; }
.md-strike { text-decoration: line-through; opacity: 0.75; }

/* ---------- Clear chat button (v29) ---------- */
.rd-clearchat {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-size: 17px; cursor: pointer; padding: 0;
}
.rd-clearchat:active { background: var(--panel-2); }
/* Clear chat now floats top-right of the chat panel, out of the send bar. */
#rcClear {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; padding: 0; line-height: 1;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-size: 15px; cursor: pointer; opacity: 0.85;
  display: flex; align-items: center; justify-content: center;
}
#rcClear:hover { opacity: 1; }
#rcClear:active { background: var(--panel-2); }

/* ---------- 🪄 Magic wand quick capture (v30) ---------- */
.rd-wand {
  flex: none; background: none; border: none; font-size: 19px; cursor: pointer;
  padding: 6px 8px; border-radius: 10px; line-height: 1;
}
.rd-wand:active { background: var(--panel-2); }
.rd-jotter {
  flex: none; background: none; border: none; font-size: 19px; cursor: pointer;
  padding: 6px 8px; border-radius: 10px; line-height: 1;
}
.rd-jotter:active { background: var(--panel-2); }
.rd-wand-text {
  width: 100%; box-sizing: border-box; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; font-family: inherit;
  outline: none; resize: vertical; min-height: 96px;
}
.rd-wand-text:focus { border-color: var(--teal-deep); }
.rd-wand-send {
  margin-top: 10px; width: 100%; background: var(--teal-deep); color: #fff; border: none;
  border-radius: 12px; padding: 12px 0; font-size: 15px; font-weight: 750; cursor: pointer;
}
.rd-wand-send:disabled { opacity: 0.6; }

/* ---------- Markdown extras: quotes + rules (v30) ---------- */
.md-q {
  display: block; border-left: 3px solid var(--teal-deep); background: var(--panel-2);
  padding: 4px 10px; margin: 2px 0; border-radius: 0 8px 8px 0;
}
.md-hr { display: block; border-top: 1px solid var(--line); margin: 8px 0; }

/* ---------- Type-on reveal caret (2026-07-24) ---------- */
/* A soft cursor that blinks at the reveal frontier while a bot reply builds on
   screen, then vanishes when the reply is complete. Works in every chat bubble
   (.rc-b, .ab, .fcb, .bubble). Hidden entirely for reduced-motion users. */
.rc-caret {
  display: inline-block; width: 2px; height: 1.05em; margin: 0 1px -2px 1px;
  background: var(--teal-deep); opacity: .8; border-radius: 1px;
  animation: rcCaretBlink 1.05s steps(1, end) infinite;
}
@keyframes rcCaretBlink { 0%, 50% { opacity: .8; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rc-caret { display: none; } }

/* ---------- 🎙️ Voice conversation (site-wide, 2026-07-23) ---------- */
/* The mic sits in the chat form next to send; tapping it opens a full-screen
   hands-free overlay with the page mascot as a living orb. */
#rcMic {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); color: var(--teal-deep);
  font-size: 18px; cursor: pointer; padding: 0; line-height: 1;
}
#rcMic:active { background: var(--panel-2); }

.rc-voice-back {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  box-sizing: border-box; background: rgba(250, 249, 245, 0.86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transition: opacity 0.2s ease;
}
.rc-voice-back.open { opacity: 1; }
.rc-voice-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 18px; max-width: 360px; width: 100%;
}
.rc-voice-orb {
  position: relative; width: 176px; height: 176px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; --vol: 0; cursor: pointer;
}
.rc-voice-orb img {
  position: relative; z-index: 2; width: 150px; height: 150px; border-radius: 50%;
  object-fit: cover; background: var(--panel); box-shadow: 0 8px 30px rgba(60, 74, 84, 0.18);
}
.rc-voice-ring {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1; border: 3px solid var(--teal-deep);
  transform: scale(calc(1 + var(--vol) * 0.16));
  transition: transform 0.08s linear, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 0 0 rgba(60, 74, 84, 0.28);
}
.rc-voice-back[data-state="listening"] .rc-voice-ring,
.rc-voice-back[data-state="hearing"] .rc-voice-ring {
  border-color: var(--green); box-shadow: 0 0 26px 4px rgba(46, 125, 79, 0.35);
}
.rc-voice-back[data-state="thinking"] .rc-voice-ring {
  border-color: var(--amber); border-top-color: transparent; animation: rcSpin 1.1s linear infinite;
}
.rc-voice-back[data-state="speaking"] .rc-voice-ring {
  border-color: var(--teal-deep); animation: rcPulse 1.2s ease-in-out infinite;
}
.rc-voice-back[data-state="paused"] .rc-voice-ring,
.rc-voice-back[data-state="tap"] .rc-voice-ring { border-color: var(--muted); border-style: dashed; }
.rc-voice-back[data-state="error"] .rc-voice-ring { border-color: var(--red); }
@keyframes rcSpin { to { transform: rotate(360deg); } }
@keyframes rcPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(60, 74, 84, 0.30); } 50% { box-shadow: 0 0 30px 8px rgba(60, 74, 84, 0.22); } }

.rc-voice-status { font-size: 20px; font-weight: 800; color: var(--text); min-height: 26px; }
.rc-voice-hint { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 300px; }
.rc-voice-end {
  margin-top: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--teal-deep);
  font-size: 15px; font-weight: 700; padding: 12px 22px; border-radius: 24px; cursor: pointer;
}
.rc-voice-end:active { background: var(--panel-2); }

/* ---------- Grouped sidebar nav (v40) ----------
   Desktop: a persistent left sidebar with focus-area groups; content shifts
   right via body.rd-has-side padding. Mobile: the sidebar becomes a slide-in
   drawer behind a ☰ button, and the old .rd-nav folder tabs are retired. */
.rd-side {
  position: fixed; top: 0; left: 0; bottom: 0; width: 236px; z-index: 60;
  background: var(--panel); border-right: 1px solid var(--line);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top) + 12px) 10px 24px;
  display: flex; flex-direction: column;
}
.rd-side-brand {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  color: var(--text); padding: 4px 8px 14px;
}
.rd-side-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.rd-side-mark img { width: 100%; height: 100%; display: block; }
.rd-side-name { font-weight: 800; font-size: 16px; letter-spacing: -0.2px; }
.rd-side-nav { display: flex; flex-direction: column; }
.rd-navgroup { display: flex; flex-direction: column; gap: 2px; }
/* Section headers are banded with a hairline above AND below, so they read as
   section labels rather than tappable rows; distinct brand-teal, uppercased. */
.rd-navgroup-h {
  font-size: 10.5px; font-weight: 700; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 7px 10px; margin: 9px 0 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rd-navgroup:first-child .rd-navgroup-h { margin-top: 4px; }
.rd-side-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 8px 10px; border-radius: 10px; color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 1.2;
}
.rd-side-link .e { font-size: 16px; width: 20px; text-align: center; flex: none; }
.rd-side-link:hover { background: var(--panel-2); }
.rd-side-link.current { background: var(--teal-dim); color: var(--teal-deep); font-weight: 800; }
.rd-side-scrim { display: none; }
.rd-topbar-title { display: none; }
.rd-menu-btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--teal);
  border-radius: 12px; min-width: 44px; min-height: 44px; font-size: 20px; flex: none;
}

@media (min-width: 1000px) {
  body.rd-has-side { padding-left: 236px; }
  .rd-nav { display: none; }
  .rd-menu-btn { display: none; }
  /* Sidebar owns the brand on desktop, so drop the header logo + wordmark and
     promote the section sub-line to the page title. Mobile keeps its brand. */
  body.rd-has-side .rd-topbar .mini-mark,
  body.rd-has-side .rd-topbar .rd-brandword { display: none; }
  body.rd-has-side .rd-topbar h1 .sub {
    display: inline-block; font-size: 18px; font-weight: 700;
    color: var(--text); letter-spacing: -0.2px; margin-top: 0;
  }
}
@media (max-width: 999px) {
  .rd-nav { display: none; }
  /* Mobile top bar: the drawer (opened by ☰) owns the brand, so drop the header
     logo + wordmark + dated sub-line and show a single clean section title.
     Keeps the bar to [☰] · section · actions with no wrapping. */
  .rd-topbar .mini-mark,
  .rd-topbar .rd-brandword,
  .rd-topbar h1 .sub { display: none; }
  .rd-topbar h1 .rd-topbar-title {
    display: block; font-size: 16.5px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: -0.2px;
  }
  .rd-side {
    width: 272px; transform: translateX(-100%);
    transition: transform 0.24s ease; box-shadow: 0 0 44px rgba(20, 25, 30, 0.20);
  }
  .rd-side.open { transform: none; }
  .rd-side-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(20, 25, 30, 0.38); opacity: 0; pointer-events: none;
    transition: opacity 0.24s ease;
  }
  .rd-side-scrim.open { opacity: 1; pointer-events: auto; }
}
