/* ===========================================================================
   Transcription — design tokens and components. The canonical stylesheet.

   Implements docs/design-system.md. Teal and slate: a slate top bar, teal for
   primary actions and focus, cool grey pages. This is the only file in the
   project that may contain a hex value.

   Each area of the product has a section rail (--section-rail): teal for the
   customer portal, amber for the editor, indigo for administration. A page sets
   the rail; the active nav pill, focus rings, stat edges and the play button
   derive from it.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ------------------------------------------------------------ Light ------ */
:root{
  /* Teal and slate. --ink is the slate of the top bar; --gold keeps its name
     from the layout this was built on, and is the light teal of focus rings,
     the avatar and the brand mark. --primary is the teal of primary actions. */
  --ink:#0F172A;
  --ink-2:#1E293B;
  --ink-3:#334155;
  --gold:#2DD4BF;
  --gold-text:#134E4A;
  --primary:#0F766E;
  --primary-hover:#115E59;

  --bg:#F4F6F8;              /* the page */
  --surface:#FFFFFF;         /* cards and panels */
  --surface-sunken:#F8FAFC;  /* insets, hover rows */
  --surface-hover:#F8FAFC;
  --overlay:#FFFFFF;

  --border:#E2E8F0;
  --border-strong:#CBD5E1;

  --text:#0F172A;
  --text-2:#475569;
  --text-3:#64748B;
  --text-on-ink:#F1F5F9;
  --text-on-ink-dim:#94A3B8;
  --text-inverse:#FFFFFF;

  --accent:var(--primary);
  --accent-hover:var(--primary-hover);
  --accent-press:#134E4A;
  --accent-text:#0F766E;
  --focus:#14B8A6;

  --chrome:var(--ink);
  --chrome-text:var(--text-on-ink);
  --chrome-text-2:var(--text-on-ink-dim);
  --chrome-hover:var(--ink-2);

  /* Status. Each tint carries text that passes AA on it. */
  --ok:#15803D;     --ok-bg:#DCFCE7;     --ok-line:#A7E3BA;
  --warn:#92400E;   --warn-bg:#FEF3C7;   --warn-line:#F4D58A;
  --bad:#B91C1C;    --bad-bg:#FEE2E2;    --bad-line:#F8B4B4;
  --info:#1D4ED8;   --info-bg:#DBEAFE;   --info-line:#AFC8F5;
  --live:#92400E;

  --inactive-bg:#EEF1F4;
  --inactive-text:#94A3B8;

  /* Section rail; the tint and readable text derive from it. */
  --section-rail:#0F766E;
  --section-bg:color-mix(in srgb, var(--section-rail) 14%, white);
  --section-text:color-mix(in srgb, var(--section-rail) 62%, black);
  --section-ink:color-mix(in srgb, var(--section-rail) 82%, black);
  --accent-subtle:var(--section-bg);

  --font-ui:'Manrope',-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  --font-read:var(--font-ui);

  --fs-display:22px; --lh-display:28px;
  --fs-h1:22px;      --lh-h1:28px;
  --fs-h2:16px;      --lh-h2:22px;
  --fs-h3:14.5px;    --lh-h3:20px;
  --fs-body:14px;    --lh-body:21px;
  --fs-read:15px;    --lh-read:25px;
  --fs-small:12.5px; --lh-small:18px;
  --fs-label:12.5px;
  --fs-caption:11.5px;

  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px;
  --s6:24px; --s8:32px; --s10:40px; --s14:56px;

  --r-sm:6px; --r:8px; --r-lg:12px;

  --shadow-sm:0 1px 1px rgba(14,34,56,0.03);
  --shadow-md:0 2px 6px rgba(14,34,56,0.05);
  --shadow-overlay:0 4px 12px rgba(14,34,56,0.08),0 18px 40px rgba(14,34,56,0.10);
  --shadow-dock:0 -1px 0 var(--border),0 -6px 20px rgba(14,34,56,0.05);

  --ease:cubic-bezier(.16,.84,.44,1);
  --t-fast:120ms; --t:200ms;

  --topbar-h:56px;
  --content-max:1240px;

  color-scheme:light;
}

/* ------------------------------------------------------------- Dark ------
   Re-stepped for the dark surface, not inverted: a value tuned to read as text
   on white does not necessarily work as a filled mark on near-black. */
