/* ============================================================
   AccentCoach — Agency Portal (v1.64.0)

   Layers on admin.css rather than restating it: the gate, the cards, the
   pills and the buttons are the panel's, because this IS a panel — a smaller
   one, for somebody with a narrower job. Only what is genuinely different
   lives here.
   ============================================================ */

/* THE CHECKING STATE (v1.99.121). admin.css hides #gate and shows #bootNote
   under body.booting; the portal is this page's own, so it is hidden here.
   !important because agency.js writes its display inline. boot() removes the
   class on every outcome, so the page cannot stay here. */
body.booting #portal{display:none !important;}
#portal{display:none;max-width:1100px;margin:0 auto;padding:0 clamp(16px,4vw,32px) 80px;}

.ag-top{
  display:flex;align-items:center;gap:18px;flex-wrap:wrap;
  padding:18px 0 16px;border-bottom:1px solid var(--edge);margin-bottom:22px;
}
.ag-brand{display:flex;align-items:center;gap:11px;}
.ag-brand .brand-mark{width:34px;height:34px;}
.ag-name{font-family:var(--font-display);font-weight:900;font-size:18px;line-height:1.1;}
.ag-sub{font-family:var(--font-mono);font-size:9.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--ink-3);}
.ag-tabs{display:flex;gap:4px;flex:1;flex-wrap:wrap;}
.ag-tab{
  border:none;background:none;cursor:pointer;font-family:inherit;
  font-size:14px;font-weight:600;color:var(--ink-2);
  padding:8px 14px;border-radius:99px;
}
.ag-tab:hover{background:var(--bg-2);color:var(--ink);}
.ag-tab.active{background:var(--teal-dim);color:var(--teal-d);}

/* The pause banner. It carries a WORD, never colour alone — the rule the
   report and the Sentinel feed both follow. */
.ag-banner{
  padding:14px 16px;margin:0 0 22px;
  border:1px solid var(--amber);border-left-width:4px;
  background:var(--amber-dim);border-radius:var(--r-sm);font-size:14px;
}

/* The content column. It carried no rule at all until v1.74.0 — harmless,
   because #portal already constrains the width, but a class that styles
   nothing is indistinguishable from one that was meant to and failed. */
.ag-main{display:block;}

.ag-view{display:none;}
.ag-view.active{display:block;}
/* THE PAGE HEADER IS THE PANEL'S (v1.74.0).

   Every view here was a bare <h1> while the operator's panel has carried
   .page-head — eyebrow, title, subtitle and a teal-to-violet rule — since
   long before this portal existed. admin.css is already loaded on this page,
   so adopting it costs nothing and is most of the difference between "a tool
   somebody made quickly" and the Command Center next door.

   .ag-head is kept because the gate and the banner still use it. */
.ag-head{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;margin-bottom:16px;}
.ag-head h1{font-size:clamp(24px,3vw,32px);}
/* The allowance readout sits with the title rather than under it, and stays
   legible when the row wraps on a narrow window. */
.page-head-row .ag-allow{align-self:flex-end;text-align:right;padding-bottom:2px;}
.ag-allow{font-family:var(--font-mono);font-size:12px;color:var(--ink-2);}
.ag-over{color:var(--red);}

.ag-form{padding:18px 20px;margin-bottom:20px;}
.ag-form-title{font-family:var(--font-display);font-size:17px;margin:0 0 12px;}
.ag-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.ag-input{
  flex:1 1 190px;min-width:150px;padding:10px 12px;
  border:1px solid var(--edge);border-radius:var(--r-sm);
  background:var(--bg-3);color:var(--ink);font-family:inherit;font-size:14px;
}
.ag-narrow{flex:0 0 110px;min-width:90px;}
.ag-hint{font-size:12.5px;color:var(--ink-3);margin:10px 0 0;line-height:1.5;}
.ag-privacy{margin-top:22px;border-top:1px solid var(--edge);padding-top:12px;}

.ag-item{
  display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  padding:14px 16px;margin-bottom:9px;
}
.ag-item-main{flex:1;min-width:200px;}
.ag-item-sub{font-size:12.5px;color:var(--ink-3);margin-top:3px;}
.ag-item-actions{display:flex;gap:7px;flex-wrap:wrap;}
.ag-item.is-suspended,.ag-item.is-spent{opacity:.62;}
.ag-code{font-family:var(--font-mono);font-size:15px;letter-spacing:.06em;}
.ag-empty{color:var(--ink-3);font-size:14px;padding:14px 2px;}
/* v1.99.117 — "Your learners' address", top of the Overview. */
.ag-address{padding:16px 20px;margin-bottom:16px;}
.ag-address-line{margin:0;font-size:14px;color:var(--ink-2);line-height:1.6;}
.ag-address-url{font-weight:700;color:var(--ink);word-break:break-all;}
/* v1.99.205 — Copy beside the address, and the welcome message on Learners.
   Copying changes nothing, so a paused agency can still copy (the read-only
   rule below greys every button inside an .ag-form; this lifts it for Copy). */
