:root {
  --bg: #E8F5EF;
  --bg-soft: #DCEEE4;
  --surface: #FFFFFF;
  --ink: #39404F;
  --ink-2: #5C6573;
  --ink-3: #9AA2B0;
  --line: #E3E8EF;
  --accent: #478D5D;
  --accent-soft: #E3F0E9;
  --user-bubble: #478D5D;
  --shadow-sm: 0 1px 2px rgba(57, 64, 79, 0.04);
  --shadow-md: 0 6px 24px rgba(57, 64, 79, 0.08);
  --radius: 16px;
  --serif: "Source Serif 4", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: linear-gradient(135deg, #E8F5EF 0%, #DEF0E7 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
textarea { font-family: inherit; }

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(232, 245, 239, 0.88);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6FB587);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1);
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.new-chat {
  font-size: 13px;
  color: var(--ink-2);
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all .15s ease;
}
.new-chat:hover { background: var(--surface); color: var(--ink); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.topbar-btn:hover { background: var(--surface); color: var(--ink); }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}
.link-btn:hover { opacity: 0.8; }

.restore-banner {
  max-width: 760px;
  margin: 8px auto 0;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
}

/* ===== Chat shell ===== */
.chat-shell {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 56px 8px 32px;
}
.hero.collapsed { display: none; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.hero .accent { color: var(--accent); font-style: italic; }
.hero-sub {
  color: var(--ink-2);
  font-size: 15px;
  margin: 0;
}

/* ===== Messages ===== */
.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 12px 0 32px;
}
.msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }
.bubble {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 15.5px;
  line-height: 1.65;
  word-wrap: break-word;
}
.msg.user .bubble {
  background: var(--user-bubble);
  color: #fff;
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}
.msg.assistant .bubble {
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}
.msg.assistant .bubble.thinking {
  color: var(--ink-3);
  font-style: italic;
}
.msg.assistant .bubble .cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--accent);
  vertical-align: -3px;
  margin-left: 2px;
  animation: blink 0.9s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== Composer ===== */
.composer-wrap {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, rgba(232, 245, 239, 0));
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  z-index: 5;
}
.composer {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px 10px 10px 18px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  box-shadow: var(--shadow-md);
  transition: border-color .15s ease;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
  max-height: 200px;
  padding: 8px 0;
  color: var(--ink);
}
.composer textarea::placeholder { color: var(--ink-3); }

.composer-actions { display: flex; gap: 6px; align-items: center; }
.mic-btn, .send-btn {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all .15s ease;
}
.mic-btn { color: var(--ink-2); }
.mic-btn:hover { background: var(--bg-soft); color: var(--ink); }
.mic-btn.recording {
  color: #fff;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ===== Push-to-talk mode ===== */
.ptt-btn {
  display: none;
  flex: 1;
  height: 44px;
  border-radius: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background .12s ease, transform .08s ease;
}
.composer.ptt-mode textarea { display: none; }
.composer.ptt-mode .ptt-btn { display: inline-flex; }
.composer.ptt-mode #uploadBtn,
.composer.ptt-mode #sendBtn { display: none; }
.composer.ptt-mode { align-items: center; }
.ptt-btn.pressing {
  background: var(--accent);
  color: #fff;
  transform: scale(0.985);
}
.ptt-btn .ptt-label::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 1px;
}
.ptt-btn.pressing .ptt-label::before {
  background: #fff;
  animation: pulseDot 1s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}