[data-theme="dark"]{
  --ink:#020617;
  --ink-2:#0F172A;
  --ink-3:#1E293B;
  --primary:#14B8A6;
  --primary-hover:#2DD4BF;

  --bg:#0B1120;
  --surface:#111827;
  --surface-sunken:#1F2937;
  --surface-hover:#1F2937;
  --overlay:#1A2332;

  --border:#1F2937;
  --border-strong:#374151;

  --text:#E5E7EB;
  --text-2:#9CA3AF;
  --text-3:#8B95A5;
  --text-inverse:#042F2E;

  --accent:var(--primary);
  --accent-hover:var(--primary-hover);
  --accent-press:#0D9488;
  --accent-text:#5EEAD4;

  --chrome:var(--ink);
  --chrome-hover:var(--ink-3);

  --ok:#4ADE80;     --ok-bg:#0F2A1B;     --ok-line:#1F5134;
  --warn:#FBBF24;   --warn-bg:#2D2208;   --warn-line:#5A4513;
  --bad:#F87171;    --bad-bg:#2F1414;    --bad-line:#5E2626;
  --info:#93C5FD;   --info-bg:#11203A;   --info-line:#23406B;
  --live:#FBBF24;

  --inactive-bg:#1F2937;
  --inactive-text:#6B7280;

  --section-bg:color-mix(in srgb, var(--section-rail) 22%, #111827);
  --section-text:color-mix(in srgb, var(--section-rail) 55%, white);

  --shadow-sm:0 1px 1px rgba(0,0,0,0.18);
  --shadow-md:0 2px 8px rgba(0,0,0,0.24);
  --shadow-overlay:0 10px 30px rgba(0,0,0,0.45);
  --shadow-dock:0 -1px 0 var(--border),0 -8px 24px rgba(0,0,0,0.30);

  color-scheme:dark;
}

/* Section rails. Set on <body>. */
.section-portal     { --section-rail:#0F766E; }   /* teal   */
.section-workstation{ --section-rail:#D97706; }   /* amber  */
.section-admin      { --section-rail:#4F46E5; }   /* indigo */
[data-theme="dark"] .section-portal{ --section-rail:#14B8A6; }
[data-theme="dark"] .section-workstation{ --section-rail:#F59E0B; }
[data-theme="dark"] .section-admin{ --section-rail:#818CF8; }

/* Speaker colours, from the intranet prototype. PROVISIONAL: not yet through
   the palette validator. Colour is never the only channel; every passage also
   carries the speaker's initials and name. app/exporters.py mirrors the light
   set for Word and PDF. */
:root{
  --speaker-1:#3B6EA5; --speaker-2:#A23E23; --speaker-3:#1F7A8C; --speaker-4:#8A6410;
  --speaker-5:#6B4C9A; --speaker-6:#276B3C; --speaker-7:#A6497E; --speaker-8:#5C6672;
}
[data-theme="dark"]{
  --speaker-1:#6E9BD6; --speaker-2:#E07A62; --speaker-3:#4FB4C4; --speaker-4:#D9A441;
  --speaker-5:#A48BD4; --speaker-6:#5EBE86; --speaker-7:#D985B4; --speaker-8:#9AA4B0;
}
.sp-1{--sp:var(--speaker-1);} .sp-2{--sp:var(--speaker-2);}
.sp-3{--sp:var(--speaker-3);} .sp-4{--sp:var(--speaker-4);}
.sp-5{--sp:var(--speaker-5);} .sp-6{--sp:var(--speaker-6);}
.sp-7{--sp:var(--speaker-7);} .sp-8{--sp:var(--speaker-8);}

/* ===========================  Base  =========================== */

*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  margin:0;min-height:100vh;
  font-family:var(--font-ui);font-size:var(--fs-body);line-height:var(--lh-body);
  background:var(--bg);color:var(--text);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,p{margin:0;}
a{color:var(--accent-text);text-decoration:none;}
a:hover{text-decoration:underline;text-underline-offset:2px;}
button{font:inherit;color:inherit;}
svg{display:block;}
[hidden]{display:none !important;}

.mono,.tc{font-family:var(--font-mono);font-variant-numeric:tabular-nums;}

.icon{width:16px;height:16px;flex-shrink:0;stroke:currentColor;fill:none;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.icon-lg{width:20px;height:20px;}

:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:4px;}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.skip-link{
  position:fixed;top:-60px;left:12px;z-index:300;
  background:var(--ink);color:var(--text-on-ink);
  padding:10px 16px;border-radius:7px;font-size:13px;font-weight:600;
  transition:top .15s ease;
}
.skip-link:focus{top:12px;text-decoration:none;}

@keyframes fadeSlideUp{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}
@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}
@keyframes appear{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:none;}}
@keyframes spin{to{transform:rotate(360deg);}}
@keyframes sweep{from{transform:translateX(-100%);}to{transform:translateX(250%);}}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.35;}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important;animation-iteration-count:1 !important;
    transition-duration:.001ms !important;scroll-behavior:auto !important;}
}

/* ===========================  Buttons  =========================== */

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:36px;padding:0 18px;
  font-family:inherit;font-size:13px;font-weight:700;letter-spacing:.01em;line-height:1;
  border-radius:var(--r);border:1px solid var(--border-strong);
  background:var(--surface);color:var(--text);
  cursor:pointer;white-space:nowrap;text-decoration:none !important;
  box-shadow:var(--shadow-sm);
  transition:background .15s ease,border-color .15s ease,box-shadow .2s ease,
             transform .12s ease,color .15s ease;
}
.btn:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
.btn:active{transform:scale(.97);}
.btn-primary{
  background:linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, white), var(--primary));
  border-color:var(--primary);color:#FFFFFF;
}
.btn-primary:hover{background:var(--primary-hover);border-color:var(--primary-hover);}
[data-theme="dark"] .btn-primary{background:var(--accent);border-color:var(--accent);color:var(--text-inverse);}
[data-theme="dark"] .btn-primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);}
.btn-secondary:hover{border-color:var(--section-rail);color:var(--section-text);}
.btn-tertiary,.btn-ghost{background:transparent;border-color:transparent;box-shadow:none;
  color:var(--section-text);padding:0 10px;}
.btn-tertiary:hover,.btn-ghost:hover{background:var(--section-bg);box-shadow:none;transform:none;}
.btn-danger{color:var(--bad);border-color:var(--bad-line);}
.btn-danger:hover{background:var(--bad-bg);border-color:var(--bad);color:var(--bad);}
.btn[aria-disabled="true"],.btn:disabled{
  background:var(--inactive-bg);color:var(--inactive-text);border-color:transparent;
  cursor:not-allowed;transform:none;box-shadow:none;
}
.btn-sm{min-height:30px;padding:0 12px;font-size:12px;border-radius:7px;}
.btn-block{width:100%;}

.btn[aria-busy="true"]{position:relative;color:transparent !important;pointer-events:none;}
.btn[aria-busy="true"]::after{
  content:"";position:absolute;width:16px;height:16px;border-radius:50%;
  border:2px solid var(--text-on-ink);border-right-color:transparent;animation:spin .7s linear infinite;
}
.btn-secondary[aria-busy="true"]::after{border-color:var(--text-2);border-right-color:transparent;}

/* ===========================  Forms  =========================== */

.field{display:flex;flex-direction:column;gap:6px;margin-bottom:var(--s4);}
.field > label,.label{font-size:var(--fs-label);font-weight:600;color:var(--text-2);}
.label-row{display:flex;align-items:baseline;justify-content:space-between;gap:var(--s3);}
.label-row a{font-size:11.5px;font-weight:600;color:var(--section-text);}
.hint{font-size:11.5px;line-height:17px;color:var(--text-3);}
.optional{font-weight:500;color:var(--text-3);}

.input,.field input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),.field select{
  width:100%;min-height:40px;padding:0 12px;
  font-family:inherit;font-size:13.5px;color:var(--text);
  background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r);
  transition:border-color .15s,box-shadow .15s;
}
.field select{
  appearance:none;padding-right:36px;cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,var(--text-2) 50%),
                   linear-gradient(135deg,var(--text-2) 50%,transparent 50%);
  background-position:calc(100% - 17px) 18px,calc(100% - 12px) 18px;
  background-size:5px 5px;background-repeat:no-repeat;
}
.input:focus,.field input:focus,.field select:focus{
  outline:none;border-color:var(--section-rail);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--section-rail) 20%, transparent);
}
.field input[aria-invalid="true"]{border-color:var(--bad);}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
@media (max-width:600px){.field-row{grid-template-columns:1fr;}}
.form-actions{display:flex;align-items:center;gap:var(--s3);flex-wrap:wrap;}