.ag-copy{margin-left:6px;vertical-align:middle;}
.ag-row .ag-copy{margin-left:0;}
.ag-copy-msg{display:inline-block;margin:0 0 0 8px;min-height:0;vertical-align:middle;}
.ag-welcome{padding:18px 20px;margin-bottom:20px;}
.ag-welcome-lead{margin:0 0 12px;}
.ag-welcome-note{margin:0 0 10px;font-size:14px;font-weight:600;color:var(--ink-2);}
.ag-welcome-text{
  display:block;width:100%;max-width:100%;box-sizing:border-box;min-height:220px;margin:0 0 12px;
  font-size:13.5px;line-height:1.5;resize:vertical;white-space:pre-wrap;overflow-wrap:break-word;
  /* v1.99.207 — editable: a comfortable height that scrolls inside itself. */
  height:340px;max-height:70vh;overflow-y:auto;overflow-x:hidden;
}
.ag-welcome-label{display:block;margin:0 0 6px;font-family:inherit;font-size:13.5px;font-weight:600;color:var(--ink-2);text-transform:none;letter-spacing:normal;}
/* A phone: 16px text, or iPhone zooms the page when the box is tapped;
   a little shorter so Copy and Reset stay near it. */
@media (max-width:700px){
  .ag-welcome{padding:16px 14px;}
  .ag-welcome-text{font-size:16px;height:300px;max-height:60vh;}
}
.ag-where{color:var(--ink);word-break:break-all;}
/* v1.99.119 — asking for a name. */
.ag-req-line{margin:12px 0 6px;font-size:14px;color:var(--ink-2);line-height:1.6;}
.ag-req-no{color:var(--red);}
.ag-req-row{align-items:center;margin-top:12px;}
.ag-req-base{font-family:var(--font-mono);font-size:13px;color:var(--ink-3);white-space:nowrap;}

/* Freshly generated codes, shown large because they are about to be copied
   onto paper or into an email — the recovery-code treatment. */
.ag-fresh{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:8px;margin-top:14px;
}
.ag-fresh code{
  display:block;padding:11px 12px;text-align:center;
  font-family:var(--font-mono);font-size:15px;letter-spacing:.08em;
  background:var(--bg);border:1px dashed var(--edge-2);border-radius:var(--r-sm);
}

/* .ag-kpis / .ag-kpi / .ag-kpi-label / .ag-kpi-value were this portal's own
   KPI card, replaced by admin.css's .kpi in v1.73.0 (Overview) and v1.74.3
   (Usage). Nothing emits them now. Removed rather than left: dead CSS is
   invisible to tests/css-classes.js, which asks whether every class EMITTED is
   defined and never the reverse — so a stylesheet is exactly where unused
   rules accumulate unnoticed. */
.ag-h2{font-family:var(--font-display);font-size:19px;margin:28px 0 12px;}
.ag-table{width:100%;border-collapse:collapse;font-size:14px;}
.ag-table th,.ag-table td{border-bottom:1px solid var(--edge);padding:9px 10px;text-align:left;}
.ag-table th{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);}
.ag-table tr.is-suspended{opacity:.6;}
.ag-table td{font-variant-numeric:tabular-nums;}
.ag-sounds{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;}
.ag-sound{
  padding:12px;border:1px solid var(--edge);border-radius:var(--r-sm);background:var(--bg-2);
}
.ag-sound b{font-family:var(--font-mono);display:block;}
.ag-sound span{font-family:var(--font-display);font-weight:900;font-size:22px;display:block;margin-top:2px;}
.ag-sound small{color:var(--ink-3);font-size:11px;}

/* A paused agency is not invited to fill in a form that will be refused. The
   server refuses it regardless — this is courtesy, not the boundary. */
body.is-readonly .ag-form button,
body.is-readonly .ag-form input,
body.is-readonly .ag-form select,
body.is-readonly .ag-item-actions button{
  opacity:.5;pointer-events:none;
}
body.is-readonly .ag-form button.ag-copy{opacity:1;pointer-events:auto;}

