/* Spiriq Notes — redesign (handoff 2, option 1b). Tokens + Manrope (as in rapidoc), flat accent, pills, no gradients.
   Recording is the only red (#ff4d5e); accent #7c6cff; success #3ddc84. */

:root {
  --bg: #0e0f13;
  --card: #16181f;       /* neutral-100 */
  --card-2: #1b1e27;     /* neutral-200 */
  --border: #262a35;     /* neutral-300 / divider */
  --n400: #3a4050; --n500: #6b7183; --n600: #8b91a1; --n700: #aab0bf; --n800: #ced3de;
  --text: #e8eaf0;
  --muted: #8b91a1;
  --accent: #7c6cff;
  --accent-2: #9d8cff;   /* accent-700 */
  --accent-100: rgba(124,108,255,.10); --accent-200: rgba(124,108,255,.18); --accent-300: rgba(124,108,255,.45);
  --accent-600: #8d7fff; --accent-800: #b3a6ff;
  --rec: #ff4d5e; --rec-soft: #ff8a95;
  --ok: #3ddc84;
  --ok-100: rgba(61,220,132,.07); --ok-200: rgba(61,220,132,.16); --ok-400: rgba(61,220,132,.5); --ok-800: #8ceeb6;
  --warn: #ffb347;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow-md: 0 3px 10px rgba(0,0,0,.5); --shadow-lg: 0 12px 32px rgba(0,0,0,.6);
  --radius: 12px; --radius-lg: 16px;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  --font-heading: var(--font-body);
  --topbar-h: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font-body); }
button, input, select { font-family: inherit; }
a { color: var(--accent-2); }
a:hover { color: var(--accent-800); }
[hidden] { display: none !important; }

/* ---------- icons in buttons ---------- */
button svg, .export-btn svg, .seg-btn svg, .tab-btn svg { flex: none; }
.ghost-btn svg, .primary-btn svg, .export-btn svg, .seg-btn svg { margin-right: 7px; vertical-align: -2px; }
.icon-btn svg { margin: 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h); padding: 0 20px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-family: var(--font-heading); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.crumb { font-size: 13px; color: var(--muted); margin-left: -4px; }
.mode-seg { margin-left: 18px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.nt-logo { --s: 30px; position: relative; display: inline-block; width: var(--s); height: var(--s);
  border-radius: calc(var(--s) * .33); background: var(--accent); overflow: hidden; flex: none; }
.nt-logo svg { position: absolute; top: 50%; transform: translateY(-50%); width: calc(var(--s) * .7); height: calc(var(--s) * .7); }
.nt-logo svg:first-child { left: calc(var(--s) * -.275); }
.nt-logo svg:last-child { left: calc(var(--s) * .583); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 999px; background: var(--card-2); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.status-pill .cost { color: var(--n700); cursor: help; }
.status-pill .cost::before { content: '·'; margin-right: 8px; color: var(--n500); }
.status { color: inherit; }
.status-pill:has(.status.rec) { background: rgba(255,77,94,.12); color: var(--rec-soft); }
.status-pill:has(.status.rec) .status::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); margin-right: 7px; vertical-align: 0; animation: pulse 1.3s ease-in-out infinite; }
.status-pill:has(.status.ok) { background: var(--ok-200); color: var(--ok); }
.status-pill:has(.status.busy) { background: var(--accent-200); color: var(--accent-2); }
.status-pill:has(.status.warn) { background: rgba(255,179,71,.14); color: var(--warn); cursor: pointer; }

.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  color: var(--n700); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.menu-btn { display: none; }