.pw-wrap{position:relative;}
.pw-wrap input{padding-right:64px !important;}
.pw-toggle{
  position:absolute;right:6px;top:50%;transform:translateY(-50%);
  background:none;border:none;font-size:11.5px;font-weight:700;
  color:var(--text-2);cursor:pointer;padding:6px 8px;border-radius:6px;
}
.pw-toggle:hover{background:var(--surface-sunken);color:var(--text);}
.pw-meter{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:2px;}
.pw-meter i{height:4px;border-radius:999px;background:var(--border);transition:background .25s;}
.pw-meter[data-score="1"] i:nth-child(-n+1){background:var(--bad);}
.pw-meter[data-score="2"] i:nth-child(-n+2){background:var(--warn);}
.pw-meter[data-score="3"] i:nth-child(-n+3){background:var(--ok);}
.pw-meter[data-score="4"] i{background:var(--ok);}
.pw-meter-label{font-size:11px;font-weight:700;color:var(--text-3);}

.check{display:flex;align-items:center;gap:var(--s2);cursor:pointer;font-size:13px;font-weight:500;margin-bottom:18px;}
.check input{width:16px;height:16px;margin:0;accent-color:var(--section-rail);}

.dropzone{
  position:relative;display:flex;align-items:center;gap:var(--s4);
  padding:var(--s5);border:1.5px dashed var(--border-strong);border-radius:var(--r-lg);
  background:var(--surface-sunken);transition:border-color .15s,background .15s;
}
.dropzone:hover,.dropzone.is-over{border-color:var(--section-rail);background:var(--section-bg);}
.dropzone:focus-within{border-color:var(--section-rail);box-shadow:0 0 0 3px color-mix(in srgb, var(--section-rail) 20%, transparent);}
.dropzone input[type="file"]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;}
.dropzone > .icon-lg{width:40px;height:40px;padding:10px;border-radius:50%;
  background:var(--section-bg);color:var(--section-text);}
.dropzone-text{min-width:0;}
.dropzone-text strong{display:block;font-weight:700;overflow-wrap:anywhere;}
.dropzone-text span{font-size:12px;color:var(--text-3);}
.dropzone.has-file .dropzone-text strong{color:var(--section-text);}

/* ===========================  Messages  =========================== */

.msg{
  display:flex;gap:var(--s3);align-items:flex-start;
  padding:11px 14px;border-radius:var(--r);border:1px solid;
  font-size:13px;line-height:20px;font-weight:500;
  animation:fadeIn .3s ease both;
}
.msg > .icon{margin-top:2px;}
.msg-body{flex:1;min-width:0;color:var(--text);}
.msg-body > * + *{margin-top:var(--s2);}
.msg-body ul{margin-bottom:0;padding-left:18px;}
.msg-body code{font-family:var(--font-mono);font-size:12.5px;overflow-wrap:anywhere;}
.msg-ok  {background:var(--ok-bg);  border-color:var(--ok-line);  color:var(--ok);}
.msg-bad {background:var(--bad-bg); border-color:var(--bad-line); color:var(--bad);}
.msg-warn{background:var(--warn-bg);border-color:var(--warn-line);color:var(--warn);}
.msg-info{background:var(--info-bg);border-color:var(--info-line);color:var(--info);}
.msg-ok .msg-body strong{color:var(--ok);}
.msg-bad .msg-body strong{color:var(--bad);}
.msg-warn .msg-body strong{color:var(--warn);}
.msg-info .msg-body strong{color:var(--info);}
.messages{display:grid;gap:var(--s3);margin-bottom:var(--s5);}

/* ===========================  Status badges  ===========================
   The intranet's pill badge: a glyph, a word and a colour. */

.status{
  display:inline-flex;align-items:center;gap:5px;
  font-size:11.5px;font-weight:700;letter-spacing:.01em;line-height:1;white-space:nowrap;
  padding:5px 10px 5px 8px;border-radius:999px;border:1px solid transparent;
}
.status .icon{width:12px;height:12px;stroke-width:2.2;}
.status-review{color:var(--info);background:var(--info-bg);}
.status-done  {color:var(--ok);  background:var(--ok-bg);}
.status-failed{color:var(--bad); background:var(--bad-bg);}
.status-queued{color:var(--text-2);background:var(--surface-sunken);border-color:var(--border);}
.status-live  {color:var(--live);background:var(--warn-bg);}
.status-live .dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:pulse 1.6s ease-in-out infinite;}

/* ===========================  Chrome  =========================== */

.devbar{
  display:flex;flex-wrap:wrap;gap:var(--s1) var(--s3);align-items:center;
  padding:6px 24px;font-size:11.5px;font-weight:600;line-height:16px;
  background:var(--warn-bg);color:var(--warn);border-bottom:1px solid var(--warn-line);
}
.devbar strong{font-weight:800;}
.devbar .sep{opacity:.5;}

.topbar{
  position:sticky;top:0;z-index:50;height:var(--topbar-h);
  display:flex;align-items:center;gap:18px;padding:0 24px;
  background:var(--chrome);color:var(--chrome-text);
  transition:background .25s ease,backdrop-filter .25s ease,box-shadow .25s ease;
}
/* The intranet's hairline of gold under the bar. */
.topbar::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;
  background:color-mix(in srgb, var(--gold) 35%, transparent);}
/* Glass once the page scrolls under it. */
.topbar.scrolled{
  background:color-mix(in srgb, var(--chrome) 88%, transparent);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  box-shadow:0 1px 0 rgba(0,0,0,0.12),0 6px 18px rgba(10,20,40,0.10);
}
@media (max-width:640px){.topbar{gap:var(--s3);padding:0 12px;}.brand-name{display:none;}}

.brand{display:flex;align-items:center;gap:10px;color:inherit;font-weight:700;font-size:15px;letter-spacing:-0.01em;}
.brand:hover{text-decoration:none;}
.brand-mark{
  width:28px;height:28px;border-radius:8px;flex-shrink:0;
  display:grid;place-items:center;background:var(--ink);color:var(--text-on-ink);
}
/* On the navy bar the mark is the intranet's light blue; the editor's gold
   rail is bright enough to carry it instead. */
.topbar .brand-mark{background:var(--gold);color:var(--gold-text);}
.section-workstation .topbar .brand-mark{background:var(--section-rail);color:var(--section-ink);}
.brand-mark svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;fill:none;}