@media(max-width:700px){
  .ag-top{gap:12px;}
  .ag-item{align-items:flex-start;}
}
.ag-field-grid{display:grid;grid-template-columns:190px 1fr;gap:10px 14px;align-items:center;margin-bottom:14px;}
.ag-field-grid label{font-size:13px;color:var(--ink-2);}
.ag-optional{font-family:var(--font-mono);font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-3);}
.ag-readout{font-size:13.5px;color:var(--ink-2);}
@media(max-width:640px){ .ag-field-grid{grid-template-columns:1fr;gap:4px;} }
.ag-inline{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.ag-inline .ag-readout{font-size:12.5px;color:var(--ink-3);}

/* ---- overview ---- */
.ov-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:12px;margin-bottom:12px;}
.ov-panel{padding:18px 20px;}
.ov-panel .ag-h2{margin-top:0;}
.ov-note{padding:14px 16px;margin-bottom:14px;border-left:3px solid var(--teal);font-size:14px;}
.ov-note.is-warn{border-left-color:var(--amber);background:var(--amber-dim);}
.ov-note.is-bad{border-left-color:var(--red);background:var(--red-dim);}
.ov-meter{margin-bottom:14px;}
.ov-meter-top{display:flex;justify-content:space-between;font-size:13px;margin-bottom:5px;}
.ov-meter-top b{font-variant-numeric:tabular-nums;}
.ov-bar{height:7px;border-radius:99px;background:var(--bg);overflow:hidden;}
.ov-bar-fill{height:100%;background:var(--teal);border-radius:99px;transition:width .3s var(--ease);}
.ov-bar-fill.is-high{background:var(--amber);}
.ov-bar-fill.is-over{background:var(--red);}
/* ---------- the Overview, rebuilt (v1.73.0) ----------
   The CSS-bar sparkline these three rules styled is gone: the panel draws a
   real chart on a canvas now. Its markup went with it, so leaving the rules
   would be three selectors matching nothing.

   Most of what the new layout needs is ALREADY THERE — agency.html loads
   admin.css as well as brand.css, so .kpi, .mini-bar-row, .recent-row and
   .dist-leg come free rather than being reinvented under a second set of
   names. Only the layout the portal does not share is defined here. */

/* auto-fit rather than a fixed count: the KPI row and the panel row both have
   to survive a narrow window without a breakpoint per arrangement. */
.ag-kpi-grid{margin-bottom:14px;}
.ag-chart-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:14px;margin-bottom:14px;align-items:start;
}
/* The activity panel earns more room than the donut beside it: a fourteen-day
   line squeezed into a third of the width is unreadable, and a donut does not
   improve with size. */
.ag-chart-grid > .ov-panel:first-child:not(:only-child){grid-column:span 2;}
@media (max-width:900px){ .ag-chart-grid > .ov-panel:first-child:not(:only-child){grid-column:auto;} }

.ag-chart-grid canvas{max-width:100%;height:auto;display:block;}

.ag-panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.ag-legend-inline{display:flex;gap:12px;flex-wrap:wrap;}
/* The learner series is dashed on the canvas, so its key is dashed too —
   the legend has to say which line it means without relying on colour. */
.ag-dot-dash{background-image:linear-gradient(90deg,currentColor 55%,transparent 0);}

/* The recent list uses admin.css's .recent-row, which lays out three columns;
   this adds the fourth (when) and keeps the score last. */
.ov-panel .recent-row{display:grid;grid-template-columns:1fr auto auto auto;gap:10px;align-items:center;}
.ov-when{font-family:var(--font-mono);font-size:12px;color:var(--ink-3);}
.ag-brand .brand-img{width:34px;height:34px;object-fit:contain;border-radius:8px;}

/* ---- branding submission (v1.66.2) ---- */
.brand-status{
  padding:11px 13px;border-radius:var(--r-sm);margin-bottom:14px;
  background:var(--bg-2);border-left:3px solid var(--edge-2);
  font-size:13px;color:var(--ink-2);line-height:1.55;
}
.brand-status.is-wait{border-left-color:var(--amber);background:var(--amber-dim);}
.brand-status.is-live{border-left-color:var(--teal);background:var(--teal-dim);}
.brand-logo-picker{display:flex;flex-direction:column;gap:10px;align-items:flex-start;}
.brand-logo-row{display:flex;gap:8px;flex-wrap:wrap;}
.brand-logo{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:74px;height:74px;border:2px solid var(--edge);border-radius:var(--r-sm);
  background:var(--bg-3);cursor:pointer;overflow:hidden;
}
.brand-logo.is-picked{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-dim);}
.brand-logo img{max-width:100%;max-height:100%;object-fit:contain;}
.brand-logo input{position:absolute;opacity:0;pointer-events:none;}
.brand-logo-none{font-size:11px;color:var(--ink-3);text-align:center;}
.brand-logo-x{
  position:absolute;top:2px;right:2px;border:none;background:rgba(28,36,54,.7);
  color:#fff;border-radius:5px;width:18px;height:18px;line-height:1;font-size:11px;cursor:pointer;
}
.brand-preview-live{
  border:1px solid var(--edge);border-radius:var(--r);background:var(--bg-2);
  padding:14px;margin:14px 0;max-width:800px;
}
.brand-preview-live:empty{display:none;}
.brand-preview-live .brand-preview-label{
  font-family:var(--font-mono);font-size:9px;letter-spacing:.16em;
  text-transform:uppercase;color:var(--ink-3);margin-bottom:10px;
}
.brand-preview-live .brand-preview-mark{display:flex;align-items:center;justify-content:center;gap:9px;margin-bottom:10px;}
.brand-preview-live .brand-preview-mark img{width:30px;height:30px;object-fit:contain;border-radius:7px;}
.brand-preview-dot{width:30px;height:30px;border-radius:8px;background:var(--teal-dim);display:inline-block;}
.brand-preview-name{font-family:var(--font-display);font-weight:900;font-size:17px;}
.brand-preview-foot{font-family:var(--font-mono);font-size:8.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);}
.ag-upload{cursor:pointer;}

