﻿:root{color-scheme:light}body{margin:0}[hidden]{display:none!important}img{max-width:100%}

  /* Layout: ATS shell. Navy sidebar + cool grey canvas, white cards, KPI row, then today's progress and this week vs your own past. */
  :root {
    --canvas: #EEF2F6;
    --card: #FFFFFF;
    --card-line: #DDE4EB;
    --divider: #E7ECF1;
    --ink: #0F2F45;
    --ink-soft: #5B6B78;
    --ink-faint: #8A98A4;
    --nav: #0C3547;
    --nav-active: #1D4C66;
    --nav-ink: #C9D7E2;
    --nav-ink-strong: #FFFFFF;
    --brand: #D7363B;
    --pill: #E8EDF2;
    --pill-ink: #2B3F4F;
    --focus: #2F6DB5;

    /* semantic colour, kept apart from the brand */
    --green: #1F9D57;
    --green-soft: #E3F4EA;
    --blue: #2F6DB5;
    --blue-soft: #E4EDF8;
    --yellow: #E0A100;
    --yellow-soft: #FBF1D6;
    --red: #D93A3A;
    --red-soft: #FBE5E5;
    --on-solid: #FFFFFF;
    --track: #E3E9EF;

    --font: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 10px;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --canvas: #0B1620;
      --card: #12222F;
      --card-line: #213444;
      --divider: #1C2E3D;
      --ink: #E6EEF4;
      --ink-soft: #9FB0BE;
      --ink-faint: #74889A;
      --nav: #082433;
      --nav-active: #183A50;
      --nav-ink: #9FB4C4;
      --nav-ink-strong: #FFFFFF;
      --brand: #F05A5E;
      --pill: #1C3142;
      --pill-ink: #C9D7E2;
      --focus: #6FA5E6;
      --green: #3CC27A;
      --green-soft: #143A28;
      --blue: #6FA5E6;
      --blue-soft: #16304A;
      --yellow: #F2C14E;
      --yellow-soft: #3A3014;
      --red: #F06B6B;
      --red-soft: #402020;
      --on-solid: #08131B;
      --track: #1E3243;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --canvas: #0B1620;
    --card: #12222F;
    --card-line: #213444;
    --divider: #1C2E3D;
    --ink: #E6EEF4;
    --ink-soft: #9FB0BE;
    --ink-faint: #74889A;
    --nav: #082433;
    --nav-active: #183A50;
    --nav-ink: #9FB4C4;
    --nav-ink-strong: #FFFFFF;
    --brand: #F05A5E;
    --pill: #1C3142;
    --pill-ink: #C9D7E2;
    --focus: #6FA5E6;
    --green: #3CC27A;
    --green-soft: #143A28;
    --blue: #6FA5E6;
    --blue-soft: #16304A;
    --yellow: #F2C14E;
    --yellow-soft: #3A3014;
    --red: #F06B6B;
    --red-soft: #402020;
    --on-solid: #08131B;
    --track: #1E3243;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
  }
  button, input, select, textarea { font-family: inherit; }
  button { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

  /* ---- Shell ---- */
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--nav) 232px, var(--canvas) 232px); }
  .side {
    background: var(--nav);
    padding: 32px 14px;
    position: sticky; top: 0; align-self: start; height: 100vh;
  }
  .brand {
    display: flex; align-items: center; gap: 8px;
    color: var(--nav-ink-strong); font-weight: 800; font-size: 1.2rem; letter-spacing: 0.04em;
    padding: 0 10px 22px;
  }
  .brand::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
  .side nav { display: grid; gap: 4px; }
  .side nav a {
    color: var(--nav-ink); text-decoration: none; font-size: 0.95rem;
    padding: 10px 14px; border-radius: 8px;
  }
  .side nav a:hover { color: var(--nav-ink-strong); background: rgba(255,255,255,0.05); }
  .side nav a[aria-current="page"] { background: var(--nav-active); color: var(--nav-ink-strong); font-weight: 700; }

  .main { padding: 32px 32px 64px; min-width: 0; }
  .content { max-width: 1180px; margin: 0 auto; display: grid; gap: 18px; }

  /* ---- Header ---- */
  .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
  .head h1 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 800; line-height: 1.15; text-wrap: balance; }
  .head .sub { color: var(--ink-soft); font-size: 0.95rem; }
  .who { text-align: right; font-size: 0.9rem; color: var(--ink-soft); }
  .who .tz { display: block; margin-top: 2px; font-size: 0.82rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
  .who b { display: block; color: var(--ink); font-weight: 700; }

  /* ---- Cards ---- */
  .card {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    padding: 18px 20px;
    min-width: 0;
  }
  .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
  .card-head h2 { margin: 0; font-size: 1.08rem; font-weight: 800; }
  .count { font-size: 0.8rem; color: var(--ink-faint); font-weight: 600; font-variant-numeric: tabular-nums; }

  /* ---- Wins strip (own past only, never a ranking) ---- */
  .wins { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--green-soft); color: var(--ink); border: 1px solid var(--card-line); font-size: 0.95rem; font-weight: 600; }
  .wins[hidden] { display: none; }
  .wins svg { flex-shrink: 0; color: var(--green); }
  .mic svg { display: block; margin: 0 auto; }

  /* ---- KPI tiles ---- */
  .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .kpi { padding: 18px 20px 16px; }
  button.kpi { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
  button.kpi:hover { border-color: var(--blue); }
  .kpi .num, .kpi .lbl { display: block; }
  .kpi .num { font-size: 2.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
  .kpi .lbl { color: var(--ink-soft); font-size: 0.9rem; margin-top: 8px; }
  .kpi .num.due { color: var(--red); }

  /* ---- Progress row ---- */
  .progress-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .eyebrow { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
  .prog-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 6px 0 10px; flex-wrap: wrap; }
  .prog-line .big { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .prog-line .big small { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }
  .bar { height: 12px; background: var(--track); border-radius: 99px; overflow: hidden; }
  .bar > span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width 0.4s ease; }
  .bar.hit > span { background: var(--green); }
  .prog-note { margin-top: 10px; font-size: 0.88rem; color: var(--ink-soft); }
  .prog-note b { color: var(--ink); }

  .week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 64px; margin: 4px 0 6px; }
  .wk-day { display: flex; justify-content: center; align-items: flex-end; gap: 3px; height: 100%; }
  .wk-day i { display: block; width: 9px; border-radius: 3px 3px 0 0; min-height: 2px; }
  .wk-day i.past { background: var(--track); }
  .wk-day i.now { background: var(--blue); }
  .wk-day i.now.ahead { background: var(--green); }
  .wk-day.future i.now { opacity: 0; }
  .wk-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; font-size: 0.7rem; color: var(--ink-faint); font-weight: 700; }
  .wk-labels .today { color: var(--ink); }
  .legend { display: flex; gap: 14px; font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; flex-wrap: wrap; }
  .legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
  .legend .l-now::before { background: var(--blue); }
  .legend .l-past::before { background: var(--track); }
  .delta { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; }
  .delta.up { background: var(--green-soft); color: var(--green); }
  .delta.even { background: var(--blue-soft); color: var(--blue); }
  .delta.down { background: var(--pill); color: var(--pill-ink); }

  /* ---- Capture bar ---- */
  .dispatch-row { display: flex; gap: 10px; align-items: stretch; }
  .dispatch input[type="text"] {
    flex: 1; min-width: 0;
    border: 1px solid var(--card-line); background: var(--canvas); color: var(--ink);
    padding: 12px 14px; font-size: 0.98rem; border-radius: 8px;
  }
  .dispatch input[type="text"]::placeholder { color: var(--ink-faint); }
  .dispatch input[type="text"]:focus { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--card); }
  .btn {
    border: none; background: var(--nav); color: var(--nav-ink-strong);
    padding: 11px 18px; font-size: 0.92rem; font-weight: 700; border-radius: 8px; white-space: nowrap;
  }
  .btn:hover { background: var(--nav-active); }
  .mic {
    border: 1px solid var(--card-line); background: var(--card); color: var(--ink);
    min-width: 46px; padding: 0 12px; font-size: 0.85rem; font-weight: 700; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: stretch;
  }
  .mic[data-live="1"] {
    background: var(--red); border-color: var(--red); color: var(--on-solid);
    animation: pulse 1.1s ease-in-out infinite;
  }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
  .transcript-line { margin-top: 8px; font-size: 0.85rem; color: var(--ink-soft); min-height: 1.2em; }
  .transcript-line .cursor {
    display: inline-block; width: 7px; height: 1em; background: var(--blue);
    vertical-align: text-bottom; animation: blink 1s step-end infinite; margin-left: 2px;
  }
  @keyframes blink { 50% { opacity: 0; } }
  .no-asr-note { margin-top: 6px; font-size: 0.8rem; color: var(--ink-faint); }
  @media (prefers-reduced-motion: reduce) {
    .mic[data-live="1"], .transcript-line .cursor { animation: none; }
    .bar > span { transition: none; }
  }

  /* ---- Two column ---- */
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }

  /* ---- Lists ---- */
  ul.log-list { list-style: none; margin: 0; padding: 0; }
  ul.log-list li, .reminder-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 11px 0; border-bottom: 1px solid var(--divider);
  }
  ul.log-list li:last-child, .reminder-item:last-child { border-bottom: none; }
  .log-time {
    font-size: 0.82rem; font-weight: 700; color: var(--ink-soft);
    white-space: nowrap; min-width: 62px; padding-top: 1px; font-variant-numeric: tabular-nums;
  }
  .log-text { flex: 1; min-width: 0; font-size: 0.95rem; font-weight: 600; overflow-wrap: anywhere; }
  .log-who { color: var(--ink-faint); font-size: 0.82rem; font-weight: 400; }
  .empty-note { color: var(--ink-faint); font-size: 0.9rem; padding: 8px 0; }

  .reminder-item { align-items: center; flex-wrap: wrap; }
  .reminder-body { flex: 1; min-width: 12rem; display: grid; gap: 1px; }
  .reminder-body .log-text { flex: none; }
  .reminder-date { font-size: 0.82rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .reminder-item.soon .reminder-date { color: var(--red); font-weight: 700; }
  .reminder-item.done .log-text { text-decoration: line-through; color: var(--ink-faint); font-weight: 400; }
  .reminder-item.done .reminder-date { color: var(--ink-faint); font-weight: 400; }
  .reminder-actions { display: flex; gap: 6px; align-items: center; }
  .snooze-panel {
    flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
    padding: 8px 10px; background: var(--canvas); border-radius: 8px; font-size: 0.82rem;
  }
  .snooze-panel .lead { color: var(--ink-soft); font-weight: 700; margin-right: 2px; }
  .snooze-panel input[type="datetime-local"] {
    font-size: 0.85rem; padding: 5px 8px; border: 1px solid var(--card-line);
    background: var(--card); color: var(--ink); border-radius: 6px; min-width: 0;
  }
  .snooze-panel .custom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex-basis: 100%; padding-top: 4px; }
  .opt { background: var(--pill); color: var(--pill-ink); border: none; border-radius: 6px; padding: 5px 10px; font-size: 0.8rem; font-weight: 700; }
  .opt:hover { background: var(--blue-soft); color: var(--blue); }
  .opt.primary { background: var(--nav); color: var(--nav-ink-strong); }
  .opt.primary:hover { background: var(--nav-active); color: var(--nav-ink-strong); }
  .check {
    border: none; border-radius: 6px; padding: 5px 12px; font-size: 0.8rem; font-weight: 700;
    background: var(--green); color: var(--on-solid);
  }
  .reminder-item.done .check { background: var(--pill); color: var(--pill-ink); }
  .del {
    background: var(--pill); border: none; color: var(--pill-ink);
    font-size: 0.78rem; font-weight: 600; padding: 5px 10px; border-radius: 6px; flex-shrink: 0;
  }
  ul.log-list .del { margin-left: auto; }
  .del:hover { background: var(--red-soft); color: var(--red); }

  @keyframes flash { 0%,60% { box-shadow: 0 0 0 3px var(--blue); } 100% { box-shadow: 0 0 0 0 transparent; } }
  .flash { animation: flash 2.4s ease-out; background: var(--blue-soft); }
  .reminder-item.flash { border-radius: 8px; }
  @media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

  /* ---- Prospects by colour ---- */
  .colour-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .cs {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; background: var(--canvas);
    font-size: 0.88rem; font-weight: 700;
  }
  .cs .n { margin-left: auto; font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; background: var(--ink-faint); }
  .dot.green { background: var(--green); } .dot.blue { background: var(--blue); }
  .dot.yellow { background: var(--yellow); } .dot.red { background: var(--red); }

  .prospect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
  .prospect-card {
    border: 1px solid var(--card-line); border-radius: 8px; padding: 12px 14px;
    display: grid; gap: 8px; background: var(--card);
  }
  .prospect-top { display: flex; gap: 10px; align-items: flex-start; }
  .prospect-top .dot { margin-top: 5px; }
  .prospect-card[data-status="green"] .dot { background: var(--green); }
  .prospect-card[data-status="blue"] .dot { background: var(--blue); }
  .prospect-card[data-status="yellow"] .dot { background: var(--yellow); }
  .prospect-card[data-status="red"] .dot { background: var(--red); }
  .prospect-card[data-status="none"] .dot { background: transparent; border: 2px dashed var(--ink-faint); }
  .prospect-name { font-weight: 800; font-size: 0.98rem; overflow-wrap: anywhere; }
  .prospect-company { color: var(--ink-soft); font-size: 0.85rem; }
  .status-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  select.status-pick {
    font-size: 0.8rem; font-weight: 700; min-width: 0; width: 100%; flex: 1 1 0;
    border: 1px solid var(--card-line); background: var(--canvas); color: var(--ink);
    padding: 6px 8px; border-radius: 6px;
  }

  /* ---- Add client (inside the clients card) ---- */
  .add-client { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--divider); }
  .add-client h3 { margin: 0 0 10px; font-size: 0.95rem; font-weight: 800; }
  .client-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .client-form input, .client-form textarea {
    border: 1px solid var(--card-line); background: var(--canvas); color: var(--ink);
    padding: 10px 12px; font-size: 0.92rem; border-radius: 8px; width: 100%;
  }
  .client-form input:focus, .client-form textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--card); }
  .client-form textarea { min-height: 64px; resize: vertical; }
  .client-form .full { grid-column: 1 / -1; }
  .client-form .form-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: stretch; }
  label.small { font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; display: block; margin-bottom: 4px; }

  footer {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    font-size: 0.8rem; color: var(--ink-faint); padding-top: 6px;
  }
  footer button {
    background: none; border: none; color: var(--ink-soft); text-decoration: underline;
    font-size: 0.8rem; padding: 0;
  }
  footer button:hover, footer button[data-armed="1"] { color: var(--red); font-weight: 700; }

  .toast {
    position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--nav); color: var(--nav-ink-strong);
    padding: 10px 16px; font-size: 0.86rem; font-weight: 600; border-radius: 8px;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 50;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ---- Responsive ---- */
  @media (max-width: 1000px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .colour-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; background: var(--canvas); }
    .side {
      position: sticky; top: env(safe-area-inset-top, 0px); height: auto; z-index: 10;
      display: flex; align-items: center; gap: 12px; padding: 10px 16px; overflow-x: auto;
    }
    .brand { padding: 0 6px 0 0; font-size: 1rem; }
    .side nav { display: flex; gap: 2px; }
    .side nav a { padding: 7px 10px; font-size: 0.85rem; white-space: nowrap; }
    .main { padding: 20px 16px 48px; }
    .progress-row, .two-col { grid-template-columns: 1fr; }
  }
  @media (max-width: 480px) {
    .who { text-align: left; }
    .client-form { grid-template-columns: 1fr; }
    .kpi .num { font-size: 1.8rem; }
    .colour-summary { grid-template-columns: 1fr 1fr; }
  }

  /* ---- Added for the multi-page prototype ---- */
  [hidden] { display: none !important; }
  .side nav button {
    display: block; width: 100%; text-align: left; background: none; border: none;
    color: var(--nav-ink); font-size: 0.95rem; padding: 10px 14px; border-radius: 8px;
  }
  .side nav button:hover { color: var(--nav-ink-strong); background: rgba(255,255,255,0.05); }
  .side nav button[aria-current="page"] { background: var(--nav-active); color: var(--nav-ink-strong); font-weight: 700; }
  .side .side-note { color: var(--nav-ink); opacity: 0.7; font-size: 0.74rem; padding: 18px 14px 0; line-height: 1.4; }

  .f {
    border: 1px solid var(--card-line); background: var(--canvas); color: var(--ink);
    padding: 9px 11px; font-size: 0.92rem; border-radius: 8px; width: 100%; min-width: 0;
  }
  .f:focus { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--card); }
  textarea.f { min-height: 64px; resize: vertical; }
  .field { display: grid; gap: 4px; min-width: 0; }
  .field > label, label.small { font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; display: block; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stack { display: grid; gap: 14px; }
  .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .row.end { justify-content: flex-end; }
  .grow { flex: 1; min-width: 0; }
  .muted { color: var(--ink-soft); font-size: 0.88rem; }
  .btn.ghost { background: var(--pill); color: var(--pill-ink); }
  .btn.ghost:hover { background: var(--blue-soft); color: var(--blue); }
  .btn.small { padding: 7px 12px; font-size: 0.82rem; }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .seg { display: inline-flex; background: var(--pill); border-radius: 8px; padding: 3px; gap: 2px; }
  .seg button { border: none; background: none; color: var(--pill-ink); padding: 6px 12px; border-radius: 6px; font-size: 0.84rem; font-weight: 700; }
  .seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--card-line); }
  .chip { display: inline-block; border: none; background: var(--blue-soft); color: var(--blue); font-size: 0.74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; max-width: 100%; overflow-wrap: anywhere; }
  .chip.plain { background: var(--pill); color: var(--pill-ink); }
  .chip.green { background: var(--green-soft); color: var(--green); }
  .chip.red { background: var(--red-soft); color: var(--red); }
  .chip.yellow { background: var(--yellow-soft); color: var(--ink); }
  button.chip { cursor: pointer; }
  .scroll-x { overflow-x: auto; }
  table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
  table.tbl th { text-align: left; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--divider); }
  table.tbl td { padding: 10px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
  table.tbl tr:last-child td { border-bottom: none; }
  table.tbl tbody tr.click { cursor: pointer; }
  table.tbl tbody tr.click:hover { background: var(--canvas); }
  .num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .a-link { background: none; border: none; color: var(--blue); font-weight: 700; padding: 0; text-align: left; font-size: inherit; text-decoration: underline; }
  .tight { margin: 0; }
  h3.sec { margin: 0 0 8px; font-size: 0.98rem; font-weight: 800; }
  .sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 8px; flex-wrap: wrap; }

  .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
  .toolbar .f { width: auto; min-width: 140px; }
  .toolbar .grow { flex: 1; min-width: 160px; }

  .contact-card { border: 1px solid var(--card-line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; background: var(--card); }
  .num-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .log-entry { padding: 11px 0; border-bottom: 1px solid var(--divider); display: grid; gap: 4px; }
  .log-entry:last-child { border-bottom: none; }
  .log-entry .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .log-entry .body { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
  .log-entry .txt { overflow-wrap: anywhere; font-size: 0.93rem; font-weight: 600; }

  .stage-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .stage-col { border: 1px solid var(--card-line); background: var(--card); border-radius: 8px; padding: 10px 12px; text-align: left; font: inherit; color: inherit; }
  .stage-col:hover { border-color: var(--blue); }
  .stage-col[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
  .stage-col .n { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
  .stage-col .l { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }

  .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .wd { border: 1px solid var(--card-line); background: var(--card); border-radius: 8px; padding: 8px; min-height: 130px; display: grid; gap: 6px; align-content: start; min-width: 0; }
  .wd.today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
  .wd .dn { font-size: 0.72rem; font-weight: 800; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
  .wd .dn b { color: var(--ink); font-size: 0.95rem; letter-spacing: 0; margin-left: 4px; }
  .ev { text-align: left; border: none; border-left: 4px solid var(--blue); background: var(--blue-soft); color: var(--ink); border-radius: 6px; padding: 5px 7px; font-size: 0.76rem; font-weight: 700; display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
  .ev small { font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .ev.t-interview { border-left-color: var(--green); background: var(--green-soft); }
  .ev.t-team { border-left-color: var(--nav); background: var(--pill); }
  .ev.t-other { border-left-color: var(--yellow); background: var(--yellow-soft); }
  .month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
  .md { border: 1px solid var(--card-line); background: var(--card); border-radius: 8px; padding: 6px; min-height: 76px; text-align: left; font: inherit; color: inherit; display: grid; gap: 3px; align-content: start; min-width: 0; }
  .md:hover { border-color: var(--blue); }
  .md.dim { opacity: 0.45; }
  .md .dnum { font-size: 0.8rem; font-weight: 800; }
  .md.today .dnum { color: var(--blue); }
  .md .evm { font-size: 0.68rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--blue-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .legend-types { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-soft); margin-top: 10px; }
  .legend-types span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--blue); }
  .legend-types .lt-i::before { background: var(--green); } .legend-types .lt-t::before { background: var(--nav); } .legend-types .lt-o::before { background: var(--yellow); }

  .lead-row { display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--divider); }
  .lead-row:last-child { border-bottom: none; }
  .lead-row .co { font-weight: 800; overflow-wrap: anywhere; }

  .chat { display: grid; gap: 10px; }
  .bubble { padding: 10px 14px; border-radius: 10px; max-width: 760px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.93rem; }
  .bubble.me { background: var(--nav); color: var(--nav-ink-strong); justify-self: end; }
  .bubble.ai { background: var(--card); border: 1px solid var(--card-line); justify-self: start; }
  .suggest { display: flex; gap: 8px; flex-wrap: wrap; }

  .preview { border: 1px solid var(--blue); background: var(--blue-soft); border-radius: 10px; padding: 14px; display: grid; gap: 12px; margin-top: 12px; }
  .inv-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .alert-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
  .alert-row:last-child { border-bottom: none; }
  .foot-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
  .shared-chip { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--pill); color: var(--pill-ink); }
  .shared-chip.on { background: var(--green-soft); color: var(--green); }
  .examples-note { font-size: 0.78rem; color: var(--ink-faint); }

  @media (max-width: 1000px) {
    .stage-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inv-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wd { min-height: 0; }
  }
  @media (max-width: 820px) {
    .side nav button { padding: 7px 10px; font-size: 0.85rem; white-space: nowrap; width: auto; }
    .side .side-note { display: none; }
    .lead-row { grid-template-columns: auto minmax(0, 1fr); }
    .lead-row > :nth-child(n+3) { grid-column: 2; }
  }
  @media (max-width: 560px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .stage-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .num-row { grid-template-columns: 1fr; }
    .week { grid-template-columns: 1fr; }
    .month { gap: 3px; }
    .md { min-height: 56px; padding: 4px; }
    .md .evm { display: none; }
  }

 a.btn{text-decoration:none;display:inline-block}
 .main,.stack>*,.card,.shell>*{min-width:0}
  .examples-note a { color: var(--blue); }


/* ---- rebuild additions ---- */
.side nav button[disabled] { opacity: .45; cursor: not-allowed; }
.err { color: var(--red); font-weight: 600; }
#loginWrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--canvas); }
#loginWrap .card { width: 100%; max-width: 380px; }
.mdtoast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--nav); color: var(--nav-ink-strong); padding: 10px 16px; border-radius: 8px; z-index: 50; }
.contact-card textarea.f { min-height: 38px; }
.email-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.email-row textarea { min-width: 0; min-height: 38px; resize: none; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
@media (max-width: 800px) {
  .email-row { grid-template-columns: 1fr; gap: 4px; }
  .email-row .del { justify-self: start; }
  .email-row textarea { font-size: 14px; }
}
.tbl tr.click a { color: inherit; text-decoration: none; }
.who button { margin-left: 10px; }