.nav{display:flex;gap:2px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;}
.nav::-webkit-scrollbar{display:none;}
.nav a{
  display:flex;align-items:center;min-height:34px;padding:0 13px;border-radius:7px;
  color:var(--chrome-text-2);font-size:13px;font-weight:600;flex-shrink:0;
  transition:background .12s,color .12s;
}
.nav a:hover{background:var(--chrome-hover);color:var(--chrome-text);text-decoration:none;}
/* The active pill takes the section's colour, as on the intranet. */
.nav a[aria-current="page"]{background:var(--section-bg);color:var(--section-text);font-weight:700;}

.chrome-btn{
  display:grid;place-items:center;width:36px;height:36px;border-radius:7px;
  background:transparent;border:none;color:var(--chrome-text-2);cursor:pointer;
}
.chrome-btn:hover{background:var(--chrome-hover);color:var(--chrome-text);}
.chrome-btn .icon{width:17px;height:17px;}
[data-theme="dark"] .icon-moon,:root:not([data-theme="dark"]) .icon-sun{display:none;}

.menu{position:relative;}
.menu > summary{list-style:none;cursor:pointer;}
.menu > summary::-webkit-details-marker{display:none;}
.account-trigger{
  display:flex;align-items:center;gap:6px;height:38px;padding:0 6px 0 4px;
  border-radius:999px;color:var(--chrome-text);
}
.account-trigger:hover,.menu[open] .account-trigger{background:var(--chrome-hover);}
.avatar{
  width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
  font-size:11px;font-weight:800;background:var(--gold);color:var(--gold-text);
}
.account-trigger .icon{width:14px;height:14px;color:var(--chrome-text-2);}
.menu-panel{
  position:absolute;right:0;top:calc(100% + 8px);z-index:60;min-width:240px;
  background:var(--overlay);color:var(--text);border:1px solid var(--border);
  border-radius:var(--r-lg);box-shadow:var(--shadow-overlay);padding:6px;
  animation:fadeSlideUp .18s var(--ease) both;
}
.menu-head{padding:10px 12px 12px;border-bottom:1px solid var(--border);margin-bottom:6px;}
.menu-head .who-name{font-weight:700;overflow-wrap:anywhere;}
.menu-head .who-role{font-size:12px;color:var(--text-3);}
.menu-item{
  display:flex;align-items:center;gap:var(--s2);width:100%;min-height:36px;padding:0 12px;
  border:none;background:none;border-radius:7px;cursor:pointer;
  color:var(--text);font-size:13px;font-weight:600;text-align:left;
}
.menu-item:hover{background:var(--section-bg);color:var(--section-text);text-decoration:none;}
.menu-item .icon{color:var(--text-3);}
.menu-item small{margin-left:auto;font-family:var(--font-mono);font-size:11px;color:var(--text-3);font-weight:500;}
.menu-panel form{margin:0;}
.email-panel{width:320px;max-width:calc(100vw - 32px);padding:14px;}
.email-panel .check{margin-bottom:10px;}
.email-panel textarea{resize:vertical;min-height:64px;font:inherit;}
.mail-field{display:grid;gap:6px;}
.mail-field > label,.mail-field > .label{font-size:var(--fs-label);font-weight:600;color:var(--text-2);}
.mail-field + .mail-field{margin-top:var(--s2);}

/* ===========================  Page  =========================== */

.page{max-width:var(--content-max);margin:0 auto;padding:28px 24px 64px;animation:fadeIn .25s ease both;}
.page-narrow{max-width:620px;}
@media (max-width:700px){.page{padding:20px 16px 40px;}}

.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--s4);
  flex-wrap:wrap;margin-bottom:22px;}
.page-head h1{font-size:23px;line-height:29px;font-weight:800;letter-spacing:-0.015em;}
.page-head .lede{font-size:13px;color:var(--text-2);margin-top:5px;}
.page-actions{display:flex;gap:var(--s2);align-items:center;flex-wrap:wrap;}

/* The intranet's breadcrumb: small, monospaced, muted. */
.crumbs{display:flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:11px;letter-spacing:.01em;color:var(--text-3);margin-bottom:8px;}
.crumbs a{color:var(--section-text);}
.crumbs .icon{width:12px;height:12px;}

.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow-sm);}
.panel + .panel{margin-top:var(--s5);}
.panel-pad{padding:22px;}
@media (max-width:640px){.panel-pad{padding:var(--s4);}}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);
  padding:16px 22px;border-bottom:1px solid var(--border);}
.panel-head h2{font-size:var(--fs-h3);line-height:var(--lh-h3);font-weight:700;}
.panel-foot{display:flex;align-items:center;gap:var(--s3);flex-wrap:wrap;
  padding:14px 22px;border-top:1px solid var(--border);background:var(--surface-sunken);
  border-radius:0 0 var(--r-lg) var(--r-lg);}
.eyebrow{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-3);}
.after-eyebrow{margin-top:var(--s2);}

/* ===========================  Stat cards  ===========================
   The intranet's stat card, used here as the list filters: the counts are
   real, and choosing one filters the table beneath it. */

.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-bottom:var(--s5);}
.stat{
  position:relative;overflow:hidden;display:flex;flex-direction:column;align-items:flex-start;gap:8px;
  padding:15px 16px 14px;text-align:left;cursor:pointer;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);color:var(--text-2);
  font-size:11.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background .15s ease;
}
/* One quiet rail across the top, as on the intranet; only a failure count is
   coloured, because it is the one that asks for action. */
.stat{border-radius:var(--r);}
.stat::before{content:"";position:absolute;top:0;left:0;right:0;height:2px;
  background:color-mix(in srgb, var(--section-rail) 55%, transparent);}
.stat:hover{transform:translateY(-2px);box-shadow:var(--shadow-md);}
.stat .count{font-family:var(--font-mono);font-size:24px;line-height:1;font-weight:600;
  letter-spacing:-0.01em;text-transform:none;color:var(--text);}
.stat[aria-pressed="true"]{border-color:var(--section-rail);background:var(--section-bg);
  box-shadow:0 0 0 1px var(--section-rail),var(--shadow-md);color:var(--section-text);}
.stat[aria-pressed="true"]::before{background:var(--section-rail);}
.stat.tone-bad .count{color:var(--bad);}

/* ===========================  Lists  =========================== */

.toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);
  flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--border);}
.toolbar-title{font-size:var(--fs-h3);font-weight:700;}

