/* CPD Capture.
 *
 * Palette:
 *   #462255  Dark Amethyst   - dark-mode chrome
 *   #313B72  Twilight Indigo - sidebar, primary actions
 *   #62A87C  Mint Leaf       - the brand green
 *   #7EE081  Light Green     - confirm, success
 *   #C3F3C0  Tea Green       - success backgrounds
 *
 * Light and dark share one token set; only the values swap, so every
 * component below is written once.
 */

:root {
  --amethyst: #462255;
  --indigo: #313b72;
  --mint: #62a87c;
  --green: #7ee081;
  --tea: #c3f3c0;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --ink: #1b2033;
  --ink-2: #5d6480;
  --ink-3: #8d93ab;
  --line: #e4e6ef;

  --sidebar: var(--indigo);
  --sidebar-ink: #ffffff;
  --sidebar-ink-2: #a7aed4;
  --sidebar-active: rgba(255, 255, 255, .13);

  --primary: #4a55a8;
  --primary-ink: #ffffff;
  --success: #2f8b53;
  --success-bg: var(--tea);
  /*
   * Green text on a green background, dark enough to be read.
   *
   * --success is 4.25:1 on the surface and only 3.39:1 on --success-bg, which
   * is under 4.5:1 for small text - so the pills were failing, measured and
   * recorded rather than noticed. This is 5.18:1 on --success-bg and 6.5:1 on
   * the surface. --success stays exactly as it was for the arcs, bars and
   * ticks, which are graphics and need 3:1.
   */
  --success-ink: #1f6b3d;
  --warn: #8a5a00;
  --warn-bg: #fdf1dc;
  --danger: #b3261e;
  --danger-bg: #fdecea;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27, 32, 51, .05), 0 8px 24px rgba(27, 32, 51, .06);
  --shadow-lg: 0 24px 60px rgba(27, 32, 51, .25);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #16121d;
    --surface: #1f1a29;
    --surface-2: #272033;
    --ink: #f0eef5;
    --ink-2: #b7b1c6;
    --ink-3: #8b849c;
    --line: #342c42;

    --sidebar: var(--amethyst);
    --sidebar-ink: #ffffff;
    --sidebar-ink-2: #c3aed0;
    --sidebar-active: rgba(255, 255, 255, .16);

    --primary: #7d86d8;
    --primary-ink: #14172b;
    --success: var(--green);
    --success-bg: rgba(126, 224, 129, .16);
    /* Light on dark here, so --success is already 7.16:1 on that background
       and needs nothing darker. */
    --success-ink: var(--green);
    --warn: #f3c67a;
    --warn-bg: rgba(243, 198, 122, .14);
    --danger: #f39a95;
    --danger-bg: rgba(243, 154, 149, .14);

    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, .6);
  }}

/* Added by vite/theme-aware-css.ts - see the file header. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #16121d;
    --surface: #1f1a29;
    --surface-2: #272033;
    --ink: #f0eef5;
    --ink-2: #b7b1c6;
    --ink-3: #8b849c;
    --line: #342c42;

    --sidebar: var(--amethyst);
    --sidebar-ink: #ffffff;
    --sidebar-ink-2: #c3aed0;
    --sidebar-active: rgba(255, 255, 255, .16);

    --primary: #7d86d8;
    --primary-ink: #14172b;
    --success: var(--green);
    --success-bg: rgba(126, 224, 129, .16);
    /* Light on dark here, so --success is already 7.16:1 on that background
       and needs nothing darker. */
    --success-ink: var(--green);
    --warn: #f3c67a;
    --warn-bg: rgba(243, 198, 122, .14);
    --danger: #f39a95;
    --danger-bg: rgba(243, 154, 149, .14);

    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, .6);
  }


* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 22px; margin: 0 0 3px; letter-spacing: -.02em; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 12px; margin: 0 0 8px; font-weight: 600; color: var(--ink-2); }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.boot { padding: 48px; color: var(--ink-2); }
.sub { color: var(--ink-2); margin: 0; font-size: 13px; }
.note, .muted { color: var(--ink-2); }
.small { font-size: 12px; }
.spacer { flex: 1; }

/* ===================================================================== app */

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* ------------------------------------------------------------------ sidebar */

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 22px; }
.brand svg { width: 22px; height: 22px; flex: none; }
.brand strong { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }

.nav {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left; background: none; border: 0;
  color: var(--sidebar-ink-2); font: inherit; font-size: 13.5px;
  padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer;
}
.nav:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .9; }
.nav .count {
  margin-left: auto; background: var(--green); color: #14321c;
  border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px;
}

/*
 * The account block at the foot of the sidebar.
 *
 * Separated from the navigation by a rule and a margin, because it answers a
 * different question - which edition am I, and is my logbook anywhere else -
 * and should not read as another place to go.
 */
.account-foot-group {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.account-foot {
  margin-top: auto;
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--sidebar-ink-2);
}
.account-foot-group .account-foot { margin-top: 0; }
.account-foot:hover { background: var(--sidebar-active); }
.account-text { display: flex; flex-direction: column; min-width: 0; font-size: 11.5px; line-height: 1.45; }
.account-text strong {
  color: #fff; font-weight: 600; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avatar {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mint); color: #0d2316;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.edition-mark { width: 28px; flex: none; text-align: center; color: var(--green); font-size: 13px; }
.upgrade {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 10px 14px; margin-top: 2px;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--green); border-radius: var(--radius-sm);
}
.upgrade:hover { background: var(--sidebar-active); }

/*
 * Sign out, under the account block. Deliberately quiet: it sits beside the
 * email all the time, so it must not compete with the thing it is next to.
 */