/* A code that cannot be deleted says so where the button would be, rather than
   leaving a gap the operator has to interpret. */
.ag-nodelete{align-self:center;white-space:nowrap;}

/* The allowance sub-lines (v1.73.4). A meter reading "0 / 10" has to be able
   to say why, or the number reads as "you have none" rather than "none
   outstanding". */
.ov-meter-sub{font-size:11.5px;color:var(--ink-3);margin:6px 0 0;line-height:1.45;}
.ag-allow-sub{display:block;font-family:var(--font-mono);font-size:11px;color:var(--ink-3);margin-top:3px;}

/* ============================================================
   LEARNERS (v1.74.1)

   A card per person rather than a row with a caption. The three facts sit in
   a strip on the right so the eye reads name-then-numbers on every card at
   the same horizontal position, which is what makes a list of them scannable
   — the previous version buried the counts in a sentence.
   ============================================================ */
.lr-card{padding:15px 17px;margin-bottom:10px;}
/* Suspended is a STATE, not a dimming. The old list dropped opacity to .62,
   which fades the name and the numbers equally and makes a real account look
   like a rendering fault. A left rule and a pill say it instead, and
   everything stays readable — an operator suspends somebody precisely so they
   can still look at them. */
.lr-card.is-suspended{border-left:3px solid var(--edge-2);background:var(--bg-2);}
.lr-card.is-suspended .lr-mark{background:var(--bg-3);color:var(--ink-3);}

.lr-head{display:flex;align-items:center;gap:13px;flex-wrap:wrap;}
.lr-mark{
  flex:none;width:38px;height:38px;border-radius:11px;
  display:grid;place-items:center;
  background:var(--teal-dim);color:var(--teal-d);
  font-family:var(--font-display);font-weight:900;font-size:17px;
}
.lr-id{flex:1;min-width:150px;}
.lr-name{font-size:15.5px;}
/* v1.99.158 — the learner page's summary card. Not .lr-head, which on this
   page is a list card's name row (admin.css styles the rest: .lr-sum, the
   tabs, the panels, the name as a button). */
.lrp-head{margin-bottom:16px;}
.lr-id .pill{margin-left:7px;vertical-align:2px;}
.lr-since{font-size:12px;color:var(--ink-3);margin-top:2px;}

.lr-facts{display:flex;gap:20px;flex-wrap:wrap;}
.lr-fact{text-align:right;min-width:64px;}
.lr-fact-v{
  display:block;font-family:var(--font-display);font-weight:900;
  font-size:19px;line-height:1.1;font-variant-numeric:tabular-nums;
}
.lr-fact-l{
  display:block;font-family:var(--font-mono);font-size:9.5px;
  letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);margin-top:3px;
}
/* The average carries its band's colour — and the number is always printed,
   so nothing here depends on colour alone. */