.search{position:relative;width:280px;max-width:100%;}
.search .icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--text-3);pointer-events:none;}
.search input{
  width:100%;min-height:36px;padding:0 12px 0 34px;font-family:inherit;font-size:13px;
  color:var(--text);background:var(--surface-sunken);border:1px solid var(--border);border-radius:999px;
}
.search input:focus{outline:none;background:var(--surface);border-color:var(--section-rail);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--section-rail) 20%, transparent);}
@media (max-width:700px){.search{width:100%;}}

.table-wrap{overflow-x:auto;}
.table{width:100%;border-collapse:collapse;font-size:13px;}
.table th{
  text-align:left;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;
  color:var(--text-3);font-weight:700;padding:10px 16px;border-bottom:1px solid var(--border);white-space:nowrap;
}
.table td{padding:12px 16px;border-bottom:1px solid var(--border);vertical-align:middle;}
.table tbody tr:last-child td{border-bottom:none;}
.table tbody tr{position:relative;transition:background .12s;}
.table tbody tr:hover{background:var(--surface-sunken);}
.table .r{text-align:right;}
.table .num{font-family:var(--font-mono);font-size:12.5px;color:var(--text-2);white-space:nowrap;}
.table .when{color:var(--text-2);white-space:nowrap;font-size:12.5px;}
.row-link{font-weight:700;color:var(--text);}
.row-link::after{content:"";position:absolute;inset:0;}
.row-link:hover{text-decoration:none;}
.table tbody tr:hover .row-link{color:var(--section-text);}
.row-link:focus-visible{outline:none;}
.row-link:focus-visible::after{outline:2px solid var(--focus);outline-offset:-2px;border-radius:var(--r);}
.sub{display:block;font-size:11.5px;color:var(--text-3);margin-top:3px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46ch;}
.cell-title{min-width:220px;}
.cell-owner{color:var(--text-2);overflow-wrap:anywhere;}
@media (max-width:760px){.table .hide-sm{display:none;}.sub{max-width:28ch;}}
@media (max-width:560px){.table .hide-xs{display:none;}}
.no-results{padding:var(--s10) var(--s6);text-align:center;color:var(--text-2);}

.empty{padding:48px 20px;text-align:center;color:var(--text-2);}
.empty > .icon{width:56px;height:56px;padding:16px;margin:0 auto 16px;border-radius:50%;
  background:var(--section-bg);color:var(--section-text);stroke-width:1.6;}
.empty h2{font-size:15.5px;line-height:22px;font-weight:800;color:var(--text);margin-bottom:6px;}
.empty p{max-width:46ch;margin:0 auto;font-size:13px;}
.empty .btn{margin-top:var(--s5);}

.drawer{margin-bottom:var(--s5);animation:fadeSlideUp .3s var(--ease) both;}
.drawer form{max-width:760px;}
.page-actions .btn[aria-expanded="true"]{display:none;}
.advanced{margin:var(--s4) 0;}
.advanced > summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;
  font-size:12.5px;font-weight:700;color:var(--section-text);}
.advanced > summary::-webkit-details-marker{display:none;}
.advanced > summary .icon{width:14px;height:14px;transition:transform .15s;}
.advanced[open] > summary .icon{transform:rotate(90deg);}
.advanced[open] > summary{margin-bottom:var(--s4);}
.advanced .field{margin-bottom:0;}
.progress{height:6px;border-radius:999px;background:var(--surface-sunken);overflow:hidden;}
.progress > i{display:block;height:100%;width:0;background:var(--section-rail);transition:width .2s linear;}
.progress.indeterminate > i{width:40%;animation:sweep 1.4s var(--ease) infinite;}
.upload-progress{margin-bottom:var(--s4);}
.upload-status{display:flex;justify-content:space-between;gap:var(--s3);font-size:12px;font-weight:600;color:var(--text-2);margin-bottom:6px;}

/* ===========================  The editor  =========================== */

.editor-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--s4);align-items:end;margin-bottom:22px;}
@media (max-width:760px){.editor-head{grid-template-columns:1fr;}}
.editor-head h1{font-size:21px;line-height:27px;font-weight:800;letter-spacing:-0.015em;overflow-wrap:anywhere;}
.meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:8px;color:var(--text-2);font-size:12.5px;}
.meta > span{display:inline-flex;align-items:center;gap:6px;}
.meta .icon{width:13px;height:13px;color:var(--text-3);}

.editor{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px;align-items:start;}
@media (max-width:1000px){.editor{grid-template-columns:1fr;}}

.section-title{font-size:11.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-2);margin:0 0 12px;}

/* Speaker bubbles, as on the intranet workstation: the speaker's colour as a
   rail, a tint and the avatar; the initials as the channel that survives
   colour-vision deficiency and a ninth speaker. */
.transcript{display:grid;gap:10px;}
.turn{
  position:relative;display:grid;grid-template-columns:34px minmax(0,1fr);gap:12px;
  padding:12px 16px 12px 14px;
  border:1px solid var(--border);border-left:3px solid var(--sp, var(--section-rail));
  border-radius:var(--r-lg);
  background:color-mix(in srgb, var(--sp, var(--section-rail)) 6%, var(--surface));
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease;
  scroll-margin-top:calc(var(--topbar-h) + 24px);scroll-margin-bottom:120px;
}
.turn:hover{box-shadow:var(--shadow-md);}
.turn.is-active{
  background:color-mix(in srgb, var(--sp, var(--section-rail)) 14%, var(--surface));
  border-color:color-mix(in srgb, var(--sp, var(--section-rail)) 45%, transparent);
  border-left-color:var(--sp, var(--section-rail));
}
.turn.is-flash{box-shadow:0 0 0 3px color-mix(in srgb, var(--warn) 45%, transparent);}
.turn:has(.speaker-pick[open]){z-index:5;}

.initials{
  width:24px;height:24px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;
  font-size:10px;font-weight:800;letter-spacing:.02em;
  color:color-mix(in srgb, var(--sp, var(--text-2)) 72%, var(--text));
  background:color-mix(in srgb, var(--sp, var(--text-2)) 20%, var(--surface));
  border:1px solid color-mix(in srgb, var(--sp, var(--text-2)) 45%, transparent);
}
.turn-avatar{width:34px;height:34px;font-size:11.5px;margin-top:2px;}