/* mic-btn icon swap: show keyboard when in PTT mode */
.mic-btn .icon-keyboard { display: none; }
.composer.ptt-mode .mic-btn .icon-mic { display: none; }
.composer.ptt-mode .mic-btn .icon-keyboard { display: block; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(71, 141, 93, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(71, 141, 93, 0); }
}
.send-btn {
  background: var(--accent);
  color: #fff;
}
.send-btn:disabled {
  background: var(--line);
  color: var(--ink-3);
  cursor: not-allowed;
}
.send-btn:not(:disabled):hover { background: #3A7A4D; }

/* ===== Chips ===== */
.chips {
  max-width: 760px;
  margin: 12px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chips.hidden { display: none; }
.chip {
  font-size: 13px;
  color: var(--ink-2);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: all .15s ease;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer-note {
  max-width: 760px;
  margin: 10px auto 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ===== Reasoning steps (Stage 2) ===== */
.reasoning {
  font-family: var(--sans);
  font-size: 13.5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 14px;
  color: var(--ink-2);
}
.reasoning-head {
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.reasoning-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
  line-height: 1.5;
  animation: stepIn .25s ease-out;
}
.reasoning-arrow {
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: none; }
}

/* ===== Inline chips (assistant suggested next steps) ===== */
.inline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.inline-chip {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent-soft);
  padding: 7px 14px;
  border-radius: 999px;
  transition: all .15s ease;
  white-space: nowrap;
}
.inline-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.prose.error { color: #b94a3a; font-style: italic; }

/* ===== Markdown elements inside .prose ===== */
.prose p { margin: 0 0 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 16px 0 8px;
  line-height: 1.3;
  color: var(--ink);
}
.prose h1 { font-size: 22px; }
.prose h2 { font-size: 19px; }
.prose h3 { font-size: 17px; }
.prose h4, .prose h5, .prose h6 { font-size: 15.5px; }
.prose ul, .prose ol { margin: 6px 0 12px; padding-left: 22px; }
.prose li { margin: 2px 0; line-height: 1.55; }
.prose li > p { margin: 0 0 4px; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.prose a:hover { text-decoration-thickness: 2px; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}
.prose blockquote {
  margin: 10px 0 14px;
  padding: 4px 14px;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-2);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* ===== Risk6 cards (Stage 3 structured report) ===== */
.risk6-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
  font-family: var(--sans);
}
.risk-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-3);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: stepIn .28s ease-out;
}
.risk-card.risk-low      { border-left-color: #4f9d7a; }
.risk-card.risk-moderate { border-left-color: #d9a13a; }
.risk-card.risk-high     { border-left-color: #c54a3a; }
.risk-card.risk-unknown  { border-left-color: var(--ink-3); opacity: .82; }
.risk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.risk-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.risk-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
}
.risk-card.risk-low      .risk-badge { background: #e3f2ea; color: #2f6e51; }
.risk-card.risk-moderate .risk-badge { background: #faecc8; color: #8a6516; }
.risk-card.risk-high     .risk-badge { background: #f7d9d2; color: #8b2e22; }
.risk-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.risk-score {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
  flex-shrink: 0;
  min-width: 56px;
}
.risk-unit {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 2px;
}
.risk-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.risk-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--ink-3);
  border-radius: 999px;
  transition: width .45s ease-out;
}
.risk-card.risk-low      .risk-bar-fill { background: #4f9d7a; }
.risk-card.risk-moderate .risk-bar-fill { background: #d9a13a; }
.risk-card.risk-high     .risk-bar-fill { background: #c54a3a; }
.risk-note {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.risk-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.risk-source-chip {
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .risk6-grid { grid-template-columns: 1fr; }
}

/* ===== Action cards (Stage 4) ===== */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 4px;
  font-family: var(--sans);
}
.actions-head {
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  animation: stepIn .28s ease-out;
}
.action-card.action-book      { border-left-color: #c54a3a; }
.action-card.action-calendar  { border-left-color: #d9a13a; }
.action-card.action-search    { border-left-color: #4f9d7a; }
.action-card.action-subscribe { border-left-color: #6a82c9; }
.action-card.action-info      { border-left-color: var(--ink-3); }
.action-left {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-emoji {
  font-size: 22px;
  line-height: 1;
}
.action-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.action-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action-value {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
}
.action-btn {
  flex-shrink: 0;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  transition: background .15s ease, transform .08s ease;
}
.action-btn:hover { background: var(--accent); }
.action-btn:active { transform: scale(0.96); }

@media (max-width: 640px) {
  .action-card { padding: 10px; gap: 10px; }
  .action-emoji { font-size: 20px; }
  .action-title { font-size: 13px; }
  .action-value { font-size: 12px; }
  .action-btn { padding: 6px 11px; font-size: 12px; }
}

/* ===== File upload pill ===== */
.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink);
  max-width: 100%;
}
.file-pill .file-icon { font-size: 16px; }
.file-pill .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.file-status {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
}
.file-status.error { color: #b94a3a; }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .brand-name { font-size: 16px; }
  .chat-shell { padding: 0 16px; }
  .hero { padding: 36px 4px 20px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 14px; }
  .msg.assistant .bubble { font-size: 16px; }
  .bubble { font-size: 15px; max-width: 92%; }
  .composer-wrap { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .composer { border-radius: 22px; padding: 8px 8px 8px 14px; }
  .composer textarea { font-size: 16px; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 2px 4px;
    margin-top: 10px;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .footer-note { font-size: 11px; padding: 0 8px; }
}

/* ===== Left sidebar (Claude-style navigation) ===== */
:root { --sidebar-w: 264px; }

.nav-no-anim, .nav-no-anim * { transition: none !important; }
body { transition: padding-left .24s cubic-bezier(.4, 0, .2, 1); }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #F1F9F4;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 12px 14px;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform .24s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}
body.nav-open .sidebar { transform: translateX(0); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 60, 50, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 150;
}
body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 2px 0 4px;
  margin-bottom: 4px;
}
.sb-collapse, .nav-toggle {
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}
.sb-collapse:hover, .nav-toggle:hover { background: var(--accent-soft); color: var(--ink); }

.sidebar-newchat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .08s ease;
}
.sidebar-newchat:hover { background: #3A7A4D; }
.sidebar-newchat:active { transform: scale(.985); }
.sidebar-newchat svg { flex-shrink: 0; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sb-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 12px 4px;
}
.sb-recent { display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  text-align: left;
  width: 100%;
  background: none;
  transition: background .15s ease, color .15s ease;
}
.sb-link:hover { background: var(--accent-soft); color: var(--ink); }
.sb-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-link svg { flex-shrink: 0; opacity: .85; }

.sb-spacer { flex: 1; min-height: 12px; }

.sb-account {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-auth-actions { display: flex; flex-direction: column; gap: 8px; }
.sb-signin {
  display: block;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.sb-signin:hover { background: #3A7A4D; }
.sb-create {
  display: block;
  text-align: center;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
}
.sb-create:hover { background: var(--surface); color: var(--ink); }

.sb-user { display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; }
.sb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6FB587);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.sb-user-meta { min-width: 0; flex: 1; }
.sb-user-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-logout {
  width: 100%;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}
.sb-logout:hover { background: var(--surface); color: var(--ink); }

.topbar-left { display: flex; align-items: center; gap: 8px; }

/* Desktop: sidebar pushes content instead of overlaying */
@media (min-width: 900px) {
  .topbar { transition: left .24s cubic-bezier(.4, 0, .2, 1); }
  body.nav-open { padding-left: var(--sidebar-w); }
  body.nav-open .topbar { left: var(--sidebar-w); }
  body.nav-open .sidebar-backdrop { opacity: 0; pointer-events: none; }
  body.nav-open .topbar .brand { display: none; }
}

@media (max-width: 899px) {
  .sidebar { box-shadow: var(--shadow-md); }
}
