/* The printed sheet has to be recognizable as the same page that lives in the
   binder, so these rules mirror the paper: red section headers, a boxed grid,
   Incoming on the left and Outgoing on the right. Screen styling stays close
   to it too, just stacked for a phone. */
.cl-tabs{display:flex;border-bottom:1px solid var(--bdr);background:var(--surf);position:sticky;top:0;z-index:5}
.cl-tab{flex:1;padding:11px 4px;border:none;background:none;font-size:12px;font-weight:600;color:var(--mut);cursor:pointer;font-family:var(--sans);border-bottom:2px solid transparent}
.cl-tab.on{color:var(--acc);border-bottom-color:var(--acc)}
.cl-appt{background:var(--surf);border:1px solid var(--bdr);border-radius:12px;margin:0 0 10px;overflow:hidden}
.cl-appt-hd{padding:11px 13px;border-bottom:1px solid var(--bdr);display:flex;gap:9px;align-items:flex-start}
.cl-sug{display:flex;align-items:center;gap:9px;padding:9px 13px;border-top:1px solid var(--bdr)}
.cl-pill{display:inline-block;padding:2px 8px;border-radius:11px;font-size:10px;font-weight:700;white-space:nowrap}
.cl-code1{background:#dbeafe;color:#1d4ed8}
.cl-code2{background:#fef3c7;color:#92400e}
.cl-code3{background:#e0e7ff;color:#4338ca}
.cl-code4{background:#fee2e2;color:#b91c1c}
.cl-btn{padding:7px 13px;border-radius:8px;font-size:12px;font-weight:700;cursor:pointer;font-family:var(--sans);border:none;white-space:nowrap}
.cl-btn-go{background:var(--acc);color:#fff}
.cl-btn-gh{background:none;border:1px solid var(--bdr);color:var(--mut)}
.cl-sheet-tbl{width:100%;border-collapse:collapse;font-size:11px}
.cl-sheet-tbl th{background:var(--surf2);font-size:9px;text-transform:uppercase;letter-spacing:.03em;color:var(--mut);padding:6px 5px;border:1px solid var(--bdr);font-weight:700}
.cl-sheet-tbl td{padding:6px 5px;border:1px solid var(--bdr);vertical-align:top}
.cl-hvms td{background:rgba(52,95,168,.035)}
.cl-void td{text-decoration:line-through;color:var(--mut);background:repeating-linear-gradient(45deg,transparent,transparent 6px,rgba(0,0,0,.03) 6px,rgba(0,0,0,.03) 12px)}
.cl-field{width:100%;padding:9px 11px;border:1.5px solid var(--bdr);border-radius:9px;font-size:15px;font-family:var(--sans);background:var(--bg);color:var(--txt);box-sizing:border-box}
.cl-lbl{display:block;font-size:11px;font-weight:700;color:var(--mut);text-transform:uppercase;letter-spacing:.03em;margin:0 0 5px}
#cl-print-area{display:none}
/* The sheet's own appearance lives out here rather than inside @media print,
   because it has to exist before the print dialog does. fitControlSheets()
   lays the binder out off-canvas and measures it to drop pages that would
   carry nothing; under screen media these rules did not apply, so it measured
   a table with the wrong font, padding and row height and left the dead pages
   in. #cl-print-area is display:none on screen, so nothing here shows. */
.cl-print-sheet{page-break-after:always;padding:10px 14px;font-family:Arial,Helvetica,sans-serif;color:#000}
.cl-print-sheet:last-child{page-break-after:auto}
.cl-print-title{text-align:center;color:#c00;font-weight:bold;font-size:15px;letter-spacing:.02em}
.cl-print-tbl{width:100%;border-collapse:collapse;font-size:10px}
.cl-print-tbl th,.cl-print-tbl td{border:1px solid #000;padding:3px 4px;height:17px}
.cl-print-tbl th{color:#c00;font-size:9px;text-transform:uppercase}
/* Explicit rather than relying on the default: this is what carries the drug,
   the location and the period onto every page after the first. */
.cl-print-tbl thead{display:table-header-group}
.cl-print-tbl tbody tr{page-break-inside:avoid}
.cl-print-strip{color:#1a3a5e!important;font-size:8.5px!important;text-align:left;
                letter-spacing:.02em;background:#f2f2f2}
.cl-print-hdr{color:#1a3a5e;font-weight:bold;font-size:12px}
@media print{
  /* Pinned so a page is a known quantity. Without it the printable height is
     whatever the browser and printer agree on that day, the sheets reflow
     between one print and the next, and nothing can be fitted to a page
     deliberately. A controlled-drug binder wants the same pagination every
     time it is run. */
  @page{size:Letter portrait;margin:0.4in}
  /* `:not(#cl-print-area)` is doing real work here, not just exclusion: the
     app's own `.screen.active{display:block!important}` (specificity 0-2-0)
     outranks a plain `body>*{display:none!important}` (0-0-1), so the printer
     rendered the live screen instead of the form. Naming an id inside :not()
     lifts this rule to 1-0-1, which wins. */
  /* BUG (found 2026-09-29, printing a location binder): every print in this
     app came out as exactly one page. `html,body{height:100%;overflow:hidden}`
     at the top of this stylesheet is the shell rule that makes the app behave
     like a fixed-viewport application on a phone — and on paper it clips the
     document to a single viewport and throws the rest away. Confirmed by
     rendering 8 sheets to PDF: 8 .cl-print-sheet divs, print area 4736px
     tall, body clipped to 720px, 1 page out. A DEA binder silently losing
     every page after the first is the worst possible way for this to fail. */
  html,body{height:auto!important;overflow:visible!important}
  body>*:not(#cl-print-area){display:none!important}
  /* `#s-login.active{display:flex!important}` is 1-1-0 and outranks the
     1-0-1 rule above, so a session that expired mid-shift would print the
     login screen instead of the record. Matched at equal specificity here,
     and later in the sheet, so this one wins. */
  #s-login.active{display:none!important}
  #cl-print-area{display:block!important;padding:0;margin:0}
}

/* ── DEA log (2026-10-27): one page per place — should have, the sum that
   gets there, what was used, what is still to log. Same look as the rest of
   the app: white cards, the teal accent, the code pills above. ── */
#dea-body{padding-bottom:110px}
.dea-pad{padding:12px 12px 18px;max-width:760px;margin:0 auto}
.dea-tabs{max-width:none}
.dea-n{display:inline-block;min-width:16px;padding:1px 5px;border-radius:9px;background:var(--red);color:#fff;font-size:9.5px;font-weight:800;vertical-align:1px}
.dea-card{background:var(--surf);border:1px solid var(--bdr);border-radius:12px;margin-bottom:10px;overflow:hidden}
.dea-card-b{padding:12px 13px}
.dea-h{font-size:11px;font-weight:700;color:var(--mut);text-transform:uppercase;letter-spacing:.04em;margin:14px 2px 7px}
.dea-row{display:flex;align-items:center;gap:8px}
.dea-mut{color:var(--mut);font-size:11.5px;line-height:1.45}
.dea-fnt{color:var(--fnt);font-size:11.5px}
.dea-note{font-size:11.5px;line-height:1.5;color:var(--mut);margin:0 2px 10px}
.dea-note.warn{color:var(--amb);background:var(--amb-lt);border:1px solid #fcd34d;border-radius:9px;padding:8px 10px}
.dea-note-s{font-size:12px;line-height:1.45}
.dea-empty{padding:2rem 1rem;text-align:center;color:var(--mut);font-size:13px;line-height:1.6}
.dea-stats{display:flex;gap:14px;margin-top:9px;flex-wrap:wrap;font-size:11.5px;color:var(--mut)}
.dea-stat{font-size:24px;font-weight:700;letter-spacing:-.02em;line-height:1.05}
.dea-place{display:flex;gap:11px;padding:12px 13px;border:none;border-top:1px solid var(--bdr);background:none;width:100%;cursor:pointer;font-family:var(--sans);color:var(--txt);align-items:flex-start}
.dea-place:first-child{border-top:none}
.dea-place-ic{width:40px;height:40px;border-radius:10px;background:var(--acc-lt);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:18px}
.dea-place-t{font-size:14px;font-weight:700}
.dea-chev{margin-left:auto;color:var(--fnt);font-size:20px;align-self:center}
.dea-chips{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}
.dea-ok{background:var(--grn-lt);color:var(--grn)}
.dea-warn{background:var(--amb-lt);color:var(--amb)}
.dea-bad{background:var(--red-lt);color:var(--red)}
.dea-src{background:#eff6ff;color:#1d4ed8}
.dea-mutp{background:#f1f5f9;color:#475569}
.dea-cII{background:#fee2e2;color:#991b1b}.dea-cIII{background:#ffedd5;color:#9a3412}.dea-cIV{background:#e0e7ff;color:#3730a3}.dea-cV{background:#ecfccb;color:#3f6212}
.dea-alert{display:flex;gap:9px;padding:10px 12px;border-top:1px solid var(--bdr);font-size:12px;line-height:1.45;align-items:flex-start}
.dea-alert:first-child{border-top:none}
.dea-ico{width:22px;height:22px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0}
.dea-ico.warn{background:var(--amb-lt);color:var(--amb)}.dea-ico.bad{background:var(--red-lt);color:var(--red)}.dea-ico.ok{background:var(--grn-lt);color:var(--grn)}
.dea-banner{font-size:12px;line-height:1.5;border-radius:12px;padding:10px 12px;margin-bottom:10px}
.dea-banner.ok{background:var(--grn-lt);color:var(--grn);border:1px solid var(--grn-bg)}
.dea-banner.warn{background:var(--amb-lt);color:var(--amb);border:1px solid #fcd34d}
.dea-drug{font-size:15px}
.dea-big{font-size:30px;font-weight:700;letter-spacing:-.02em;line-height:1.05}
.dea-big.neg{color:var(--red)}
.dea-unit{font-size:15px;font-weight:600;color:var(--mut);margin-left:3px}
.dea-eq{display:grid;grid-template-columns:1fr auto;gap:4px 10px;font-size:12.5px;margin-top:10px;padding-top:9px;border-top:1px dashed var(--bdr2)}
.dea-eq .v{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
.dea-eq .tot{font-weight:800;border-top:1.5px solid var(--txt);padding-top:4px;font-size:13.5px}
.dea-bar{height:7px;border-radius:4px;background:#edf0f3;overflow:hidden;margin-top:5px}
.dea-bar>i{display:block;height:100%;background:var(--acc)}
.dea-flag{margin-top:10px;padding:9px 10px;border-radius:9px;background:var(--amb-lt);color:var(--amb);font-size:11.5px;line-height:1.5}
.dea-flag.bad{background:var(--red-lt);color:var(--red)}
.dea-link{display:block;width:100%;margin-top:10px;padding:0;border:none;background:none;color:var(--acc);font-weight:700;font-size:12px;text-align:left;cursor:pointer;font-family:var(--sans)}
.dea-seg{display:inline-flex;border:1px solid var(--bdr2);border-radius:8px;overflow:hidden}
.dea-seg button{padding:6px 9px;border:none;border-left:1px solid var(--bdr2);background:var(--surf);color:var(--mut);font-size:11.5px;font-weight:700;cursor:pointer;font-family:var(--sans)}
.dea-seg button:first-child{border-left:none}
.dea-seg button.on{background:var(--acc);color:#fff}
.dea-day{font-size:10.5px;font-weight:700;color:var(--mut);text-transform:uppercase;letter-spacing:.05em;padding:8px 12px 6px;background:var(--surf2);border-top:1px solid var(--bdr)}
.dea-card>.dea-day:first-child{border-top:none}
.dea-line{display:flex;gap:10px;padding:10px 12px;border-top:1px solid var(--bdr)}
.dea-day+.dea-line{border-top:none}
.dea-line.void .dea-line-t,.dea-line.void .dea-amt{text-decoration:line-through;color:var(--mut)}
.dea-line-t{font-weight:700;font-size:13px}
.dea-bal{margin-left:auto;text-align:right;white-space:nowrap}
.dea-amt{font-weight:800;font-variant-numeric:tabular-nums}
.dea-amt.out{color:var(--red)}.dea-amt.in{color:var(--grn)}
.dea-done{margin-top:10px}
.dea-done summary{cursor:pointer;font-size:12px;font-weight:700;color:var(--mut);margin-bottom:8px}
.dea-add{display:flex;flex-direction:column;gap:2px;text-align:left;padding:11px 13px;border:1px solid var(--bdr);border-radius:10px;background:var(--surf);cursor:pointer;font-family:var(--sans);color:var(--txt)}
.dea-add b{font-size:14px}.dea-add span{font-size:12px;color:var(--mut)}
/* Roadside: big type, high contrast — read by somebody else, often outdoors */
.dea-road{background:#0b1f22;color:#fff;width:100%;max-width:520px;margin:0 auto;border-radius:16px 16px 0 0;padding:16px 14px 22px;
  max-height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;box-sizing:border-box}
.dea-road-pill{background:#14363a;color:#9fe0d6}
.dea-road-x{border:none;background:none;color:#8fb3b5;font-size:13px;cursor:pointer;font-family:var(--sans)}
.dea-road-h{font-size:21px;font-weight:800;margin:12px 0 10px;line-height:1.2}
.dea-road-lab{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#8fb3b5;font-weight:700;margin-top:9px}
.dea-road-val{font-size:15px;font-weight:700;margin-top:2px;line-height:1.35}
.dea-road-card{background:#fff;color:#111;border-radius:12px;margin-top:12px;overflow:hidden}
.dea-road-tbl{width:100%;border-collapse:collapse;font-size:13px}
.dea-road-tbl td{padding:9px 11px;border-top:1px solid var(--bdr);vertical-align:top}
.dea-road-tbl tr:first-child td{border-top:none}
.dea-road-btn{display:block;width:100%;margin-top:10px;padding:13px;border-radius:10px;border:none;background:#14363a;color:#fff;font-size:14px;font-weight:700;cursor:pointer;font-family:var(--sans)}
.dea-road-btn.light{background:#fff;color:#0b1f22}
.dea-road-foot{font-size:11.5px;color:#8fb3b5;text-align:center;margin-top:10px}
.dea-card-b>.dea-eq:first-child{border-top:none;margin-top:0;padding-top:0}
/* Count tab (DEA log step 2): numbers typed on a phone, big enough to hit */
.dea-inp{border:1.5px solid var(--bdr2);border-radius:8px;padding:7px 9px;font-size:16px;font-weight:700;width:76px;text-align:right;background:#fff;color:var(--txt);font-family:var(--sans);box-sizing:border-box}
.dea-count-row .dea-row label{white-space:nowrap}
/* Today's calendar on the DEA log's first page — open, folds with the arrow (2026-10-29) */
.dea-today{margin-top:10px;border-top:1px solid var(--bdr,#e5e7eb);padding-top:8px}
.dea-today summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:700;padding:6px 2px;min-height:40px}
.dea-today summary::-webkit-details-marker{display:none}
.dea-today-arrow{margin-left:auto;font-size:20px;line-height:1;transition:transform .15s;color:var(--mut)}
.dea-today:not([open]) .dea-today-arrow{transform:rotate(-90deg)}
.dea-today .cl-appt{margin-top:8px}
/* A note from EquineAIScribe, on the DEA log's first page until it is logged (2026-10-29) */
.dea-note-card{border:2px solid var(--grn,#1a7f5a);margin-bottom:12px}
.dea-note-card .cl-appt{margin-top:8px}