.turn-head{display:flex;align-items:center;gap:6px 10px;flex-wrap:wrap;margin-bottom:4px;min-width:0;}
.speaker{font-size:12.5px;font-weight:800;color:color-mix(in srgb, var(--sp, var(--text)) 70%, var(--text));
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* Not allowed to shrink: in a flex row it otherwise ellipsises names that
   have plenty of room. Very long names still stop at 28 characters. */
.speaker-pick{flex:none;}
.speaker-pick > summary.who-line{width:max-content;}
.turn-head .speaker{overflow:visible;text-overflow:clip;}
.speaker-pick > summary.who-line{display:flex;align-items:center;gap:4px;padding:2px 6px;margin-left:-6px;
  border-radius:6px;max-width:100%;}
.speaker-pick > summary.who-line:hover,.speaker-pick[open] > summary.who-line{
  background:color-mix(in srgb, var(--sp, var(--section-rail)) 14%, transparent);}
.speaker-pick > summary .icon{width:12px;height:12px;color:var(--text-3);}
.pick-panel{left:-6px;right:auto;width:270px;padding:12px;display:grid;gap:var(--s2);}
.pick-list{margin:0 0 var(--s2);padding:0;border:none;display:grid;gap:2px;}
.pick-list legend{margin-bottom:var(--s2);}
.pick{display:flex;align-items:center;gap:var(--s2);min-height:34px;padding:0 8px;border-radius:7px;cursor:pointer;}
.pick:hover{background:var(--surface-sunken);}
.pick:has(input:checked){background:color-mix(in srgb, var(--sp) 14%, var(--surface));}
.pick input{margin:0;accent-color:var(--sp);}
.pick-panel .inline-form .input{min-width:0;min-height:32px;font-size:13px;}

.timecode{
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:11px;
  display:inline-flex;align-items:center;gap:5px;min-height:22px;padding:0 7px;
  border:none;border-radius:999px;background:transparent;color:var(--text-3);cursor:pointer;
}
.timecode .icon{width:9px;height:9px;fill:currentColor;stroke:none;}
.timecode:hover,.timecode:focus-visible{background:color-mix(in srgb, var(--sp, var(--section-rail)) 16%, transparent);color:var(--text);}
.turn.is-active .timecode{color:var(--text);}

.unsure{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:700;
  padding:3px 8px;border-radius:999px;background:var(--warn-bg);color:var(--warn);}
.unsure .icon{width:11px;height:11px;stroke-width:2.2;}

.said{min-width:0;}
.turn-main{min-width:0;}
.turn-body{
  font-family:var(--font-read);font-size:var(--fs-read);line-height:var(--lh-read);font-weight:500;
  color:var(--text);margin:0 -6px;padding:2px 6px;border-radius:6px;
  overflow-wrap:anywhere;white-space:pre-wrap;transition:background .15s,box-shadow .15s;
}
.turn-body[contenteditable]:hover{background:color-mix(in srgb, var(--surface) 60%, transparent);cursor:text;}
.turn-body[contenteditable]:focus{outline:none;background:var(--surface);
  box-shadow:0 0 0 1px var(--border-strong),0 0 0 4px color-mix(in srgb, var(--section-rail) 22%, transparent);}
/* Low confidence: tint AND a dotted rule AND a word. */
.turn.is-unsure .turn-body{
  text-decoration:underline dotted var(--warn);text-decoration-thickness:2px;text-underline-offset:5px;
}
.turn.is-unsure .turn-body:focus{text-decoration:none;}

.save-state{min-height:18px;margin-top:4px;font-size:11.5px;font-weight:600;color:var(--text-3);display:flex;align-items:center;gap:6px;}
.save-state:empty{margin-top:0;min-height:0;}
.save-state[data-state="saved"]{color:var(--ok);}
.save-state[data-state="error"]{color:var(--bad);}
.save-state .btn{min-height:24px;font-size:11.5px;}

/* The review rail. */
.rail{position:sticky;top:calc(var(--topbar-h) + 22px);display:grid;gap:14px;}
@media (max-width:1000px){.rail{position:static;}}
.rail.panel{display:block;}
.rail-section{padding:16px 18px;}
.rail-section + .rail-section{border-top:1px solid var(--border);}
.rail-section h2{font-size:var(--fs-h3);font-weight:700;margin-bottom:12px;display:flex;justify-content:space-between;align-items:baseline;}
.figure{display:flex;align-items:baseline;gap:var(--s2);}
.figure strong{font-family:var(--font-mono);font-size:23px;font-weight:600;letter-spacing:-.01em;}
.figure span{color:var(--text-2);font-size:12.5px;}
.meter{height:6px;border-radius:999px;background:var(--surface-sunken);overflow:hidden;margin:10px 0 12px;}
.meter > i{display:block;height:100%;background:var(--ok);border-radius:999px;}
.rail p{font-size:12px;line-height:18px;color:var(--text-2);}
.rail .btn{margin-top:var(--s3);}
.speakers{list-style:none;margin:0;padding:0;display:grid;gap:8px;}
.speakers li{display:flex;align-items:center;flex-wrap:wrap;gap:var(--s2);font-size:13px;min-width:0;}
.speakers .name{font-weight:800;font-size:12.5px;color:color-mix(in srgb, var(--sp) 70%, var(--text));
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.speakers .n{margin-left:auto;font-family:var(--font-mono);font-size:11.5px;color:var(--text-3);white-space:nowrap;}
.speakers .rename{margin-left:var(--s1);}
.speakers .rename > summary{list-style:none;min-height:24px;padding:0 8px;font-size:11.5px;}
.speakers .rename > summary::-webkit-details-marker{display:none;}
.speakers .rename[open]{flex-basis:100%;margin-left:32px;}
.speakers .rename[open] > summary{display:none;}
.speakers .rename .input{min-width:0;min-height:32px;font-size:13px;}
.rail .note{margin-top:var(--s3);font-size:11.5px;color:var(--text-3);}

/* The transport, as on the intranet workstation: back, play in the section
   colour, forward, a seekable line and the time. The native player stays
   underneath for anyone without JavaScript. */
.dock{position:fixed;left:0;right:0;bottom:0;z-index:40;
  background:color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  box-shadow:var(--shadow-dock);}
.has-dock main{padding-bottom:84px;}
.dock-inner{max-width:var(--content-max);margin:0 auto;padding:12px 24px;display:flex;align-items:center;gap:18px;}
.dock-now{min-width:0;flex:0 1 220px;}
.dock-now .eyebrow{display:block;margin-bottom:2px;}
.dock-now .now{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.dock-now .now .tc{font-weight:500;color:var(--text-2);margin-left:6px;}
.dock audio{flex:1;min-width:0;height:40px;}
.transport-btns{display:flex;align-items:center;gap:6px;flex-shrink:0;}
.t-btn{width:34px;height:34px;border-radius:8px;border:1px solid var(--border-strong);
  background:var(--surface);color:var(--text-2);cursor:pointer;display:grid;place-items:center;
  transition:background .12s,color .12s,transform .12s;}
.t-btn:hover{background:var(--surface-sunken);color:var(--text);}
.t-btn:active{transform:scale(.95);}
.t-btn .icon{width:15px;height:15px;}
.t-play{width:42px;height:42px;background:var(--section-rail);border-color:var(--section-rail);color:var(--section-ink);}
.t-play:hover{background:color-mix(in srgb, var(--section-rail) 88%, white);color:var(--section-ink);}
.t-play .icon{width:16px;height:16px;fill:currentColor;stroke:none;}
.t-track{flex:1;min-width:0;display:flex;align-items:center;}
.t-seek{width:100%;height:28px;margin:0;background:transparent;cursor:pointer;
  -webkit-appearance:none;appearance:none;--pct:0%;}
.t-seek::-webkit-slider-runnable-track{height:6px;border-radius:999px;
  background:linear-gradient(90deg,var(--section-rail) var(--pct),var(--surface-sunken) var(--pct));
  border:1px solid var(--border);}
.t-seek::-moz-range-track{height:6px;border-radius:999px;background:var(--surface-sunken);border:1px solid var(--border);}
.t-seek::-moz-range-progress{height:6px;border-radius:999px;background:var(--section-rail);}
.t-seek::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;margin-top:-5px;border-radius:50%;
  background:var(--section-rail);border:2px solid var(--surface);box-shadow:0 0 0 1px var(--section-rail);}
.t-seek::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:var(--section-rail);border:2px solid var(--surface);}
.t-time{font-size:12.5px;font-weight:600;flex-shrink:0;}
.t-time .sep{color:var(--text-3);font-weight:400;margin:0 3px;}
.t-time .total{color:var(--text-3);}
@media (max-width:760px){.dock-now{display:none;}.dock-inner{padding:10px 12px;gap:10px;}.t-time .total,.t-time .sep{display:none;}}

.working{padding:48px 24px;text-align:center;}
.working h2{font-size:16px;font-weight:800;margin-bottom:6px;}
.working p{color:var(--text-2);max-width:50ch;margin:0 auto;font-size:13px;}
.working .progress{max-width:280px;margin:24px auto 0;}

/* ===========================  Signed-out pages  ===========================
   The intranet's standalone card: centred, brand, heading, one task. */

/* Sign-in: a slate brand panel on the left, the card on the right with a
   gradient stripe along its top. */
body.auth-page{display:flex;flex-direction:column;}
.auth{flex:1;display:grid;grid-template-columns:minmax(320px,1.05fr) minmax(340px,.95fr);min-height:100vh;}
@media (max-width:900px){.auth{grid-template-columns:1fr;}.auth-brand-panel{display:none;}}
.auth-brand-panel{
  position:relative;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--text-on-ink);padding:48px 32px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0) 0 0/22px 22px,
    radial-gradient(circle at 28% 32%, rgba(45,212,191,0.26) 0%, transparent 42%),
    radial-gradient(circle at 74% 64%, rgba(14,165,233,0.22) 0%, transparent 44%),
    radial-gradient(circle at 40% 86%, rgba(245,158,11,0.12) 0%, transparent 40%),
    linear-gradient(155deg, #020617 0%, #0F2A33 52%, #042F2E 100%);
}
.auth-hero{display:flex;flex-direction:column;align-items:center;text-align:center;animation:fadeSlideUp .7s var(--ease) both;}
.wordmark-mark{display:grid;place-items:center;width:76px;height:76px;border-radius:22px;
  background:linear-gradient(160deg, rgba(45,212,191,0.22), rgba(14,165,233,0.10));
  border:1px solid rgba(94,234,212,0.30);box-shadow:0 0 60px rgba(45,212,191,0.25);}