.lr-fact.is-good .lr-fact-v{color:var(--good-d);}
.lr-fact.is-mid  .lr-fact-v{color:#8A6224;}
.lr-fact.is-low  .lr-fact-v{color:var(--red);}

/* THE DESTRUCTIVE ACTION IS KEPT APART. Rename, reset and suspend are all
   undoable; delete is not, and a row of four identical buttons invites the
   fourth to be clicked like the other three. */
.lr-actions{
  display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;
  margin-top:13px;padding-top:12px;border-top:1px solid var(--edge);
}
.lr-actions-safe{display:flex;gap:7px;flex-wrap:wrap;}

/* Shared by every tab's empty state, so it is not named after the first one
   that needed it — the Access Codes tab uses it too. An empty state says what
   to do next; a grey line reporting an absence does not. */
.ag-emptycard{padding:22px 20px;}
.ag-emptycard p{margin:0 0 8px;font-size:14px;color:var(--ink-2);line-height:1.6;}

@media(max-width:640px){
  .lr-facts{gap:14px;width:100%;justify-content:flex-start;}
  .lr-fact{text-align:left;}
  .lr-actions{justify-content:flex-start;}
}

/* ============================================================
   ACCESS CODES (v1.74.2)

   The code is the loudest thing in its row, because a code is a thing people
   read aloud and type by hand. Everything else about it is a caption.
   ============================================================ */
.cd-card{padding:15px 17px;margin-bottom:10px;}
/* A code that can no longer be redeemed is set back rather than faded out:
   the operator still has to read it — to find it on a printed sheet, or to
   decide whether to generate a replacement. The old list used opacity .62 on
   the whole row, which makes the code itself hard to read at exactly the
   moment somebody is checking it against paper. */
.cd-card.is-done{background:var(--bg-2);border-left:3px solid var(--edge-2);}

.cd-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.cd-code{
  font-size:17px;letter-spacing:.1em;
  padding:5px 10px;border-radius:var(--r-sm);
  background:var(--bg);border:1px dashed var(--edge-2);
}
.cd-code:hover{border-color:var(--teal);color:var(--teal-d);}

/* HOW FAR THROUGH, beside WHAT IT IS. A pill alone reads "live" for a code
   with one redemption left and for one with fifty. */
.cd-uses{display:flex;align-items:center;gap:8px;margin-left:auto;}
.cd-uses-bar{
  width:74px;height:5px;border-radius:99px;background:var(--bg-2);
  border:1px solid var(--edge);overflow:hidden;
}
.cd-uses-fill{height:100%;background:var(--teal);border-radius:99px;}
.cd-uses-fill.is-full{background:var(--ink-3);}
.cd-uses-n{font-family:var(--font-mono);font-size:11px;color:var(--ink-3);white-space:nowrap;}

.cd-meta{
  display:flex;gap:6px 18px;flex-wrap:wrap;margin-top:10px;
  font-size:12.5px;color:var(--ink-2);
}
.cd-meta i{color:var(--ink-3);font-style:normal;}
.cd-note{color:var(--ink-3);font-style:italic;}

.cd-actions{
  display:flex;justify-content:flex-end;align-items:center;gap:10px;flex-wrap:wrap;
  margin-top:12px;padding-top:11px;border-top:1px solid var(--edge);
}

/* THE TWO CLOCKS. The single most confusable thing on this screen, so it is a
   bordered note rather than a paragraph of italics somebody skims past. */
.cd-clocks{
  margin-top:14px;padding:12px 14px;
  border:1px solid var(--edge);border-left:3px solid var(--teal);
  border-radius:var(--r-sm);background:var(--bg-2);
  font-size:12.5px;color:var(--ink-2);line-height:1.6;
}
.cd-clocks ul{margin:7px 0 0;padding-left:18px;}
.cd-clocks li{margin-bottom:5px;}
.cd-clocks p{margin:8px 0 0;color:var(--ink-3);}

.cd-fresh-note{
  font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;
  text-transform:uppercase;color:var(--teal-d);margin-left:auto;
}

@media(max-width:640px){
  .cd-uses{margin-left:0;width:100%;}
  .cd-actions{justify-content:flex-start;}
  .cd-fresh-note{margin-left:0;}
}

/* ============================================================
   USAGE (v1.74.3)
   ============================================================ */
.uz-table td{vertical-align:middle;}
.uz-n{font-family:var(--font-mono);}
.uz-when{color:var(--ink-3);font-size:13px;}
.uz-none{color:var(--ink-3);font-size:12.5px;font-style:italic;}

/* A bar behind the number so a column of averages reads as a shape. The
   figure is always printed beside it — length and colour are decoration. */
.uz-score{display:flex;align-items:center;gap:9px;min-width:150px;}
.uz-bar{
  flex:1;max-width:110px;height:6px;border-radius:99px;
  background:var(--bg-2);border:1px solid var(--edge);overflow:hidden;
}
.uz-bar-fill{display:block;height:100%;border-radius:99px;}
.uz-score b{font-variant-numeric:tabular-nums;min-width:38px;}

.uz-sounds{display:grid;gap:2px;}
/* The IPA symbol wants the display face at a readable size: it is the thing
   being named, and at label size a phonetic symbol is a smudge. */
.uz-ipa{font-size:16px;min-width:34px;}
.uz-sound-avg{
  font-family:var(--font-mono);font-size:11.5px;color:var(--ink-2);
  min-width:38px;text-align:right;
}

/* ============================================================
   THE BRANDING PREVIEW (v1.74.4)

   A miniature of the learner's own header rather than a dot beside a name.
   It has two audiences: the agency checking before it submits, and the
   operator deciding whether to approve — and the operator's whole job is
   seeing the branding as a learner would, which a sketch cannot support.
   ============================================================ */
/* v1.99.112 — three panels at real size: the dark side menu, the light
   sign-in card, the phone's top bar. v1.99.220: they read the same --menu-*
   tokens as the app's #sidebar, #topbar and branded sign-in strip, and
   renderBrandPreview writes the agency's whole menu on the preview box
   (SiteBrand.applyAgencyMenu: today's dark blue or the picked colour set), so
   the preview is what learners see; tests/agency-ui.js asserts both. */
.bp-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;max-width:760px;}
.bp-panel{margin:0;display:flex;flex-direction:column;gap:6px;min-width:0;}
.bp-cap{font-size:11.5px;color:var(--ink-2);}
.bp-rail{
  display:flex;align-items:center;gap:11px;padding:16px 14px;border-radius:var(--r-sm);
  background:linear-gradient(165deg,var(--menu-1) 0%,var(--menu-m) 46%,var(--menu-2) 100%);--teal:var(--menu-a);min-height:76px;
}
.bp-rail .bp-name{color:#FFFFFF;font-size:19px;}
.bp-signin{
  border:1px solid var(--edge);border-radius:var(--r-sm);background:var(--bg-3);
  padding:16px 14px;min-height:76px;
}
.bp-signin-brand{display:flex;align-items:center;gap:10px;margin-bottom:12px;}
.bp-phone{border:1px solid var(--edge);border-radius:14px;overflow:hidden;background:var(--bg);max-width:240px;}
.bp-phone-bar{
  display:flex;align-items:center;height:46px;padding:0 14px;
  background:linear-gradient(120deg,var(--menu-1),var(--menu-mt) 58%,var(--menu-2));--teal:var(--menu-a);
}
/* The sign-in page's coloured strip, as the branded box draws it (index.html's
   #authOverlay.is-agency .auth-aside). */
.bp-signin-aside{
  display:flex;align-items:center;min-height:40px;margin:-16px -14px 12px;padding:0 14px;border-radius:var(--r-sm) var(--r-sm) 0 0;
  background:linear-gradient(155deg,var(--menu-1) 0%,var(--menu-m) 46%,var(--menu-2) 100%);--teal:var(--teal-bright);
}
.bp-signin-aside .bp-name{color:#FFFFFF;font-size:15px;}
.bp-phone-bar .bp-name{color:#FFFFFF;font-size:17px;}
.bp-mark{width:32px;height:32px;border-radius:8px;object-fit:contain;flex:none;}
.bp-mark-none{background:var(--teal-dim);display:block;}
.bp-words{min-width:0;}
.bp-name{font-family:var(--font-display);font-weight:900;font-size:16px;line-height:1.15;overflow-wrap:anywhere;}
/* Three grey strokes standing in for the page's content, so a header reads
   as a header. */
.bp-body{padding:12px 2px 2px;display:grid;gap:7px;}
.bp-phone .bp-body{padding:14px;}
.bp-body span{display:block;height:7px;border-radius:99px;background:var(--bg-2);}
.bp-phone .bp-body span{background:var(--edge);}
.bp-body span:nth-child(1){width:70%;}
.bp-body span:nth-child(2){width:88%;}
.bp-body span:nth-child(3){width:46%;}
/* Immutable in the real app and shown here so nobody is surprised by it. */
.bp-powered{
  margin-top:10px;font-family:var(--font-mono);font-size:9px;
  letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);
}
.brand-logo-hint{max-width:460px;margin:0;}
.bp-note{margin-top:10px;}

/* THE PLAN A LEARNER IS ON (v1.83.0) — a row inside the learner card, between
   their figures and the destructive actions. It states the plan and the days
   in WORDS, never a colour, because "what have they got and for how long" is
   the question the row exists to answer. */
.lr-plan{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:12px 0 0;padding:10px 12px;border:1px solid var(--edge);
  border-radius:var(--r-sm);background:var(--bg-2);font-size:13.5px;}
.lr-plan-has{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;}
.lr-plan-none,.lr-plan-note{color:var(--ink-3);}
.lr-plan-set{display:inline-flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap;}
.lr-plan-set select{min-width:170px;}

/* A warning that sits BESIDE a success (v1.84.0): the codes were generated,
   and the caution is about whether they can all be redeemed. Amber, not red,
   and it carries the whole sentence rather than relying on the colour. */
.ag-cap-warn{margin-top:8px;padding:9px 12px;border-left:3px solid var(--amber);
  background:var(--bg-2);border-radius:0 var(--r-sm) var(--r-sm) 0;
  font-size:13px;color:var(--ink-2);}

/* ---------- colour theme picker (v1.99.129) ----------
   The preview panels reuse the branding preview's .bp-* frames, so the dark
   menu panel is the app's own navy gradient and, being a dark panel, hands
   its contents the theme's bright shade (--teal:var(--teal-bright)). Every
   colour below is a brand token, so SiteBrand.applyTheme on #themePreview is
   the whole of the preview's logic. */
.theme-swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px;margin:12px 0;max-width:760px;}
.theme-swatch{display:flex;align-items:center;gap:9px;padding:9px 10px;border:1px solid var(--edge);border-radius:var(--r-sm);
  background:var(--bg-3);color:var(--ink);font:inherit;font-size:13.5px;cursor:pointer;text-align:left;min-height:44px;}
.theme-swatch:hover{border-color:var(--edge-2);}
.theme-swatch.is-picked{border-color:var(--ink);box-shadow:0 0 0 2px var(--ink) inset;font-weight:600;}
.theme-chip{width:22px;height:22px;border-radius:6px;flex:none;}
.theme-name{line-height:1.25;min-width:0;}
.theme-name small{display:block;font-size:11.5px;font-weight:400;color:var(--ink-2);}
/* v1.99.220 — a colour set's swatch: its menu (with its accent as a dot) and
   its button colour, side by side. */
.set-chips{display:inline-flex;gap:3px;flex:none;}
.set-menu{position:relative;width:22px;height:26px;border-radius:6px;}
.set-dot{position:absolute;left:5px;top:8px;width:12px;height:3px;border-radius:2px;}
.set-btn{width:12px;height:26px;border-radius:6px;}
.theme-now{margin-left:10px;}
.theme-locked{padding:12px 14px;border-left:3px solid var(--edge-2);background:var(--bg-2);border-radius:0 var(--r-sm) var(--r-sm) 0;font-size:14px;margin:12px 0;}
.tp-nav{position:relative;display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:9px;font-size:13px;color:var(--menu-ink-2);}
.tp-nav-on{background:rgba(255,255,255,.1);color:#FFFFFF;font-weight:600;}
.tp-nav-on::before{content:"";position:absolute;left:-10px;top:50%;transform:translateY(-50%);width:3px;height:18px;border-radius:0 3px 3px 0;background:var(--teal);}
.tp-ic{width:14px;height:14px;border-radius:4px;border:2px solid currentColor;opacity:.8;flex:none;}
.tp-nav-on .tp-ic{color:var(--teal);opacity:1;}
.tp-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;}
.tp-eyebrow{font-family:var(--font-mono);font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--teal-d);}
.tp-btn{display:inline-block;background:var(--teal);color:#FFFFFF;border:none;border-radius:99px;padding:8px 16px;font:700 13px var(--font-body);
  box-shadow:0 8px 18px -10px color-mix(in srgb,var(--teal-glow) 90%,transparent);}
