/* Visor — styles. Colors come from the logo: blue #4DBEDC → green #7BC288.

   The look is Visor's own: a light sidebar on a cool canvas and each page on
   one white sheet, with thin lines rather than stacked cards, real numbers
   wherever there's room, and circles (the lenses of the logo) for people and
   marks. Colour stays in the logo's family: its blue for actions and the
   current place, its blue-to-green gradient for accents, each class's own
   colour on its pages, amber and red only for status. The wording is plain:
   no greetings, nothing chatty. */

:root {
  --blue: #4DBEDC;
  --blue-deep: #1E9BC4;
  --blue-soft: #E4F5FA;
  --green: #7BC288;
  --green-deep: #4CA35C;
  --green-soft: #E9F6EB;
  --grad: linear-gradient(100deg, var(--green) 0%, var(--blue) 100%);
  --ink: #14293A;
  --ink-2: #4E6878;
  --ink-3: #8599A8;
  --line: #E3EAF0;
  --surface: #EFF4F8;   /* the canvas */
  --surface-2: #F7FAFC; /* quiet fills inside white surfaces */
  --card: #FFFFFF;
  --amber: #E39B2E;
  --amber-soft: #FCF1DF;
  --red: #D9534F;
  --red-soft: #FBE7E6;
  --violet: #7C5CD6;
  --violet-soft: #EEE9FB;
  /* Surfaces float on a hairline ring and a soft shadow, not a border */
  --ring: 0 0 0 1px rgba(18,48,59,0.06);
  --shadow-sm: 0 0 0 1px var(--line);
  --shadow-md: 0 8px 24px rgba(18,48,59,0.08), 0 1px 3px rgba(18,48,59,0.04), var(--ring);
  --shadow-lg: 0 28px 70px rgba(18,48,59,0.22), var(--ring);
  --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-xl: 14px; --r-ctl: 8px;
  /* Buttons, links and active states: a darker blue than the logo's, so white
     text on it and it on white both pass WCAG AA */
  --brand: #0E7BAB;
  --brand-hover: #0B6A96;
  --brand-soft: #E3F2FA;
  --field-line: #D2DCE4;
  --focus: 0 0 0 3px rgba(14,123,171,0.22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--surface); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, .section-title { letter-spacing: -0.012em; }
a { color: var(--brand); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 9px 16px; border-radius: var(--r-ctl); background: var(--brand); color: #fff; font-weight: 600; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
#routeView:focus { outline: none; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-ctl); border: 1px solid transparent; font-weight: 600; font-size: 13.5px; line-height: 1.1; transition: background .12s ease, border-color .12s, color .12s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #23425A; }
.btn-ghost { background: #fff; color: var(--ink); border-color: transparent; box-shadow: inset 0 0 0 1px var(--field-line); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); box-shadow: inset 0 0 0 1px #B4C6CF; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover:not(:disabled) { background: #CFE8F5; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #f6d5d3; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 10px 18px; font-size: 14.5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; background: transparent; border: 1px solid transparent; color: var(--ink-2); }
.btn-icon:hover { background: #E6EEF1; color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-2); }
.input { width: 100%; padding: 9px 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: #fff; outline: none; transition: border-color .12s, box-shadow .12s, background-color .12s; }
.input:hover:not(:focus):not(:disabled) { border-color: #B9CAD2; }
.input:focus { border-color: var(--brand); box-shadow: var(--focus); }
.input.error { border-color: var(--red); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { background: var(--red-soft); color: #B23B37; border-radius: var(--r); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.form-ok { background: var(--green-soft); color: var(--green-deep); border-radius: var(--r); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

/* ---------- pills / tags / avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill-blue { background: var(--blue-soft); color: var(--blue-deep); }
.pill-green { background: var(--green-soft); color: var(--green-deep); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-gray { background: #E9F0F3; color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill .dot.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .4; transform: scale(.7);} }

.avatar { position: relative; overflow: hidden; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: #fff; flex: none; background: #4A6370; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* speaker colors (used in scripts and charts) */
.c0 { --c: #1E9BC4; } .c1 { --c: #4CA35C; } .c2 { --c: #E39B2E; } .c3 { --c: #7C5CD6; } .c4 { --c: #D9534F; } .c5 { --c: #2A9D8F; } .c6 { --c: #B5179E; } .c7 { --c: #6C757D; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: 0 0 0 1px #C4D2D9; }
.section-title { font-size: 15px; font-weight: 600; margin: 0; }
.kicker svg { width: 14px; height: 14px; }
.kicker { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }

/* ---------- layout: auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px; background: var(--surface); }
.auth-brand { background: linear-gradient(150deg, #C4EAF5 0%, #D8F1DE 100%); color: var(--ink); padding: 52px; border-radius: var(--r-xl); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 420'><g fill='none' stroke-width='1.5'><circle cx='230' cy='190' r='170' stroke='%234DBEDC'/><circle cx='340' cy='190' r='170' stroke='%237BC288'/><circle cx='285' cy='190' r='62' stroke='%234DBEDC'/></g></svg>") right -140px top -90px / 460px 345px no-repeat; }
.auth-brand > * { position: relative; }
.auth-brand .logo-big { width: 72px; height: auto; border-radius: 12px; background: #fff; padding: 9px 10px; box-shadow: 0 10px 30px rgba(20,41,58,0.14); display: block; }
.auth-brand h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.015em; margin: 24px 0 10px; font-weight: 700; }
.auth-brand p { font-size: 15.5px; max-width: 420px; margin: 0; }
.auth-brand .how { display: grid; gap: 0; margin-top: 40px; max-width: 460px; }
.auth-brand .how div { padding: 11px 0; border-top: 1px solid rgba(20,41,58,.16); font-size: 14.5px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-head .linklike { font-size: 13px; font-weight: 500; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 24px 8px; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-sm); padding: 30px 30px; }
.auth-card h2 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.01em; }
.auth-card .sub { color: var(--ink-2); margin: 0 0 24px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--ink-2); margin-top: 18px; }
.auth-switch button { background: none; border: 0; color: var(--brand); font-weight: 600; padding: 0; }
.google-btn-mount { display: flex; justify-content: center; margin-bottom: 16px; min-height: 40px; }
.google-btn-mount.hidden + .auth-divider { display: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: var(--ink-2); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border, #e5e7eb); }
#signupForm.google-mode #suEmail { background: var(--bg-2, #f4f4f5); color: var(--ink-2); }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.role-card { border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: #fff; text-align: left; transition: all .15s; }
.role-card:hover { border-color: #9FCADB; }
.role-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--focus); }
.role-card .t { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.role-card .t svg { width: 18px; height: 18px; color: var(--blue-deep); }
.role-card .d { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.label-note { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.school-picker-box { position: relative; }
.school-picker .dropdown button { font-size: 14px; }
.school-picker .dropdown svg { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
.school-chosen { display: flex; align-items: center; gap: 6px; color: var(--green-deep); font-weight: 600; margin-top: 6px; }
.school-chosen:empty { display: none; }
.school-chosen svg { width: 14px; height: 14px; flex: none; }
.school-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--green-soft); color: var(--green-deep); font-size: 13.5px; font-weight: 600; margin: -6px 0 14px; }
.school-chip.warn { background: var(--amber-soft); color: var(--amber); }
.school-chip svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; align-content: start; padding: 10px; gap: 10px; } .auth-brand { padding: 18px 20px; } .auth-brand .logo-big { width: 56px; padding: 7px 8px; } .auth-brand h1 { margin: 12px 0 0; font-size: 24px; } .auth-brand h1 br { display: none; } .auth-brand p { display: none; } .auth-brand .credit { margin-top: 8px; } .auth-brand .how { display: none; } .auth-card { padding: 26px 20px; } }

/* ---------- layout: app ----------
   The sidebar on the canvas, and the page on its sheet beside it. */
#appView:not(.hidden) { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; }
.vbar, .vnav-scrim { display: none; }
.vnav { grid-column: 1; grid-row: 1; position: sticky; top: 0; height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px 10px; }
/* The logo's two lenses, faint, behind the foot of the sidebar */
.vnav::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0 0; height: 250px; pointer-events: none; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 252 250'><g fill='none' stroke-width='1.25' opacity='.55'><circle cx='92' cy='190' r='92' stroke='%234DBEDC'/><circle cx='168' cy='190' r='92' stroke='%237BC288'/><circle cx='130' cy='190' r='34' stroke='%234DBEDC'/></g></svg>") center bottom / 100% auto no-repeat; }
.shell, .route-view { grid-column: 2; grid-row: 1; min-width: 0; }
.vnav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--ink); text-decoration: none; }
.vnav-brand img { width: 32px; height: auto; flex: none; }
.vnav-brand-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.vnav-brand-t b { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
#topSchool { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topSchool:empty { display: none; }
.vnav-main, .vnav-list { display: flex; flex-direction: column; gap: 2px; }
.vnav-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink); font-size: 13.5px; font-weight: 500; text-decoration: none; transition: background-color .15s, box-shadow .15s; }
.vnav-item > svg { width: 18px; height: 18px; flex: none; }
.vnav-item:hover { background: rgba(20,41,58,.05); }
.vnav-item:focus-visible, .vnav-add:focus-visible, .user-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.vnav-item.active { position: relative; background: rgba(14,123,171,.10); font-weight: 600; }
.vnav-item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: linear-gradient(180deg, var(--blue), var(--green)); }
.vnav-n { flex: none; min-width: 20px; padding: 0 6px; border-radius: 5px; background: #F2B04A; color: #3A2503; font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.vnav-main .vnav-item.active { color: var(--brand); }
.vnav-school { color: var(--ink); font-weight: 600; }
.vnav-school-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; margin-left: -2px; overflow: hidden; border-radius: 6px; background: var(--grad); color: #fff; }
.vnav-school-ic svg { width: 14px; height: 14px; }
.vnav-school-ic img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.vnav-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A class in the sidebar: its letter on a tile of its colour, dark enough for white text */
.vtile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 9px; background: color-mix(in srgb, var(--cc, #5E6E7D) 70%, #14293A); color: #fff; font-size: 12px; font-weight: 700; }
.vlens { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--green); color: #2E8549; }
.vlens svg { width: 14px; height: 14px; }
.vnav-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.vnav-add { border: 0; background: none; padding: 4px 2px; border-radius: 6px; color: var(--brand); font-size: 12px; font-weight: 600; }
.vnav-add:hover { color: var(--brand-hover); }
.vnav-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.vnav-empty { padding: 4px 10px; font-size: 13px; color: var(--ink-2); }
.vnav-more { padding: 6px 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.vnav-more:hover { color: var(--ink); }
.vnav .live-dot { flex: none; background: var(--green-deep); animation: none; box-shadow: 0 0 0 3px var(--green-soft); }
.vnav-foot { position: relative; margin: 0 -12px -10px; padding: 8px 12px 10px; background: var(--surface); border-top: 1px solid var(--line); }
.vnav-foot .user-menu { display: block; }
.vnav-foot .user-btn { width: 100%; padding: 6px 8px; border-radius: 8px; color: var(--ink); text-align: left; }
.vnav-foot .user-btn:hover { background: rgba(20,41,58,.05); }
.vnav-foot .menu { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }
.vnav-foot .credit { padding: 8px 10px 2px; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: var(--r-ctl); padding: 4px 12px 4px 4px; }
.user-btn:hover { background: var(--surface); }
.user-btn .n { font-weight: 600; font-size: 14px; }
.user-btn .r { font-size: 12px; color: var(--ink-2); text-transform: capitalize; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); background: #fff; border: 0; border-radius: 10px; box-shadow: var(--shadow-md); min-width: 210px; padding: 6px; z-index: 30; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); }
.menu button:hover { background: var(--surface); }
.menu button.danger { color: var(--red); }
.menu button svg { width: 16px; height: 16px; color: var(--ink-2); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 0; }

.credit { font-size: 10.5px; color: var(--ink-3); opacity: .7; padding: 14px 8px 0; letter-spacing: .02em; }
.credit-light { color: var(--ink); opacity: .72; padding: 18px 0 0; }
/* The sheet: every page sits on one large white surface */
.route-view, .shell > .main { box-sizing: border-box; margin: 12px 12px 12px 0; min-height: calc(100vh - 24px); background: var(--grad) top / 100% 3px no-repeat, #fff; border-radius: var(--r-xl); box-shadow: 0 0 0 1px rgba(20,41,58,0.06), 0 12px 32px rgba(20,41,58,0.06); }
.shell > .main { display: block; padding: 34px 36px 48px; }
@media (max-width: 900px) {
  #appView:not(.hidden) { display: block; }
  .vbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 40; height: 54px; padding: 0 8px; background: var(--surface); }
  .vbar-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--ink); }
  .vbar-btn svg { width: 22px; height: 22px; }
  .vbar-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 750; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; }
  .vbar-brand img { width: 34px; height: auto; }
  .vnav { position: fixed; left: 0; top: 0; z-index: 60; width: 272px; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(-100%); visibility: hidden; transition: transform .22s var(--ease), visibility 0s .22s; }
  body.nav-open .vnav { transform: none; visibility: visible; transition: transform .22s var(--ease); }
  body.nav-open .vnav-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(18,48,59,0.32); }
  .route-view, .shell > .main { margin: 0 8px 8px; min-height: calc(100vh - 62px); }
  .shell > .main { padding: 22px 16px 48px; }
}

/* project header */
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.proj-head h2 { font-size: 30px; margin: 0; letter-spacing: -0.02em; line-height: 1.15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.proj-head .meta { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.proj-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.code-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-ctl); background: #fff; border: 1px solid var(--field-line); font-family: var(--mono); font-weight: 700; letter-spacing: .12em; font-size: 13px; }
.code-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.code-chip svg { width: 15px; height: 15px; color: var(--ink-2); }
.copy-chip { cursor: pointer; color: var(--ink); }
.copy-chip-state { display: inline-flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid var(--field-line); color: var(--brand); font: 600 12px var(--font); letter-spacing: 0; }
.copy-chip-state svg { width: 14px; height: 14px; color: currentColor; }
.copy-chip.copied, .copy-chip.copied:hover { border-color: var(--green-deep); background: var(--green-soft); }
.copy-chip.copied .copy-chip-state { border-left-color: var(--green-deep); color: #2E7A44; }

.tabs { display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: #EDF2F4; margin-bottom: 20px; }
.tab { background: none; border: 0; padding: 5px 12px; border-radius: var(--r-sm); font-weight: 600; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; white-space: nowrap; transition: color .15s, background-color .2s, box-shadow .2s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 0 0 1px rgba(18,48,59,0.08); }
.tab .count { background: var(--surface); border-radius: 999px; padding: 0 7px; font-size: 12px; color: var(--ink-2); }
.tab.active .count { background: var(--brand-soft); color: var(--brand); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty .ic svg { width: 26px; height: 26px; color: var(--blue-deep); }
.empty h4 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 14px; }

/* member rows */
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.row .s { font-size: 12.5px; color: var(--ink-2); }
.search-wrap { position: relative; margin-bottom: 16px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.search-wrap .input { padding-left: 38px; }
.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 0; border-radius: 10px; box-shadow: var(--shadow-md); z-index: 15; max-height: 280px; overflow: auto; padding: 4px; }
.dropdown button { border-radius: 10px; }
.dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; }
.dropdown button:hover { background: var(--surface); }
.dropdown .none { padding: 12px; color: var(--ink-2); font-size: 13.5px; }

/* resource cards */
.res-grid { display: grid; gap: 12px; }
.res-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; cursor: pointer; }
.res-card .ic { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.res-card .ic svg { width: 22px; height: 22px; }
.res-card .ic.audio { background: var(--blue-soft); color: var(--blue-deep); }
.res-card .ic.ext { background: var(--violet-soft); color: var(--violet); }
.res-card .t { font-weight: 600; font-size: 15px; }
.res-card .s { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res-card .cta { flex: none; }

/* add-resource choices */
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .choice-grid, .choice-grid.two { grid-template-columns: 1fr; } }
.choice { border: 1px solid var(--field-line); border-radius: var(--r-lg); padding: 18px 14px; background: #fff; text-align: center; transition: all .12s; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.choice:hover { border-color: var(--brand); background: var(--brand-soft); }
.choice .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.choice .ic svg { width: 22px; height: 22px; }
.choice .t { font-weight: 700; font-size: 14.5px; }
.choice .d { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.choice-hero { flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; text-align: left !important; width: 100%; min-height: 150px; padding: 22px 24px; border-width: 2px; background: linear-gradient(135deg, #F2FAF4, #EDF7FB); }
.choice-hero .ic { width: 60px; height: 60px; border-radius: 50%; margin: 0; flex: none; }
.choice-hero .ic svg { width: 30px; height: 30px; }
.choice-hero .t { font-size: 17px; text-align: left; }
.choice-hero .d { text-align: left; }
.choice-hero .d { font-size: 13.5px; margin-top: 4px; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 34px 20px; text-align: center; background: var(--surface); transition: all .12s; }
.dropzone.over, .dropzone:hover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--blue-deep); }
.dropzone.bad { border-color: var(--red); background: var(--red-soft); }
.dropzone.bad svg { color: var(--red); }
.dz-error { color: var(--red); font-size: 13.5px; margin: 8px auto 0; max-width: 420px; line-height: 1.45; }
.rec { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0; }
.rec-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(77,190,220,0.4); }
.rec-btn.on { background: var(--red); box-shadow: 0 0 0 10px rgba(217,83,79,0.15); animation: recpulse 1.2s infinite; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 8px rgba(217,83,79,0.15);} 50% { box-shadow: 0 0 0 16px rgba(217,83,79,0.05);} }
.rec-btn svg { width: 30px; height: 30px; }
.rec-time { font-family: var(--mono); font-size: 26px; font-weight: 600; }
canvas.wave { width: 100%; max-width: 460px; height: 64px; border-radius: 8px; background: var(--surface); }

/* progress steps (transcribing) */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.step .d { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step.done { color: var(--ink); } .step.done .d { background: var(--green); border-color: var(--green); color: #fff; }
.step.active { color: var(--ink); font-weight: 600; } .step.active .d { border-color: var(--blue); border-top-color: transparent; animation: spin .8s linear infinite; }
.step .d svg { width: 12px; height: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; display: inline-block; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

/* who-said-this wizard */
.wiz-progress { display: flex; gap: 6px; margin-bottom: 18px; }
.wiz-progress span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.wiz-progress span.done { background: var(--green); }
.wiz-progress span.cur { background: var(--blue); }
.quote { background: var(--surface); border-left: 4px solid var(--c, var(--blue)); border-radius: 0 var(--r) var(--r) 0; padding: 12px 16px; font-size: 16px; line-height: 1.5; margin-bottom: 10px; font-style: italic; }
.quote::before { content: "“"; color: var(--ink-3); font-style: normal; margin-right: 2px; }
.quote::after { content: "”"; color: var(--ink-3); font-style: normal; margin-left: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; transition: all .12s; }
.chip:hover { border-color: var(--blue); background: var(--blue-soft); }
.chip.selected { border-color: var(--blue-deep); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(77,190,220,0.2); }
.chip .avatar { width: 26px; height: 26px; font-size: 10px; }
.chip.other { padding: 8px 14px; border-style: dashed; }

/* script view */
.script { display: flex; flex-direction: column; gap: 10px; }
.line { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: baseline; }
.line .who { font-weight: 700; color: var(--c, var(--ink)); display: flex; align-items: center; gap: 8px; font-size: 14px; }
.line .who .t { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.line .what { font-size: 15px; }
.line.unnamed .who { color: var(--amber); }
@media (max-width: 640px) { .line { grid-template-columns: 1fr; gap: 2px; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }

/* bars */
.bar { height: 12px; border-radius: 6px; background: #EAF2F5; overflow: hidden; flex: 1; display: flex; }
.bar > i { height: 100%; display: block; background: var(--c, var(--blue)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar-row { display: grid; grid-template-columns: 170px 1fr 52px; align-items: center; gap: 12px; }
.bar-row .n { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .v { text-align: right; font-family: var(--mono); font-size: 13px; }
.bar-rows { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 120px 1fr 44px; } }

/* analysis */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 18px 20px; }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; line-height: 1; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.stat .d { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: 1fr; } }
.workload { display: flex; flex-direction: column; gap: 22px; }
.wl { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.wl .role-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--c, var(--blue-deep)); }
.wl .role-ic svg { width: 20px; height: 20px; }
.wl .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wl .head .n { font-weight: 700; font-size: 16px; }
.wl .head .r { color: var(--ink-2); font-size: 13.5px; }
.wl .barline { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.wl .pct { font-size: 22px; font-weight: 800; width: 62px; text-align: right; letter-spacing: -0.02em; }
.wl ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.wl ul li { margin: 3px 0; }
.wl .ev { font-size: 12.5px; color: var(--ink-2); font-style: italic; margin-top: 6px; }
.wl .src { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.task { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.task:first-child { border-top: 0; }
.task .o { font-weight: 600; white-space: nowrap; }
.callout { padding: 14px 18px; border-radius: var(--r-lg); font-size: 14.5px; }
.callout.amber { background: var(--amber-soft); border: 0; color: #6E4A0E; }
.callout.red { background: var(--red-soft); border: 0; color: #8A2C29; }
.callout.dark { background: var(--ink); color: #fff; }
.callout.dark .kicker { color: rgba(255,255,255,0.6); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.rise { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }
.collapse .ch { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; }
.collapse .ch svg { width: 16px; height: 16px; transition: transform .28s cubic-bezier(.2, .7, .2, 1); color: var(--ink-3); }
.collapse.open .ch svg.chev { transform: rotate(90deg); }
/* Opens and closes smoothly: the body's row grows from 0fr to 1fr */
.collapse { display: grid; grid-template-rows: auto 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .7, .2, 1); }
.collapse.open { grid-template-rows: auto 1fr; }
.collapse .cb { min-height: 0; overflow: hidden; padding: 6px 18px 18px; border-top: 1px solid var(--line); transition: padding .3s cubic-bezier(.2, .7, .2, 1), border-color .3s, visibility 0s; }
.collapse:not(.open) .cb { padding-top: 0; padding-bottom: 0; border-top-color: transparent; visibility: hidden; transition: padding .3s cubic-bezier(.2, .7, .2, 1), border-color .3s, visibility 0s .3s; }

/* toggle */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.toggle .l { font-weight: 600; font-size: 14.5px; }
.toggle .d { font-size: 12.5px; color: var(--ink-2); }
.switch { width: 44px; height: 26px; border-radius: 13px; background: #D5E1E7; border: 0; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: left .15s; }
.switch.on { background: var(--brand); } .switch.on::after { left: 21px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(18,48,59,0.34); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 70; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: rise .2s ease; }
.modal.wide { max-width: 760px; }
.modal .mh { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 26px 26px 0; }
.modal .mh h3 { margin: 0; font-size: 20px; }
.modal .mh p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.modal .mb { padding: 20px 26px 24px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 0 26px 24px; }
.modal .mf.between { justify-content: space-between; }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-md); z-index: 60; max-width: min(560px, calc(100vw - 32px)); width: max-content; animation: rise .2s ease; display: flex; gap: 10px; align-items: center; }
.toast.err { background: #B23B37; }
.toast.warn { background: #7A4E0C; }
.toast svg { width: 16px; height: 16px; }

/* audio player */
audio { width: 100%; margin-bottom: 14px; }

/* ---------- document view (same tabs as the extension) ---------- */
.dv-tabs { margin: -4px 0 18px; overflow-x: auto; }
.dv-tabs .tab { white-space: nowrap; }
.dv-note { margin-bottom: 14px; font-size: 13.5px; }
.dv-summary { background: var(--surface); margin-bottom: 16px; font-size: 14.5px; }
.dv-h { margin: 18px 0 10px; }
.dv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .dv-two { grid-template-columns: 1fr; } }
.grow { flex: 1; min-width: 0; }

.dv-hm { padding: 14px 16px; overflow-x: auto; }
.dv-hm-row { display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: 8px; margin-bottom: 3px; min-width: 420px; }
.dv-hm-day { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.dv-hm-cells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.dv-hm-cells i { display: block; height: 13px; border-radius: 3px; }
.dv-hm-total { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: right; }
.dv-hm-ruler .dv-hm-cells b { font-size: 9.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; overflow: visible; }
.dv-hm-ruler .dv-hm-total { font-family: var(--font); color: var(--ink-3); }

.dv-bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding: 14px 14px 30px; }
.dv-bars.short { height: 120px; gap: 10px; }
.dv-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.dv-bar i { display: block; background: var(--blue-deep); border-radius: 4px 4px 0 0; min-height: 0; }
.dv-bar:hover i { background: var(--ink); }
.dv-bar span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font-size: 10px; color: var(--ink-3); white-space: nowrap; }

.dv-person { padding: 14px 16px; }
.dv-person-head { display: flex; align-items: center; gap: 12px; }
.dv-person-name { font-weight: 700; }
.dv-person-share { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.dv-person-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.dv-person-grid > div { background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; }
.dv-person-grid b { display: block; font-size: 16px; }
.dv-person-grid span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
@media (max-width: 640px) { .dv-person-grid { grid-template-columns: repeat(2, 1fr); } }
.dv-mix, .dv-stack, .dv-churn { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); margin-top: 12px; }
.dv-mix i, .dv-stack i, .dv-churn i { display: block; height: 100%; }
.dv-stack { margin-top: 0; height: 12px; }
.dv-stack.tall { height: 18px; }
.dv-churn { height: 5px; margin-top: 8px; }
.dv-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.dv-key i, .dv-name i, .dv-origin i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

.dv-list { display: flex; flex-direction: column; gap: 8px; }
.dv-row { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 10px 0; }
.dv-rail { width: 4px; border-radius: 0 4px 4px 0; background: var(--c); flex: none; }
.dv-row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dv-name { font-weight: 600; font-size: 14px; margin-right: 10px; white-space: nowrap; }
.dv-when { margin-left: auto; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.dv-row-meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.dv-ev-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; gap: 10px; }
.dv-sorts { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; }
.dv-sorts button { border: 0; background: none; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dv-sorts button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.dv-evlist { display: flex; flex-direction: column; gap: 6px; }
.dv-ev { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r-sm); background: #fff; }
.dv-ev .dv-when { margin-left: auto; }
.dv-size { font-family: var(--mono); font-size: 12.5px; min-width: 90px; text-align: right; }

.dv-signal { display: flex; align-items: center; gap: 22px; }
.dv-signal-num { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; min-width: 110px; text-align: center; }
.dv-signal-num small { font-size: 22px; }
.dv-signal-title { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.dv-origin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.dv-origin > div { display: flex; gap: 2px; font-size: 13.5px; }
.dv-origin i { margin-top: 5px; flex: none; }
@media (max-width: 640px) { .dv-origin { grid-template-columns: 1fr; } .dv-signal { flex-direction: column; align-items: flex-start; } }
.dv-obs { display: flex; flex-direction: column; gap: 6px; }
.dv-ob { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }

@media (max-width: 640px) { .modal .stat-grid { grid-template-columns: repeat(2, 1fr); } .modal .stat .v { font-size: 24px; } }

/* writing habits table (Analysis tab) */
.hb-wrap { overflow-x: auto; }
.hb { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.hb th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hb td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.hb tr:last-child td { border-bottom: 0; }
.hb-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hb-mix { width: 120px; margin-top: 0; margin-bottom: 4px; }
.hb-warn { color: #B8741A; }

@media (max-width: 640px) { .dv-tabs .tab { padding: 10px 8px; font-size: 14px; } }