.wordmark-mark svg{width:40px;height:40px;stroke:#5EEAD4;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none;}
.wordmark{margin-top:20px;font-size:38px;line-height:1;font-weight:800;letter-spacing:-0.03em;color:var(--text-on-ink);}
.wordmark b{font-weight:800;color:#5EEAD4;}
.tagline{margin-top:12px;font-size:15px;font-weight:500;color:var(--text-on-ink-dim);}
/* A waveform that breathes, bar by bar. Decorative, and still under reduced motion. */
.auth-wave{display:flex;align-items:center;gap:4px;height:56px;margin-top:34px;}
.auth-wave i{display:block;width:4px;border-radius:2px;background:linear-gradient(180deg,#5EEAD4,#0EA5E9);
  opacity:.75;height:var(--h);animation:breathe-bar 1.8s ease-in-out infinite;
  animation-delay:calc(var(--i) * -0.11s);}
@keyframes breathe-bar{0%,100%{transform:scaleY(.45);}50%{transform:scaleY(1);}}
.brand-name b{font-weight:800;color:var(--gold);}
/* Leading icons in sign-in fields. */
.input-icon{position:relative;}
.input-icon > .icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-3);pointer-events:none;z-index:1;}
.input-icon input{padding-left:38px !important;}
.auth-chips{position:absolute;left:0;right:0;bottom:32px;display:flex;flex-direction:column;align-items:center;gap:14px;padding:0 24px;}
.auth-chips .row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;}
.auth-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;
  font-size:11.5px;font-weight:700;color:var(--text-on-ink);
  background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.14);backdrop-filter:blur(6px);}
.auth-chip .icon{width:12px;height:12px;color:#5EEAD4;}
.auth-chips .caption{font-size:13.5px;color:var(--text-on-ink);opacity:.85;}

.auth-side{position:relative;display:flex;flex-direction:column;background:var(--bg);}
.auth-top{display:flex;align-items:center;justify-content:flex-end;padding:18px;}
.auth-main{flex:1;display:grid;justify-items:center;align-content:start;padding:16px 24px 32px;}
@media (min-height:760px){.auth-main{padding-top:6vh;}}
.auth-card{
  position:relative;width:100%;max-width:400px;overflow:hidden;
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  box-shadow:0 20px 50px rgba(14,34,56,0.10),var(--shadow-md);padding:34px 34px 30px;
  animation:fadeSlideUp .5s var(--ease) both;
}
.auth-card::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;
  background:linear-gradient(90deg, #2DD4BF, #0EA5E9, #F59E0B);}
.auth-brand{display:inline-grid;place-items:center;width:46px;height:46px;border-radius:12px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--primary) 85%, white), var(--primary));margin-bottom:18px;
  box-shadow:0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent);}