.tp-btn-sm{display:inline-block;padding:6px 12px;font-size:12px;}
.tp-link{color:var(--teal);text-decoration:underline;font-size:13px;}
.tp-good{color:var(--good);font-weight:700;font-size:13px;}
.tp-phone-body{padding:12px 14px;}

/* ---------- the combined Agency branding screen (v1.99.130, step 5) ----------
   DOM order: name, theme, preview, WhatsApp, address. Narrow: one column in that order,
   so the preview sits right under the swatches. Wide: the preview is lifted
   into a right-hand column spanning every part, sticky so it stays in view
   while the parts scroll. */
.brand-rule{margin:0 0 16px;padding:12px 14px;border-left:3px solid var(--teal);background:var(--bg-2);
  border-radius:0 var(--r-sm) var(--r-sm) 0;font-size:14px;max-width:760px;}
.brand-screen{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;align-items:start;}
.brand-screen > .card{margin:0;}
@media (min-width:1100px){
  .brand-screen{grid-template-columns:minmax(0,1fr) 420px;
    grid-template-areas:"name preview" "theme preview" "contact preview" "address preview";}
  .brand-part-name{grid-area:name;}
  .brand-part-theme{grid-area:theme;}
  .brand-part-contact{grid-area:contact;}
  .brand-part-address{grid-area:address;}
  .brand-part-preview{grid-area:preview;position:sticky;top:16px;}
  .brand-part-preview .bp-grid{grid-template-columns:1fr 1fr;}
}
.brand-part-preview .brand-preview-live{margin:0;}
/* v1.99.147 — the WhatsApp card's "In use now" line sits beside Save. */
.contact-now{margin:0;}
/* The side menu panel holds the brand row and two menu items, stacked. */
.brand-part-preview .bp-rail{flex-direction:column;align-items:stretch;gap:2px;padding:14px 10px 12px;overflow:hidden;}
.bp-railhead{display:flex;align-items:center;gap:11px;padding:0 4px 10px;}
.bp-welcome{font-family:var(--font-display);font-weight:700;font-size:15px;margin:0 0 10px;}
.tp-btn-wide{display:block;text-align:center;}