.sign-out-foot {
  width: 100%; text-align: left;
  padding: 7px 10px 8px 48px; margin-top: 1px;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 11.5px;
  color: var(--sidebar-ink-2); border-radius: var(--radius-sm);
}
.sign-out-foot:hover { background: var(--sidebar-active); color: #fff; }

.sidebar-foot { margin-top: auto; display: flex; gap: 9px; align-items: flex-start; padding: 14px 8px 0; }
.sidebar-foot .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  margin-top: 5px; flex: none; box-shadow: 0 0 0 3px rgba(126, 224, 129, .2);
}
.sidebar-foot div { font-size: 11.5px; line-height: 1.4; color: var(--sidebar-ink-2); }
.sidebar-foot strong { display: block; color: #fff; font-weight: 500; }

/* --------------------------------------------------------------------- main */

.main { padding: 26px 30px 48px; max-width: 1240px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
/* Captures on their own row: one panel, so it does not stretch to fill a
   column meant for two. */
.pending-row { grid-template-columns: 1fr; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .sidebar { height: auto; position: static; } }

/* ----------------------------------------------------------------- buttons */

button { font: inherit; }
.primary, .ghost, .confirm {
  border-radius: var(--radius-sm); padding: 9px 15px; cursor: pointer;
  border: 1px solid transparent; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
}
.primary { background: var(--primary); color: var(--primary-ink); }
.confirm { background: var(--green); color: #14321c; }
.primary:hover:not(:disabled), .confirm:hover:not(:disabled) { filter: brightness(1.06); }
.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.ghost:hover:not(:disabled) { background: var(--surface-2); }
.ghost.danger { color: var(--danger); border-color: var(--danger-bg); }
button:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-size: 12.5px; text-decoration: underline; }
.link.danger { color: var(--danger); }
.icon-btn {
  background: none; border: 0; cursor: pointer; color: var(--ink-3);
  padding: 4px 8px; border-radius: 6px; font-size: 16px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------------------------ banner */

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.banner.good { background: var(--success-bg); color: var(--success-ink); border-color: transparent; }
.banner.bad { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.banner-close { background: none; border: 0; font-size: 17px; cursor: pointer; color: inherit; }

/* ------------------------------------------------------------------- tiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 13px; align-items: flex-start;
}
.tile .glyph {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--primary);
}
.tile .glyph.green { background: var(--success-bg); color: var(--success); }
.tile .glyph.amber { background: var(--warn-bg); color: var(--warn); }
.tile h3 { margin: 0 0 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.tile b { display: block; font-size: 25px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.tile span { font-size: 11.5px; color: var(--ink-3); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; box-shadow: var(--shadow);
}
.stat h3 { margin: 0 0 4px; font-size: 11.5px; }
.stat b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- progress */

.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.progress-head b { font-size: 13px; font-weight: 600; }
.bar { height: 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--green)); }

/* ------------------------------------------------------------------- table */

.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; min-width: 640px; }
.grid th, .grid td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.grid th { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: var(--surface-2); }
.grid .num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td strong { font-weight: 600; }

/* ------------------------------------------------- recent CPD activity */

/* Compact rows and a narrower minimum than the general grid: five columns of
   short values, not a logbook, and it has to survive sitting in half of a
   two-column dashboard. */
.grid.activity { min-width: 460px; table-layout: fixed; }
.grid.activity th, .grid.activity td { padding: 9px 10px; }
.grid.activity .when { white-space: nowrap; color: var(--ink-2); width: 104px; }
.grid.activity .cat-col { width: 168px; }
.grid.activity th.num, .grid.activity td.num { width: 66px; }
.grid.activity .src-col { width: 118px; }
/* The topic takes the slack and truncates. Fixed layout plus this is what
   stops one long course title shoving Hours and Source off the edge. */
.grid.activity .topic {
  color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0;
}

.cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 9px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  background: var(--surface-2); color: var(--ink-2);
}
.cat-icon { width: 11px; height: 11px; flex: none; opacity: .8; }
.cat-badge.blue { background: rgba(74, 85, 168, .12); color: #4a55a8; }
.cat-badge.purple { background: rgba(70, 34, 85, .11); color: #6b3a80; }
.cat-badge.green { background: rgba(47, 139, 83, .13); color: #2f8b53; }
.cat-badge.orange { background: rgba(176, 108, 10, .13); color: #8a5a00; }
.cat-badge.teal { background: rgba(23, 125, 135, .12); color: #177d87; }
.cat-badge.rose { background: rgba(170, 60, 90, .11); color: #a63a5c; }

/* Understated on purpose: the topic is the thing being read, not this. */
.src { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11.5px; }
.src-icon { width: 13px; height: 13px; flex: none; color: var(--ink-3); }

/* Narrow: drop Source rather than shrink everything. It is the least
   important column and the only one whose absence costs nothing. */
/* ---- the logbook: the same table, with its operational columns ---- */

/* Wider minimum than the dashboard's: it carries three more columns and is
   always full width, so letting it scroll a little beats crushing the title. */
.grid.logbook { min-width: 820px; }
.grid.logbook .status-col { width: 104px; }
/* 180, measured: the widest pair is "This computer" beside "Saved", which
   needs 152px of content. At 164 the cell had 144 to give, so that one row
   wrapped and stood 13px taller than its neighbours - the kind of uneven
   row that reads as a rendering fault rather than a wrapped badge. */
.grid.logbook .stored-col { width: 180px; }
.grid.logbook .act-col { width: 72px; }
/* Two lines in one cell, so the provider rides with the title instead of
   taking a column. Overridden from the dashboard's single-line topic. */
.grid.logbook .topic { white-space: normal; }
.grid.logbook .topic-name,
.grid.logbook .topic-sub {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid.logbook .topic-sub { font-weight: 400; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
/* Wraps when the column is narrow rather than forcing the table wider. */
.stored { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

@media (max-width: 1100px) {
  /* Status is the first to go: every confirmed record says the same word. */
  .grid.logbook { min-width: 660px; }
  .grid.logbook .status-col { display: none; }
}

/* Narrowing in two steps, dropping the least important column each time.
   Source goes first; it is the only column whose absence costs nothing. */
@media (max-width: 720px) {
  .grid.activity { min-width: 300px; }
  .grid.activity .src-col { display: none; }
}

/* On a phone the category goes too. Keeping it left Topic about 28 pixels -
   one letter and an ellipsis - and a title nobody can read is worse than a
   badge they can find in the logbook. Date, Topic and Hours are the three
   that answer "what did I do and does it count". */
@media (max-width: 520px) {
  .grid.activity .cat-col { display: none; }
  .grid.activity .when { width: 86px; }
  .grid.activity th.num, .grid.activity td.num { width: 56px; }
  /* The logbook keeps delete and where-it-is-stored, because those are the
     reasons to open the logbook rather than the dashboard.

     540, not 420: at this width the table scrolls inside its panel either
     way, so a smaller minimum buys nothing and costs the activity name -
     at 420 it had 114px and every title was three words and an ellipsis.
     The page itself still does not scroll sideways. */
  .grid.logbook { min-width: 540px; }
  .grid.logbook .stored-col { width: 112px; }
  /* Stacked on purpose rather than left to wrap. Wrapping put some rows on
     one line and some on two, so the row heights came out 59, 67, 71, 72 -
     a table that looks mis-rendered. Two lines every time is even. */
  .grid.logbook .stored { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .cat-badge.blue { background: rgba(130, 142, 230, .16); color: #a8b1ee; }
:root:not([data-theme="light"]) .cat-badge.purple { background: rgba(195, 174, 208, .15); color: #cbb0d8; }
:root:not([data-theme="light"]) .cat-badge.green { background: rgba(126, 224, 129, .14); color: #8fd79b; }
:root:not([data-theme="light"]) .cat-badge.orange { background: rgba(240, 180, 90, .15); color: #e7b771; }
:root:not([data-theme="light"]) .cat-badge.teal { background: rgba(90, 200, 210, .14); color: #7fcfd8; }
:root:not([data-theme="light"]) .cat-badge.rose { background: rgba(230, 140, 170, .14); color: #e294b0; }}

/* Added by vite/theme-aware-css.ts - see the file header. */
:root[data-theme="dark"] .cat-badge.blue { background: rgba(130, 142, 230, .16); color: #a8b1ee; }
:root[data-theme="dark"] .cat-badge.purple { background: rgba(195, 174, 208, .15); color: #cbb0d8; }
:root[data-theme="dark"] .cat-badge.green { background: rgba(126, 224, 129, .14); color: #8fd79b; }
:root[data-theme="dark"] .cat-badge.orange { background: rgba(240, 180, 90, .15); color: #e7b771; }
:root[data-theme="dark"] .cat-badge.teal { background: rgba(90, 200, 210, .14); color: #7fcfd8; }
:root[data-theme="dark"] .cat-badge.rose { background: rgba(230, 140, 170, .14); color: #e294b0; }


.pill {
  display: inline-block; border-radius: 7px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.pill.technical { background: rgba(74, 85, 168, .12); color: var(--primary); }
.pill.ethics { background: rgba(98, 168, 124, .18); color: var(--success-ink); }
.pill.professional { background: rgba(70, 34, 85, .1); color: var(--amethyst); }
.pill.confirmed, .pill.saved { background: var(--success-bg); color: var(--success-ink); }
.pill.pending { background: var(--warn-bg); color: var(--warn); }

@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .pill.professional { background: rgba(195, 174, 208, .15); color: #cbb0d8; }
:root:not([data-theme="light"]) .pill.technical { background: rgba(125, 134, 216, .16); color: #a3aae6; }}

/* Added by vite/theme-aware-css.ts - see the file header. */
:root[data-theme="dark"] .pill.professional { background: rgba(195, 174, 208, .15); color: #cbb0d8; }
:root[data-theme="dark"] .pill.technical { background: rgba(125, 134, 216, .16); color: #a3aae6; }


.empty {
  color: var(--ink-3); padding: 40px 14px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ------------------------------------------------------------------- lists */

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row-list li:last-child { border-bottom: 0; }
.row-glyph {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2);
}
.row-main { flex: 1; min-width: 0; cursor: pointer; }
.row-main strong { display: block; font-size: 13.5px; font-weight: 600; }
.row-main span { font-size: 12px; color: var(--ink-2); }
.row-actions { display: flex; gap: 7px; flex: none; }
.row-actions button { padding: 6px 12px; font-size: 12.5px; }

.score {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px;
  border-radius: 7px; padding: 4px 9px; white-space: nowrap;
}
.score.likely { background: var(--success-bg); color: var(--success); }
.score.possible { background: var(--warn-bg); color: var(--warn); }
.score.unlikely { background: var(--surface-2); color: var(--ink-3); }

/* ------------------------------------------------------------------- forms */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); }
label.check input { width: auto; accent-color: var(--mint); }
/*
 * The same two lines for a radio, which never had them.
 *
 * `label` is a column and `.radio` only set `display: flex`, so the
 * direction stayed column; and the global `input { width: 100% }` applied,
 * so the control stretched the width of its row and the glyph drifted into
 * the middle of it. Every radio in the app was drawn that way - the
 * add-activity form's as well as the registration form's - which is why this
 * is on the shared class rather than scoped to the new screen.
 */
label.radio { flex-direction: row; align-items: center; gap: 9px; }
label.radio input { width: auto; accent-color: var(--mint); }
input, select, textarea {
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
label small { font-weight: 400; color: var(--ink-3); }
.warn-text { color: var(--warn) !important; font-weight: 600; }
.warn { color: var(--warn); font-size: 12.5px; }
.error { color: var(--danger); font-size: 12.5px; }
textarea { resize: vertical; font-family: inherit; }

/* -------------------------------------------------------------- setting tabs */

.tabs-row { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 9px 14px; font: inherit; font-size: 13px; color: var(--ink-2); margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.group {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 9px; background: var(--surface); overflow: hidden;
}
.group-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; cursor: pointer; padding: 12px 14px; font: inherit; color: var(--ink);
}
.group-head:hover { background: var(--surface-2); }
.group-head .chev { color: var(--ink-3); transition: transform .15s; display: inline-flex; }
.group-head.open .chev { transform: rotate(90deg); }
.group-head .name { flex: 1; text-align: left; font-weight: 600; font-size: 13px; }
.group-head .count {
  background: var(--surface-2); color: var(--ink-2); border-radius: 999px;
  padding: 1px 9px; font-size: 11.5px; font-weight: 600;
}
.group-body { padding: 0 14px 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--surface-2); color: var(--ink-2); border-radius: 6px;
  padding: 3px 9px; font-size: 11.5px;
}

.debug {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px; font-size: 11.5px; overflow-x: auto; color: var(--ink-2); white-space: pre-wrap;
}

/* ------------------------------------------------------------------- modal */

.modal { position: fixed; inset: 0; background: rgba(27, 20, 40, .55); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 60; }
.modal-card {
  background: var(--surface); border-radius: 14px; width: min(620px, 100%);
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; gap: 9px; align-items: center; padding: 15px 22px; border-top: 1px solid var(--line); }
.modal-card.narrow { width: min(430px, 100%); }
.modal-card.narrow .modal-body { display: flex; flex-direction: column; gap: 12px; }

/* ======================================================== popup (toolbar) */

.popup { width: 340px; }
.popup-head {
  background: var(--sidebar); color: #fff; padding: 13px 15px;
  display: flex; align-items: center; gap: 10px;
}
.popup-head svg { width: 20px; height: 20px; flex: none; }
.popup-head strong { font-size: 14px; font-weight: 650; }
.popup-head .count {
  margin-left: auto; background: var(--green); color: #14321c;
  border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700;
}
.popup-body { padding: 14px 15px 15px; }
.popup-total {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 13px;
}
.popup-total b { display: block; font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.popup-total span { color: var(--ink-2); font-size: 11.5px; }
.popup .row-list li { padding: 9px 0; }
.popup .row-main strong { font-size: 12.5px; }
.popup-actions { display: flex; gap: 8px; margin-top: 13px; }
.popup-actions button { flex: 1; justify-content: center; }
.pad { padding: 12px 0; }

/* ----------------------------------------------------------- drop target */

/*
 * The whole window accepts a drop, so the cue covers the whole window. It sits
 * above everything and ignores the pointer, or it would swallow the drop event
 * it exists to advertise.
 */
.dropveil {
  position: fixed;
  inset: 12px;
  z-index: 50;
  pointer-events: none;
  display: grid;
  place-items: center;
  border: 2px dashed var(--mint);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tea) 60%, transparent);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dropveil {
    background: color-mix(in srgb, var(--amethyst) 70%, transparent);
    color: var(--sidebar-ink);
  }
}

:root[data-theme="dark"] .dropveil {
  background: color-mix(in srgb, var(--amethyst) 70%, transparent);
  color: var(--sidebar-ink);
}

/* ------------------------------------------------- sync badge and modes */

.chip-warn { background: var(--warn-bg); color: var(--warn); }
.brand .chip { margin-left: auto; font-size: 10px; }
.conn input[type="radio"] { margin-top: 3px; accent-color: var(--primary); }

/* ------------------------------------------------- top bar and user chip */

.topbar { display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 14px;
  background: none; border: 0; border-radius: 999px;
  cursor: pointer; font: inherit; color: var(--ink);
}
.user-chip:hover { background: var(--surface-2); }
.user-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
.user-text strong { font-size: 13px; font-weight: 600; }
.user-text span { font-size: 11.5px; color: var(--ink-3); }
.topbar .avatar { width: 34px; height: 34px; font-size: 13px; background: var(--indigo); color: #fff; }

/* ------------------------------------------------------- course catalogue */

/*
 * A tray on the dashboard and a grid in the full view, from one card. The
 * card sizes itself, so the two layouts differ only in how many fit.
 */
.course-tray {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.course-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Cards stretch to the tallest in their row, which is what lets the footers
   line up. `height: 100%` makes that explicit rather than relying on the
   grid's default stretch surviving a future change. */
.course-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
}
.course-top { background: var(--surface-2); position: relative; }
/* A ratio rather than a fixed height: every card in a row is the same width,
   so they all get the same image height, and it stays in proportion when the
   window narrows instead of squashing to a letterbox. */
.course-image {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
}
.course-image.placeholder {
  background: linear-gradient(135deg, var(--tea), var(--surface-2));
}
/* Grows to fill the card so the footer below it can be pushed to the bottom. */
.course-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-provider { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.course-card h3 { font-size: 13.5px; font-weight: 650; color: var(--ink); margin: 0; line-height: 1.35; }
/* Clamped, so one provider's essay does not make its card twice the height of
   the row. The full text is still in the DOM for search and for a title. */
.course-desc {
  margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--ink-2); }
.course-fact { display: inline-flex; align-items: center; gap: 5px; }
/* Subtle on purpose: these are for scanning, not for reading. */
.fact-icon { width: 13px; height: 13px; flex: none; color: var(--ink-3); }

.course-price { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.course-price .now, .course-price .was { font-size: 13px; font-weight: 600; color: var(--ink); }
.course-price small { font-weight: 400; color: var(--ink-3); font-size: 11px; }
/* The offer reads as a saving rather than as the only price. */
/* The tag on a promoted card. Same card, same size - the only difference
   between it and its neighbours is this and its place in the row. */
.course-tag {
  position: absolute; top: 8px; left: 8px;
  background: var(--success-bg); color: var(--success-ink);
  border-radius: 999px; padding: 3px 9px; font-size: 10.5px; font-weight: 650;
  letter-spacing: .01em;
}
/* Solid on the hero, because it sits over a photograph rather than over the
   card's own surface, and a tinted background is not reliably legible there. */
.course-tag.solid {
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 1px 4px rgba(27, 32, 51, .3);
}
/*
 * Worked out from the two prices above it, never typed into the sheet.
 *
 * Plain text, not a second filled badge: the offer pill is the claim and
 * this is its size. Two green pills stacked read as two different offers.
 */
.course-saving { font-size: 11px; font-weight: 600; color: var(--success-ink); }
.course-price .offer {
  align-self: flex-start;
  background: var(--success-bg); color: var(--success-ink);
  border-radius: 6px; padding: 3px 8px; font-size: 11.5px;
}
/* `margin-top: auto` is what aligns every "View course" in a row on one line,
   however long the titles and descriptions above them are. The rule sits on
   the footer rather than the link so the divider moves with it. */
.course-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; align-items: center;
}
/* 44px is the tap target: a 32px link is fine with a mouse and a guess
   with a finger or a shaky hand. */
.course-link {
  align-self: flex-start; font-size: 12.5px;
  display: inline-flex; align-items: center; min-height: 44px;
}
.course-nolink { font-size: 12px; color: var(--ink-3); }

.search {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 13px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* Wraps rather than squeezing: on a narrow window the heading takes its own
   line and the search keeps a usable width, instead of both shrinking until
   neither is readable. */
.tray-head {
  display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap;
}
.tray-title {
  font-size: 14px; font-weight: 650; color: var(--ink); margin: 0; flex: none;
}
/* The search still takes the slack, but stops shrinking before it is too
   small to type in, which is what forces the wrap. */
.tray-head .search { flex: 1 1 200px; min-width: 200px; }

.pill.local { background: var(--surface-2); color: var(--ink-2); }
.pill.synced { background: var(--success-bg); color: var(--success-ink); }

/* ----------------------------------------------------------- provider mark */

/*
 * One size for both the logo and the monogram, so a card does not change
 * shape when a logo is added or fails to load.
 */
.course-provider { display: flex; align-items: center; gap: 7px; }
.provider-logo {
  width: 18px; height: 18px; flex: none;
  border-radius: 4px; object-fit: contain;
  /* Marks are drawn for a light background and are often transparent. */
  background: #ffffff;
}
.provider-logo.monogram {
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
  font-size: 8.5px; font-weight: 700; letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .provider-logo.monogram { background: var(--surface-2); }
}

/* A standing disclaimer. Takes its size and colour from `note small`, the
   app's existing style for explanatory text, and adds only what a long
   paragraph needs: a measure to read against, and room above it.

   It used to set 11.5px and --ink-3 itself, which made it the third kind of
   secondary text on a page that already had a 13px subtitle and 14px notes.
   Nothing here overrides type any more, so it stays uniform if that scale
   ever changes. */
.disclaimer { margin: 18px 0 4px; max-width: 70ch; line-height: 1.55; }
.disclaimer .link { font: inherit; }

/* ------------------------------------------------------------ update bar */

/* Pale amber: present without being an alarm. An update is good news that can
   wait, so it must not look like the error banner directly below it. */
.banner.update {
  background: var(--warn-bg); color: var(--warn); border-color: transparent;
}
/* Below the minimum the server accepts: the same bar, saying something that
   actually costs the user a feature. */
.banner.update.blocked { background: var(--danger-bg); color: var(--danger); }
.update-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ghost.small { padding: 5px 11px; font-size: 12.5px; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .banner.update { background: rgba(240, 180, 90, .14); color: #e7b771; }
:root:not([data-theme="light"]) .banner.update.blocked { background: rgba(230, 120, 120, .15); color: #e79a9a; }}

/* Added by vite/theme-aware-css.ts - see the file header. */
:root[data-theme="dark"] .banner.update { background: rgba(240, 180, 90, .14); color: #e7b771; }
:root[data-theme="dark"] .banner.update.blocked { background: rgba(230, 120, 120, .15); color: #e79a9a; }


/* --------------------------------------------------------------- firm bar */

/* An invitation and a removal notice share the strip, and both are
   deliberately quiet. Neither is an error, and an invitation in particular
   must not look like something has gone wrong - it is a question. Indigo
   rather than amber so it is not mistaken for the update bar sitting
   immediately above it. */
.banner.firm {
  background: var(--surface-2); border-color: var(--line); color: var(--ink);
  align-items: flex-start;
}
.banner.firm.invite { border-left: 3px solid var(--primary); }
.banner.firm .muted { display: block; margin-top: 3px; }
.primary.small { padding: 5px 11px; font-size: 12.5px; }

@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .banner.firm { background: rgba(255, 255, 255, .04); }}

/* Added by vite/theme-aware-css.ts - see the file header. */
:root[data-theme="dark"] .banner.firm { background: rgba(255, 255, 255, .04); }


/* ------------------------------------------------- catalogue filter bar */

.filter-panel { padding: 12px 14px; }
/* Wraps rather than squeezing: at the smallest window the sort and the
   button drop below the search instead of all three becoming unusable. */
.filter-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-top .search { flex: 1 1 220px; min-width: 180px; }
.filter-top select { flex: none; width: auto; }

/* Auto-fit, so four groups sit in a row on a wide window and stack on a
   narrow one without a breakpoint for each width. */
.filter-body {
  display: grid; gap: 14px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.filter-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.filter-group legend {
  padding: 0 0 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
/* Capped and scrollable: a catalogue with forty providers must not push the
   courses off the screen. */
.filter-options { display: flex; flex-direction: column; gap: 6px; max-height: 168px; overflow-y: auto; }
.check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--primary); flex: none; }
/* Wraps, and the inputs are allowed to shrink. A date input carries an
   intrinsic width in Chromium that flex:1 alone will not override, so it
   overflowed the panel at the app's smallest window until width:100% and
   min-width:0 were both set. */
.filter-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-range input { flex: 1 1 88px; min-width: 0; width: 100%; }
.filter-range input[type="date"] { flex-basis: 128px; }
.filter-group small { font-size: 11px; line-height: 1.4; }

.filter-chips {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 11.5px; cursor: pointer;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }

/* --------------------------------------------- dashboard right-hand column */

/* The aside drops below the main column before either becomes too narrow to
   read, which at the app's 940px minimum means it is already stacked. */
.dash-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 290px; }
}
.dash-main { min-width: 0; }
.dash-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.quick-links h2 { margin: 0 0 10px; }
.quick-link {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 9px 8px; text-align: left; font: inherit; cursor: pointer; color: var(--ink);
}
.quick-link:hover { background: var(--surface-2); }
.quick-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.quick-glyph {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(74, 85, 168, .10); color: var(--primary);
}
.quick-icon { width: 15px; height: 15px; }
.quick-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.quick-text strong { font-size: 13px; font-weight: 600; }
.quick-text span { font-size: 11.5px; color: var(--ink-2); }
.quick-chevron { width: 14px; height: 14px; color: var(--ink-3); flex: none; }

/* Skeletons, so a slow first fetch is a shape rather than a jump. */
.skeleton-line, .skeleton-block {
  background: var(--surface-2); border-radius: 6px; width: 100%;
}
.skeleton-line { height: 12px; }
.skeleton-line.short { width: 55%; }
.skeleton-block { height: 52px; }

@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) .price-offer { background: rgba(130, 142, 230, .16); }
:root:not([data-theme="light"]) .price-offer-label,
:root:not([data-theme="light"]) .price-offer strong { color: #a8b1ee; }
:root:not([data-theme="light"]) .quick-glyph { background: rgba(130, 142, 230, .16); color: #a8b1ee; }}

/* Added by vite/theme-aware-css.ts - see the file header. */
:root[data-theme="dark"] .price-offer { background: rgba(130, 142, 230, .16); }
:root[data-theme="dark"] .price-offer-label,
:root[data-theme="dark"] .price-offer strong { color: #a8b1ee; }
:root[data-theme="dark"] .quick-glyph { background: rgba(130, 142, 230, .16); color: #a8b1ee; }


/* ===========================================================================
   Compliance: rings, score, timeline, chart, add-activity.

   Every colour here is an existing token - --primary for progress, --success
   for met, --warn for a limit or a pace warning, --danger for over. Nothing
   new was introduced, so dark mode and the contrast ratios come along for
   free rather than needing a second pass.

   The one piece of motion in the whole feature is the ring fill, and it is
   dropped entirely under prefers-reduced-motion.
   =========================================================================== */

.compliance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

/* ------------------------------------------------------------------ rings */
.ring { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring-art { position: relative; }
.ring-track { stroke: var(--surface-2); }
.ring-fill { stroke: var(--primary); transition: stroke-dasharray .45s ease-out; }
.ring-met .ring-fill { stroke: var(--success); }
.ring-limit .ring-fill { stroke: var(--warn); }
.ring-over .ring-fill { stroke: var(--danger); }
.ring-centre {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 17px; font-weight: 650; letter-spacing: -.02em; color: var(--ink);
}
.ring-centre b { font-weight: 650; }
.ring-tick {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  background: var(--success-bg); color: var(--success);
}
.ring-label { text-align: center; display: flex; flex-direction: column; gap: 2px; max-width: 132px; }
.ring-label strong { font-size: 12px; font-weight: 600; }
.ring-label span { font-size: 11px; color: var(--ink-2); }
.ring-state { font-size: 10.5px; font-weight: 600; }
/* A requirement as a tile: the same border, radius and surface as a timeline
   year card, so the two rows below each other read as one card. The width is
   set here and not from the art size, because the rule note underneath is
   what decides how wide the tile has to be. */
.ring-tile {
  padding: 14px 12px 12px; gap: 10px; justify-content: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.ring-tile .ring-label { max-width: 100%; }
.ring-note { font-size: 10.5px; color: var(--ink-2); line-height: 1.35; margin-top: 2px; }
/* The word "Met" is text, and --success is 4.25:1 on the surface - just
   under 4.5:1. The colour cue lives in the arc and the tick glyph, which are
   graphics and only need 3:1 (the tick is 3.42:1 on --success-bg). */
.ring-state.met { color: var(--ink-2); }
.ring-state.over { color: var(--danger); }
.ring-state.limit { color: var(--warn); }
/* A grid, not a flex row, and for one reason: a wrapped flex item with
   flex-grow stretches to fill the line it landed on, so four tiles in a
   three-wide card gave the fourth the full width of the panel. The columns
   are the same shape as the timeline's underneath it. */
.ring-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; padding: 4px 0 6px;
}

/* ------------------------------------------------------------- score card */
/*
 * Two columns that begin and end together.
 *
 * `stretch` rather than `start`, and no height anywhere: the row is as tall
 * as the taller column and both children fill it. Inside, the score card
 * takes the slack on the left and the three cards divide the right evenly,
 * so the bottom edges line up whatever the content length. It was `start`,
 * which left the two columns ending wherever their content happened to.
 */
.score-grid {
  display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px;
  align-items: stretch; margin-bottom: 16px;
}
.score-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* The score card absorbs the slack, so Quick links sits on the bottom edge
   rather than floating halfway up a column with space under it. */
.score-col > .score-card { flex: 1; }
/* The gap does the spacing. `.panel` carries a bottom margin for the ordinary
   stacked case, and left on here it would be added to the gap. */
.score-col > .panel, .score-side > .panel { margin-bottom: 0; }
.score-body { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.score-ring { display: flex; flex-direction: column; align-items: center; gap: 2px; }
/* The score is already out of 100, so the middle of the ring carries the
   number itself and the unit goes underneath. "78%" would be a percentage of
   a percentage. */
.score-number { font-size: 30px; font-weight: 650; letter-spacing: -.03em; }
/* --ink-2, not --ink-3: measured at 5.83:1 against the surface, where
   --ink-3 is 3.05:1 and fails 4.5:1 for text this size. */
.score-out-of { font-size: 11px; color: var(--ink-2); }
.score-caption {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-2); margin-top: 4px;
}
.score-parts { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Three equal rows, so the last card ends level with Quick links opposite
   it. A flex column sized them by content, which is why the right-hand
   column used to stop short of the left. */
.score-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; min-width: 0; }

.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.meter-label { font-size: 12px; font-weight: 600; }
.meter-right { font-size: 12px; font-weight: 600; }
.meter-track {
  height: 8px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); overflow: hidden;
}
.meter-track i { display: block; height: 100%; background: var(--primary); transition: width .4s ease-out; }
.meter-track.tone-met i { background: var(--success); }
.meter-track.tone-limit i { background: var(--warn); }
.meter-track.tone-over i { background: var(--danger); }
.meter-note { margin: 5px 0 0; font-size: 11px; color: var(--ink-2); }

.next-action { margin: 16px 0 0; font-size: 13px; }
.next-action strong {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-2); margin-bottom: 2px;
}
.disclaimer {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--ink-2);
}

/* ------------------------------------------------------------- side cards */
.side-card h3 {
  margin: 0 0 8px; font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .06em;
}
.side-card strong { font-size: 14px; }
.side-card .streak-count {
  display: block; font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1;
}
/* "7 in a row" is one phrase, so the words sit on the number's baseline
   rather than on a line of their own. */
.streak-unit { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.side-detail { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.side-bar { height: 6px; margin-top: 10px; }

/* -------------------------------------------------------- milestone banner */
.milestone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-left: 3px solid var(--success); margin-bottom: 16px;
}
.milestone-main { display: flex; align-items: center; gap: 12px; }
.milestone-mark { width: 10px; height: 10px; border-radius: 999px; background: var(--success); flex: none; }
.milestone-main strong { display: block; font-size: 13.5px; }
.milestone-word { color: var(--success-ink); }
.milestone-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-only {
  background: none; border: 0; font-size: 20px; line-height: 1; color: var(--ink-2);
  cursor: pointer; padding: 2px 8px; border-radius: var(--radius-sm);
}
.icon-only:hover { background: var(--surface-2); color: var(--ink); }

/* -------------------------------------------------------------- body panel */
/* The tabs and the period share one rule above the panel: which
   accreditation on the left, the dates it is being measured over on the
   right. The period used to sit under the tabs, where it read as a heading
   for the rings rather than as the span the whole card covers. */
.tabs-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap;
}
.tabs-head .tabs { border-bottom: 0; margin-bottom: 0; }
.tabs-period { margin: 0 0 8px; text-align: right; }
.body-heading { margin-bottom: 12px; }
.body-heading h2 { margin: 0 0 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.body-period { margin: 0 0 10px; }
.section-head {
  margin: 18px 0 10px; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .05em;
}
.rule-notes { margin: 2px 0 0; padding-left: 18px; font-size: 11.5px; color: var(--ink-2); }
.rule-notes li { margin-bottom: 3px; }
.rule-notes.untracked { margin-top: 14px; }
.sources { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- timeline */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.year-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px;
  background: var(--surface-2);
}
.year-card.current { background: var(--surface); border-color: var(--primary); }
.year-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.year-hours { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.year-bar { margin-top: 8px; }

/* -------------------------------------------------------------------- pace */
.pace { margin-top: 16px; }
.pace-track {
  position: relative; height: 12px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line);
}
.pace-track i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.pace-track.ahead i { background: var(--success); }
.pace-marker {
  position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--warn);
  border-radius: 2px; transform: translateX(-1px);
}
.pace-note { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-2); }

/* ------------------------------------------------------------------- chart */
.chart-block { margin-top: 20px; }
/* The axis labels are HTML beside and beneath the drawing, not <text> inside
   it: the chart stretches to the panel with preserveAspectRatio="none", which
   would squash type. The strokes survive because they are non-scaling. */
.chart-frame { display: flex; align-items: stretch; gap: 8px; }
.chart-y {
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 10px; color: var(--ink-2); text-align: right; min-width: 36px; flex: none;
  padding: 2px 0;
}
.chart-x {
  display: flex; justify-content: space-between; margin: 4px 0 0 44px; font-size: 10px;
}
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart { width: 100%; height: 150px; display: block; min-width: 0; }
.chart-line {
  fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.chart-pace {
  fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.chart-today { stroke: var(--warn); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--primary); }
.chart-key { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 0; }
.chart-key span {
  display: inline-block; width: 16px; height: 0; border-top-width: 2px;
  border-top-style: solid; margin-left: 10px;
}
.chart-key .key-line { border-top-color: var(--primary); }
.chart-key .key-pace { border-top-color: var(--ink-3); border-top-style: dashed; }
.chart-key .key-today { border-top-color: var(--warn); }
.scope-toggle { display: flex; gap: 2px; flex: none; }

/* --------------------------------------------------- courses for you */
/*
 * A hero across two thirds, up to two smaller featured cards down the last
 * third, and the ordinary row underneath. Every part is allowed to be
 * absent: one flagged course gets `.solo` and the whole width, and none at
 * all leaves the row on its own with nothing above it.
 */
.course-feature-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px;
}
.course-feature-grid.solo { grid-template-columns: 1fr; }
.course-feature-side { display: grid; grid-template-rows: repeat(2, 1fr); gap: 14px; min-width: 0; }

/*
 * A third picture, two thirds words.
 *
 * A fraction rather than 260px, so the picture keeps its share of the card at
 * every width instead of becoming a thumbnail on a wide screen and half the
 * card on a narrow one. The floor stops it going so narrow that a photograph
 * is cropped past recognising.
 */
.course-hero {
  display: grid; grid-template-columns: minmax(180px, 34%) minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.hero-art { position: relative; min-height: 190px; }
/*
 * Fills its column however tall the words beside it turn out to be, rather
 * than keeping a 16:9 box and leaving a strip under it. `cover` crops rather
 * than squashing; the rounded corners come from the card's own `overflow:
 * hidden`, which is why they only need saying for the narrow fallback below.
 */
.hero-image {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hero-title {
  margin: 0; font-size: 17px; font-weight: 650; line-height: 1.3;
  letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Flat, because these are facts about the course rather than filters the
   user can press. `.chip` is the pressable one and has a hover state. */
.chip-flat {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600;
}
/* The one sentence that is about this person rather than the course. It is
   absent entirely when nothing true could be written, so it never needs an
   empty state. */
.hero-why {
  margin: 2px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.45;
  border-left: 2px solid var(--primary); padding-left: 10px;
}
.hero-why strong {
  display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-2); margin-bottom: 1px;
}
.hero-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.hero-now { font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.hero-gst { font-size: 11px; color: var(--ink-2); }
.hero-was { font-size: 13px; color: var(--ink-2); text-decoration: line-through; }
.hero-saving { margin: 0; font-size: 12px; font-weight: 600; color: var(--success-ink); }
/*
 * The links out of a card, as links.
 *
 * `<a href>` rather than `<button>`, so they are focusable, Enter works with
 * no key handler, and the context menu offers to copy the address. These two
 * rules are what make an anchor look like the app's primary button, and the
 * 44px floor is the tap target - a 32px button is fine with a mouse and a
 * guess with a finger or a shaky hand.
 */
.hero-cta, .small-cta {
  align-self: flex-start; margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; text-decoration: none;
}

/* The same shape as the hero, smaller: a third picture, the rest words. */
.course-small {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; min-width: 0;
  display: grid; grid-template-columns: minmax(84px, 33%) minmax(0, 1fr);
}
.small-art { position: relative; min-height: 112px; }
.small-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.small-body {
  padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.course-small .course-tag { position: static; align-self: flex-start; }
.small-title {
  margin: 0; font-size: 13px; font-weight: 650; line-height: 1.35; color: var(--ink);
  overflow-wrap: anywhere;
}
/* Pushed to the bottom and full width, so the two cards' buttons line up with
   each other whatever their titles did above them. */
.small-cta {
  margin-top: auto; width: 100%; justify-content: center;
  font-size: 12px; padding: 0 10px;
}

@media (max-width: 1100px) {
  /* The hero's two thirds stop being two thirds of enough. */
  .course-feature-grid { grid-template-columns: 1fr; }
  .course-feature-side { grid-template-rows: auto; grid-template-columns: repeat(2, 1fr); }
}
/*
 * The picture moves above the details rather than squeezing beside them.
 *
 * 1000px, not 760: the app's own `minWidth` is 940, so a breakpoint below
 * that can never fire in the window it was written for. This one is the
 * smallest window the app actually has.
 */
@media (max-width: 1000px) {
  .course-hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; }
  .hero-image { aspect-ratio: 16 / 9; height: auto; }
  /*
   * A photograph wants 16:9 across the full width. A logo on a panel does
   * not - at 660px that is 370px of empty space with a mark in the middle -
   * so the panel takes a fixed band instead of the ratio.
   */
  .hero-art .art-panel {
    aspect-ratio: auto; height: 150px; min-height: 0;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  /* Narrower still: the thumbnails go over the top too. */
  .course-small { grid-template-columns: 1fr; }
  .small-art { min-height: 0; }
  .small-image { aspect-ratio: 16 / 9; height: auto; }
  .course-small .art-panel {
    aspect-ratio: auto; height: 100px; min-height: 0;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .course-feature-side { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------- registrations */
/*
 * The Settings pane, and the dashboard's offer to set one up. No new colours
 * and no new components - the rows borrow the list shapes already used for
 * pending captures, and the form uses the same `.form-grid`, `.choice-set`
 * and `.pill` the rest of Settings does.
 */

/* The prompt above an empty dashboard. Bordered like the milestone banner,
   in --primary rather than --success: this is something to do, not something
   achieved. */
.reg-prompt {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  border-left: 3px solid var(--primary); margin-bottom: 16px;
}
.reg-prompt strong { display: block; font-size: 14px; margin-bottom: 3px; }
.reg-prompt .sub { max-width: 62ch; }

.reg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reg-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 12px 14px;
}
.reg-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reg-row-main strong { font-size: 13.5px; }

.reg-form {
  background: var(--surface-2); margin-top: 14px;
  border: 1px solid var(--line); box-shadow: none;
}
.reg-form-head { font-size: 13px; margin: 0 0 12px; color: var(--ink); font-weight: 650; }

/* The range the user confirms. Boxed because it is the one thing on the form
   that is computed rather than typed, and the one worth re-reading. */
.reg-confirm {
  margin: 12px 0 0; padding: 10px 12px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}

.reg-requirements { display: flex; flex-direction: column; gap: 10px; }
.reg-req {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
}
/* `flex-direction: row` said out loud: the base `label` rule is a column,
   which put every figure under its own name and the unit half a card away. */
.reg-req-label {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  flex: 1 1 260px; min-width: 0;
}
.reg-req-label input { width: 96px; flex: none; }
.reg-req-side {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  flex: 1 1 240px; min-width: 0;
}
.reg-source { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.reg-source .link { font-size: inherit; }

@media (max-width: 1000px) {
  .reg-row { flex-direction: column; align-items: flex-start; }
  .reg-prompt { flex-direction: column; }
}

/* ------------------------------------------------------- picture fallbacks */
/*
 * What fills the picture space when there is no picture.
 *
 * Never an empty box and never the browser's broken-image glyph: the
 * provider's logo on a neutral panel, or their initials if there is no logo
 * either. It takes the same box as a photograph would - the same class is on
 * both - so a card with a picture and a card without are the same size and
 * the price, the saving and the button sit in the same place on each.
 */
.art-panel {
  display: grid; place-items: center;
  background: var(--surface-2); border-right: 1px solid var(--line);
  padding: 14px; box-sizing: border-box;
}
.course-top .art-panel { border-right: 0; border-bottom: 1px solid var(--line); }
/* `contain`, not `cover`: a logo cropped to fill a box is a logo nobody
   recognises, which is the whole reason it is standing in for the picture. */
.art-panel-logo { max-width: 72%; max-height: 72%; object-fit: contain; }
.art-panel-initials {
  font-size: 22px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3);
}
.course-small .art-panel-initials { font-size: 17px; }

/* ------------------------------------------------------------ email viewer */
/*
 * The message a detection came from. No new colours: the card is a `.panel`,
 * the headers are a definition list, and the body sits on `--surface-2` so
 * whatever the sender's HTML does to its own background, the card edge is
 * still the app's.
 */
.email-card { background: var(--surface-2); }
.email-head { font-size: 14px; font-weight: 650; color: var(--ink); margin: 0 0 10px; }
.email-headers { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.email-fields {
  display: grid; grid-template-columns: 76px minmax(0, 1fr);
  gap: 4px 12px; margin: 0; font-size: 12.5px;
}
.email-fields dt { color: var(--ink-2); font-weight: 600; }
.email-fields dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* Amber, not red: a blocked tracking pixel is worth knowing about, not a
   problem with the message. */
.email-blocked {
  margin: 0 0 10px; padding: 8px 11px; font-size: 11.5px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: var(--radius-sm);
}

/*
 * The sender's own markup lives in here and nowhere else.
 *
 * Bounded height so a newsletter cannot push the buttons off the screen,
 * `overflow: auto` so it scrolls inside its box, and a white background
 * because email HTML is written for one and reads badly on a dark card.
 */
.email-body {
  max-height: 400px; overflow: auto; background: #ffffff; color: #1b2033;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; line-height: 1.5;
}
.email-body.expanded { max-height: 70vh; }
.email-body img, .email-body table { max-width: 100%; }
.email-body table { border-collapse: collapse; }
.email-body a { color: #2a3db8; }
/* The marker left where a remote image was refused. */
.email-body .blocked-image {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: #eef0f7; color: #5d6480; font-size: 11px;
  max-width: 100%; overflow-wrap: anywhere; vertical-align: middle;
}
.email-body-wrap { margin-bottom: 4px; }
/* The expand control is not part of the sender's box. */
.email-body-wrap > .link { margin-top: 8px; }

/* ------------------------------------------------------------- attachments */

.attachments { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.attachment {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 11px 12px;
}
/* The one that becomes the record's evidence, marked on the card rather than
   only in a sentence somewhere else. */
.attachment.chosen { border-color: var(--primary); }
.attachment-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.attachment-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attachment-name strong { font-size: 12.5px; overflow-wrap: anywhere; }
.attachment-evidence {
  margin: 8px 0 0; font-size: 11.5px; font-weight: 600; color: var(--primary);
}
/* Electron's own PDF viewer, which brings page navigation and zoom with it. */
.attachment-pdf {
  width: 100%; height: 460px; margin-top: 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #ffffff;
}
.attachment-image {
  display: block; max-width: 100%; max-height: 420px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* ------------------------------------------------------ why it was picked up */

.why-details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 10px 12px; margin-bottom: 16px;
}
.why-details summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.why-details summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.why-summary { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.why-summary .chips { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.why-details .debug { margin-top: 10px; }

/* ----------------------------------------------------------- activity grid */
.activity-grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.activity-grid th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-2); font-weight: 600; padding: 0 10px 8px 0; border-bottom: 1px solid var(--line);
}
.activity-grid td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.activity-grid tr:last-child td { border-bottom: 0; }

/* -------------------------------------------------------------- add screen */
.add-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.add-side { display: flex; flex-direction: column; gap: 16px; }
.add-actions { display: flex; gap: 10px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-set {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 14px;
}
.choice-set legend { font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.choice-set p { margin: 0 0 8px; }
.radio, .check {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px;
  margin-bottom: 6px; font-weight: 500;
}
.radio input, .check input { margin: 2px 0 0; flex: none; }
.counts-row span { display: flex; flex-direction: column; gap: 1px; }
.dropzone {
  border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 16px;
  text-align: center; background: var(--surface-2);
}
.dropzone strong { display: block; font-size: 12.5px; margin-bottom: 3px; }
.dropzone button { margin-top: 10px; }
.evidence-chosen { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; }
.hint-certificate {
  margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--warn-bg); border: 1px solid var(--warn); font-size: 11.5px;
}

/* ------------------------------------------- the smallest window the app has */
/* minWidth is 940 and the sidebar takes its share, so both two-column
   layouts fold before the content starts truncating. */
@media (max-width: 1180px) {
  .score-grid, .add-grid { grid-template-columns: 1fr; }
  .score-body { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .score-parts { width: 100%; text-align: left; }
  /* Stacked, the order is score, quick links, then the three cards - and
     each is as tall as its own content. Equal rows only mean something
     while they are a column beside another one. */
  .score-side { grid-template-rows: auto; }
  .score-col > .score-card { flex: 0 1 auto; }
}
@media (max-width: 1000px) {
  .field-pair { grid-template-columns: 1fr; }
  .compliance-head { flex-direction: column; }
  /* Once the tabs and the period have wrapped onto separate lines, a
     right-aligned period is a line of text floating away from everything
     else on the card. */
  .tabs-period { text-align: left; margin-bottom: 10px; }
}

/* Focus has to be visible on everything new, not only on inputs. */
.tab:focus-visible, .icon-only:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ring-fill, .meter-track i { transition: none; }
}
/* Not stored yet is an ordinary state, so this sits inside the row rather
   than replacing it. */
.attachment-problem { margin: 8px 0 0; line-height: 1.5; }

/* ------------------------------------------------------------ assigned CPD */

/*
 * Courses the firm has asked somebody to book.
 *
 * Built from the existing tokens and the existing button classes - no new
 * colour, which is the rule the compliance work settled. The left-hand accent
 * is `--primary` at low alpha, the same treatment `.quick-glyph` uses, and it
 * is decoration: the heading and the sentence under it carry the meaning, so
 * the card reads the same with the stripe removed.
 */
.assigned-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.assigned-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border-left: 3px solid rgba(74, 85, 168, .35);
  background: var(--surface-2);
}
.assigned-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.assigned-text strong { font-size: 13.5px; font-weight: 600; }
/* Wraps rather than truncating: a course title somebody has to recognise is
   not improved by an ellipsis. */
.assigned-row .actions { flex: none; }

/* Stack at the app's own minimum width, so neither button leaves the card. */
@media (max-width: 1000px) {
  .assigned-row { flex-direction: column; align-items: stretch; }
  .assigned-row .actions { justify-content: flex-start; }
}

/* The prompt is a banner; it only needs its buttons kept off the sentence. */
.assigned-prompt { gap: 14px; }
.assigned-prompt .actions { flex: none; }
/*
 * The desktop app's stylesheet, plus the few rules this surface needs that
 * the app has no equivalent for.
 *
 * `@styles` is the desktop repository's own `src/ui/styles.css`, imported
 * rather than copied, so every colour, font size, radius and spacing value
 * here is the app's. Nothing below overrides it. Everything below is for
 * markup the app does not have, and there are only two kinds of that:
 *
 *   1. The sign-in screen. The desktop is local-first and works forever with
 *      no account, so it has no screen that stands in front of the app -
 *      there is nothing to borrow.
 *   2. The privacy list in Settings, which is a claim-by-claim list the
 *      desktop does not make anywhere.
 *
 * If a rule here starts looking like a correction to the app's styles, that
 * is the signal to change the markup to match the app instead.
 *
 * `@styles` is imported from main.tsx ahead of this file, so the order is
 * stated in code rather than inferred from an `@import`. There is no `body`
 * rule here: the app's stylesheet already sets the margin, `--bg` and
 * `--ink` on it, and writing those again would be the first of the
 * corrections this file is not supposed to contain.
 */

/* --------------------------------------------------------- the sign-in page */

/*
 * One centred card on the page's own background. It is deliberately not a
 * `.app`/`.sidebar`/`.main` frame with the navigation greyed out: nothing
 * behind this screen is reachable, and showing a disabled shell would
 * suggest otherwise.
 */
.signin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.signin-card {
  width: 100%;
  max-width: 400px;
  padding: 26px 24px 22px;
}

/* The app's `.panel-head` assumes a row of actions beside the heading. */
.signin-card .panel-head {
  margin-bottom: 4px;
}

.signin-card form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.signin-card .primary {
  width: 100%;
  justify-content: center;
}

/*
 * The alternatives under the button. Spaced apart because "Create an
 * account" and "Forgotten your password?" ran together into one blue line
 * that read as a single link.
 */
.signin-alts {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------- the privacy claims */

/*
 * `.note` and `.small` are the app's; this is the list layout only.
 */
.privacy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.privacy-list li {
  display: flex;
  gap: 9px;
  align-items: baseline;
}

/*
 * `--success-ink`, not `--success`.
 *
 * The green for text is a token the desktop added after measuring: `--success`
 * is 3.39:1 on the surface and is for arcs and ticks, which are graphics and
 * need only 3:1. Using it here would reintroduce exactly the contrast failure
 * its CLAUDE.md records fixing.
 */
.privacy-list .tick {
  color: var(--success-ink);
  font-weight: 650;
}

/* ------------------------------------------------------------ small fixes */

/*
 * The app's `minWidth` is 940 and the score card's two columns need it.
 * A browser window has no minimum, so this is the one place the web surface
 * genuinely meets a case the desktop cannot.
 */
@media (max-width: 940px) {
  .score-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }
}

/*
 * The sidebar's account block is a button in the app, because it opens the
 * Storage screen. Here it opens nothing - you are already signed in and
 * there is no local file to describe - so it is a div, and the app's
 * `button`-shaped rules do not reach it.
 */
.sidebar .account-foot {
  width: 100%;
  text-align: left;
}

/* ------------------------------------------------------- theme choices */

/*
 * The app's `.radio` class, in a column. `label` is `flex-direction: column`
 * app-wide and `.radio` resets it to a row - the desktop found that the hard
 * way when every radio in the app stretched to full width with its glyph
 * adrift in the middle - so this only needs to stack the group.
 */
.theme-choices {
  display: grid;
  gap: 10px;
  max-width: 340px;
}

/* ===================================================== the course shelves */

/*
 * Two grids instead of the app's one.
 *
 * The desktop uses a single `repeat(auto-fill, minmax(260px, 1fr))` and puts
 * a small tag on promoted cards, and its own comment explains why: a
 * promoted course is still a course, and a bigger box would be the separate
 * featured section coming back in a different shape. On the web the
 * catalogue is a shopfront rather than a pane inside a tool, so the separate
 * section is wanted - and these rules are the whole of the difference.
 *
 * Explicit column counts, not `auto-fill`. `auto-fill` decides the count
 * from the available width, which is right when every card is equal and
 * wrong here: "three across, and bigger" is the requirement, and a minmax
 * that happened to fit four would quietly break it on a wide window.
 */

.shelf-head {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  margin: 22px 0 12px;
}

.shelf-head:first-of-type { margin-top: 6px; }

.featured-grid { grid-template-columns: repeat(3, 1fr); }
.rest-grid { grid-template-columns: repeat(4, 1fr); }

/*
 * One or two featured courses keep the three-column width and sit left.
 *
 * `1fr` columns would stretch two cards to half the page each, and a single
 * one to the full width, where it stops reading as a card and starts reading
 * as a banner. Fixed tracks at the same width as a third of the row, with
 * the rest of the line left empty, is what "left-align, don't stretch" means.
 */
.featured-grid.is-sparse {
  grid-template-columns: repeat(auto-fit, minmax(0, calc((100% - 32px) / 3)));
  justify-content: start;
}

/*
 * Bigger, and the size difference is carried by the card rather than the
 * grid: a taller picture and more room for the title, so a featured card
 * still looks like the same object.
 */
.featured-grid .course-card.is-featured .course-image,
.featured-grid .course-card.is-featured .course-art {
  aspect-ratio: 3 / 2;
}

.featured-grid .course-card.is-featured .course-body { padding: 16px 16px 14px; }
.featured-grid .course-card.is-featured h3 { font-size: 16px; line-height: 1.35; }

.featured-grid .course-card.is-featured {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  box-shadow: var(--shadow);
}

/* The GST label, which the desktop shows only on its hero. On a shopfront
   every price has to say which it is. */
.course-gst { font-size: 11px; color: var(--ink-3); margin-left: 6px; }

/*
 * Responsive, in the steps the brief asked for: featured 3 -> 2 -> 1 and the
 * rest 4 -> 3 -> 2 -> 1. The breakpoints are the app's own 940 - its minimum
 * window width - plus two the desktop never needed, because a desktop window
 * does not go to 390px and a phone does.
 */
@media (max-width: 1180px) {
  .rest-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 940px) {
  .featured-grid,
  .featured-grid.is-sparse { grid-template-columns: repeat(2, 1fr); }
  .rest-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .featured-grid,
  .featured-grid.is-sparse,
  .rest-grid { grid-template-columns: 1fr; }

  /*
   * The sidebar is fixed chrome a phone has no room for, so at this width
   * the frame stacks: navigation across the top, content below. Without it
   * the main column is a sliver and the page scrolls sideways, which is the
   * one thing ruled out.
   */
  .app { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
  }
  .sidebar .brand { width: 100%; }
  .sidebar .nav { flex: 0 0 auto; }
  .sidebar .account-foot { width: 100%; }
  .main { padding: 16px; }
}

/* A label and its control side by side, for the header's profession picker.
   `label` is a column everywhere else, which is right for a form and wrong
   for one control in a toolbar. */
.inline-field { flex-direction: row; align-items: center; gap: 8px; }

/* ============================================ connect Microsoft */

/*
 * The step between sign-in and the dashboard. Wider than the sign-in card
 * because it carries three claims about privacy, and a narrow column turns
 * those into a wall.
 */
.connect-card {
  width: 100%;
  max-width: 520px;
  padding: 26px 26px 22px;
}

.connect-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.connect-head h2 { margin: 0; font-size: 18px; }
.connect-head .sub { margin: 2px 0 0; }

.connect-card .privacy-list { margin: 16px 0; }

/*
 * Both buttons the same size, side by side. "Skip for now" is a real choice
 * - a firm that blocks consent makes it the only route in - so it is not a
 * grey link under the primary action.
 */
.connect-actions {
  display: flex;
  gap: 10px;
  margin: 18px 0 12px;
}

.connect-actions button { flex: 1; justify-content: center; }

/* ---------------------------------------- the dashboard's connection card */

.connect-strip {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.connect-strip h2 { margin: 0 0 4px; font-size: 15px; }
.connect-strip .note { margin: 0; max-width: 62ch; }
.connect-strip button { flex: none; }

/*
 * Connected: one quiet line. It has done its job and should stop taking
 * space from the thing somebody came to the dashboard to read.
 */
.connected-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.connected-who {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
}

.connected-who strong { color: var(--ink); }

/* The detection breakdown under "Why this was picked up". */
.why-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 18px;
  margin: 12px 0 0;
}

.why-facts div { display: grid; gap: 1px; }
.why-facts dt { font-size: 11px; color: var(--ink-3); }
.why-facts dd { margin: 0; font-size: 12.5px; color: var(--ink); }
.why-facts code { font-size: 11.5px; }
