/* ============================================================================
   Audit Lab look. Loaded AFTER app.css and only overrides it — delete the
   <link> in index.html and the platform is back to the original design.

   Modelled on the co-counsel portal the firm uses (auditlab.wagstafflawfirm.com):
   Poppins, navy primary, a gradient band behind a floating pill nav, white
   16px-radius panels on a light grey page, and on a case a gradient rail with
   vertical tabs. Written from measurements of that UI, not copied from it.
   ========================================================================== */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap;
             src: url("/static/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap;
             src: url("/static/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap;
             src: url("/static/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap;
             src: url("/static/fonts/poppins-700.woff2") format("woff2"); }

:root {
  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page:      #f3f5f9;
  --surface:   #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef1f6;
  --line:      #e6e9f0;
  --line-2:    #edf0f5;
  --line-3:    #d1d5db;
  --ink:       #111827;
  --ink-2:     #3f4a5c;
  --ink-3:     #6b7588;
  --ink-4:     #9ca3af;

  --accent:     #2446c7;
  --accent-600: #1d3aa8;
  --accent-700: #162c80;
  --accent-100: #dde5fb;
  --accent-50:  #f0f4fe;

  --r1: 6px; --r2: 8px; --r3: 16px; --r4: 16px;

  /* The two gradients: horizontal band (dashboard/header), vertical rail (case). */
  /* Our own gradients: deep navy into royal blue, calmer than the source's rainbow. */
  --band: linear-gradient(115deg, #0e1a47 0%, #1b2f7a 38%, #2446c7 72%, #3a6ff0 100%);
  --rail: linear-gradient(180deg, #0e1a47 0%, #1b2f7a 45%, #2446c7 100%);
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px -2px rgba(16,24,40,.06);
  --glass: rgba(255, 255, 255, .08);
  --top-h: 72px;
}
html[data-theme="dark"] {
  --accent: #6d8cff; --accent-600: #8aa4ff; --accent-700: #b3c4ff;
}

body { font-size: 14px; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.tiny { font-size: 12px; }

/* ═════════════ shell: gradient band + floating pill nav, no sidebar ═════════════ */
#shell, #shell.collapsed {
  display: flex; flex-direction: column; height: 100vh;
}
.topbar {
  flex: none; height: var(--top-h); padding: 0 16px; gap: 16px;
  background: var(--band); border-bottom: 0; color: #fff;
}
.brand { width: auto; }
#navtoggle { display: none; }
.logo { background: #fff; color: var(--accent); border-radius: 8px;
        width: 32px; height: 32px; font-size: 12px; }
.brand-text b { color: #fff; font-size: 14px; }
.brand-text span { color: rgba(255,255,255,.7); }

.pillnav {
  display: flex; align-items: center; gap: 2px; padding: 6px;
  background: rgba(0,0,0,.24); border-radius: 9999px; margin: 0 auto;
  flex: none; max-width: 60vw; overflow-x: auto; scrollbar-width: none;
}
.pillnav .navitem {
  width: auto; height: 40px; padding: 0 18px; border-radius: 9999px;
  color: #fff; font-size: 14px; font-weight: 500; gap: 7px;
}
.pillnav .navitem .ico { color: rgba(255,255,255,.8); }
.pillnav .navitem .label { flex: none; }
.pillnav .navitem:hover { background: rgba(255,255,255,.14); color: #fff; }
.pillnav .navitem.on { background: #fff; color: var(--accent); font-weight: 600; }
.pillnav .navitem.on .ico { color: var(--accent); }
.pillnav .navitem .count { background: rgba(255,255,255,.2); color: #fff; }
.pillnav .navitem.on .count { background: var(--accent-50); color: var(--accent); }

.more-menu { min-width: 240px; padding: 6px; }
.more-menu .navitem { height: 36px; border-radius: 8px; }

/* Search moves to the right cluster as a compact glass field. */
.searchwrap { flex: 0 1 260px; }
.searchwrap svg { color: rgba(255,255,255,.75); }
#gsearch { height: 38px; border-radius: 9999px; color: #fff;
           background: rgba(255,255,255,.16); }
#gsearch::placeholder { color: rgba(255,255,255,.75); }
#gsearch:hover { background: rgba(255,255,255,.22); }
.kbd { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.topbar-right { margin-left: 0; }
.topbar .syncpill { background: rgba(255,255,255,.14); border-color: transparent;
                    color: #fff; height: 32px; }
.topbar .syncpill:hover { background: rgba(255,255,255,.22); }
.topbar .iconbtn { color: #fff; border-radius: 9999px; height: 32px; }
.topbar .iconbtn:hover { background: rgba(255,255,255,.16); color: #fff; }
.topbar .themeswitch { background: rgba(255,255,255,.14); border-color: transparent; }
.topbar .themeswitch button { color: rgba(255,255,255,.75); }
.topbar .themeswitch button[aria-pressed="true"] { background: #fff; color: var(--accent); }
.avatar { background: #fff; color: var(--accent); width: 34px; height: 34px;
          font-size: 12px; }

main#main { flex: 1; min-height: 0; }
.page { max-width: none; padding: 24px 32px 44px; }

/* ═════════════ hero (Command Center greeting) ═════════════ */
.hero { background: var(--band); color: #fff;
        padding: 20px 32px 88px; margin: 0; }
.hero h1 { font-size: 28px; color: #fff; }
.hero .sub { color: rgba(255,255,255,.82); font-size: 15px; }
.hero .page-actions .btn { background: rgba(255,255,255,.16); color: #fff;
                           border-color: transparent; }
.hero .page-actions .method { background: rgba(255,255,255,.9); }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
              gap: 16px; margin-top: 24px; }
.hero-stat { position: relative; overflow: hidden; background: #fff;
             color: var(--ink); border-radius: 16px; padding: 18px 20px;
             border: 0; text-align: left; font: inherit; cursor: pointer; }
.hero-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0;
                     width: 5px; background: var(--hs, var(--accent)); }
.hero-stat .k { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.hero-stat .v { font-size: 30px; font-weight: 600; letter-spacing: -.02em;
                margin-top: 2px; }
.hero-stat .s { font-size: 12px; color: var(--ink-3); }
.hero-stat:hover { box-shadow: 0 8px 24px -8px rgba(0,0,0,.35); }
.hero-stat.hs-1 { --hs: linear-gradient(#ff70be, #f9a8d4); }
.hero-stat.hs-2 { --hs: linear-gradient(#17b26a, #47cd89); }
.hero-stat.hs-3 { --hs: linear-gradient(#8b5cf6, #a78bfa); }
.hero-stat.hs-4 { --hs: linear-gradient(#f59e0b, #fbbf24); }
/* The white panel that overlaps the band, as on the dashboard. */
.panel-lift { position: relative; margin: -64px 16px 24px; background: var(--surface);
              border-radius: 16px; padding: 24px; }
html[data-theme="dark"] .hero-stat { background: var(--surface); }

/* ═════════════ components ═════════════ */
.card { border-radius: 16px; border-color: var(--line); box-shadow: var(--shadow-card); }
.card-head { padding: 16px 20px; border-bottom-color: var(--line); }
.card-head h2 { font-size: 16px; }
.card-body { padding: 20px; }
.card-foot { background: var(--surface); }
.tile { border-radius: 16px; padding: 16px 18px; }
.tile .v { font-size: 26px; }

.btn { border-radius: 9999px; font-weight: 500; height: 36px; padding: 0 16px; }
.btn.sm { height: 30px; padding: 0 12px; }
.btn.xs { border-radius: 9999px; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.badge, .chip { border-radius: 9999px; }

input[type=text], input[type=search], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea { border-radius: 8px; }
.selectbtn { border-radius: 9999px; height: 36px; }

thead th { background: var(--surface); color: #737373; font-size: 11px;
           font-weight: 500; text-transform: uppercase; letter-spacing: .04em;
           padding: 10px 16px; }
tbody td { font-size: 13px; padding: 14px 16px; border-bottom-color: var(--line-2); }
tbody tr.click:hover { background: var(--accent-50); }

.pop { border-radius: 12px; }
.palette { border-radius: 16px; }

/* ═════════════ case page: gradient rail + vertical tabs ═════════════ */
.case-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr);
               min-height: 100%; }
.case-rail { background: var(--rail); color: #fff; padding: 20px 16px 24px;
             display: flex; flex-direction: column; gap: 16px;
             position: sticky; top: 0; align-self: start; height: calc(100vh - var(--top-h));
             overflow-y: auto; }
.case-rail .back { align-self: flex-start; background: var(--glass); color: #fff;
                   border: 0; border-radius: 9999px; padding: 8px 16px;
                   font: 500 14px var(--sans); cursor: pointer; }
.case-rail .back:hover { background: rgba(11,62,126,.65); }
.case-id { padding: 0 16px; }
.case-id .practice-name { font-size: 12px; color: rgba(255,255,255,.7);
                          text-transform: uppercase; letter-spacing: .05em; }
.case-id .client { font-size: 16px; font-weight: 600; margin: 2px 0; }
.case-id .num { font-size: 13px; color: rgba(255,255,255,.55); }
.case-id .badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.case-tabs { display: flex; flex-direction: column; gap: 2px; padding: 8px;
             background: var(--glass); border-radius: 16px; }
.case-tabs button { display: flex; align-items: center; gap: 8px; width: 100%;
                    text-align: left; padding: 10px 12px; border: 0;
                    border-radius: 12px; background: none; color: #fff;
                    font: 400 15px var(--sans); cursor: pointer; }
.case-tabs button:hover { background: rgba(255,255,255,.12); }
.case-tabs button[aria-current="true"] { background: #fff; color: var(--accent-600);
                                         font-weight: 600; }
.case-tabs .n { margin-left: auto; font-size: 12px; opacity: .7;
                font-variant-numeric: tabular-nums; }
.case-tabs button.locked { color: rgba(255,255,255,.5); cursor: default; }
.case-tabs button.locked:hover { background: none; }

.case-main { padding: 20px 24px 44px; min-width: 0; }
.case-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
            margin-bottom: 16px; }
.case-top h1 { font-size: 22px; margin-right: auto; }
.infochip { display: inline-flex; align-items: center; gap: 6px; height: 38px;
            padding: 0 12px; background: var(--surface); border: 1px solid var(--line);
            border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.infochip span { color: var(--ink-3); }
.infochip b { font-weight: 500; color: var(--ink); }

/* Label-over-value field grid, six across like the source's case sections. */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
          gap: 16px 20px; }
.field .fl { display: block; font-size: 12px; color: var(--ink-3); }
.field .fv { display: block; font-size: 15px; color: var(--ink); margin-top: 2px;
             overflow-wrap: anywhere; }
.field .fv.na { color: var(--ink-4); }

@media (max-width: 1100px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .case-layout { grid-template-columns: 1fr; }
  .case-rail { position: static; height: auto; }
  .case-tabs { flex-direction: row; overflow-x: auto; }
  .case-tabs button { width: auto; white-space: nowrap; }
}

/* Header fit: ~1700px wide is the common laptop viewport here. The "Ask AI"
   button duplicates the Ask pill, and the scope/sync pills keep only their dot
   and short label until there is room. */
.topbar #aibtn { display: none; }
.pillnav .navitem { padding: 0 14px; }
.searchwrap { flex: 0 1 200px; min-width: 120px; }
.topbar-right { flex: none; gap: 6px; }
@media (max-width: 1800px) {
  .pillnav .navitem .ico { display: none; }
  .pillnav .navitem#navmore .ico { display: grid; }
  .brand-text span { display: none; }
}
@media (max-width: 1500px) {
  #syncpill span:not(.dot) { display: none; }
}


/* ═════════════ Cases list ═════════════ */
.cases-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.cases-head h1 { font-size: 26px; letter-spacing: -.02em; }
.cases-sub { display: flex; align-items: center; gap: 8px; color: var(--ink-3);
             margin-top: 2px; font-size: 14px; }
.cases-sub b { color: var(--ink); font-weight: 600; }
.soft { color: var(--ink-3); font-size: 12px; }

.bigsearch { flex: 1; max-width: 620px; margin-left: auto; position: relative;
             display: flex; align-items: center; }
.bigsearch svg { position: absolute; left: 16px; color: var(--ink-3);
                 width: 17px; height: 17px; pointer-events: none; }
.bigsearch input { width: 100%; height: 46px; padding: 0 18px 0 44px;
                   font: 400 14.5px var(--sans); color: var(--ink);
                   background: var(--surface); border: 1px solid var(--line);
                   border-radius: 9999px; box-shadow: var(--shadow-card); }
.bigsearch input:focus { outline: none; border-color: var(--accent);
                         box-shadow: 0 0 0 4px var(--accent-50); }
.cases-head #cexport { height: 46px; padding: 0 20px; }

.viewtabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px;
            background: var(--surface-3); border-radius: 9999px; }
.viewtabs button { border: 0; background: none; cursor: pointer; height: 34px;
                   padding: 0 16px; border-radius: 9999px; color: var(--ink-2);
                   font: 500 13.5px var(--sans); white-space: nowrap; }
.viewtabs button:hover { color: var(--ink); }
.viewtabs button[aria-selected="true"] { background: var(--surface); color: var(--accent);
  font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.12); }

.cases-filters { gap: 8px; margin-bottom: 14px; flex-wrap: wrap; padding: 0; }
.fl-label { font-size: 12px; font-weight: 600; color: var(--ink-3);
            text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.cases-filters .btn.xs { height: 36px; padding: 0 14px; font-size: 13px; }
.cases-filters .btn.xs[aria-pressed="true"] { background: var(--accent-50);
  color: var(--accent); border-color: var(--accent-100); }

.cases-card { overflow: hidden; }
.cases-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2);
                        border-bottom: 1px solid var(--line); padding: 12px 16px;
                        white-space: nowrap; }
.cases-table .sortmark { margin-left: 5px; opacity: .35; font-size: 10px; }
.cases-table th[aria-sort="ascending"] .sortmark,
.cases-table th[aria-sort="descending"] .sortmark { opacity: 1; color: var(--accent); }
.cases-table th[aria-sort="ascending"],
.cases-table th[aria-sort="descending"] { color: var(--accent); }
.cases-table tbody td { padding: 14px 16px; vertical-align: middle;
                        border-bottom: 1px solid var(--line-2); }
.cases-table tbody tr { transition: background .12s ease; }
.cases-table tbody tr:hover { background: var(--accent-50); }
.cases-table tbody tr:hover .chevr { opacity: 1; transform: translateX(2px); }

.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-t { min-width: 0; }
.who-n { font-size: 14.5px; font-weight: 600; color: var(--ink);
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.who-s { font-size: 12px; color: var(--ink-3); margin-top: 1px;
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.who-s .mono { font-size: 11.5px; }
.who.sm { gap: 8px; font-size: 13px; color: var(--ink-2); }

.av { flex: none; width: 38px; height: 38px; border-radius: 50%;
      display: grid; place-items: center; font: 600 13px var(--sans);
      color: var(--avc); background: var(--avb); }
.who.sm .av { width: 26px; height: 26px; font-size: 10.5px; }
.av-0 { --avb: #e0e7ff; --avc: #3730a3; }  .av-1 { --avb: #dcfce7; --avc: #166534; }
.av-2 { --avb: #fef3c7; --avc: #92400e; }  .av-3 { --avb: #fce7f3; --avc: #9d174d; }
.av-4 { --avb: #e0f2fe; --avc: #075985; }  .av-5 { --avb: #ede9fe; --avc: #5b21b6; }
.av-6 { --avb: #ffedd5; --avc: #9a3412; }  .av-7 { --avb: #ccfbf1; --avc: #115e59; }

/* Stage pill: family colour + readable label; the SA number rides small. */
.stage { display: inline-flex; align-items: center; gap: 6px; max-width: 280px;
         padding: 4px 11px 4px 9px; border-radius: 9999px; font-size: 12.5px;
         font-weight: 500; color: var(--stc); background: var(--stb);
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage em { font-style: normal; font-size: 10.5px; font-weight: 700; opacity: .7; }
.stdot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--stc); }
.stfam { font-size: 11px; color: var(--ink-3); margin: 3px 0 0 10px; }
.st-presign { --stb: #f1f5f9; --stc: #475569; }
.st-prelit  { --stb: #e8eefe; --stc: #1d3aa8; }
.st-review  { --stb: #f3e8ff; --stc: #7e22ce; }
.st-hold    { --stb: #fef3c7; --stc: #a16207; }
.st-lit     { --stb: #e0e7ff; --stc: #3730a3; }
.st-ref     { --stb: #ccfbf1; --stc: #0f766e; }
.st-settled { --stb: #dcfce7; --stc: #15803d; }
.st-stop    { --stb: #fee2e2; --stc: #b91c1c; }
.st-other   { --stb: var(--surface-3); --stc: var(--ink-2); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
.tag { display: inline-block; max-width: 200px; padding: 3px 9px; border-radius: 6px;
       font-size: 12px; color: var(--ink-2); background: var(--surface-3);
       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag.more { color: var(--accent); background: var(--accent-50); font-weight: 600; }

.substs { display: flex; gap: 3px; margin-top: 4px; }
.subst { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 9999px; }
.subst.atty { background: #dcfce7; color: #15803d; }
.subst.part { background: #fef3c7; color: #a16207; }
.subst.no   { background: var(--surface-3); color: var(--ink-4); }

.rec { font-size: 13px; color: var(--ink-2); }
.rec b { color: var(--ink); font-weight: 600; }
.warnx { color: #b91c1c; font-weight: 600; }
.warnx svg { width: 11px; height: 11px; vertical-align: -1px; }
.op { font-size: 13px; color: var(--ink-2); }
.act { text-align: right; }
.act a { font-size: 12px; opacity: .55; }
.act a:hover { opacity: 1; }
.chevr { display: inline-block; margin-left: 10px; font-size: 20px; line-height: 1;
         color: var(--accent); opacity: .25; transition: all .12s ease; }

.cases-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px;
              border-top: 1px solid var(--line); background: var(--surface); }
.pager { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Dark: the pastel pills and avatars become tints of the same hues. */
html[data-theme="dark"] .av { background: color-mix(in srgb, var(--avc) 30%, #1a1a18);
                              color: color-mix(in srgb, var(--avb) 85%, #fff); }
html[data-theme="dark"] .stage,
html[data-theme="dark"] .subst.atty, html[data-theme="dark"] .subst.part {
  background: color-mix(in srgb, var(--stc, #15803d) 22%, transparent);
  color: color-mix(in srgb, var(--stc, #15803d) 45%, #fff); }
html[data-theme="dark"] .warnx { color: #f19999; }

@media (max-width: 1200px) {
  .cases-head { flex-wrap: wrap; }
  .bigsearch { order: 3; flex-basis: 100%; max-width: none; }
}
/* Even grid: fixed layout so every column holds its share of the full width on
   every page, every row is the same height, and long text truncates with "…"
   (full value in the tooltip) instead of wrapping and pushing columns around. */
.cases-table { table-layout: fixed; width: 100%; }
.cases-table col.c-client  { width: 24%; }
.cases-table col.c-stage   { width: 20%; }
.cases-table col.c-injury  { width: 19%; }
.cases-table col.c-subst   { width: 12%; }
.cases-table col.c-records { width: 10%; }
.cases-table col.c-manager { width: 13%; }
.cases-table col.c-opened  { width: 8%; }
.cases-table col.c-act     { width: 6%; }
.cases-table tbody tr { height: 72px; }
.cases-table td, .cases-table th { overflow: hidden; text-overflow: ellipsis; }
.cases-table td > *, .cases-table .who-t, .cases-table .who-n, .cases-table .who-s { max-width: 100%; }
.cases-table .who-n, .cases-table .who-s { max-width: none; }
.cases-table .stage { max-width: 100%; }
.cases-table .stfam, .cases-table .rec div, .cases-table .op div
  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cases-table .tags { flex-wrap: nowrap; max-width: 100%; overflow: hidden; }
.cases-table .tag { flex: 0 1 auto; min-width: 0; }
.cases-table .tag.more { flex: none; }
.cases-table .who.sm { min-width: 0; }
.cases-table .who.sm > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═════════════ Ask your firm ═════════════ */
.ask-page { max-width: 1100px; margin: 0 auto; }
.ask-hero { text-align: center; padding: 36px 24px 8px; }
.ask-hero.compact { padding-top: 12px; }
.ask-hero.compact .ask-lede, .ask-hero.compact .ask-badge { display: none; }
.ask-hero.compact h1 { font-size: 22px; margin-bottom: 12px; }
.ask-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
             border-radius: 9999px; background: var(--accent-50); color: var(--accent);
             font-size: 12.5px; font-weight: 500; margin-bottom: 14px; }
.ask-badge svg { width: 14px; height: 14px; }
.ask-hero h1 { font-size: 34px; letter-spacing: -.025em; margin-bottom: 8px;
               background: var(--band); -webkit-background-clip: text; background-clip: text;
               color: transparent; }
.ask-lede { max-width: 620px; margin: 0 auto 24px; color: var(--ink-3); font-size: 15px; }

.composer { position: relative; max-width: 820px; margin: 0 auto; }
.composer textarea { width: 100%; min-height: 60px; padding: 18px 64px 18px 22px;
  font: 400 15.5px/1.5 var(--sans); color: var(--ink); resize: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 6px 24px -8px rgba(16,24,40,.18); }
.composer textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-50), 0 6px 24px -8px rgba(16,24,40,.18); }
.composer .send { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px;
  border-radius: 50%; border: 0; cursor: pointer; background: var(--band); color: #fff;
  font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.composer .send:disabled { opacity: .6; cursor: default; }
.composer .send .spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.composer-hints { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
                  margin-top: 10px; font-size: 12px; color: var(--ink-4); }

.sugs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
        max-width: 900px; margin: 22px auto 0; }
.sug { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
       border-radius: 9999px; padding: 8px 14px; font: 400 13px var(--sans); cursor: pointer;
       transition: all .12s ease; }
.sug:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-50); }

.ask-info { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
             padding: 18px 20px; box-shadow: var(--shadow-card); }
.info-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; margin-bottom: 8px; }
.info-card h3 svg { color: var(--accent); }
.info-card p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.info-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.info-card li { margin-bottom: 5px; }

.thread { display: flex; flex-direction: column; gap: 18px; margin-top: 22px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
      padding: 22px 26px; box-shadow: var(--shadow-card); }
.qa-q { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 8px; }
.qa-meta { display: flex; align-items: center; gap: 12px; font-size: 12px;
           color: var(--ink-3); padding-bottom: 14px; margin-bottom: 14px;
           border-bottom: 1px solid var(--line-2); }
.qa.busy .qa-q { margin-bottom: 16px; }
.steps { display: grid; gap: 10px; margin-bottom: 12px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--ink-4); font-size: 14px; }
.step .spin { visibility: hidden; }
.step.on { color: var(--ink); }
.step.on .spin { visibility: visible; }

.rt { font-size: 15px; line-height: 1.7; color: var(--ink); }
.rt p { margin: 0 0 12px; }
.rt ul, .rt ol { margin: 0 0 14px; padding-left: 22px; }
.rt li { margin: 0 0 8px; }
.rt b { font-weight: 600; }
.rt-h { font-size: 15.5px; font-weight: 600; margin: 18px 0 8px; color: var(--accent-700); }
.rt-h:first-child { margin-top: 0; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px;
        padding: 0 5px; margin: 0 1px; border-radius: 9999px; vertical-align: 2px;
        background: var(--accent-50); color: var(--accent); border: 1px solid var(--accent-100);
        font: 600 10.5px/1 var(--sans); text-decoration: none; }
a.cite:hover { background: var(--accent); color: #fff; text-decoration: none; }
.cite.bad { background: var(--surface-3); color: var(--ink-4); border-color: var(--line); }

.qa-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.qa-rows h4, .srcs h4 { font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 10px; }
.qa-rows table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.src { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
       background: var(--surface-2); transition: box-shadow .3s, border-color .3s; }
.src.flash { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.src-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.src-n { flex: none; display: grid; place-items: center; width: 22px; height: 22px;
         border-radius: 50%; background: var(--accent); color: #fff; font: 600 11px var(--sans); }
.src-n.dim { background: var(--surface-3); color: var(--ink-4); }
.src-t { flex: 1; min-width: 0; }
.src-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden;
            text-overflow: ellipsis; }
.src-sub { font-size: 11.5px; color: var(--ink-3); }
.src-snip { font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
            display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lowconf { color: #b91c1c; }
.cov { margin: 12px 0 0; }
@media (max-width: 900px) { .ask-info { grid-template-columns: 1fr; } }
.src-snip mark { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 2px; }
html[data-theme="dark"] .src-snip mark { background: #715d0a; }

/* ═════════════ finding rows (Command Center, Risk Center, case page) ═════════════ */
.soft-note { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px;
             font-size: 12.5px; color: var(--ink-3); cursor: help; }
.soft-note svg { width: 14px; height: 14px; }
.fi { display: grid; align-items: center; gap: 18px; width: 100%; text-align: left;
      grid-template-columns: 96px minmax(200px, 1fr) minmax(0, 2.2fr) minmax(150px, .9fr) 18px;
      min-height: 76px; padding: 12px 20px; border: 0; background: none;
      border-bottom: 1px solid var(--line-2); font: inherit; color: inherit; cursor: pointer;
      transition: background .12s ease; }
div.fi { cursor: default; grid-template-columns: 96px minmax(0, 1fr) minmax(130px, auto); }
.fi:last-child { border-bottom: 0; }
button.fi:hover { background: var(--accent-50); }
button.fi:hover .fi-go { opacity: 1; transform: translateX(2px); }

.fi-sev { display: inline-flex; align-items: center; gap: 6px; justify-self: start;
          padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600;
          color: var(--fc); background: var(--fb); }
.fi-sev i { width: 7px; height: 7px; border-radius: 50%; background: var(--fc); }
.fi.sev-critical { --fc: #b91c1c; --fb: #fee2e2; }
.fi.sev-high     { --fc: #c2410c; --fb: #ffedd5; }
.fi.sev-medium   { --fc: #a16207; --fb: #fef3c7; }
.fi.sev-low      { --fc: #475569; --fb: #f1f5f9; }

.fi-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fi-wt { display: flex; flex-direction: column; min-width: 0; }
.fi-wt b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden;
           text-overflow: ellipsis; }
.fi-wt span { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }

.fi-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fi-what { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap;
           overflow: hidden; text-overflow: ellipsis; }
.fi-info { color: var(--ink-4); cursor: help; font-size: 13px; margin-left: 2px; }
.fi-info:hover { color: var(--accent); }
.fi-next { font-size: 12.5px; color: var(--accent); white-space: nowrap; overflow: hidden;
           text-overflow: ellipsis; }

.fi-facts { font-size: 12.5px; color: var(--ink-3); text-align: right; line-height: 1.5;
            overflow: hidden; }
.fi-facts span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-facts span:first-child { color: var(--ink-2); }
.fi-facts em { font-style: normal; color: var(--accent); font-weight: 500; }
.fi-go { font-size: 22px; color: var(--accent); opacity: .3; transition: all .12s ease; }

html[data-theme="dark"] .fi-sev { background: color-mix(in srgb, var(--fc) 22%, transparent);
                                   color: color-mix(in srgb, var(--fc) 40%, #fff); }
html[data-theme="dark"] .fi-sev i { background: currentColor; }

@media (max-width: 1100px) {
  .fi { grid-template-columns: 90px minmax(0, 1fr) 18px; }
  .fi .fi-body { grid-column: 2 / 3; }
  .fi .fi-facts { display: none; }
}
.ask-promo { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 18px 20px; border: 0; border-radius: 16px; cursor: pointer; color: #fff;
  background: var(--band); font: inherit; box-shadow: var(--shadow-card); }
.ask-promo b { display: block; font-size: 15px; }
.ask-promo span span { display: block; font-size: 12.5px; opacity: .85; margin-top: 2px; }
.ask-promo .ap-ico { flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: rgba(255,255,255,.16); }
.ask-promo .fi-go { color: #fff; opacity: .8; margin-left: auto; }
.ask-promo:hover .fi-go { transform: translateX(2px); opacity: 1; }
.fi-wrap { border-bottom: 1px solid var(--line-2); }
.fi-wrap:last-child { border-bottom: 0; }
.fi-wrap .fi { border-bottom: 0; }
.fi-wrap.overridden .fi { opacity: .6; }
.fi-ovr { display: flex; align-items: center; justify-content: flex-end; gap: 10px;
          padding: 0 20px 12px 134px; margin-top: -6px; }

/* ═════════════ case workspace: shared ═════════════ */
.ws-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 12px; margin-bottom: 16px; }
.ws-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
           padding: 14px 16px; box-shadow: var(--shadow-card); }
.ws-stat span { display: block; font-size: 12.5px; color: var(--ink-3); }
.ws-stat b { display: block; font-size: 22px; font-weight: 600; margin-top: 2px; }
.ws-stat em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.ws-stat em.warn { color: #a16207; } .ws-stat em.bad { color: #b91c1c; font-weight: 600; }
.ws-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ws-toolbar .viewtabs { margin-bottom: 0; }
.viewtabs button em { font-style: normal; font-size: 11.5px; color: var(--ink-4); margin-left: 3px; }
.viewtabs button[aria-selected="true"] em { color: var(--accent); }
.ws-toolbar select { height: 40px; border-radius: 9999px; padding: 0 14px; font: inherit;
                     border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.bigsearch.sm { flex: 1; min-width: 220px; max-width: 360px; margin-left: auto; }
.bigsearch.sm input { height: 40px; font-size: 13.5px; }

/* Communications */
.comm-list { display: flex; flex-direction: column; }
.comm { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px;
        padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.comm:last-child { border-bottom: 0; }
.comm-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
            font-size: 18px; background: var(--chb, var(--surface-3)); }
.ch-call  { --chb: #e0f2fe; } .ch-text { --chb: #dcfce7; } .ch-email { --chb: #e8eefe; }
.ch-mail  { --chb: #fef3c7; } .ch-note { --chb: #f3e8ff; }
html[data-theme="dark"] .comm-ico { background: var(--surface-3); }
.comm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.comm-head .chip { font-size: 11px; }
.comm-date { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.comm-subj { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-top: 2px; }
.comm-body { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin-top: 6px;
             white-space: pre-line; overflow-wrap: anywhere; }
.comm .btn.xs { margin-top: 6px; padding-left: 0; color: var(--accent); }

/* Checklist */
.task-card { overflow: hidden; }
.task-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px 6px; }
.task-head h2 { font-size: 17px; }
.task-head .soft { margin: 2px 0 0; }
.task-prog { margin-left: auto; display: flex; align-items: center; gap: 10px; width: 220px; }
.task-prog .bar { flex: 1; height: 8px; border-radius: 9999px; }
.task-prog .bar > i { border-radius: 9999px; }
.task-new { display: grid; grid-template-columns: minmax(0, 1fr) 200px 160px auto; gap: 8px;
            padding: 12px 20px 16px; border-bottom: 1px solid var(--line); }
.task-new input, .task-new select { height: 42px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font: inherit; background: var(--surface); color: var(--ink); }
.task-new input:focus, .task-new select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-50); }
.task-new .btn { height: 42px; }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(120px, auto) 28px;
        align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--surface-2); }
.task-check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-3);
              background: var(--surface); cursor: pointer; color: #fff; font-weight: 700;
              display: grid; place-items: center; font-size: 13px; transition: all .12s; }
.task-check:hover { border-color: var(--accent); }
.task.done .task-check { background: #16a34a; border-color: #16a34a; }
.task-title { font-size: 14.5px; font-weight: 500; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-4); }
.task-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.task-meta a { color: var(--accent); }
.task.overdue .due { color: #b91c1c; font-weight: 600; }
.task-del { opacity: 0; } .task:hover .task-del { opacity: .7; }
.task-done summary { cursor: pointer; padding: 12px 20px; font-size: 13px; color: var(--ink-3);
                     border-top: 1px solid var(--line); }
.task-done[open] summary { border-bottom: 1px solid var(--line-2); }

/* Team insights */
.pins-intro { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
              margin-bottom: 16px; }
.pins-intro h2 { grid-column: 1; }
.pins-intro p { grid-column: 1; margin: 0; max-width: 70ch; }
.pins-intro .btn { grid-column: 2; grid-row: 1 / 3; }
.pin { margin-bottom: 16px; }
.pin-by { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3);
          margin-bottom: 10px; }

/* History */
.hist { list-style: none; margin: 0; padding: 0; position: relative; }
.hist::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px;
                background: var(--line); }
.hist li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 14px;
           padding: 8px 0; }
.h-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
         background: var(--surface); border: 2px solid var(--line); font-size: 13px; z-index: 1; }
.h-task .h-dot { border-color: #16a34a; color: #16a34a; }
.h-pin .h-dot { border-color: var(--accent); }
.h-override .h-dot { border-color: #a16207; color: #a16207; }
.h-summary .h-dot { border-color: #7e22ce; color: #7e22ce; }
.h-sa .h-dot { border-color: var(--ink-3); color: var(--ink-3); }
.h-what { font-size: 14px; }

/* ═════════════ charts ═════════════ */
:root { --viz-1: #2446c7; --viz-2: #0f9488; }
html[data-theme="dark"] { --viz-1: #5b7ef0; --viz-2: #0d9e8f; }
.viz { position: relative; margin: 0; }
.viz svg { width: 100%; height: auto; display: block; }
.viz .grid { stroke: var(--line); stroke-width: 1; }
.viz .ax { font: 11px var(--sans); fill: var(--ink-3); }
.viz .end { font: 600 11.5px var(--sans); fill: var(--ink-2); }
.viz .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .ln.s1 { stroke: var(--viz-1); } .viz .ln.s2 { stroke: var(--viz-2); }
.viz .dot { stroke: var(--surface); stroke-width: 2; }
.viz .dot.s1 { fill: var(--viz-1); } .viz .dot.s2 { fill: var(--viz-2); }
.viz .xh { stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 3 3; }
.viz .hit { fill: transparent; cursor: crosshair; }
.viz-legend { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--ink-2);
              margin-bottom: 6px; }
.viz-legend .viz-tbl { margin-left: auto; }
.sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px;
      vertical-align: middle; }
.sw.s1 { background: var(--viz-1); } .sw.s2 { background: var(--viz-2); }
.viz-tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink);
           border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12.5px;
           box-shadow: 0 8px 24px -8px rgba(16,24,40,.25); min-width: 150px; z-index: 5; }
.viz-tip div { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.viz-tip span { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-table { margin-top: 6px; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 56px; align-items: center;
        gap: 10px; padding: 3px 0; border: 0; background: none; font: inherit; color: inherit;
        text-align: left; width: 100%; }
button.hbar { cursor: pointer; } button.hbar:hover .hb-t i { opacity: .8; }
.hb-l { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 12px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--viz-1); border-radius: 4px; }
.hb-v { font-size: 13px; color: var(--ink); text-align: right; }
.lc-tiles .tile .v { font-size: 26px; }
@media (max-width: 900px) { .task-new { grid-template-columns: 1fr; } }

/* ═════════════ SA detail: people, intake, fields, medical ═════════════ */
.people .person { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.people .person:first-child { padding-top: 0; }
.people .person:last-of-type { border-bottom: 0; }
.p-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-role { font-size: 12.5px; color: var(--ink-3); }
.p-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.team { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.team h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
           color: var(--ink-3); margin: 0 0 6px; }
.tm { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; }
.tm b { font-weight: 500; }
.unverified { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px;
              padding: 12px 16px; font-size: 13.5px; margin-bottom: 14px; }
html[data-theme="dark"] .unverified { background: #2a2210; border-color: #4a3b12; color: #f5d27a; }
.fields .field.wide { grid-column: 1 / -1; }
.fld-card { margin-bottom: 14px; }
.udf-table { overflow-x: auto; margin-top: 4px; }
.udf-table table { font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; }
.udf-table th { padding: 6px 10px; } .udf-table td { padding: 6px 10px; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.plist li:last-child { border-bottom: 0; }
.chron { display: flex; align-items: center; justify-content: space-between; gap: 12px;
         padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.chron:last-child { border-bottom: 0; }

/* ═════════════ columns, saved views, reports ═════════════ */
.fl-spacer { flex: 1; }
.colmenu { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; min-width: 340px; }
.colopt { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 2px; cursor: pointer; }
.colopt input { accent-color: var(--accent); }
.saveview { min-width: 320px; }
.saveview .field { margin-bottom: 10px; }
.saveview input[type=text] { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.celltext { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.rep-folder { margin-bottom: 20px; }
.rep-folder h3 { font-size: 14px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.rep { display: grid; grid-template-columns: 30px minmax(0, 1fr) 170px 80px 100px auto; gap: 14px;
       align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.rep:last-child { border-bottom: 0; }
.rep:hover { background: var(--surface-2); }
.rep-star { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--ink-4); }
.rep-star.on { color: #f59e0b; }
.rep-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.rep-name:hover { color: var(--accent); }
.rep-main .soft { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-acts { display: flex; gap: 6px; justify-content: flex-end; }
.rep-date { font-size: 12px; }
/* Header fit with 8 sections: the search field collapses to an icon button
   (it only opens the ⌘K palette anyway) until the window is wide. */
@media (max-width: 1900px) {
  .searchwrap { flex: 0 0 76px; min-width: 76px; }
  #gsearch { padding: 0 0 0 30px; color: transparent; cursor: pointer; }
  #gsearch::placeholder { color: transparent; }
  .kbd { right: 9px; }
  .pillnav .navitem { padding: 0 12px; }
}

/* ═════════════ calendar ═════════════ */
.cal { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center;
       padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.cal:last-child { border-bottom: 0; }
.cal-date { text-align: center; border-radius: 12px; background: var(--accent-50); color: var(--accent);
            padding: 6px 0; line-height: 1.1; }
.cal-date b { display: block; font-size: 20px; }
.cal-date span { font-size: 11px; }
.cal.overdue .cal-date { background: #fee2e2; color: #b91c1c; }
.cal.done .cal-date { background: var(--surface-3); color: var(--ink-3); }
.cal-title { font-size: 14.5px; font-weight: 500; }

/* ═════════════ folders + filing assistant ═════════════ */
.fold-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.fold-head h2 { margin-right: auto; font-size: 17px; }
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
        margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-card); }
.fold summary { display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer;
                list-style: none; font-size: 14.5px; user-select: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: "▸"; color: var(--ink-4); transition: transform .12s; }
.fold[open] summary::before { transform: rotate(90deg); }
.fold[open] summary { border-bottom: 1px solid var(--line); }
.fold-n { margin-left: auto; font-size: 12px; color: var(--ink-3); background: var(--surface-3);
          border-radius: 9999px; padding: 2px 10px; }
.fold table td { padding: 10px 16px; }
.sum-whole { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 10px;
             background: var(--accent-50); border: 1px solid var(--accent-100); border-radius: 14px; }
.sum-whole .btn { margin-left: auto; }
.intake { margin-bottom: 14px; }
.drop { display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer;
        border: 2px dashed var(--line-3); border-radius: 14px; margin: 12px; transition: all .12s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-50); }
.drop.busy { opacity: .7; pointer-events: none; }
.drop-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
            background: var(--accent-50); color: var(--accent); font-size: 20px; }
.intake-list { border-top: 1px solid var(--line); }
.intake-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px;
              background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.intake-row { padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.intake-row:last-child { border-bottom: 0; }
.intake-row.changed select { border-color: #f59e0b; }
.in-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.in-wait { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.in-why { font-size: 13px; color: var(--ink-2); margin: 6px 0 8px; }
.in-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 12px; }
.in-grid label span { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.in-grid label.wide { grid-column: 1 / -1; }
.in-grid select, .in-grid input { width: 100%; height: 38px; padding: 0 10px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.in-acts { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.intake-filed { padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12.5px;
                display: flex; flex-wrap: wrap; gap: 6px 12px; }
@media (max-width: 900px) { .in-grid { grid-template-columns: 1fr; } }
.prov .pv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prov .pv-top b { font-weight: 600; font-size: 14px; }
.prov .pv-cites { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pv-scan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
           padding-top: 12px; border-top: 1px solid var(--line-2); }
/* Next step: plain text, not a fake link; the action is the button beside it. */
.fi-next { color: var(--ink-2); white-space: normal; }
.fi-task { margin-left: 8px; height: 24px; vertical-align: 1px; }
.fi-task.done { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
/* Case page findings: read the whole title (no ellipsis), and keep both actions
   in one fixed row at the bottom right, in the same place on every finding. */
div.fi .fi-what, div.fi .fi-next { white-space: normal; overflow: visible; text-overflow: clip; }
div.fi .fi-what { line-height: 1.35; }
.fi-ovr { gap: 8px; }
.fi-ovr .fi-task { margin-left: 0; height: 30px; order: 1; }
.fi-ovr [data-ovr] { order: 2; height: 30px; }
.fi-ovr .soft { order: 0; margin-right: auto; }

/* ═════════════ providers ═════════════ */
.pv-wrap { padding: 20px 22px; }
.pv-top { display: flex; align-items: flex-start; gap: 16px; }
.pv-top h2 { font-size: 18px; }
.pv-top .btn { margin-left: auto; }
.pv-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pv-msg { margin: 12px 0 4px; font-size: 13px; padding: 10px 14px; border-radius: 10px;
          background: var(--surface-2); border: 1px solid var(--line-2); }
.pv-tools { margin: 14px 0 12px; }
.pv-src { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 9999px;
          font-size: 11.5px; font-weight: 600; }
.pv-src.s-sa { background: #e0f2fe; color: #075985; }
.pv-src.s-records { background: linear-gradient(90deg, #ede9fe, #e0e7ff); color: #4c1d95; }
.pv-src.s-chronology { background: #dcfce7; color: #166534; }
html[data-theme="dark"] .pv-src.s-sa { background: #0c3a52; color: #bae6fd; }
html[data-theme="dark"] .pv-src.s-records { background: #2e2159; color: #ddd6fe; }
html[data-theme="dark"] .pv-src.s-chronology { background: #14392a; color: #bbf7d0; }

.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pv-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
           border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
           transition: box-shadow .15s, transform .15s; overflow: hidden; }
.pv-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pvc); }
.pv-card:hover { box-shadow: 0 10px 28px -14px rgba(16,24,40,.35); transform: translateY(-1px); }
.g-facility   { --pvc: #2446c7; --pvb: #e8eefe; }
.g-clinician  { --pvc: #0f9488; --pvb: #ccfbf1; }
.g-diagnostic { --pvc: #7e22ce; --pvb: #f3e8ff; }
.g-pharmacy   { --pvc: #c2410c; --pvb: #ffedd5; }
.g-other      { --pvc: #64748b; --pvb: #f1f5f9; }
html[data-theme="dark"] .pv-card, html[data-theme="dark"] .pv-row { --pvb: color-mix(in srgb, var(--pvc) 22%, transparent); }
.pv-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pv-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
          background: var(--pvb); font-size: 19px; }
.pv-ico.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.pv-id { min-width: 0; }
.pv-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-time { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.pv-track { position: relative; height: 6px; border-radius: 9999px; background: var(--surface-3); }
.pv-track i { position: absolute; top: 0; bottom: 0; min-width: 6px; border-radius: 9999px; background: var(--pvc); }
.pv-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv-pages { margin-left: auto; border: 0; background: none; cursor: pointer; font: 500 12.5px var(--sans);
            color: var(--accent); padding: 2px 4px; border-radius: 6px; }
.pv-pages:hover { background: var(--accent-50); }
.pv-citelist { list-style: none; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2);
               display: flex; flex-direction: column; gap: 4px; }
.pv-citelist li { display: flex; gap: 10px; font-size: 12.5px; }
.pv-doc { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.pv-pg { flex: none; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.pv-mini .pv-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.pv-mini .pv-row:last-of-type { border-bottom: 0; }
.pv-mini .pv-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.pv-dots { display: flex; gap: 3px; }
.pv-dots i { width: 8px; height: 8px; border-radius: 50%; }
.pv-dots .d-sa { background: #0284c7; } .pv-dots .d-records { background: #7c3aed; } .pv-dots .d-chronology { background: #16a34a; }
.pv-time.none span { color: var(--ink-4); }
.pv-card { min-height: 132px; }
.pv-foot { margin-top: auto; }

/* ═════════════ login ═════════════ */
#login.login2 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
                min-height: 100vh; background: var(--page); place-items: stretch; }
.lg-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 44px 56px;
            color: #fff; background: var(--band); }
.lg-brand::after { content: ""; position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px;
                   border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%); }
.lg-logo { display: flex; align-items: center; gap: 12px; }
.lg-logo > span { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
                  background: #fff; color: var(--accent); font-weight: 700; font-size: 15px; }
.lg-logo b { display: block; font-size: 17px; }
.lg-logo em { font-style: normal; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.lg-pitch { margin: auto 0; max-width: 520px; position: relative; z-index: 1; }
.lg-pitch h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.025em; margin-bottom: 16px; color: #fff; }
.lg-pitch p { font-size: 16px; line-height: 1.6; opacity: .88; margin: 0 0 28px; }
.lg-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lg-pitch li { display: flex; align-items: center; gap: 14px; font-size: 14.5px; opacity: .95; }
.lg-pitch li i { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
                 font-style: normal; background: rgba(255,255,255,.14); }
.lg-foot { font-size: 12.5px; opacity: .65; position: relative; z-index: 1; }
.lg-panel { display: grid; place-items: center; padding: 40px 24px; }
.lg-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
           padding: 36px 34px; box-shadow: 0 24px 60px -30px rgba(16,24,40,.35); }
.lg-card h2 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 6px; }
.lg-sub { color: var(--ink-3); margin: 0 0 22px; font-size: 14.5px; }
.lg-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px;
          padding: 10px 12px; font-size: 13.5px; margin-bottom: 16px; }
html[data-theme="dark"] .lg-err { background: #2b1414; border-color: #5b2323; color: #fca5a5; }
.lg-field { display: block; margin-bottom: 16px; }
.lg-field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.lg-field input { width: 100%; height: 48px; padding: 0 14px; font: 400 15px var(--sans); color: var(--ink);
                  background: var(--surface); border: 1px solid var(--line-3); border-radius: 12px; }
.lg-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-50); }
.lg-pw { position: relative; }
.lg-pw input { padding-right: 70px; }
.lg-pw button { position: absolute; right: 8px; top: 8px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
                background: var(--surface-3); color: var(--ink-2); font: 500 12.5px var(--sans); cursor: pointer; }
.lg-code { text-align: center; font-size: 26px !important; letter-spacing: .5em; font-variant-numeric: tabular-nums; }
.lg-qr { display: grid; place-items: center; margin: 0 0 18px; }
.lg-qr img { border-radius: 12px; padding: 8px; background: #fff; border: 1px solid var(--line); }
.lg-btn { width: 100%; height: 50px; border: 0; border-radius: 12px; cursor: pointer; color: #fff;
          font: 600 15.5px var(--sans); background: var(--band); box-shadow: 0 10px 24px -12px rgba(36,70,199,.8);
          transition: transform .1s, box-shadow .15s; }
.lg-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(36,70,199,.9); }
.lg-btn:disabled { opacity: .7; cursor: default; transform: none; }
.lg-link { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--accent);
           font: 500 13.5px var(--sans); cursor: pointer; }
.lg-note { margin: 22px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 900px) {
  #login.login2 { grid-template-columns: 1fr; }
  .lg-brand { padding: 28px; min-height: 0; }
  .lg-pitch { margin: 24px 0 8px; } .lg-pitch h1 { font-size: 28px; } .lg-pitch ul, .lg-foot { display: none; }
}

/* ═════════════ dashboard ═════════════ */
.dash-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.dash-head h1 { font-size: 28px; letter-spacing: -.025em; }
.dash-head p { margin: 4px 0 0; }
.dash-scope { margin-left: auto; display: flex; flex-direction: column; gap: 4px; }
.dash-scope span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.dash-scope select { height: 44px; min-width: 280px; padding: 0 14px; border-radius: 12px; font: 500 14px var(--sans);
                     border: 1px solid var(--line-3); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.dash-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 18px;
       background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); color: var(--ink);
       text-decoration: none !important; overflow: hidden; transition: transform .12s, box-shadow .15s; }
.kpi::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--kc); }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(16,24,40,.35); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.kpi-v { font-size: 36px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.kpi-s { font-size: 12.5px; color: var(--ink-3); }
.kpi-ring { width: 34px; height: 34px; }
.kpi-ring circle { fill: none; stroke-width: 4; }
.kpi-ring .r-bg { stroke: var(--surface-3); }
.kpi-ring .r-fg { stroke: var(--kc); stroke-linecap: round; }
.k-active { --kc: #2446c7; } .k-good { --kc: #16a34a; } .k-attn { --kc: #d97706; }
.k-closed { --kc: #64748b; } .k-new { --kc: #7c3aed; }
.dash-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.dash-grid.g2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.dash-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-table { margin-bottom: 14px; }
.dash-table td { padding: 12px 16px; }
.health { display: flex; height: 10px; border-radius: 9999px; overflow: hidden; background: var(--surface-3); }
.health i { display: block; height: 100%; }
.health .h-good { background: #16a34a; } .health .h-attn { background: #f59e0b; }
.attn-n { color: #b45309; font-weight: 600; }
html[data-theme="dark"] .attn-n { color: #fbbf24; }
.dash-mini { display: flex; align-items: center; gap: 16px; padding: 18px 20px; color: var(--ink); text-decoration: none !important; }
.dash-mini:hover { border-color: var(--accent-100); }
.dm-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px;
          background: var(--accent-50); color: var(--accent); }
.dm-v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.dm-l { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.dm-s { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.acts { list-style: none; margin: 0; padding: 0; }
.acts li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 8px 0;
           border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.acts li:last-child { border-bottom: 0; }
.act-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); }
.act-t { font-size: 12px; white-space: nowrap; }
.dash-foot { margin-top: 6px; font-size: 12px; }
@media (max-width: 1300px) { .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .dash-grid.g2, .dash-grid.g3 { grid-template-columns: 1fr; } .dash-head { flex-wrap: wrap; } }
/* Dashboard greeting banner (moved here from the Command Center) */
.dash-hero { padding: 26px 32px 92px; }
.dash-hero .dash-head { margin-bottom: 22px; }
.dash-hero h1 { font-size: 30px; }
.dash-hero .dash-scope span { color: rgba(255,255,255,.8); }
.dash-hero .dash-scope select { border-color: transparent; box-shadow: 0 8px 20px -10px rgba(0,0,0,.4); }
.dash-hero .dash-kpis { margin-bottom: 0; }
.dash-hero .kpi { border: 0; box-shadow: 0 12px 28px -16px rgba(0,0,0,.45); }
html[data-theme="dark"] .dash-hero .kpi { background: var(--surface); }
.panel-lift.dash { padding: 22px; background: transparent; }
.panel-lift.dash > .dash-grid:first-child, .panel-lift.dash > section:first-child { margin-top: 0; }
.cc-stats { margin-top: 0; margin-bottom: 18px; }
.cc-stats .hero-stat { box-shadow: var(--shadow-card); border: 1px solid var(--line); }
.sortsel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sortsel select { height: 36px; border-radius: 9999px; padding: 0 12px; font: 500 13px var(--sans);
                  border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* ═════════════ Locate & verify ═════════════ */
.lv-flash { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
html[data-theme="dark"] .lv-flash { background: #0f2a1a; border-color: #1f4d31; color: #bbf7d0; }
.lv-people { margin-bottom: 14px; }
.lv-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.lv-person { padding: 18px; position: sticky; top: 12px; }
.lv-who { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.lv-name { font-size: 16px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lv-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: 13px; }
.lv-facts dt { color: var(--ink-3); } .lv-facts dd { margin: 0; overflow-wrap: anywhere; }
.lv-steps { display: flex; flex-direction: column; gap: 12px; }
.lv-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px; }
.lv-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
          color: #fff; background: var(--band); }
.lv-body h3 { font-size: 16px; margin-bottom: 4px; }
.lv-body > .soft { margin: 0 0 12px; font-size: 13px; }
.lv-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lv-link { position: relative; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 8px;
           padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
           color: var(--ink); text-decoration: none !important; transition: all .12s; }
.lv-link:hover { border-color: var(--accent); background: var(--accent-50); }
.lv-link span { grid-row: 1 / 3; font-size: 20px; align-self: center; }
.lv-link b { font-size: 13.5px; } .lv-link em { font-style: normal; font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.lv-link i { position: absolute; top: 8px; right: 10px; font-style: normal; font-size: 11px; color: #15803d; font-weight: 600; }
.lv-link.done { border-color: #86efac; background: #f0fdf4; }
html[data-theme="dark"] .lv-link.done { background: #0f2a1a; border-color: #1f4d31; }
.lv-link.wide { max-width: 560px; }
.lv-signals { margin-top: 14px; }
.lv-signals h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 6px; }
.lv-sig { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; font-size: 13px; }
.lv-none { margin: 12px 0 0 !important; }
.lv-status { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.lv-status label { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
                   cursor: pointer; font-weight: 500; }
.lv-status label:has(input:checked) { border-color: var(--accent); background: var(--accent-50); }
.lv-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chipcheck { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 9999px; border: 1px solid var(--line);
             font-size: 12.5px; cursor: pointer; }
.chipcheck:has(input:checked) { border-color: var(--accent); background: var(--accent-50); color: var(--accent); }
.lv-form { margin-bottom: 12px; }
.lv-opts { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.lv-opts .btn { margin-left: auto; }
.lv-hs { font-size: 18px; }
@media (max-width: 1100px) { .lv-grid { grid-template-columns: 1fr; } .lv-person { position: static; } }