/* v1.99.154 — the Notifications tab. */
.pn-state{margin:0 0 4px;font-size:14.5px;line-height:1.55;}
.pn-ok{color:var(--ink);}
.pn-no{color:#8A6224;background:var(--amber-dim);border-radius:10px;padding:10px 12px;}
.pn-bad{color:var(--red);}
.pn-grid{display:grid;grid-template-columns:auto 1fr;gap:10px 14px;align-items:start;}
.pn-grid > label{margin:0;padding-top:12px;}
.pn-wide{width:100%;box-sizing:border-box;}
textarea.pn-wide{resize:vertical;font:inherit;}
.pn-count{margin-top:4px;}
.pn-buttons{margin-top:12px;}
.pn-head{justify-content:space-between;}
.pn-head .ag-form-title,.pn-head h3{margin:0;}
.pn-final{margin:0 0 6px;}
.pn-item{align-items:flex-start;}
.pn-body{margin-top:3px;font-size:14px;overflow-wrap:anywhere;}
.pn-detail{border:1px solid var(--edge-2);border-radius:12px;padding:14px 16px;margin:6px 0 12px;background:var(--bg-2);}
.pn-detail h3{font-size:15.5px;}
.pn-detail-text{margin:10px 0;overflow-wrap:anywhere;}
.pn-facts{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:0;font-size:14px;}
.pn-facts dt{color:var(--ink-2);}
.pn-facts dd{margin:0;overflow-wrap:anywhere;}
.pn-log{margin:8px 0 0;padding-left:18px;font-size:14px;}
.pn-log li{margin:8px 0;overflow-wrap:anywhere;}
@media (max-width:560px){
  .pn-grid{grid-template-columns:1fr;gap:4px;}
  .pn-grid > label{padding-top:10px;}
}
/* ============================================================
   ENDING SOON (v1.99.216) — above every tab. The fixed warning colours,
   never the brand: amber, and red for the agency's own plan in its last
   three days. In the page flow.
   ============================================================ */
.ag-ending{margin:0 0 18px;display:grid;gap:10px;}
.ag-end-part{padding:12px 14px;border:1px solid var(--amber);border-left-width:4px;
  background:var(--amber-dim);border-radius:var(--r-sm);font-size:14px;color:var(--ink);overflow-wrap:break-word;}
.ag-end-plan.is-firm{border-color:var(--red);background:var(--red-dim);}
.ag-end-learners{line-height:1.5;}
.ag-end-list{margin:8px 0 0;padding-left:18px;}
.ag-end-list li{margin:2px 0;}

/* ============================================================
   TODAY'S AI PRACTICE (v1.99.217) — the Overview's card. The bar is neutral
   ink on a light track; the fixed warning colours appear only as the card's
   state (its left edge and wash) at 80% and when reached, never as a fill
   that changes colour with the number.
   ============================================================ */
.ag-ai-slot:empty{display:none;}
.ag-ai{margin:0 0 16px;border-left:4px solid var(--edge-2);}
.ag-ai.is-near{border-left-color:var(--amber);background:var(--amber-dim);}
.ag-ai.is-reached{border-left-color:var(--red);background:var(--red-dim);}
.ag-ai-pct{margin:0 0 6px;font-size:15px;color:var(--ink);}
.ag-ai-bar{height:10px;border-radius:99px;background:var(--edge);overflow:hidden;margin:0 0 10px;}
.ag-ai-fill{display:block;height:100%;background:var(--ink-2);border-radius:99px;}
.ag-ai-line{margin:6px 0 0;font-size:14px;line-height:1.5;color:var(--ink);overflow-wrap:break-word;}

/* v1.99.240 — C2: the certificate design picker and its live sample. The
   sample itself is drawn in a shadow root with the certificate's own
   stylesheet; only its frame lives here. */
.cert-design{margin-top:14px;}
.cd-presets,.cd-accents{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 12px;}
.cd-group{font-size:12.5px;color:var(--ink-3);margin:8px 0 0;}
.cd-preset{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:48px;padding:8px 12px;border:1px solid var(--edge);
  border-radius:var(--r-sm);background:#fff;color:var(--ink);font:inherit;font-size:14px;text-align:left;cursor:pointer;max-width:100%;}
.cd-preset small{font-size:12px;color:var(--ink-3);font-weight:400;}
.cd-preset.is-picked{border-color:var(--ink);box-shadow:0 0 0 2px var(--ink) inset;font-weight:600;}
.cd-accent{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:6px 10px;border:1px solid var(--edge);border-radius:99px;
  background:#fff;color:var(--ink);font:inherit;font-size:13px;cursor:pointer;}
.cd-accent.is-picked{border-color:var(--ink);box-shadow:0 0 0 2px var(--ink) inset;font-weight:600;}
.cd-chip{display:inline-block;width:18px;height:18px;border-radius:50%;border:1px solid rgba(0,0,0,.15);flex:0 0 18px;}
.cd-none{font-size:13.5px;color:var(--ink-2);margin:4px 0 12px;}
.cert-prev{margin:6px 0 10px;max-width:100%;overflow:hidden;border-radius:var(--r-sm);background:var(--bg-2);}
.cd-link{font-size:13.5px;}

/* v1.99.241 — C3: the two lines and the signatory. */
.cd-lines{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:4px 0 12px;max-width:640px;}
.cd-lines select{width:100%;min-height:44px;font:inherit;font-size:16px;}
.cd-sig{margin-top:16px;padding-top:14px;border-top:1px solid var(--edge);}
.cd-sig-h{font-size:16px;margin:0 0 6px;}
.cd-sig-now{font-size:14px;margin:4px 0 10px;overflow-wrap:anywhere;}
