  /* ---------- Quick reports rail (Insights view) ---------- */
  .quick-reports{
    background:var(--card);border:1px solid var(--border);
    border-radius:var(--radius-2);padding:14px 16px;margin-bottom:14px;
    box-shadow:var(--shadow-1);
  }
  .quick-reports-head{
    display:flex;align-items:center;gap:10px;flex-wrap:wrap;
    margin-bottom:10px;
  }
  .quick-reports-head > span:first-child{
    display:inline-flex;align-items:center;gap:8px;
    font-size:13px;color:var(--ink-2);
  }
  .quick-reports-head > span:first-child svg{color:var(--purple)}
  .quick-reports-head .small{color:var(--muted)}
  .quick-reports-body{
    display:flex;align-items:stretch;gap:8px;flex-wrap:wrap;
  }
  .quick-reports-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:8px;flex:1 1 580px;min-width:0;
  }
  .qr-card{
    display:flex;align-items:center;gap:10px;
    background:var(--bg-soft);border:1px solid var(--border);
    border-radius:10px;padding:10px 12px;cursor:pointer;
    transition:all .14s;text-align:left;min-height:48px;
  }
  .qr-card:hover{background:var(--card);border-color:var(--brand);transform:translateY(-1px);box-shadow:var(--shadow-1)}
  .qr-icon{
    width:30px;height:30px;border-radius:8px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
  }
  .qr-icon svg{width:15px;height:15px}
  .qr-name{font-size:13px;font-weight:600;color:var(--ink);flex:1;line-height:1.25}
  .qr-arrow{color:var(--faint);transition:all .14s}
  .qr-card:hover .qr-arrow{color:var(--brand);transform:translateX(2px)}
  .quick-reports-all{
    width:74px;min-height:74px;aspect-ratio:1/1;flex:0 0 74px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
    background:var(--bg-soft);border:1px solid var(--border);
    border-radius:10px;padding:8px;cursor:pointer;text-align:center;
    transition:all .14s;color:var(--ink-2);
  }
  .quick-reports-all:hover{background:var(--card);border-color:var(--brand);transform:translateY(-1px);box-shadow:var(--shadow-1)}
  .quick-reports-all-label{font-size:11px;font-weight:700;line-height:1.12;color:var(--ink)}
  .quick-reports-all .qr-arrow{line-height:1;color:var(--faint)}
  .quick-reports-all:hover .qr-arrow{color:var(--brand);transform:translateX(2px)}

  /* ---------- Reports hub ---------- */
  .reports-hero{
    background:var(--card);border:1px solid var(--border);
    border-radius:var(--radius-3);padding:18px;
    display:flex;align-items:center;gap:14px;
    box-shadow:var(--shadow-1);
  }
  .reports-hero-icon{
    width:48px;height:48px;border-radius:14px;flex-shrink:0;
    background:linear-gradient(135deg,#7c3aed,#2563eb);color:#fff;
    display:flex;align-items:center;justify-content:center;
  }
  .reports-hero-icon svg{width:22px;height:22px}
  .reports-hero--library{align-items:flex-start}
  .reports-hero-copy{min-width:0;padding-top:1px}
  .reports-hero-eyebrow{
    display:flex;align-items:center;gap:8px;margin-bottom:4px;
    color:var(--purple);font-size:10.5px;font-weight:800;
    letter-spacing:.08em;text-transform:uppercase;
  }
  .reports-hero-count{
    padding:2px 7px;border:1px solid color-mix(in srgb,var(--purple) 28%,transparent);
    border-radius:999px;background:color-mix(in srgb,var(--purple) 10%,transparent);
    color:var(--purple);font-size:9.5px;letter-spacing:.04em;
  }
  .reports-hero-title{
    color:var(--ink);font-size:18px;font-weight:750;
    line-height:1.25;letter-spacing:-.015em;
  }
  .reports-hero-desc{max-width:720px;margin-top:4px;color:var(--muted);font-size:12.5px;line-height:1.5}
  .reports-hero-action{margin-left:auto;white-space:nowrap}
  .report-groups{display:grid;gap:14px;margin-top:16px}
  .report-group{
    --report-group-accent:var(--purple);
    display:grid;grid-template-columns:minmax(170px,220px) minmax(0,1fr);gap:18px;
    background:var(--card);border:1px solid var(--border);
    border-radius:var(--radius-3);padding:16px;
    box-shadow:var(--shadow-1);
  }
  .report-group[data-report-group="treatment"]{--report-group-accent:var(--teal)}
  .report-group[data-report-group="planning"]{--report-group-accent:var(--brand)}
  .report-group-head{
    min-width:0;padding:3px 16px 3px 2px;
    border-right:1px solid var(--hairline);
  }
  .report-group-heading{display:flex;align-items:center;gap:8px}
  .report-group-marker{
    width:7px;height:7px;border-radius:50%;flex:none;
    background:var(--report-group-accent);
    box-shadow:0 0 0 4px color-mix(in srgb,var(--report-group-accent) 12%,transparent);
  }
  .report-group-name{color:var(--ink);font-size:14px;font-weight:750;line-height:1.3}
  .report-group-desc{margin-top:7px;color:var(--muted);font-size:11.5px;line-height:1.5}
  .report-group-count{
    margin-top:10px;color:var(--faint);font-size:10.5px;
    font-weight:700;letter-spacing:.035em;text-transform:uppercase;
  }
  /* auto-fit divided each group's leftover width among however many cards that
     group happened to have, so the three groups (4 / 3 / 2 reports) rendered at
     three different card widths and the page lost its column rhythm. A fixed
     4-track grid gives every card the same width across all groups; shorter
     groups simply leave the trailing tracks empty. */
  .reports-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;min-width:0;
  }
  @media(max-width:1280px){.reports-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
  @media(max-width:1040px){.reports-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
  .report-card{
    width:100%;background:var(--bg-soft);border:1px solid var(--border);
    border-radius:11px;padding:14px;cursor:pointer;
    text-align:left;transition:all .14s;
    display:grid;grid-template-columns:38px minmax(0,1fr) 18px;
    grid-template-rows:auto 1fr;column-gap:11px;row-gap:3px;
    min-height:92px;align-items:start;
  }
  .report-card:hover{
    transform:translateY(-1px);box-shadow:var(--shadow-2);
    border-color:color-mix(in srgb,var(--report-group-accent) 42%,var(--border));
  }
  .report-card:focus-visible{border-color:var(--report-group-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--report-group-accent) 20%,transparent)}
  .report-icon{
    grid-column:1;grid-row:1 / span 2;
    width:38px;height:38px;border-radius:10px;
    display:flex;align-items:center;justify-content:center;
  }
  .report-icon svg{width:20px;height:20px}
  .report-arrow{
    grid-column:3;grid-row:1 / span 2;align-self:center;
    width:18px;height:18px;color:var(--faint);
    display:flex;align-items:center;justify-content:center;
    transition:color .14s,transform .14s;
  }
  .report-card:hover .report-arrow{color:var(--report-group-accent);transform:translateX(2px)}
  .report-name{grid-column:2;font-size:13.5px;font-weight:700;color:var(--ink);letter-spacing:-.01em;line-height:1.3}
  .report-desc{grid-column:2;font-size:11.5px;color:var(--muted);line-height:1.45}
  @media(max-width:860px){
    .report-group{grid-template-columns:1fr;gap:14px}
    .report-group-head{padding:0 0 12px;border-right:0;border-bottom:1px solid var(--hairline)}
    .report-group-desc{max-width:620px}
    .report-group-count{margin-top:6px}
  }
  @media(max-width:560px){
    .reports-hero--library{flex-wrap:wrap}
    .reports-hero--library .reports-hero-icon{width:42px;height:42px;border-radius:12px}
    .reports-hero-action{width:100%;margin-left:0;justify-content:center}
    .report-group{padding:13px}
    .reports-grid{grid-template-columns:1fr}
    .report-card{min-height:86px}
  }

  /* Single report page */
  .report-section{
    background:var(--card);border:1px solid var(--border);
    border-radius:var(--radius-2);padding:18px 20px;
    margin-bottom:12px;box-shadow:var(--shadow-1);
  }
  .report-section h4{
    font-size:13px;font-weight:700;color:var(--ink);
    margin-bottom:12px;letter-spacing:.01em;text-transform:none;
  }
  .report-section .report-body p{font-size:14px;line-height:1.65;color:var(--ink-2);margin-bottom:8px}
  .report-section .report-body p:last-child{margin-bottom:0}
  .report-foot{margin-top:10px;padding-top:8px;border-top:1px dashed var(--hairline);color:var(--muted)}
  .report-degraded { opacity: .72; font-style: italic; }
  .report-load-state{
    display:flex;align-items:center;gap:14px;justify-content:space-between;
    margin:14px 18px;padding:12px 14px;border:1px solid var(--border);
    border-radius:var(--radius-2);background:var(--bg-soft);color:var(--ink-2);
  }
  .report-load-state > div{display:grid;gap:3px;min-width:0}
  .report-load-state strong{font-size:13px;color:var(--ink)}
  .report-load-state span{font-size:12px;line-height:1.45;color:var(--muted)}
  .report-load-error{border-color:var(--crit-border,var(--border))}
  .report-load-partial{border-color:var(--warn-border,var(--border))}
  @media(max-width:640px){.report-load-state{align-items:stretch;flex-direction:column}.report-load-state .btn{align-self:flex-start}}

  /* ---------- Time Machine control (PRE-323) ----------
   * The picker alone made "any moment from admission to now" a scrubbing
   * exercise, so relative quick-jumps sit under it and a live hint reads back
   * how far the chosen moment is from now. The generate call can run for a
   * minute, so the in-flight state is a real panel (target time, indeterminate
   * bar, elapsed counter) rather than a one-line shimmer. */
  .tm-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px}
  .tm-head-icon{
    flex:none;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;
    background:rgba(124,58,237,.10);color:var(--purple);border:1px solid rgba(124,58,237,.24);
  }
  .tm-head-icon svg{width:18px;height:18px}
  .tm-head h4{margin:0 0 3px}
  .tm-head p{margin:0;color:var(--muted);font-size:12.5px;line-height:1.5;max-width:62ch}
  .tm-controls{background:var(--bg-soft);border:1px solid var(--border);border-radius:12px;padding:14px 16px}
  .tm-controls-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
  .tm-field{display:flex;flex-direction:column;gap:5px;min-width:0}
  .tm-field label{
    font-size:10.5px;font-weight:700;color:var(--muted);
    text-transform:uppercase;letter-spacing:.06em;
  }
  .tm-controls input[type="datetime-local"]{
    font:inherit;font-size:13.5px;font-variant-numeric:tabular-nums;color:var(--ink);
    background:var(--card);border:1px solid var(--border-2);border-radius:9px;
    padding:8px 10px;min-width:212px;
  }
  .tm-controls input[type="datetime-local"]:focus{
    outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-ring);
  }
  .tm-rel{font-size:12px;color:var(--muted);padding-bottom:9px;white-space:nowrap}
  .tm-controls .btn.primary{margin-left:auto}
  .tm-jumps{
    display:flex;gap:6px;align-items:center;flex-wrap:wrap;
    margin-top:12px;padding-top:12px;border-top:1px dashed var(--border);
  }
  .tm-jumps-label{
    font-size:10.5px;font-weight:700;color:var(--faint);
    text-transform:uppercase;letter-spacing:.06em;margin-right:2px;
  }
  .tm-jump{
    font:inherit;font-size:11.5px;font-weight:600;color:var(--ink-2);cursor:pointer;
    background:var(--card);border:1px solid var(--border);border-radius:999px;padding:4px 11px;
    transition:background .12s ease,border-color .12s ease,color .12s ease;
  }
  .tm-jump:hover{background:var(--brand-soft);border-color:var(--brand-ring);color:var(--brand-2)}
  .tm-jump.active{background:var(--brand);border-color:var(--brand);color:#fff}
  .tm-progress{
    background:var(--card);border:1px solid var(--border);border-radius:12px;
    padding:16px 18px;display:flex;gap:13px;align-items:flex-start;
  }
  .tm-progress-icon{
    flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
    background:rgba(124,58,237,.10);color:var(--purple);animation:tm-pulse 1.6s ease-in-out infinite;
  }
  .tm-progress-icon svg{width:17px;height:17px}
  @keyframes tm-pulse{0%,100%{opacity:.5;transform:scale(.92)}50%{opacity:1;transform:scale(1)}}
  .tm-progress-main{flex:1;min-width:0}
  .tm-progress-title{font-size:13px;font-weight:700;color:var(--ink)}
  .tm-progress-sub{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.5}
  .tm-bar{height:3px;border-radius:999px;background:var(--card-3);overflow:hidden;margin-top:11px}
  .tm-bar::after{
    content:"";display:block;height:100%;width:34%;border-radius:999px;
    background:linear-gradient(90deg,var(--brand),var(--purple));
    animation:tm-slide 1.5s cubic-bezier(.4,0,.6,1) infinite;
  }
  @keyframes tm-slide{0%{transform:translateX(-105%)}100%{transform:translateX(330%)}}
  .tm-elapsed{flex:none;font-size:11.5px;color:var(--faint);font-variant-numeric:tabular-nums}
  @media (prefers-reduced-motion:reduce){
    .tm-progress-icon,.tm-bar::after{animation:none}
    .tm-bar::after{width:100%;opacity:.5}
  }
  @media (max-width:640px){
    .tm-controls input[type="datetime-local"]{min-width:0;width:100%}
    .tm-field{width:100%}
    .tm-rel{padding-bottom:0}
    .tm-controls .btn.primary{margin-left:0;width:100%;justify-content:center}
  }
  :root[data-theme="dark"] .tm-head-icon,
  :root[data-theme="dark"] .tm-progress-icon{
    background:rgba(167,139,250,.14);border-color:rgba(167,139,250,.32);
  }

  /* ---------- Communication Record (timeline) ---------- */
  .comms-toolbar{
    display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px;
  }
  .comms-intro{
    color:var(--muted);margin:0;line-height:1.55;max-width:560px;flex:1;min-width:240px;
  }

  .comms-summary{
    display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
    background:var(--card);border:1px solid var(--border);border-radius:12px;
    padding:11px 16px;margin-bottom:16px;box-shadow:var(--shadow-1);
  }
  .comms-summary-stat{font-size:13.5px;color:var(--muted)}
  .comms-summary-stat b{color:var(--ink);font-weight:600}
  .comms-summary-next{
    display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;
    padding:5px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);
  }
  .comms-summary-next svg{width:14px;height:14px}

  .comms-filter{display:flex;gap:6px;margin-bottom:16px;flex-wrap:wrap}
  .comms-filter-tab{
    font-size:13px;font-weight:600;color:var(--muted);
    padding:6px 14px;border-radius:999px;border:1px solid transparent;
    background:transparent;cursor:pointer;transition:all .14s;
  }
  .comms-filter-tab span{color:var(--faint);font-weight:600;margin-left:3px}
  .comms-filter-tab:hover{background:var(--bg-soft)}
  .comms-filter-tab.on{background:var(--card);border-color:var(--border);color:var(--ink);box-shadow:var(--shadow-1)}
  .comms-filter-tab.on span{color:var(--muted)}

  .comms-timeline{display:flex;flex-direction:column;gap:18px}
  .comms-tl-group{display:flex;gap:14px}
  .comms-tl-date{
    width:56px;flex:none;text-align:right;font-size:12px;font-weight:600;
    color:var(--muted);padding-top:5px;
  }
  .comms-tl-items{
    position:relative;flex:1;min-width:0;
    border-left:2px solid var(--hairline);padding-left:22px;
    display:flex;flex-direction:column;gap:12px;
  }

  .comms-card{
    position:relative;background:var(--card);border:1px solid var(--border);
    border-radius:14px;box-shadow:var(--shadow-1);overflow:hidden;
  }
  .comms-card.draft{border-style:dashed}
  .comms-card::before{
    content:"";position:absolute;left:-29px;top:22px;width:12px;height:12px;border-radius:50%;
    box-shadow:0 0 0 3px var(--bg);z-index:1;
  }
  .comms-card.family::before{background:var(--purple)}
  .comms-card.patient::before{background:var(--brand)}
  /* The ED's referral handover. Its own accent because it is the one card in
     this timeline that is not a bedside conversation — with no rule of its own
     it lost the timeline dot, the head tint and the kicker colour, and read as
     a record with no type at all. */
  .comms-card.referral::before{background:var(--teal)}

  .comms-card-head{
    width:100%;display:flex;align-items:flex-start;gap:12px;
    cursor:pointer;border:0;padding:13px 16px;text-align:left;font:inherit;color:inherit;
  }
  .comms-card.family .comms-card-head{background:rgba(124,58,237,.06)}
  .comms-card.patient .comms-card-head{background:var(--brand-soft)}
  .comms-card.referral .comms-card-head{background:rgba(13,148,136,.07)}
  .comms-card-icon{
    width:36px;height:36px;border-radius:10px;flex-shrink:0;background:var(--card);
    display:flex;align-items:center;justify-content:center;
  }
  .comms-card-icon svg{width:19px;height:19px}
  .comms-card.family .comms-card-icon{color:var(--purple)}
  .comms-card.patient .comms-card-icon{color:var(--brand)}
  .comms-card.referral .comms-card-icon{color:var(--teal)}
  .comms-card-id{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
  .comms-card-kicker{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  .comms-card-type{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
  .comms-card.family .comms-card-type{color:var(--purple)}
  .comms-card.patient .comms-card-type{color:var(--brand)}
  .comms-card.referral .comms-card-type{color:var(--teal)}
  .comms-card-title{font-size:15.5px;font-weight:700;color:var(--ink);letter-spacing:0;margin:0;line-height:1.3}
  .comms-card-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin-top:1px}
  .comms-card-toggle{display:flex;align-items:center;color:var(--faint);flex-shrink:0;margin-top:2px}
  .comms-card-toggle svg{width:18px;height:18px}

  .comms-status{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:10.5px;font-weight:700}
  .comms-status svg{width:12px;height:12px}
  .comms-status.signed{background:var(--ok-soft);color:var(--ok);border:1px solid var(--ok-border)}
  .comms-status.draft{background:var(--warn-soft);color:var(--warn);border:1px solid var(--warn-border)}

  .comms-card-due{
    display:flex;align-items:center;gap:6px;padding:8px 16px;
    font-size:12px;font-weight:600;color:var(--warn);background:var(--warn-soft);
    border-top:1px solid var(--warn-border);
  }
  .comms-card-due svg{width:14px;height:14px;flex-shrink:0}

  .comms-card-body{padding:14px 16px;border-top:1px solid var(--hairline)}
  .comms-card-people{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
  .comms-person{font-size:12px;background:var(--bg-soft);border:1px solid var(--border);color:var(--ink-2);padding:3px 10px;border-radius:999px}

  .comms-card-rows{border:1px solid var(--border);border-radius:10px;overflow:hidden;margin-bottom:12px}
  .comms-card-row{display:flex;justify-content:space-between;gap:12px;padding:8px 12px;font-size:12.5px}
  .comms-card-row+.comms-card-row{border-top:1px solid var(--hairline)}
  .comms-card-row>span:first-child{color:var(--muted)}
  .comms-card-row>span:last-child{color:var(--ink);font-weight:600;text-align:right}
  .comms-card-row .val-warn{color:var(--warn)}
  .comms-under{font-weight:600}
  .comms-under.confirmed{color:var(--ok)}
  .comms-under.partial{color:var(--warn)}
  .comms-under.not_assessed{color:var(--muted)}

  .comms-card-summary{font-size:13.5px;line-height:1.65;color:var(--ink-2);margin:0 0 12px}
  .comms-card-points{
    list-style:none;display:flex;flex-direction:column;gap:5px;
    font-size:13px;color:var(--ink-2);margin:0 0 12px;padding-left:4px;
  }
  .comms-card-points li{position:relative;padding-left:16px}
  .comms-card-points li::before{
    content:"";position:absolute;left:0;top:7px;width:6px;height:6px;border-radius:50%;background:var(--purple);
  }
  .comms-card.patient .comms-card-points li::before{background:var(--brand)}

  .comms-card-tasks{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
  .comms-card-task{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:9px;background:var(--bg-soft);border:1px solid var(--border)}
  .comms-card-task.due{background:var(--warn-soft);border-color:var(--warn-border)}
  .comms-task-check{width:18px;height:18px;flex-shrink:0;border-radius:5px;border:1.5px solid var(--border);background:var(--card);cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;padding:0}
  .comms-card-task.due .comms-task-check{border-color:var(--warn)}
  .comms-card-task.done .comms-task-check{background:var(--ok);border-color:var(--ok)}
  .comms-task-check svg{width:12px;height:12px}
  .comms-task-text{flex:1;font-size:12.5px;color:var(--ink-2)}
  .comms-card-task.done .comms-task-text{text-decoration:line-through;color:var(--muted)}
  .comms-task-meta{font-size:11.5px;color:var(--muted)}

  .comms-card-sublabel{display:block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:5px}
  .comms-card-concerns{margin-bottom:12px}

  .comms-card-pills{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
  .comms-tag{
    display:inline-block;background:var(--bg-soft);border:1px solid var(--border);
    color:var(--muted);padding:2px 9px;border-radius:6px;font-size:10.5px;font-weight:600;
    text-transform:uppercase;letter-spacing:0;
  }
  .comms-tag.family{background:rgba(124,58,237,.08);border-color:rgba(124,58,237,.25);color:var(--purple)}
  .comms-tag.patient{background:var(--brand-soft);border-color:var(--brand-ring);color:var(--brand)}
  .comms-tag.referral{background:rgba(13,148,136,.08);border-color:rgba(13,148,136,.25);color:var(--teal)}

  .comms-card-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
  .comms-card-actions button{
    display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--muted);
    background:transparent;border:1px solid var(--border);border-radius:8px;padding:5px 11px;cursor:pointer;transition:all .14s;
  }
  .comms-card-actions button:hover{background:var(--bg-soft);color:var(--ink-2)}
  .comms-card-actions button svg{width:14px;height:14px}
  .comms-card-actions button.comms-act-primary{color:var(--brand);border-color:var(--brand-ring,#bfdbfe);background:var(--brand-soft)}
  .comms-card-actions button.comms-act-primary:hover{filter:brightness(.97)}

  /* Post-transcription structured note (review step) */
  .comms-note{margin-top:14px;border:1px solid var(--border);border-radius:12px;background:var(--bg-soft);padding:12px 14px}
  .comms-note-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
  .comms-note-title{font-size:13px;font-weight:700;color:var(--ink);display:inline-flex;align-items:center;gap:6px}
  .comms-note-state{font-size:11.5px;font-weight:600}
  .comms-note-state.drafting{color:var(--brand);display:inline-flex;align-items:center;gap:6px}
  .comms-note-state.ready{color:var(--ok)}
  .comms-mini-spin{width:12px;height:12px;border:2px solid var(--brand-ring,rgba(10,132,255,.3));border-top-color:var(--brand);border-radius:50%;animation:commsSpin .7s linear infinite;display:inline-block}
  @keyframes commsSpin{to{transform:rotate(360deg)}}
  .comms-note-sec{margin-bottom:12px}
  .comms-note-sec:last-child{margin-bottom:0}
  .comms-note-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:5px;display:flex;gap:8px;align-items:baseline}
  .comms-note-hint{font-size:10.5px;font-weight:500;text-transform:none;letter-spacing:0;color:var(--faint)}
  .comms-note-input{width:100%;font:inherit;font-size:13px;line-height:1.5;color:var(--ink);background:var(--card);border:1px solid var(--border);border-radius:8px;padding:8px 10px;resize:vertical;box-sizing:border-box}
  .comms-note-input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
  .comms-note-rows{border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--card)}
  .comms-note-row{display:flex;justify-content:space-between;gap:12px;padding:7px 11px;font-size:12.5px}
  .comms-note-row+.comms-note-row{border-top:1px solid var(--hairline)}
  .comms-note-row>span:first-child{color:var(--muted)}
  .comms-note-row>span:last-child{color:var(--ink);font-weight:600;text-align:right}
  .comms-note-list{margin:0;padding-left:18px;font-size:12.5px;color:var(--ink-2);display:flex;flex-direction:column;gap:3px}
  .comms-note-tags{display:flex;gap:6px;flex-wrap:wrap}
  .comms-tasks{display:flex;flex-direction:column;gap:6px}
  .comms-task{display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:8px;background:var(--card);border:1px solid var(--border);cursor:pointer}
  .comms-task.off{opacity:.5}
  .comms-task input{flex-shrink:0}
  .comms-note-error{text-align:center;padding:10px 6px}
  .comms-note-error-sub{font-size:12px;color:var(--muted);margin:6px 0 10px}
  .comms-note-stale{display:flex;align-items:center;gap:8px;padding:7px 10px;margin-bottom:10px;border-radius:8px;background:var(--warn-soft);border:1px solid var(--warn-border);font-size:12px;color:var(--warn)}
  .comms-note-stale svg{width:14px;height:14px;flex-shrink:0}
  .comms-note-stale span{flex:1}
  .btn.ghost.small{padding:5px 11px;font-size:12px}
  .comms-foot-hint{font-size:11.5px;color:var(--warn);align-self:center;margin-right:auto}

  :root[data-theme="dark"] .comms-card.family .comms-card-head{background:rgba(167,139,250,.12)}
  :root[data-theme="dark"] .comms-card.referral .comms-card-head{background:rgba(45,212,191,.12)}
  :root[data-theme="dark"] .comms-tag.referral{background:rgba(45,212,191,.14);border-color:rgba(45,212,191,.35);color:var(--teal)}
  :root[data-theme="dark"] .comms-tag.family{background:rgba(167,139,250,.14);border-color:rgba(167,139,250,.35);color:var(--purple)}
  :root[data-theme="dark"] .comms-tag.patient{background:var(--brand-soft);border-color:var(--brand-ring);color:var(--brand)}
  :root[data-theme="dark"] .comms-card::before{box-shadow:0 0 0 3px var(--bg)}
  @media(max-width:640px){
    .comms-summary{align-items:flex-start}
    .comms-tl-group{display:block}
    .comms-tl-date{width:auto;text-align:left;padding-top:0;margin:0 0 8px}
    .comms-tl-items{padding-left:18px}
    .comms-card::before{left:-25px}
    .comms-card-actions button{flex:1;justify-content:center}
  }

  /* Recorder modal */
  .comms-recorder{
    text-align:center;padding:24px 0;
    background:var(--bg-soft);border-radius:12px;
    margin-top:8px;
  }
  .comms-rec-mic{
    width:74px;height:74px;border-radius:50%;
    border:0;padding:0;
    background:linear-gradient(135deg,#ec4899,#7c3aed);color:#fff;
    display:flex;align-items:center;justify-content:center;
    margin:0 auto 12px;cursor:pointer;
    box-shadow:0 8px 24px rgba(236,72,153,.32);
    transition:all .15s;
  }
  .comms-rec-mic svg{width:28px;height:28px}
  .comms-rec-mic:hover{transform:scale(1.04)}
  .comms-rec-mic.recording{
    background:var(--crit);animation:dictatePulse 1s infinite;
  }
  .comms-rec-status{font-size:13px;color:var(--ink-2);font-weight:500}
  .comms-rec-time{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;margin-top:4px;color:var(--ink)}
  /* Capture — conversation type toggle */
  .comms-type-switch{display:flex;gap:6px;margin-bottom:14px}
  .comms-type-switch button{
    flex:1;padding:9px 12px;border-radius:9px;cursor:pointer;
    background:var(--bg-soft);border:1px solid var(--border);
    font:inherit;font-size:13px;font-weight:600;color:var(--muted);
  }
  .comms-type-switch button:hover{color:var(--ink-2)}
  .comms-type-switch button.on{background:var(--brand-soft);border-color:var(--brand-ring,#bfdbfe);color:var(--brand)}

  /* Capture — participants chips under the input */
  .comms-participant-chips{
    display:flex;flex-wrap:wrap;gap:5px;margin-top:6px;
  }
  .comms-participant-chips .pchip{
    background:var(--bg-soft);border:1px solid var(--border);
    color:var(--ink-2);font-size:11.5px;padding:2px 8px;border-radius:6px;
  }

  /* Communication recording error banner */
  .comms-error-banner{
    display:flex;align-items:flex-start;gap:8px;
    padding:9px 12px;background:var(--crit-soft);border:1px solid #fecaca;
    color:#991b1b;border-radius:8px;font-size:12.5px;line-height:1.45;
    margin-bottom:12px;
  }
  .comms-error-banner b{color:#7f1d1d}

  /* Review — speakers panel */
  .comms-speakers{
    background:var(--bg-soft);border:1px solid var(--border);border-radius:10px;
    padding:11px 13px;margin-bottom:14px;
  }
  .comms-speakers-head{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    font-size:11.5px;color:var(--muted);font-weight:600;
    text-transform:uppercase;letter-spacing:.05em;margin-bottom:7px;
  }
  .comms-speakers-progress{
    font-size:11px;font-weight:700;color:var(--warn);
    text-transform:none;letter-spacing:0;
  }
  .comms-speakers-progress.ok{color:var(--ok);display:inline-flex;align-items:center;gap:4px}
  .comms-speakers-progress.ok svg{width:12px;height:12px}
  .comms-speaker-row{
    display:flex;align-items:center;gap:8px;padding:5px 0;
    border-top:1px solid var(--hairline);
  }
  .comms-speaker-row:first-of-type{border-top:none}
  .comms-speaker-dot{
    width:9px;height:9px;border-radius:50%;flex-shrink:0;
  }
  /* Native select per speaker — no popover, no custom menu */
  .comms-speaker-select{
    flex:1;min-width:0;padding:6px 9px;border-radius:7px;cursor:pointer;
    background:var(--card);border:1px solid var(--border);
    font:inherit;font-size:13px;color:var(--ink);
  }
  .comms-speaker-select.ok{border-color:var(--ok-border);background:var(--ok-soft);color:var(--ok);font-weight:600}
  .comms-speaker-add{
    width:100%;margin-top:8px;padding:6px 9px;border-radius:7px;
    background:var(--card);border:1px dashed var(--border);
    font:inherit;font-size:12.5px;color:var(--ink);outline:none;
  }
  .comms-speaker-add:focus{border-style:solid;border-color:var(--brand)}

  /* Review — bubble transcript */
  .comms-transcript-head{
    display:flex;align-items:center;justify-content:space-between;
    font-size:11.5px;color:var(--muted);font-weight:600;
    text-transform:uppercase;letter-spacing:.05em;margin:14px 0 6px;
  }
  .comms-transcript-edit{
    background:transparent;border:1px solid var(--border);
    color:var(--muted);padding:3px 9px;border-radius:6px;cursor:pointer;font-size:11.5px;font-weight:600;
  }
  .comms-transcript-edit:hover{background:var(--bg-soft);color:var(--ink-2)}
  .comms-transcript{
    background:var(--card);border:1px solid var(--border);border-radius:10px;
    padding:10px 12px;display:flex;flex-direction:column;gap:8px;
  }
  .comms-turn{display:flex;flex-direction:column;gap:2px}
  .comms-turn-meta{
    display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted);
  }
  .comms-turn-meta .dot{width:8px;height:8px;border-radius:50%}
  .comms-turn-meta .name{font-weight:600;color:var(--ink-2)}
  .comms-turn-text{font-size:13.5px;color:var(--ink-2);line-height:1.55;padding-left:14px}
  .comms-turn textarea{
    width:100%;min-height:42px;padding:6px 8px;font-size:13px;
    background:var(--bg-soft);border:1px solid var(--border);border-radius:6px;outline:none;
    margin-left:14px;
  }

  /* ---- Recording flow polish: keep step chrome + primary action on-screen ----
   * The comms wizard modal can get tall (transcript + note). The shared .modal
   * scroll container is the ONLY scroller now; the head (title/progress) sticks
   * to the top and the foot (Sign & commit) sticks to the bottom so the primary
   * action is always reachable without hunting below the fold. Scoped to the
   * comms modal so other modals are unaffected. */
  .comms-modal-head{
    position:sticky;top:0;z-index:6;background:var(--card);
    border-radius:18px 18px 0 0;
  }
  .comms-modal-foot{
    position:sticky;bottom:0;z-index:6;background:var(--card);
    box-shadow:0 -1px 0 var(--hairline), 0 -10px 22px -14px rgba(0,0,0,.35);
  }
  .comms-modal-foot .btn{white-space:nowrap}
  .comms-foot-hint{font-size:11.5px;color:var(--muted);align-self:center;margin-right:auto}
  /* Conversation identity in the review header */
  .comms-ctx{display:inline-flex;align-items:center;gap:7px;font-weight:600;color:var(--ink-2)}
  .comms-ctx-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--muted)}
  .comms-ctx.family .comms-ctx-dot{background:var(--purple)}
  .comms-ctx.patient .comms-ctx-dot{background:var(--brand)}
  .comms-ctx.referral .comms-ctx-dot{background:var(--teal)}

  /* Removable selected-participant pills */
  .comms-participant-chips .pchip{display:inline-flex;align-items:center;gap:5px}
  .comms-pchip-rm{
    background:transparent;border:none;color:var(--muted);cursor:pointer;
    font-size:14px;line-height:1;padding:0;display:inline-flex;
  }
  .comms-pchip-rm:hover{color:var(--crit)}

  .comms-speaker-tag{
    font-size:11px;font-weight:700;color:var(--ink-2);background:var(--card);
    border:1px solid var(--border);border-radius:6px;padding:1px 6px;
    font-variant-numeric:tabular-nums;flex-shrink:0;
  }

  /* Review — transcript is collapsible reference (no nested scroll trap) */
  .comms-transcript-toggle{
    display:inline-flex;align-items:center;gap:6px;background:transparent;border:none;
    color:var(--muted);font:inherit;font-size:11.5px;font-weight:700;
    text-transform:uppercase;letter-spacing:.05em;cursor:pointer;padding:0;
  }
  .comms-transcript-toggle:hover{color:var(--ink-2)}
  .comms-transcript-toggle .caret{font-size:10px;transition:transform .12s}
  .comms-tr-count{
    font-size:10.5px;font-weight:600;text-transform:none;letter-spacing:0;
    color:var(--faint);
  }
  .comms-transcript.collapsed{display:none}

  /* Disabled mic when fields incomplete */
  .comms-rec-mic.disabled{
    background:var(--border);box-shadow:none;cursor:not-allowed;
    pointer-events:none;
  }

  /* Transcribing overlay between step 2 → 3 */
  .comms-transcribing{
    text-align:center;padding:38px 0;
  }
  .comms-transcribing .spinner{
    width:36px;height:36px;border-radius:50%;
    border:3px solid var(--border);border-top-color:var(--brand);
    margin:0 auto 14px;animation:spin 0.9s linear infinite;
  }
  @keyframes spin{to{transform:rotate(360deg)}}
  .comms-transcribing .label{font-size:14px;color:var(--ink-2);font-weight:500}
  .comms-transcribing .sub{font-size:12px;color:var(--muted);margin-top:4px}

  /* Aggregated prescription pill in to-do views */
  .todo-rx-aggregate{
    display:flex;align-items:center;gap:12px;
    width:100%;background:var(--crit-soft);border:1px solid #fecaca;
    border-radius:10px;padding:12px 14px;cursor:pointer;
    text-align:left;transition:all .14s;
  }
  .todo-rx-aggregate:hover{background:#fee2e2;border-color:#fca5a5;transform:translateX(2px)}
  .todo-rx-icon{
    width:32px;height:32px;border-radius:8px;flex-shrink:0;
    background:var(--crit);color:#fff;
    display:flex;align-items:center;justify-content:center;
  }
  .todo-rx-icon svg{width:16px;height:16px}
  .todo-rx-title{font-size:14px;color:var(--ink);margin-bottom:2px}
  .todo-rx-list{font-size:12px;color:var(--crit);font-weight:500}
  .todo-rx-arrow{color:var(--crit)}
  .pri-item-aggregate{
    background:var(--crit-soft);border:1px solid #fecaca;border-radius:8px;
    padding:6px 10px;cursor:pointer;
  }
  .pri-item-aggregate:hover{background:#fee2e2}

  /* ---------- Insights ---------- */
  .insight-grid{display:flex;flex-direction:column;gap:10px}
  .insight{
    background:var(--card);border:1px solid var(--border);
    border-radius:12px;padding:14px;
    display:flex;gap:12px;align-items:flex-start;
  }
  .insight.crit{border-color:var(--crit-border);background:linear-gradient(180deg,var(--crit-soft) 0%,var(--card) 60%)}
  .insight.warn{border-color:var(--warn-border);background:linear-gradient(180deg,var(--warn-soft) 0%,var(--card) 60%)}
  .insight.ok{border-color:var(--ok-border);background:linear-gradient(180deg,var(--ok-soft) 0%,var(--card) 60%)}
  .insight-icon{
    width:38px;height:38px;border-radius:10px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;color:#fff;
  }
  .insight-icon.crit{background:var(--crit)}
  .insight-icon.warn{background:var(--warn)}
  .insight-icon.ok{background:var(--ok)}
  .insight-icon.info{background:var(--info)}
  .insight-icon svg{width:20px;height:20px}
  .insight-body{flex:1;min-width:0}
  .insight-headline{font-size:14px;font-weight:700;color:var(--ink);margin-bottom:3px}
  .insight-detail{font-size:12.5px;color:var(--ink-2);line-height:1.5}
  .insight-foot{margin-top:8px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:11.5px;color:var(--muted)}
  .insight-foot a{display:inline-flex;align-items:center;gap:4px;font-weight:600}
  .insight-foot a:hover{text-decoration:underline}
  .insight-foot a svg{width:11px;height:11px}

  /* ---------- Claim readiness ----------
   * Reads top-down as a decision: verdict → magnitude → what to fix → the
   * evidence that backs it. Severity is carried by a left accent rather than a
   * filled background, so a screen with several findings stays legible instead
   * of turning into a block of red. */
  .claim-verdict{
    display:flex;align-items:center;gap:14px;
    background:var(--card);border:1px solid var(--border);
    border-left:4px solid var(--border);
    border-radius:var(--radius-2);padding:16px 18px;margin-bottom:12px;
    box-shadow:var(--shadow-1);
  }
  .claim-verdict-icon{
    flex:none;width:38px;height:38px;border-radius:10px;
    display:grid;place-items:center;color:#fff;background:var(--inact);
  }
  .claim-verdict-icon svg{width:19px;height:19px}
  .claim-verdict--clear{border-left-color:var(--ok)}
  .claim-verdict--clear .claim-verdict-icon{background:var(--ok)}
  .claim-verdict--review{border-left-color:var(--warn)}
  .claim-verdict--review .claim-verdict-icon{background:var(--warn)}
  .claim-verdict--blocked{border-left-color:var(--crit)}
  .claim-verdict--blocked .claim-verdict-icon{background:var(--crit)}
  .claim-verdict--nobill{border-left-color:var(--brand)}
  .claim-verdict--nobill .claim-verdict-icon{background:var(--brand)}
  .claim-verdict-title{font-size:15px;font-weight:700;color:var(--ink);margin-bottom:2px}
  .claim-verdict-copy{font-size:12.5px;color:var(--muted);line-height:1.5;max-width:64ch}
  .claim-verdict-figure{flex:none;text-align:right}
  .claim-verdict-figure-value{
    font-size:22px;font-weight:700;color:var(--ink);
    font-variant-numeric:tabular-nums;letter-spacing:-.01em;
  }
  .claim-verdict-figure-label{
    font-size:10px;font-weight:600;color:var(--muted);
    text-transform:uppercase;letter-spacing:.05em;
  }

  .claim-stats{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;margin-bottom:12px;
  }
  .claim-stat{
    background:var(--card);border:1px solid var(--border);
    border-radius:var(--radius-2);padding:14px 16px;box-shadow:var(--shadow-1);
  }
  .claim-stat--vent{border-color:var(--crit-border);background:linear-gradient(180deg,var(--crit-soft) 0%,var(--card) 70%)}
  .claim-stat-value{
    font-size:24px;font-weight:700;color:var(--ink);line-height:1.1;
    font-variant-numeric:tabular-nums;letter-spacing:-.02em;
  }
  .claim-stat-label{font-size:12px;font-weight:600;color:var(--ink-2);margin-top:4px}
  .claim-stat-sub{font-size:10.5px;color:var(--muted);margin-top:1px}

  .claim-bill-head{
    display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap;
    padding-bottom:12px;border-bottom:1px solid var(--hairline);
  }
  .claim-bill-head > div:first-child{flex:1;min-width:0}
  .claim-bill-head .btn{margin-left:auto}
  .claim-bill-name{
    display:flex;align-items:center;gap:7px;
    font-size:14px;font-weight:700;color:var(--ink);margin-bottom:2px;
  }
  .claim-bill-name svg{width:14px;height:14px;color:var(--muted)}

  .claim-findings{display:flex;flex-direction:column;gap:10px;margin-top:12px}
  .claim-finding{
    border:1px solid var(--border);border-left:3px solid var(--inact);
    border-radius:10px;padding:12px 14px;background:var(--bg-soft);
  }
  .claim-finding--crit{border-left-color:var(--crit)}
  .claim-finding--under{border-left-color:var(--info)}
  .claim-finding--ded{border-left-color:var(--purple)}
  .claim-finding--info{border-left-color:var(--inact)}
  .claim-finding-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}
  .claim-finding-amount{
    margin-left:auto;font-size:14px;font-weight:700;color:var(--ink);
    font-variant-numeric:tabular-nums;
  }
  .claim-finding-title{font-size:13.5px;font-weight:650;color:var(--ink);line-height:1.45}
  .claim-finding-detail{font-size:12.5px;color:var(--ink-2);line-height:1.55;margin-top:3px}
  .claim-finding-lines{margin:8px 0 0;padding-left:18px}
  .claim-finding-lines li{
    font-size:12px;color:var(--muted);line-height:1.6;
    font-family:var(--font-mono,ui-monospace,SFMono-Regular,Menlo,monospace);
  }
  .claim-delta{
    display:inline-flex;align-items:center;gap:8px;margin-top:8px;
    background:var(--card);border:1px solid var(--border);
    border-radius:8px;padding:5px 10px;font-size:12px;color:var(--ink-2);
  }
  .claim-delta b{font-variant-numeric:tabular-nums;color:var(--ink)}
  .claim-delta-vs{color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.05em}

  .claim-days{display:flex;flex-direction:column;gap:8px}
  .claim-day{
    display:flex;gap:14px;align-items:flex-start;
    padding:10px 12px;border:1px solid var(--border);
    border-radius:10px;background:var(--bg-soft);
  }
  .claim-day-date{
    flex:none;width:92px;font-size:12px;font-weight:700;color:var(--ink);
    font-variant-numeric:tabular-nums;padding-top:3px;
  }
  .claim-day-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
  .claim-day-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
  .claim-tag{
    display:inline-flex;align-items:center;
    background:var(--card);border:1px solid var(--border);
    border-radius:6px;padding:2px 8px;font-size:11.5px;color:var(--ink-2);
    font-variant-numeric:tabular-nums;
  }

  :root[data-theme="dark"] .claim-finding,
  :root[data-theme="dark"] .claim-day{background:rgba(255,255,255,.03)}
  :root[data-theme="dark"] .claim-stat--vent{background:none;border-color:var(--crit-border)}

  @media(max-width:900px){
    .claim-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  }
  @media(max-width:560px){
    .claim-verdict{flex-wrap:wrap}
    .claim-verdict-figure{text-align:left;width:100%}
    .claim-stats{grid-template-columns:1fr 1fr}
    .claim-day{flex-direction:column;gap:6px}
    .claim-day-date{width:auto}
  }