/* ---------- buttons ---------- */
.primary-btn, .rec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: 999px; padding: 11px 22px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.primary-btn:hover, .rec-btn:hover { background: var(--accent-600); }
.primary-btn:active, .rec-btn:active { transform: scale(.98); }
.primary-btn.small { padding: 9px 18px; font-size: 13.5px; }
.primary-btn.wide { width: 100%; }
.primary-btn:disabled, .rec-btn:disabled { opacity: .5; cursor: default; }
.rec-btn.recording { background: var(--rec); }
.rec-btn.recording:hover { background: #d63646; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.recording .rec-dot { animation: pulse 1.2s ease-in-out infinite; }
.rec-btn .timer { display: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-btn .timer.live { display: inline; }
.rec-btn .timer.live::before { content: '·'; margin-right: 9px; opacity: .7; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.ghost-btn {
  display: inline-flex; align-items: center; background: none; border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 15px; color: var(--n700); font-size: 13px; font-weight: 600; cursor: pointer;
}
.ghost-btn:hover:not(:disabled) { color: var(--text); background: var(--card-2); }
.ghost-btn.accent { color: var(--accent-2); border-color: var(--accent-300); }
.ghost-btn.accent:hover:not(:disabled) { background: var(--accent-100); color: var(--accent-2); }
.ghost-btn:disabled { opacity: .4; cursor: default; }
.ghost-btn.danger { margin-left: auto; }
.ghost-btn.danger:hover:not(:disabled) { color: var(--rec); border-color: rgba(255,77,94,.5); background: rgba(255,77,94,.08); }
.ghost-btn.left { margin-right: auto; }
.ghost-btn.tiny { padding: 6px 10px; }
.ghost-btn.tiny-wide { padding: 6px 12px; font-size: 12.5px; }
.ghost-btn.pulse { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(124,108,255,0); } 50% { box-shadow: 0 0 0 6px rgba(124,108,255,.25); } }

/* segmented control + tabs */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg-btn { display: inline-flex; align-items: center; background: none; border: none; color: var(--muted); padding: 6px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--card-2); color: var(--text); }
#trView .seg-btn { padding: 5px 14px; font-size: 12px; }
.tabs { display: inline-flex; gap: 2px; }
.tab-btn { background: none; border: none; border-radius: 999px; color: var(--muted); padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--card-2); color: var(--text); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--n700); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .sw { position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 999px; background: var(--n400); transition: background .15s; flex: none; }
.switch .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .15s; }
.switch input:checked + .sw { background: var(--ok); }
.switch input:checked + .sw::after { left: 16px; }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }

/* inputs (pills) */
input[type="text"], input[type="search"], input[type="url"], input[type="email"], input[type="password"], select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 15px; font-size: 13.5px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: var(--n500); }
select { padding-right: 30px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b91a1' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.layout.admin-mode { grid-template-columns: minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow: hidden; }
.side-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-head { padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 0 13px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; background: none; border: none; padding: 8px 0; font-size: 13px; color: var(--text); }
.search-box input:focus { outline: none; }
.folder-tools { display: flex; padding: 0 12px 6px; }
.folder-tools .ghost-btn { font-size: 12px; padding: 4px 11px; color: var(--muted); border-style: dashed; }
.folder { background: var(--card-2); border: 1px solid transparent; color: var(--muted); border-radius: 999px; padding: 3px 11px; font-size: 12px; cursor: pointer; }
.folder:hover { color: var(--text); }
.folder.active { color: #fff; background: var(--accent-200); }

.meeting-list { flex: 1; overflow-y: auto; padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.mi-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--n500); padding: 12px 8px 6px; }
.mi-group:first-child { padding-top: 2px; }
.meeting-item {
  text-align: left; background: none; border: 1px solid transparent; border-radius: var(--radius);
  padding: 9px 12px; color: var(--text); cursor: pointer; font-size: 13.5px; display: flex; flex-direction: column; gap: 2px;
}
.meeting-item:hover { background: var(--card-2); }
.meeting-item.active { background: var(--card); border-color: var(--border); box-shadow: var(--shadow-sm); }
.mi-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-meta { color: var(--muted); font-size: 11.5px; }
.mi-prev { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-total { margin: 0; padding: 10px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.history-empty { color: var(--muted); font-size: 13px; padding: 8px; }

main { min-width: 0; padding: 22px 26px 40px; }
#meetingView, #practiceView { display: flex; flex-direction: column; gap: 16px; }
#practiceView { max-width: 860px; }

/* ---------- meeting head ---------- */
.meeting-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.mh-left { min-width: 0; flex: 1; }
.mh-right { display: flex; align-items: center; gap: 14px; padding-top: 4px; }
.title-input { background: none; border: none; color: var(--text); font-family: var(--font-heading); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; padding: 0; width: 100%; outline: none; }
.title-input::placeholder { color: var(--n500); }
.meeting-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.meta-field { display: inline-flex; align-items: center; gap: 6px; color: var(--n600); border: 1px solid var(--border); border-radius: 999px; padding: 0 4px 0 11px; }
.meta-field:focus-within { border-color: var(--accent); }
.meta-field input, .meta-field select { background: none; border: none; border-radius: 999px; padding: 4px 8px 4px 2px; font-size: 12.5px; color: var(--text); max-width: 160px; }
.meta-field select { padding-right: 26px; background-position: right 8px center; min-width: 120px; }
.meta-field input:focus, .meta-field select:focus { outline: none; }
.bot-row { flex-basis: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bot-row input { flex: 1; min-width: 220px; }
.bot-status { font-size: 12.5px; color: var(--accent-2); }
.bot-status.rec { color: var(--rec); }
.bot-status.ok { color: var(--ok); }
.bot-status.err { color: var(--rec); }

/* ---------- work grid ---------- */
.work-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.right-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.pane { padding: 0; overflow: hidden; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); min-height: 50px; }
.pane-head h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pane-actions { display: flex; align-items: center; gap: 10px; }
.chunk-status { font-size: 12px; color: var(--accent-2); }
.card-head { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-body { padding: 16px 18px; }

.transcript, .summary { padding: 14px 18px 18px; min-height: 90px; max-height: min(60vh, 640px); overflow-y: auto; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; }
.transcript .utt { display: flex; gap: 10px; margin-bottom: 12px; }
.transcript .utt::before { content: ''; flex: none; width: 3px; border-radius: 2px; background: var(--border); }
.transcript .utt.me::before { background: var(--ok-400); }
.transcript .utt > .utt-body { flex: 1; min-width: 0; }
.transcript .ts { display: block; margin: 0 0 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.transcript .ts.me { color: var(--ok); }
.transcript .ts.others { color: var(--muted); }
.transcript .play { color: var(--muted); text-decoration: none; font-size: 11px; margin-left: 4px; }
.transcript .play:hover { color: var(--accent-2); }
.transcript .cap-name { font-weight: 700; color: var(--accent-2); margin-right: 6px; }
.transcript .cap-line { display: block; margin: 4px 0; }
.transcript .cap-line .cap-t { color: var(--muted); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.participants { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0; }
.participants .chip { cursor: default; background: var(--card-2); color: var(--n700); border: none; }
.participants .chip b { color: var(--text); font-weight: 600; }
.participants .chip.me { background: var(--ok-200); color: var(--ok-800); }

.summary h1, .summary h2, .summary h3 { font-size: 14px; margin: 14px 0 4px; font-weight: 700; }
.summary ul { margin: 0 0 10px; padding-left: 20px; }
.summary li { margin: 3px 0; }
.summary p { margin: 6px 0; }
.summary strong { color: #fff; }
.placeholder { color: var(--muted); font-size: 13.5px; margin: 0; }

.lang-tips { border-top: 1px dashed var(--border); background: var(--ok-100); padding: 12px 18px 14px; }
.lang-tips-head { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); margin-bottom: 6px; }
.lang-tips-head .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.lang-tips ul { margin: 0; padding-left: 20px; }
.lang-tips li { margin: 3px 0; font-size: 13px; line-height: 1.55; }

.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 10px 14px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.export-btn:hover:not(:disabled) { border-color: var(--accent-300); }
.export-btn:disabled { opacity: .4; cursor: default; }

/* coach */
.coach { max-height: min(60vh, 640px); }
.coach h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-block; background: var(--card-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: 12px; color: var(--text); }
.chip.small { font-size: 11.5px; color: var(--muted); }
.focus { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-100); border-radius: 6px; }
.coach li { margin: 6px 0; }
.coach .said { color: var(--muted); }
.coach .try { color: var(--ok); font-weight: 600; }
.coach .why { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.coach-note { color: var(--warn); font-size: 12.5px; }
.coach-meta { color: var(--muted); font-size: 11.5px; margin-top: 14px; }
.fillers { line-height: 2; }
.coach-who { padding: 5px 28px 5px 12px; font-size: 12.5px; max-width: 180px; background-position: right 10px center; }
.score { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; margin-right: 10px; }
.score-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.turn-q { color: var(--muted); font-size: 12.5px; }

/* ---------- practice ---------- */
.practice-setup { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.pr-title { margin: 0; font-family: var(--font-heading); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.pr-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 6px 0 4px; }
.pr-form label { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.pr-form select { font-size: 13px; padding: 7px 28px 7px 13px; min-width: 130px; }
.pr-form .switch { flex-direction: row; align-items: center; padding-bottom: 8px; }
.practice-setup .primary-btn { align-self: flex-start; }
.pr-setting { margin: 0; padding: 10px 18px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--border); }
.pr-chat { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.bubble { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.bubble.partner { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.you { align-self: flex-end; background: var(--accent-200); border: 1px solid var(--accent-300); border-bottom-right-radius: 4px; }
.bubble.pending { opacity: .6; font-style: italic; }
.bubble .hint-line { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.bubble .speak { float: right; margin-left: 8px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.bubble .speak:hover { color: var(--text); }
.pr-answer { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pr-answer input { flex: 1; min-width: 200px; }
.pr-answer .timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.pr-answer .timer.live { color: var(--text); }

/* ---------- admin page ---------- */
.admin-page { max-width: 760px; margin: 0 auto; }
.admin-page form { display: flex; flex-direction: column; gap: 16px; }
.admin-page #admPaneSettings { display: flex; flex-direction: column; gap: 16px; }
.admin-page label { display: block; margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.admin-page label:first-child, .admin-page p.hint + label { margin-top: 8px; }
.admin-page .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.admin-page p.hint { margin: 0 0 4px; }
.admin-page label > input, .admin-page label > select, .admin-page .key-row input { display: block; width: 100%; margin-top: 6px; }
.admin-page label > select { width: auto; min-width: 260px; }
.admin-page code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--n700); }
.key-row { display: flex; gap: 6px; align-items: center; }
.key-row input { flex: 1; }
.key-row .ghost-btn.tiny { margin-top: 6px; }
.key-state { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.key-state.ok { color: var(--ok); }
.key-state.missing { color: var(--rec); }
.adm-msg { font-size: 13px; color: var(--muted); margin: 8px 0 0; min-height: 1.2em; white-space: pre-line; }
.adm-msg.ok { color: var(--ok); }
.adm-msg.err { color: var(--rec); }
.chat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.chat-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 6px; align-items: center; }
.chat-row input { margin-top: 0; }
label.check { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
label.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); display: inline-block; }
label.check .hint { flex-basis: 100%; margin-left: 24px; }

/* users (admin → Users) */
.users-list { margin-top: 12px; font-size: 13.5px; }
.u-person { padding: 12px 0; border-top: 1px solid var(--border); }
.u-person:first-child { border-top: none; padding-top: 4px; }
.u-row { display: flex; align-items: center; gap: 10px; }
.u-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-200); color: var(--accent-2); font-weight: 700; font-size: 12px; flex: none; }
.u-avatar.invited { background: var(--card-2); color: var(--n600); }
.u-name { flex: 1; min-width: 0; }
.u-name b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-email { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-when { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.u-role { font-size: 11px; font-weight: 600; padding: 3px 11px; border-radius: 999px; background: var(--card-2); color: var(--n700); white-space: nowrap; }
.u-role.admin { background: var(--accent-200); color: var(--accent-2); }
.u-toggle { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--n700); cursor: pointer; white-space: nowrap; }
.u-toggle:hover { color: var(--text); background: var(--card-2); }
.u-aliases { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0 42px; }
.u-aliases .chip.small { display: inline-flex; align-items: center; gap: 4px; }
.u-unlink { border: none; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.u-unlink:hover { color: var(--rec); }
.users-list .u-link-input { flex: 1; min-width: 180px; max-width: 320px; font-size: 12px; padding: 5px 12px; border-style: dashed; background: none; }
.users-list .u-link-input:focus { border-style: solid; }

/* ---------- dialogs ---------- */
.dlg { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; width: min(480px, 92vw); max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.dlg h2 { margin: 0 0 12px; font-family: var(--font-heading); font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.dlg-sub { margin: 18px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; }
.dlg label { display: block; margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.dlg .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.dlg p.hint { margin: 0 0 4px; }
.dlg input, .dlg select { display: block; width: 100%; margin-top: 5px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dlg-actions .rec-btn.small, .dlg-actions .primary-btn { padding: 9px 20px; font-size: 13.5px; }
.dlg.narrow { width: min(380px, 92vw); }
.space-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.space-btn { text-align: left; background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.space-btn:hover { border-color: var(--accent); }
.ext-hint { margin: 14px 0 0 !important; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.err { color: var(--rec); font-size: 13px; margin: 8px 0 0; min-height: 1em; }

/* sign-in */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 14px 0 4px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: #1f1f1f; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.google-btn:hover { background: #f1f1f1; }
.passkey-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 10px 0 4px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card-2); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.passkey-btn:hover { border-color: var(--accent-300); }
.passkey-btn .pk-icon { color: var(--accent-2); }
.invite-hint { text-align: center; margin: 8px 0 0 !important; }
.or-hint { text-align: center; margin: 12px 0 0 !important; }
.pk-list { margin-top: 8px; font-size: 13px; }
.pk-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.pk-row:first-child { border-top: none; }
.pk-row .pk-icon { color: var(--muted); flex: none; }
.pk-row .pk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-row .pk-meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pk-row .pk-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.pk-row .pk-del:hover { color: var(--rec); }
#pkAddBtn { display: inline-flex; align-items: center; gap: 8px; }
#pkAddBtn .pk-icon { width: 16px; height: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .work-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: min(320px, 88vw); z-index: 20; background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  main { padding: 16px 14px 40px; }
  .status-pill .cost { display: none; }
}
@media (max-width: 560px) {
  .mh-right { width: 100%; justify-content: space-between; }
  .export-grid { grid-template-columns: 1fr 1fr; }
}

/* post-login nudge */
.nudge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--accent-300); border-radius: var(--radius); background: var(--accent-100); font-size: 13.5px; }
.nudge .pk-icon { color: var(--accent-2); flex: none; }
.nudge-text { flex: 1; min-width: 220px; }
.nudge .hint { color: var(--muted); font-size: 12.5px; }

/* avatar + menu */
.avatar-wrap { position: relative; margin-left: 4px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--accent-200); color: var(--accent-2); font-weight: 700; font-size: 12.5px; cursor: pointer; overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar:hover { border-color: var(--accent-300); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu-head b { font-weight: 600; font-size: 13.5px; }
.menu-head .hint { font-size: 12px; color: var(--muted); word-break: break-all; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 13.5px; cursor: pointer; }
.menu-item:hover { background: var(--card-2); }
.nudge-check { font-size: 12.5px; color: var(--muted); font-weight: 400; margin: 0; align-items: center; }
.nudge-check input { margin: 0; }
.dlg-tabs { margin: 0 0 14px; padding: 4px; background: var(--bg); border-radius: 999px; display: inline-flex; }
.dlg-tabs .tab-btn { padding: 6px 16px; font-size: 13px; }

/* services (admin) */
.svc-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.svc-row:first-of-type { border-top: none; }
.svc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.svc-text b { font-weight: 700; }
.switch input:disabled + .sw { opacity: .5; cursor: default; }
.meta-cost { font-variant-numeric: tabular-nums; color: var(--n500); font-size: 12px; cursor: help; }

/* folder groups in the sidebar */
.fg-head { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: none; border-radius: 8px; padding: 7px 8px; margin-top: 6px; color: var(--n700); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: left; }
.fg-head:hover { background: var(--card-2); color: var(--text); }
.fg-head .fg-caret { width: 14px; height: 14px; flex: none; transition: transform .15s; color: var(--n500); }
.fg-head.collapsed .fg-caret { transform: rotate(-90deg); }
.fg-head .fg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-head .fg-count { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); }
.fg-head:hover .fg-count { background: var(--border); }
.fg-body { display: flex; flex-direction: column; gap: 2px; padding-left: 8px; }
.fg-empty { padding: 4px 12px 6px; color: var(--n500); font-size: 12px; }
.meeting-item { position: relative; }
.meeting-item .mi-more { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--card-2); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; }
.meeting-item:hover .mi-more, .meeting-item.active .mi-more { opacity: 1; }
.meeting-item .mi-more:hover { color: var(--text); background: var(--border); }
.menu.ctx { position: fixed; top: 0; left: 0; right: auto; min-width: 220px; max-width: 320px; }
.menu .menu-sub { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--n500); }
.menu .menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu .menu-item.danger:hover { color: var(--rec); background: rgba(255,77,94,.08); }
.menu .menu-item.checked::before { content: '✓ '; color: var(--ok); }
.menu .menu-item.indent { padding-left: 22px; }
.fold-input { margin: 4px 12px 8px; width: calc(100% - 24px); font-size: 13px; padding: 7px 13px; }
.fg-head .fg-more { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); font-size: 14px; line-height: 1; opacity: 0; flex: none; }
.fg-head:hover .fg-more { opacity: 1; }
.fg-head .fg-more:hover { background: var(--border); color: var(--text); }
.fg-head .fg-rename { flex: 1; min-width: 0; font: inherit; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--accent); background: var(--bg); color: var(--text); }