[data-theme="dark"] .auth-brand{background:#0F766E;}
.auth-brand svg{width:22px;height:22px;stroke:var(--text-on-ink);stroke-width:2.2;stroke-linecap:round;fill:none;}
.auth-brand:hover{text-decoration:none;}
.auth-card h1{font-size:23px;line-height:29px;font-weight:800;letter-spacing:-0.02em;}
.auth-card .lede{font-size:13px;color:var(--text-2);line-height:1.55;margin-top:6px;}
.auth-card .msg{margin-top:16px;}
.auth-card form{margin-top:22px;}
.auth-card .after{margin-top:16px;}
.auth-alt{margin-top:18px;padding-top:16px;border-top:1px solid var(--border);
  font-size:12.5px;color:var(--text-2);text-align:center;}
.auth-alt a{font-weight:700;color:var(--section-text);}
.auth-foot{padding:0 24px 24px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-3);
  display:flex;gap:6px;align-items:center;justify-content:center;text-align:center;}
.auth-foot .icon{width:13px;height:13px;}
.theme-btn{
  width:36px;height:36px;border-radius:8px;display:grid;place-items:center;
  background:var(--surface);border:1px solid var(--border);color:var(--text-2);cursor:pointer;box-shadow:var(--shadow-sm);
}
.theme-btn:hover{background:var(--surface-sunken);color:var(--text);}
.theme-btn .icon{width:17px;height:17px;}

/* ===========================  Administration  =========================== */

.setting{display:grid;grid-template-columns:260px minmax(0,1fr);gap:var(--s6);padding:20px 22px;}
.setting + .setting{border-top:1px solid var(--border);}
@media (max-width:760px){.setting{grid-template-columns:1fr;gap:var(--s3);padding:var(--s4);}}
.setting-name h3{font-size:14px;font-weight:700;}
.setting-name p{font-size:12px;line-height:18px;color:var(--text-3);margin-top:4px;}
.setting-body{min-width:0;display:grid;gap:var(--s3);align-content:start;}
.source{font-size:12px;color:var(--text-3);}
.value-line{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;font-size:13px;font-weight:600;}
.value-line .icon{color:var(--ok);}
.value-line.is-off .icon{color:var(--text-3);}

.inline-form{display:flex;gap:var(--s2);flex-wrap:wrap;align-items:center;margin:0;}
.inline-form .input{flex:1;min-width:200px;}
.inline-form select.input{flex:0 1 auto;min-width:150px;min-height:32px;font-size:12.5px;padding-right:30px;
  appearance:none;cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,var(--text-2) 50%),
                   linear-gradient(135deg,var(--text-2) 50%,transparent 50%);
  background-position:calc(100% - 15px) 14px,calc(100% - 10px) 14px;background-size:5px 5px;background-repeat:no-repeat;}
.inline-form.end{justify-content:flex-end;}
.row-actions{display:flex;gap:var(--s1);justify-content:flex-end;flex-wrap:wrap;}

.options{display:grid;gap:var(--s2);margin:0;padding:0;border:none;}
.option{display:grid;grid-template-columns:auto 1fr;gap:2px var(--s3);align-items:start;
  padding:12px 16px;border:1px solid var(--border);border-radius:var(--r);cursor:pointer;background:var(--surface);
  transition:border-color .15s,background .15s,box-shadow .15s;}
.option:hover{border-color:var(--border-strong);box-shadow:var(--shadow-md);}
.option:has(input:checked){border-color:var(--section-rail);background:var(--section-bg);}
.option:has(input:focus-visible){outline:2px solid var(--focus);outline-offset:2px;}
.option input{grid-row:span 2;margin:3px 0 0;width:16px;height:16px;accent-color:var(--section-rail);}
.option strong{font-weight:700;font-size:13px;}
.option span{font-size:12px;color:var(--text-2);}
.options-row{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));}
.options + .form-actions{margin-top:var(--s3);}

.checks{list-style:none;margin:0;padding:0;display:grid;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);}
.checks li{display:grid;grid-template-columns:20px minmax(0,1fr);gap:var(--s3);padding:12px 14px;font-size:12.5px;}
.checks li + li{border-top:1px solid var(--border);}
.checks .icon{margin-top:2px;stroke-width:2.2;}
.checks .ok .icon{color:var(--ok);}
.checks .no .icon{color:var(--bad);}
.checks strong{display:block;font-weight:700;overflow-wrap:anywhere;}
.checks span{color:var(--text-2);}

.steps{margin:0;padding-left:20px;display:grid;gap:var(--s2);font-size:13px;color:var(--text-2);}
.steps code{font-family:var(--font-mono);font-size:12px;}
.help > summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;
  font-size:12.5px;font-weight:700;color:var(--section-text);}
.help > summary::-webkit-details-marker{display:none;}
.help > summary .icon{width:14px;height:14px;transition:transform .15s;}
.help[open] > summary .icon{transform:rotate(90deg);}
.help[open] > summary{margin-bottom:var(--s3);}

.you{font-size:10.5px;font-weight:700;color:var(--section-text);background:var(--section-bg);
  padding:2px 7px;border-radius:999px;margin-left:6px;}
.muted{color:var(--text-3);}
.page-note{margin-top:var(--s4);}
.secret-box{display:flex;align-items:center;gap:var(--s3);flex-wrap:wrap;
  padding:16px;border:1.5px dashed var(--border-strong);border-radius:var(--r);background:var(--surface-sunken);}
.secret-box code{font-family:var(--font-mono);font-size:20px;letter-spacing:.02em;user-select:all;overflow-wrap:anywhere;flex:1;}
.notes{margin-top:var(--s5);}

/* ===========================  Toasts  =========================== */

#toastRegion{position:fixed;bottom:18px;right:18px;z-index:200;display:flex;flex-direction:column;gap:8px;max-width:340px;}
.has-dock #toastRegion{bottom:96px;}
.toast{
  background:var(--surface);color:var(--text);border:1px solid var(--border-strong);
  border-left:3px solid var(--ok);border-radius:9px;padding:11px 14px;box-shadow:var(--shadow-overlay);
  font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px;
  animation:fadeSlideUp .2s ease both;
}
.toast.danger{border-left-color:var(--bad);}
