/* === Patient chart: strip, Records rail, centre, Insert panel ===
   Panes are flush white surfaces split by 1px hairlines (--border-light).
   One colour channel per element: primary = accent fill, secondary = neutral
   border, ghost/toolbar = text only, selected row and pressed chip = neutral fill,
   record-type labels = hue text only, allergies/warnings = warn ink. */

#view-patient-detail.chart-view {
  --ch-mono: 'IBM Plex Mono', var(--mono);
  --ch-line: var(--border-light);
  --ch-soft: var(--line-soft);
  --ch-ctrl-line: #d5dce6;
  --ch-row-hover: rgba(15,30,50,.035);
  --ch-blank-bg: #fbefc8;
  --ch-avatar: var(--sidebar-bg);
  max-width: none; margin: 0;
  font-size: 14px; line-height: 1.45; color: var(--text);
}
[data-theme="dark"] #view-patient-detail.chart-view { --ch-ctrl-line: var(--border); --ch-row-hover: rgba(255,255,255,.04); --ch-blank-bg: #4a3d1c; --ch-avatar: #1d3a63; }
@media (prefers-color-scheme: dark) {
  [data-theme="system"] #view-patient-detail.chart-view { --ch-ctrl-line: var(--border); --ch-row-hover: rgba(255,255,255,.04); --ch-blank-bg: #4a3d1c; --ch-avatar: #1d3a63; }
}

/* The chart owns the whole content area: no page padding, panes scroll inside. */
.content:has(> #view-patient-detail.active) { padding: 0; }
#view-patient-detail.chart-view.active { display: flex; flex-direction: column; min-height: 100%; background: var(--bg); }
#view-patient-detail .patient-info { display: block; margin: 0; position: static; }
#view-patient-detail #patient-draft-banner { display: none; }

.ch-mono { font-family: var(--ch-mono); }
.ch-muted { color: var(--text-secondary); }
.ch-ink { color: var(--text); }
#view-patient-detail [hidden] { display: none !important; }
[dir="rtl"] .ch-flip { transform: scaleX(-1); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 4px; border: 1px solid transparent;
  font: 500 13px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: none; color: var(--ink-2); transition: background .12s;
}
.ch-btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; padding: 0 16px; }
.ch-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ch-btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.ch-btn-secondary:hover { background: var(--hover-solid); }
.ch-btn-ghost:hover { background: var(--hover-neutral); }
.ch-btn:disabled { opacity: .5; cursor: default; }
.ch-btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.ch-btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.ch-btn-ghost.ch-btn-xs { padding: 0 8px 0 6px; gap: 4px; }
.ch-btn-block { width: 100%; }
.ch-iconbtn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 4px; color: var(--ink-2); cursor: pointer; padding: 0;
}
.ch-iconbtn:hover { background: var(--hover-neutral); }
.ch-btn:focus-visible, .ch-iconbtn:focus-visible, .ch-tb:focus-visible, .ch-chip:focus-visible, .ch-tab:focus-visible,
.ch-rec-row:focus-visible, .ch-draft-card:focus-visible, .ch-ctab:focus-visible, .ch-menu-item:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -2px;
}

/* ── Menus ───────────────────────────────────────────────────────────────── */
.ch-menu-wrap { position: relative; display: inline-flex; }
.ch-menu {
  position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 60; min-width: 200px;
  background: var(--surface); border: 1px solid var(--ch-ctrl-line, #d5dce6); border-radius: 6px;
  box-shadow: 0 10px 24px rgba(12,31,59,.14); padding: 4px; display: flex; flex-direction: column;
}
.ch-menu-wide { min-width: 280px; }
.ch-menu-end { inset-inline-end: 0; }
.ch-menu-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 7px 10px; background: none; border: 0; border-radius: 4px; color: var(--text);
  font: 13px/1.3 var(--font); text-align: start; cursor: pointer;
}
.ch-menu-item:hover, .ch-menu-item.ch-active { background: var(--hover-neutral); }
.ch-menu-item.ch-danger { color: var(--danger); }
.ch-menu-sep { height: 1px; background: var(--ch-line); margin: 4px 6px; }
.ch-menu-block { padding: 6px 10px; font-size: 13px; }
.ch-menu-block:empty { display: none; }
.ch-menu-block.id-status { display: flex; flex-direction: column; gap: 6px; }
.ch-menu-block .id-free-toggle { justify-content: space-between; width: 100%; }
.ch-menu-block .id-fee { border: 0; background: none; padding: 0; margin: 0; }
.ch-slash-menu { position: fixed; top: 0; inset-inline-end: auto; }

/* ── Patient strip ───────────────────────────────────────────────────────── */
.ch-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--ch-line);
}
.ch-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-back { margin-inline-start: -8px; margin-inline-end: -4px; }
.ch-avatar {
  width: 42px; height: 42px; flex: none; border-radius: 4px; background: var(--ch-avatar); color: #fff;
  font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.ch-who-text { min-width: 0; }
.ch-name { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.005em; line-height: 1.3; color: var(--text); }
.ch-meta { font-size: 12px; color: var(--text-secondary); }
.ch-alerts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.ch-problems, .ch-strip-note { font-size: 12px; color: var(--text-secondary); }
.ch-allergy { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; background: var(--warn-solid); color: #fff; border-radius: 3px; font-size: 12px; font-weight: 600; }
.ch-facts { margin: 0; margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 12px; }
.ch-facts dt { color: var(--text-tertiary); }
.ch-facts dd { margin: 0; font-weight: 500; color: var(--text); }
.ch-facts dd.ch-mono { font-family: var(--ch-mono); }
.ch-strip .ch-menu-wrap { margin-inline-start: -12px; }
.ch-strip .ch-fee-fact .ch-menu-wrap { margin: 0; }
.ch-strip .ch-fee-status { height: auto; margin: 0 -4px; padding: 0 4px; font: 500 12px/1.45 var(--font); gap: 2px; }
.ch-strip .ch-fee-status svg { width: 12px; height: 12px; color: var(--text-tertiary); }
.ch-fee-status.ch-ok-ink, .ch-fee-fact .ch-ok-ink { color: var(--success); }
.ch-fee-fact .ch-menu { inset-inline-end: -4px; inset-inline-start: auto; min-width: 220px; }

/* ── Workspace ───────────────────────────────────────────────────────────── */
.ch-work { flex: 1; min-height: 0; display: flex; gap: 1px; background: var(--ch-line); position: relative; }
.ch-rail, .ch-centre { background: var(--surface); min-width: 0; display: flex; flex-direction: column; }
.ch-rail { flex: 0 0 var(--chart-rail-w, 290px); }
.ch-centre { flex: 1 1 560px; }
.ch-insert { flex: 0 0 var(--chart-insert-w, 304px); min-width: 0; background: var(--surface-2); display: flex; flex-direction: column; }

/* Rail */
.ch-draft-slot { padding: 10px 10px 0; }
.ch-draft-slot:empty { display: none; }
.ch-draft-card {
  width: 100%; display: block; text-align: start; padding: 10px 12px 11px; color: inherit; font: inherit;
  border: 1px solid var(--ch-line); border-radius: 4px; background: var(--surface); cursor: pointer;
}
.ch-draft-card:hover { background: var(--ch-row-hover); }
.ch-draft-card[aria-current="true"] { border-color: var(--border); background: var(--selected); }
.ch-draft-card-static { cursor: default; }
.ch-draft-card-static:hover { background: var(--surface); }
.ch-draft-acts { display: flex; gap: 6px; margin-top: 8px; }
.ch-tabs { display: flex; align-items: center; padding: 0 8px; border-bottom: 1px solid var(--ch-line); }
.ch-tabs .ch-add-slot { margin-inline-start: auto; align-self: center; }
.ch-tab {
  height: 42px; padding: 0 12px; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font: 400 13px var(--font); cursor: pointer; margin-bottom: -1px;
}
.ch-tab:hover { color: var(--text); }
.ch-tab[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--text); font-weight: 600; }
.ch-rail-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-filters-row { padding: 10px 10px; }
.ch-filters { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; flex: 1; min-width: 0; }
.ch-filters::-webkit-scrollbar { display: none; }
.ch-filters .ch-chip { flex: none; white-space: nowrap; }
.ch-chip {
  height: 28px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent;
  color: var(--text-secondary); font: 400 12px var(--font); cursor: pointer;
}
.ch-chip:hover { background: var(--hover-neutral); }
.ch-chip[aria-pressed="true"] { background: var(--pressed); color: var(--text); font-weight: 600; }
.ch-add-slot { align-self: flex-start; }
.ch-rec-list { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; flex: 1; border-top: 1px solid var(--ch-soft); }
.ch-rec-row {
  width: 100%; display: block; text-align: start; padding: 11px 16px 12px; border: 0;
  border-bottom: 1px solid var(--ch-soft); background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.ch-rec-row:hover { background: var(--ch-row-hover); }
.ch-rec-row[aria-current="true"] { background: var(--selected); }
.ch-rec-top { display: flex; align-items: baseline; gap: 8px; width: 100%; }
.ch-rec-date { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ch-rec-author { margin-inline-start: auto; font-size: 12px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-rec-title { display: block; font-size: 13px; font-weight: 600; margin-top: 3px; color: var(--text); }
.ch-rec-sum { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Records that belong to a visit: compact rows indented under it, a short L connector,
   no own top border; the group closes with one hairline after its last row. */
.ch-rec-sub { position: relative; padding-inline-start: 16px; }
.ch-rec-sub::before { content: ""; position: absolute; inset-inline-start: 24px; top: 0; height: 17px; width: 9px; border-inline-start: 1px solid var(--ch-line); border-bottom: 1px solid var(--ch-line); border-end-start-radius: 4px; pointer-events: none; }
.ch-rec-sub .ch-rec-row-sub { min-height: 36px; padding: 6px 16px 6px 22px; border-bottom: 0; }
[dir="rtl"] .ch-rec-sub .ch-rec-row-sub, :dir(rtl) > .ch-rec-sub .ch-rec-row-sub { padding: 6px 22px 6px 16px; }
.ch-rec-sub:has(+ li:not(.ch-rec-sub)), .ch-rec-sub:last-child { border-bottom: 1px solid var(--ch-soft); }
.ch-rec-sub .ch-rec-top { display: inline-flex; width: auto; margin-inline-end: 8px; vertical-align: baseline; }
.ch-rec-sub .ch-tag { font-size: 11px; }
.ch-rec-sub .ch-rec-title { display: inline-block; max-width: calc(100% - 76px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-size: 13px; font-weight: 500; margin: 0; }
.ch-rec-sub .ch-rec-sum { margin-top: 0; font-size: 12px; color: var(--text-secondary); }
li:has(+ .ch-rec-sub) > .ch-rec-row { border-bottom: 0; }
.ch-rec-empty { padding: 16px; font-size: 13px; color: var(--text-secondary); }

.ch-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ch-tag-visit { color: var(--primary); }
.ch-tag-rx { color: var(--success); }
.ch-tag-lab { color: var(--warning); }
.ch-tag-file { color: var(--text-secondary); }
.ch-tag-ink { color: var(--text); }
[lang="ar"] .ch-tag, [dir="rtl"] .ch-tag { letter-spacing: 0; }

/* Summary tab: plain sections */
.ch-summary { overflow-y: auto; padding: 16px 16px 20px; gap: 22px; }
.ch-sum-sec { margin-bottom: 22px; }
.ch-label { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text); }
.ch-label-note { font-weight: 400; color: var(--text-tertiary); text-transform: none; letter-spacing: 0; }
.ch-vitals { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ch-vitals dt { font-size: 12px; color: var(--text-tertiary); }
.ch-vitals dd { margin: 0; font-family: var(--ch-mono); font-size: 15px; }
.ch-vitals dd.ch-warn { color: var(--warning); font-weight: 500; }
.ch-flag { font-family: var(--font); font-size: 11px; }
.ch-sum-list { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.ch-sum-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--ch-soft); }
.ch-sum-list li:last-child { border-bottom: 0; }
.ch-sum-list li > :last-child { text-align: end; overflow-wrap: anywhere; }
/* The Snapshot's cards read as plain sections in the rail. */
.ch-summary .card, .ch-summary .panel-card, .ch-summary .bg-card, .ch-summary .notes-card {
  border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; margin: 0 0 22px;
}
.ch-summary .grid-2 { display: block; }
.ch-summary .panel-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 0; border: 0; }
.ch-summary .panel-head h2, .ch-summary .note-col-title, .ch-summary .summary-label {
  margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--text);
}
.ch-summary .panel-head .tag-ico, .ch-summary .note-ico { display: none; }
.ch-summary .panel-head .count { margin-inline-start: auto; font-size: 12px; color: var(--text-tertiary); background: none; padding: 0; border: 0; }
.ch-summary .panel-tags, .ch-summary .summary-tags { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 0; }
.ch-summary .patient-summary { padding: 0; }
.ch-summary .summary-section { margin: 0 0 22px; }
.ch-summary .summary-resolved-toggle { font-size: 12px; color: var(--ink-2); padding: 0; }
.ch-summary .panel-tags .tag, .ch-summary .summary-tags .tag {
  display: block; background: none; border: 0; border-bottom: 1px solid var(--ch-soft); border-radius: 0;
  padding: 7px 0; margin: 0; font-size: 13px; color: var(--text); font-weight: 500; text-align: start;
}
.ch-summary .panel-tags .tag:last-child, .ch-summary .summary-tags .tag:last-child { border-bottom: 0; }
.ch-summary .tag .med-dose { display: block; font-weight: 400; font-size: 12px; color: var(--text-secondary); }
.ch-summary .tag-stopped { color: var(--text-secondary); text-decoration: line-through; }
.ch-summary .tag-clickable:hover { background: var(--hover-neutral); }
.ch-summary .notes-grid { display: flex; flex-direction: column; gap: 22px; }
.ch-summary .note-col { border: 0; padding: 0; background: none; }
.ch-summary .note-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ch-summary .note-priv { font-size: 11px; color: var(--text-tertiary); }
.ch-summary .note-body { font-size: 13px; }
.ch-summary .patient-snapshot-empty { font-size: 13px; color: var(--text-secondary); }

/* Centre tabs */
.ch-ctabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--ch-line); flex: none; }
.ch-ctabs .ch-ctab {
  width: auto; height: 38px; padding: 0 12px; margin: 0 0 -1px; gap: 6px; display: inline-flex; align-items: center;
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--text-secondary); font: 400 13px var(--font); cursor: pointer;
}
.ch-ctabs .ch-ctab:hover { background: none; color: var(--text); }
.ch-ctabs .ch-ctab.active { background: none; border-bottom-color: var(--primary); color: var(--text); font-weight: 600; }
.ch-ctabs .tab-count { font-size: 11px; color: var(--text-tertiary); background: none; padding: 0; margin: 0; }
.ch-panes { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-panes > .patient-tab { display: none; }
.ch-panes > .patient-tab.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ch-pane-pad.active { overflow-y: auto; padding: 18px 24px 32px; display: block !important; }

/* Visit pane: draft editor or record */
.ch-pane-visit { position: relative; }
.ch-draft, .ch-record { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.ch-empty-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.ch-empty-title { font-size: 15px; font-weight: 600; }
.ch-empty-inner .ch-btn { margin-top: 10px; }

/* Note header. Row 1 (<= 44px, one baseline): title, "· Follow-up ⌄" type dropdown, and at
   the end the note mode dropdown plus "Not saved · Retry" only when autosave fails.
   Row 2: date · time · fee · referrer · Edit, 13px muted. No boxes; the toolbar's hairline
   is the only rule. Dropdowns: features/visit-header.js (ChartLayout menus). */
.ch-draft-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 6px 24px 8px; flex: none; position: relative; }
.ch-draft-who { display: contents; }
.ch-draft-title { order: 1; font-size: 17px; font-weight: 600; line-height: 32px; white-space: nowrap; }
.ch-vtype-slot { order: 2; display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.ch-vtype-slot:empty { display: none; }
.ch-draft-status-slot { order: 3; margin-inline-start: auto; display: inline-flex; align-items: baseline; gap: 14px; min-width: 0; }
.ch-draft-meta { order: 4; flex: 0 0 100%; font-size: 13px; line-height: 20px; color: var(--text-secondary); display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-variant-numeric: tabular-nums; }
.ch-meta-text, .ch-meta-ref { min-width: 0; }
.ch-meta-dot { color: var(--text-tertiary); }
.ch-meta-edit { background: none; border: 0; padding: 0; margin-inline-start: 4px; font: 500 13px var(--font); color: var(--primary); cursor: pointer; border-radius: 3px; }
.ch-meta-edit:hover { text-decoration: underline; }
.ch-meta-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ch-meta-rec { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 600; margin-inline-end: 6px; }
.ch-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ch-pulse 1.2s ease-in-out infinite; }
@keyframes ch-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ch-rec-dot { animation: none; } }
/* The fee in the details line opens a small menu (Waive fee, Edit fee, free status). */
.ch-meta-fee { color: inherit; font: inherit; }
button.ch-meta-fee { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 3px; text-decoration: underline dotted; text-decoration-color: var(--text-tertiary); text-underline-offset: 3px; }
button.ch-meta-fee:hover { color: var(--text); }
button.ch-meta-fee:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ch-fee-wrap .ch-menu { inset-inline-start: 0; inset-inline-end: auto; min-width: 200px; }
.ch-ok-ink { color: var(--success); }

/* Text dropdowns: ink text and a small chevron, no border; menus are 6px-radius ChartLayout menus. */
.ch-dd { display: inline-flex; }
.ch-dd-sep { color: var(--text-tertiary); font-size: 15px; }
.ch-dd-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px; margin: 0 -6px;
  background: none; border: 0; border-radius: 6px; color: var(--text); font: 500 15px var(--font); cursor: pointer; white-space: nowrap;
}
.ch-dd-btn:hover, .ch-dd-btn[aria-expanded="true"] { background: var(--hover-neutral); }
.ch-dd-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ch-dd-chev { flex: none; color: var(--text-tertiary); }
.ch-dd-label { overflow: hidden; text-overflow: ellipsis; }
.ch-mode-slot { display: inline-flex; align-items: center; gap: 8px; }
.ch-draft-status-slot { align-self: center; }
.ch-when-short { display: none; }
.ch-mode-dd { display: none; }
.ch-mode-segwrap { display: inline-flex; align-items: center; gap: 8px; }
.ch-mode-dd .ch-dd-menu { inset-inline-end: 0; inset-inline-start: auto; }
.ch-mode-slot:empty { display: none; }
@media (max-width: 1023px) { .ch-mode-dd { display: inline-flex; } .ch-mode-segwrap { display: none; } }
.ch-seg-label { font-size: 12px; color: var(--text-secondary); }
.ch-seg { display: inline-flex; height: 32px; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: 8px; background: transparent; }
.ch-seg-btn { border: 0; background: transparent; color: var(--text-secondary); font: 500 13px var(--font); padding: 0 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ch-seg-btn:hover { background: var(--hover-neutral); }
.ch-seg-btn[aria-checked="true"] { background: var(--pressed); color: var(--text); font-weight: 600; }
.ch-seg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ch-dd-menu { min-width: 200px; border-radius: 6px; }
.ch-vtype-slot .ch-dd-menu { inset-inline-start: 0; inset-inline-end: auto; }
.ch-dd-menu .ch-menu-item[aria-checked="true"] { font-weight: 600; }
.ch-dd-menu .ch-menu-item svg { color: var(--primary); flex: none; }
/* Autosave is silent; only a failure shows (warn ink, Retry). The element keeps its state. */
.ch-draft-status-slot .draft-status:not(.draft-failed) { display: none; }
.ch-draft-status-slot .draft-status.draft-failed { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; font-size: 12px; font-weight: 500; color: var(--warning); white-space: nowrap; }
.draft-retry { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; border-radius: 3px; }
.draft-retry:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* The form's own type and mode toggles stay in the note, hidden (they keep the values). */
#view-patient-detail .ch-note .notes-mode-toggle { display: none; }

.ch-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 18px; flex: none;
  border-bottom: 1px solid var(--ch-line);
}
.ch-toolbar:empty { display: none; }
.ch-tb {
  flex: none; white-space: nowrap; min-width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: none; border: 0; border-radius: 4px; color: var(--ink-2); font: 500 14px var(--font); cursor: pointer;
}
.ch-tb:hover { background: var(--hover-neutral); }
.ch-tb[aria-disabled="true"] { cursor: default; }
.ch-tb[aria-disabled="true"]:hover { background: none; }
.ch-tb-b { font-weight: 700; }
.ch-tb-i { font-style: italic; font-family: Georgia, serif; }
.ch-tb-u { text-decoration: underline; }
.ch-tb-h { font-size: 13px; font-weight: 600; }
.ch-tb-text { padding: 0 8px; font-size: 13px; font-weight: 400; }
.ch-tb-sep { width: 1px; height: 18px; background: var(--ch-line); margin: 0 6px; }
.ch-blank-mark { background: var(--ch-blank-bg); color: var(--text); padding: 0 3px; border-radius: 2px; font-family: var(--ch-mono); font-size: 12px; }
.ch-toolbar .ch-menu { inset-inline-end: auto; inset-inline-start: 0; }
.ch-toolbar .ch-menu-wrap { flex: none; }

.ch-note-scroll { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.ch-draft-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 24px; border-top: 1px solid var(--ch-line); flex: none; }
.ch-draft-foot:empty { display: none; }
.ch-draft-foot .ch-btn { flex: none; white-space: nowrap; }
.ch-blanks { font-size: 12px; color: var(--text-tertiary); margin-inline-end: auto; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Record view */
.ch-rec-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border-bottom: 1px solid var(--ch-line); flex: none; }
.ch-back-btn { height: 30px; padding: 0 10px 0 6px; font-weight: 500; }
.ch-vsep { width: 1px; height: 18px; background: var(--ch-line); margin: 0 4px; }
.ch-pos { font-size: 12px; color: var(--text-tertiary); }
.ch-bar-end { margin-inline-start: auto; display: flex; gap: 2px; }
.ch-rec-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.ch-rec-head { padding: 18px 32px 14px; border-bottom: 1px solid var(--ch-line); }
.ch-rec-h1 { font-size: 17px; font-weight: 600; }
.ch-rec-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ch-rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ch-rec-actions .ch-menu { inset-inline-end: auto; inset-inline-start: 0; }
.ch-rec-body { padding: 4px 32px 32px; }
.ch-rec-secs { max-width: 720px; }
.ch-rec-sec { margin: 0; }
.ch-sec-label { margin: 18px 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.ch-rx-list, .ch-rx-bullets { margin: 0; padding: 0; list-style: none; text-align: start; }
.ch-rx-item { display: flex; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--ch-soft); }
.ch-rx-item:last-child { border-bottom: 0; }
.ch-rx-n { flex: none; min-width: 22px; font-size: 14px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ch-rx-main { min-width: 0; text-align: start; }
.ch-rx-name { font-size: 14px; font-weight: 600; line-height: 1.5; }
.ch-rx-detail { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-top: 1px; }
.ch-rx-sep { color: var(--text-tertiary); }
.ch-rx-bullets li { position: relative; padding: 3px 0; padding-inline-start: 16px; font-size: 14px; line-height: 1.6; text-align: start; }
.ch-rx-bullets li::before { content: "•"; position: absolute; inset-inline-start: 4px; color: var(--text-tertiary); }
.ch-rx-line { font-size: 14px; line-height: 1.6; padding: 4px 0; text-align: start; white-space: pre-line; }
.ch-rx-note { color: var(--text-secondary); font-size: 13px; }
.ch-sec-text { white-space: pre-line; font-size: 14px; line-height: 1.6; padding: 6px 0; }
.ch-rec-img { display: block; max-width: 100%; max-height: 420px; margin-top: 18px; border-radius: 4px; cursor: zoom-in; background: var(--bg-secondary); }
.ch-rec-secs table { margin-top: 18px; }
/* Visit content from visitContentHtml(): sections as label + text, no tag pills. */
.ch-rec-doc { max-width: 720px; padding: 0; border: 0; background: none; }
.ch-rec-doc .timeline-section, .ch-rec-doc .timeline-section + .timeline-section { display: block; margin: 0; padding: 0; border: 0; }
.ch-rec-doc .timeline-section-title { margin: 18px 0 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.ch-rec-doc .timeline-section-content { font-size: 14px; line-height: 1.6; padding: 6px 0; color: var(--text); white-space: pre-line; }
.ch-rec-doc .timeline-section-content.ts-html { white-space: normal; }
.ch-rec-doc .tag { background: none; border: 0; padding: 0; margin: 0; font-size: 14px; color: var(--text); font-weight: 400; }
.ch-rec-doc .timeline-section-content:has(> .tag) { display: flex; flex-wrap: wrap; align-items: baseline; }
.ch-rec-doc .tag:not(:last-child)::after { content: "·"; padding: 0 8px; color: var(--text-tertiary); }
.ch-rec-doc .tag-stopped { color: var(--warning); }
.ch-rec-doc .visit-extra-item { border: 0; padding: 4px 0; background: none; }
.ch-rec-doc .visit-extras-loading { font-size: 12px; color: var(--text-tertiary); padding-top: 12px; }

/* Insert panel */
.ch-ins-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--ch-line); }
.ch-ins-title { font-size: 14px; font-weight: 600; }
.ch-ins-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ch-ins-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.chart-ins-row { padding: 12px 16px 13px; border-bottom: 1px solid var(--ch-soft); }
.ch-ins-top { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.ch-ins-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ch-ins-name { font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-ins-hint { font-family: var(--ch-mono); font-size: 11px; line-height: 1.3; color: var(--text-tertiary); white-space: nowrap; }
.ch-ins-acts { flex: none; margin-inline-start: auto; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.ch-ins-acts .ch-btn { white-space: nowrap; flex: none; }
.ch-ins-acts .chart-ins-empty { width: 64px; justify-content: center; }
.ch-ins-acts .chart-ins-fill, .ch-ins-done { width: 56px; justify-content: center; }
.ch-ins-done { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-tertiary); padding: 0 4px; }
.ch-ins-prev { margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }

/* ── The visit note: existing editor fields, one flowing document ─────────── */
#view-patient-detail .ch-note .vf-layout { display: block; height: auto; }
#view-patient-detail .ch-note .vf-main { overflow: visible; }
#view-patient-detail .ch-note .visit-form-sections {
  display: block; max-width: 720px; margin: 0 auto; padding: 6px 32px 48px; font-size: 15px; line-height: 1.65;
}
#view-patient-detail .ch-note .vf-section {
  border: 0; border-top: 1px solid var(--ch-soft); border-radius: 0; background: none; overflow: visible; margin: 0; padding: 0;
}
#view-patient-detail .ch-note .vf-section-header {
  display: flex; align-items: center; gap: 8px; padding: 18px 0 6px; background: none; border: 0; cursor: pointer;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text); font-weight: 600; min-height: 0;
}
#view-patient-detail .ch-note .vf-section-header:hover { background: none; }
#view-patient-detail .ch-note .vf-section-header .vf-chevron { order: 9; margin-inline-start: auto; width: 14px; height: 14px; color: var(--text-tertiary); }
#view-patient-detail .ch-note .vf-section-badge { background: none; border: 0; padding: 0; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-tertiary); }
#view-patient-detail .ch-note .vf-section-body { padding: 0 0 14px; border: 0; }
/* Notes, examination, assessment and plan always read as open note sections. */
#view-patient-detail .ch-note :is(#vf-section-notes, #vf-section-exam, #vf-section-assess, #vf-section-plan) > .vf-section-header { cursor: default; pointer-events: none; }
#view-patient-detail .ch-note :is(#vf-section-notes, #vf-section-exam, #vf-section-assess, #vf-section-plan) > .vf-section-header :is(.vf-history-btn, button) { pointer-events: auto; }
#view-patient-detail .ch-note :is(#vf-section-notes, #vf-section-exam, #vf-section-assess, #vf-section-plan) .vf-chevron { display: none; }
#view-patient-detail .ch-note :is(#vf-section-notes, #vf-section-exam, #vf-section-assess, #vf-section-plan) > .vf-section-body { display: block; }
#view-patient-detail .ch-note #vf-section-notes { border-top: 0; }
#view-patient-detail .ch-note #vf-section-notes > .vf-section-header { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; }

/* Visit facts: folded into the header line; Edit opens this one compact row. */
#view-patient-detail .ch-note .vf-facts { display: none; }
#view-patient-detail .ch-draft.ch-meta-open .ch-note .vf-facts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 14px 0 22px; }
#view-patient-detail .ch-note .vf-facts .vf-row { display: contents; }
#view-patient-detail .ch-note .vf-facts .form-group { margin: 0; flex: 0 0 auto !important; max-width: none !important; min-width: 0; }
#view-patient-detail .ch-note .vf-facts .form-group:has(#visit-date) { width: 132px; }
#view-patient-detail .ch-note .vf-facts .form-group:has(#visit-time) { width: 108px; }
#view-patient-detail .ch-note .vf-facts .form-group:has(#visit-referrer) { flex: 1 1 120px !important; min-width: 120px; }
#view-patient-detail .ch-note .vf-facts .form-group:has(.visit-type-toggle) { display: none; }
#view-patient-detail .ch-note .vf-facts .vf-fee { flex: 0 1 auto !important; width: 160px; }
#view-patient-detail .ch-note .vf-facts .form-group > label { display: block; height: 14px; line-height: 14px; font-size: 11px; font-weight: 500; color: var(--text-tertiary); margin: 0 0 3px; }
#view-patient-detail .ch-note .vf-facts :is(.dp-field, .tp-field) { height: 34px; min-height: 0; padding: 0 8px; font-size: 13px; gap: 8px; border: 1px solid var(--ch-ctrl-line); border-radius: 4px; box-sizing: border-box; }
#view-patient-detail .ch-note .vf-facts input { height: 34px; padding: 0 10px; font-size: 13px; border: 1px solid var(--ch-ctrl-line); border-radius: 4px; background: var(--surface); box-sizing: border-box; width: 100%; }
#view-patient-detail .ch-note .vf-facts input:focus, #view-patient-detail .ch-note .vf-facts :is(.dp-field, .tp-field):focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
/* Fee: one field, no spinner, quick-picks as text at its end (never wrap below). */
#view-patient-detail .ch-note .vf-fee-field { display: flex; align-items: center; height: 34px; box-sizing: border-box; border: 1px solid var(--ch-ctrl-line); border-radius: 4px; background: var(--surface); overflow: hidden; }
#view-patient-detail .ch-note .vf-fee-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
#view-patient-detail .ch-note .vf-fee-field input { flex: 1 1 70px; min-width: 56px; width: auto; border: 0; border-radius: 0; box-shadow: none !important; font-family: var(--ch-mono); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; background: transparent; }
#view-patient-detail .ch-note .vf-fee-field input::-webkit-outer-spin-button, #view-patient-detail .ch-note .vf-fee-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#view-patient-detail .ch-note .vf-fee-field .price-pills { flex: 0 1 auto; flex-wrap: nowrap; gap: 0; margin: 0; padding-inline-end: 4px; overflow: hidden; align-items: center; }
#view-patient-detail .ch-note .vf-fee-field .price-pill { border: 0; background: none; padding: 0 6px; height: 24px; font: 500 12px var(--ch-mono); color: var(--text-secondary); border-radius: 3px; }
#view-patient-detail .ch-note .vf-fee-field .price-pill:hover { background: var(--hover-neutral); color: var(--text); }
#view-patient-detail .ch-note .free-patient-fee-note { font-size: 12px; color: var(--text-secondary); display: flex; gap: 6px; align-items: center; }

/* Dictation bar only once Dictate is used. */
#view-patient-detail .ch-note .vf-voice-bar { display: none; }
#view-patient-detail .ch-note .vf-voice-bar .vf-record-btn { height: 30px; padding: 0 10px; font-size: 12px; }

/* Text: borderless, growing, 15/1.65. */
#view-patient-detail .ch-note textarea,
#view-patient-detail .ch-note .visit-free-notes,
#view-patient-detail .ch-note .vf-list-notes {
  width: 100%; border: 0; border-radius: 0; background: transparent; padding: 2px 0; margin: 0; min-height: 0;
  font: 15px/1.65 var(--font); color: var(--text); resize: none; box-shadow: none;
}
#view-patient-detail .ch-note .visit-free-notes { min-height: 240px; padding-inline-end: 34px; }
#view-patient-detail .ch-note textarea:focus { outline: none; box-shadow: inset 0 -1px 0 var(--primary); border: 0; }
#view-patient-detail .ch-note textarea::placeholder { color: var(--text-tertiary); }
#view-patient-detail .ch-note .form-group { margin-bottom: 10px; }
#view-patient-detail .ch-note .form-group > label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
#view-patient-detail .ch-note .dictation-btn { border: 0; background: none; top: 0; color: var(--text-tertiary); }
#view-patient-detail .ch-note .dictation-btn:hover { background: var(--hover-neutral); color: var(--text); }

/* Structured lists: rows separated by hairlines instead of boxed inputs. */
#view-patient-detail .ch-note .vf-list-group { border: 0; border-radius: 0; background: none; padding: 0; margin: 0 0 6px; }
#view-patient-detail .ch-note .vf-list-title,
#view-patient-detail .ch-note .vf-sublabel-head,
#view-patient-detail .ch-note .vitals-title {
  display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text); font-weight: 600;
}
#view-patient-detail .ch-note .vf-list-title { justify-content: flex-start; }
#view-patient-detail .ch-note .vf-sublabel { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-secondary); margin: 2px 0; }
#view-patient-detail .ch-note .vf-list-sub { margin: 0; }
#view-patient-detail .ch-note .linerows, #view-patient-detail .ch-note .medrows { gap: 0; border-top: 1px solid var(--ch-soft); }
#view-patient-detail .ch-note .linerow, #view-patient-detail .ch-note .medrow { border-bottom: 1px solid var(--ch-soft); gap: 6px; align-items: center; }
#view-patient-detail .ch-note :is(.linerow-input, .medrow-name, .medrow-dose) {
  border: 0; border-radius: 0; background: transparent; padding: 6px 0; height: auto; font-size: 14px; box-shadow: none;
}
#view-patient-detail .ch-note .medrow-dose { color: var(--text-secondary); }
#view-patient-detail .ch-note :is(.linerow-input, .medrow-name, .medrow-dose):focus { outline: none; box-shadow: inset 0 -1px 0 var(--primary); }
#view-patient-detail .ch-note :is(.linerow-del, .medrow-del, .linerow-resolve, .medrow-move-btn) {
  border: 0; background: none; height: 28px; color: var(--text-tertiary); border-radius: 4px;
}
#view-patient-detail .ch-note :is(.linerow-del, .medrow-del, .linerow-resolve, .medrow-move-btn):hover { background: var(--hover-neutral); color: var(--text); }
#view-patient-detail .ch-note .linerow-resolve { color: var(--success); }
#view-patient-detail .ch-note .vf-section-body .btn-secondary,
#view-patient-detail .ch-note .linerow-add-btn {
  border-color: transparent; background: none; color: var(--ink-2); padding: 4px 8px !important; font-size: 12px !important;
}
#view-patient-detail .ch-note .vf-section-body .btn-secondary:hover,
#view-patient-detail .ch-note .linerow-add-btn:hover { background: var(--hover-neutral); }
#view-patient-detail .ch-note .pillfield-hint { font-size: 12px; color: var(--text-tertiary); }
#view-patient-detail .ch-note .vf-optional-toggle { border: 0; background: none; padding: 4px 8px; margin-inline-start: -8px; font-size: 12px; color: var(--ink-2); border-radius: 4px; }
#view-patient-detail .ch-note .vf-optional-toggle:hover { background: var(--hover-neutral); }

/* Examination: vitals boxes stay boxed (numbers), everything else flat. */
#view-patient-detail .ch-note .vitals-block { border: 0; background: none; padding: 0; margin: 0; }
#view-patient-detail .ch-note .vitals-title { margin-top: 4px; }
#view-patient-detail .ch-note .vital-field input, #view-patient-detail .ch-note .vital-field select { height: 32px; font-size: 14px; font-family: var(--ch-mono); }
#view-patient-detail .ch-last-vitals { font-size: 12px; color: var(--text-secondary); margin: -2px 0 8px; font-family: var(--ch-mono); }
#view-patient-detail .ch-note .vf-followup-box { border: 0; background: none; padding: 6px 0 0; }

/* Collapsed optional sections show just their label row. */
#view-patient-detail .ch-note .vf-section:not(.open) > .vf-section-header { color: var(--text-secondary); }

@media print {
  body.ch-printing * { visibility: hidden !important; }
  body.ch-printing #chart-record-pane, body.ch-printing #chart-record-pane * { visibility: visible !important; }
  body.ch-printing #chart-record-pane { position: absolute; inset: 0 auto auto 0; width: 100%; }
  body.ch-printing #chart-record-pane .ch-rec-bar, body.ch-printing #chart-record-pane .ch-rec-actions { display: none !important; }
  body.ch-printing .ch-rec-scroll { overflow: visible; }
}

/* ── Desktop (>= 1200px): three panes, each scrolling inside. ─────────────── */
@media (min-width: 1200px) {
  .content:has(> #view-patient-detail.active) { overflow: hidden; }
  #view-patient-detail.chart-view.active { height: 100%; min-height: 0; }
}

.ch-problems { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-ins-rail, .ch-ins-close, .ch-ins-collapse { display: none; }
/* The 44px rail of icon buttons: the drawer's handle (768-1359) and the collapsed panel (>= 1360). */
.ch-ins-rail { flex: 0 0 44px; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; background: var(--surface-2); }
.ch-ins-railbtn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  background: none; border: 0; border-radius: 6px; color: var(--ink-2); cursor: pointer;
}
.ch-ins-railbtn:hover { background: var(--hover-neutral); color: var(--text); }
.ch-ins-railbtn:focus-visible, .ch-ins-collapse:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (min-width: 1360px) {
  .ch-ins-collapse { display: inline-flex; }
  .ch-work.ch-ins-collapsed .ch-insert { display: none; }
  .ch-work.ch-ins-collapsed .ch-ins-rail:not([hidden]) { display: flex; }
  .ch-work.ch-ins-collapsed .ch-resizer-insert { display: none; }
}
/* Phone and tablet pieces (features/chart-mobile.css shows them below 1200px). The strip's
   alerts and facts sit in a wrapper that does not exist for layout on wider screens. */
.ch-strip-more { display: contents; }
.chm-menu, .chm-meta, .chm-who-btn, .chm-more-meta, .chm-rail-toggle, .chm-back, .ch-m-only, .chm-nav, .chm-cbar, .chm-kbar, .chm-grip { display: none; }


/* Patient strip stays on one row on laptops; the problem list truncates. */
@media (min-width: 1200px) {
  .ch-strip { flex-wrap: nowrap; gap: 12px 18px; padding-inline: 16px; }
  .ch-who { flex: none; }
  .ch-alerts { flex: 1 1 0; flex-wrap: nowrap; overflow: hidden; }
  .ch-alerts .ch-allergy { flex: none; }
  .ch-facts { flex: none; flex-wrap: nowrap; gap: 4px 18px; margin-inline-start: 0; white-space: nowrap; }
  .ch-strip .ch-menu-wrap { flex: none; margin-inline-start: -6px; }
}
@media (min-width: 1360px) { .ch-facts { gap: 4px 28px; } }
@media (min-width: 768px) { .ch-draft-foot { flex-wrap: nowrap; padding-inline: 16px; } }

/* ── Tablet and laptop (768-1359): the Insert panel collapses to a slim rail and opens as a drawer. ── */
@media (min-width: 768px) and (max-width: 1359px) {
  .ch-work { position: relative; }
  .ch-ins-rail { display: flex; }
  .ch-ins-rail[hidden] { display: none; }
  .ch-ins-railbtn[aria-expanded="true"] { background: var(--hover-neutral); }
  .ch-ins-toggle {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0; width: 34px;
    background: none; border: 0; border-radius: 4px; color: var(--ink-2); cursor: pointer; font: 500 12px var(--font);
  }
  .ch-ins-toggle:hover, .ch-ins-toggle[aria-expanded="true"] { background: var(--hover-neutral); }
  .ch-ins-toggle span { writing-mode: vertical-rl; letter-spacing: .02em; }
  .ch-insert {
    display: none; position: absolute; inset-block: 0; inset-inline-end: 0; width: var(--chart-insert-w, 340px); max-width: 100%; z-index: 30;
    border-inline-start: 1px solid var(--ch-line); box-shadow: var(--shadow-pop, 0 12px 32px rgba(12,31,59,.22));
  }
  .ch-work.ch-ins-open .ch-insert:not([hidden]) { display: flex; }
  .ch-ins-close { display: inline-flex; position: absolute; top: 10px; inset-inline-end: 10px; }
  .ch-ins-head { position: relative; padding-inline-end: 48px; }
}

/* Below 1200px (tablet drawers, phone views): features/chart-mobile.css. */

/* ── Calm pass: one mic control, one-line AI notice, resizable panes ─────── */
.ch-voice-wrap { flex: none; }
.ch-tb-mic.ch-rec { color: var(--danger); font-weight: 600; }
.ch-tb-mic.ch-rec svg { stroke: currentColor; }
.ch-tb-caret { min-width: 18px; width: 18px; margin-inline-start: -4px; }
.ch-voice-menu { min-width: 250px; padding: 10px 12px; }
.ch-voice-menu .vf-voice-bar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; border: 0; background: none; padding: 0; margin: 0; }
.ch-voice-menu .vf-record-btn { display: none; }
.ch-voice-menu .save-recording-toggle { font-size: 12px !important; color: var(--text) !important; }
.ch-voice-menu #voice-status { font-size: 12px; color: var(--text-secondary); }
.ch-voice-menu #voice-status:empty { display: none; }
#view-patient-detail .ch-note .voice-transcript { margin: 0 0 14px; padding: 0; border: 0; background: none; box-shadow: none; }
#view-patient-detail .ch-note .voice-transcript.hidden { display: none; }
.vt-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 12px; color: var(--text-secondary); }
.vt-link { background: none; border: 0; padding: 0; font: 500 12px var(--font); color: var(--primary); cursor: pointer; border-radius: 3px; }
.vt-link:hover { text-decoration: underline; }
.vt-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vt-body { margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; max-height: 180px; overflow-y: auto; }
.ch-draft-card .ch-rec-title { font-size: 13px; }
.ch-draft-card .ch-rec-date, .ch-draft-card .ch-rec-author, .ch-draft-card .ch-rec-sum { font-size: 12px; }

/* Pane resize handles: a 6px hit area over the 1px divider, hairline on hover or drag. */
.ch-resizer { position: absolute; top: 0; bottom: 0; width: 6px; z-index: 40; cursor: col-resize; touch-action: none; display: none; }
.ch-resizer::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 2px; width: 2px; background: transparent; transition: background-color .12s; }
.ch-resizer:hover::after, .ch-resizer.ch-dragging::after, .ch-resizer:focus-visible::after { background: var(--primary); }
.ch-resizer:focus-visible { outline: none; }
.ch-resizer-rail { inset-inline-start: calc(var(--chart-rail-w, 290px) - 2px); }
.ch-resizer-insert { inset-inline-end: calc(var(--chart-insert-w, 304px) - 3px); }
body.ch-resizing { user-select: none; -webkit-user-select: none; cursor: col-resize; }
body.ch-resizing * { cursor: col-resize !important; }
@media (min-width: 1200px) { .ch-resizer { display: block; } .ch-toolbar { flex-wrap: nowrap; } }
@media (min-width: 1200px) and (max-width: 1359px) {
  .ch-resizer-insert { display: none; }
  .ch-work.ch-ins-open .ch-resizer-insert { display: block; inset-inline-end: calc(var(--chart-insert-w, 340px) - 3px); }
}

/* ── Reports as records, Bookings rail tab, report editor ─────────────────── */
#view-patient-detail.chart-view { --ch-report: #6a3d9a; }
[data-theme="dark"] #view-patient-detail.chart-view { --ch-report: #c4a7ef; }
@media (prefers-color-scheme: dark) { [data-theme="system"] #view-patient-detail.chart-view { --ch-report: #c4a7ef; } }
.ch-tag-report { color: var(--ch-report); }

/* Three rail tabs plus the "+" menu in a narrow rail. */
.ch-tabs .ch-tab { padding: 0 9px; white-space: nowrap; }
.ch-filters { gap: 0; }
.ch-filters .ch-chip { padding: 0 5px; }
.ch-filters-row { padding-inline: 8px; }
.ch-tab-count { font-size: 11px; font-weight: 400; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.ch-textbtn { background: none; border: 0; padding: 4px 2px; font: 500 13px var(--font); color: var(--primary); cursor: pointer; border-radius: 3px; }
.ch-textbtn:hover { text-decoration: underline; }
.ch-textbtn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.ch-bookings { overflow: hidden; }
.ch-bk-head { padding: 10px 14px; display: flex; flex: none; }
.ch-bk-new { width: 100%; justify-content: center; height: 36px; gap: 6px; }
.ch-bk-scroll { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--ch-soft); padding-bottom: 8px; }
.ch-bk-group { margin: 14px 16px 6px; }
.ch-bk-list { list-style: none; margin: 0; padding: 0; }
.ch-bk-row { display: flex; align-items: flex-start; gap: 4px; min-height: 56px; padding: 11px 8px 11px 16px; border-bottom: 1px solid var(--ch-soft); }
[dir="rtl"] .ch-bk-row { padding: 11px 16px 11px 8px; }
.ch-bk-row:hover { background: var(--ch-row-hover); }
.ch-bk-row[aria-current="true"]:hover { background: var(--selected); }
.ch-bk-row[aria-current="true"] { background: var(--selected); }
.ch-bk-unpaid .ch-bk-when { box-shadow: inset 2px 0 0 var(--warning); padding-inline-start: 6px; margin-inline-start: -8px; }
.ch-bk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: start; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
button.ch-bk-main { cursor: pointer; }
.ch-bk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ch-bk-when { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ch-bk-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ch-bk-info { color: var(--text-secondary); }
.ch-bk-ok { color: var(--green); }
.ch-bk-bad { color: var(--danger); }
.ch-bk-warn { color: var(--text-secondary); }
.ch-bk-unmarked { color: var(--warning); }
.ch-bk-wd { font-weight: 400; color: var(--text-secondary); }
.ch-bk-month { margin: 10px 16px 2px; font-size: 11px; font-weight: 600; color: var(--text-tertiary); }
.ch-bk-checked { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-weight: 600; vertical-align: bottom; }
.ch-bk-spacer { width: 32px; height: 28px; margin-top: -4px; flex: none; }
.ch-bk-meta { font-size: 12px; color: var(--text-secondary); }
.ch-bk-notes { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-bk-row .ch-menu-wrap { flex: none; margin-top: -4px; }
.ch-bk-row .ch-menu { z-index: 8; }

/* Secretary centre: booking details or the patient basics, never an empty pane. */
.ch-empty.ch-empty-sec { display: block; align-items: stretch; padding: 0; overflow-y: auto; }
.ch-empty-sec .ch-rec-scroll { overflow: visible; }
.ch-sec-dl { margin: 0; max-width: 520px; }
.ch-sec-dl-tight { margin-top: 10px; }
.ch-sec-row { display: flex; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--ch-soft); font-size: 13px; }
.ch-sec-row dt { flex: 0 0 110px; color: var(--text-secondary); }
.ch-sec-row dd { margin: 0; min-width: 0; }
.ch-empty-sec .ch-rec-body { padding-top: 18px; }
.ch-rec-actions .ch-danger { color: var(--danger); }

/* Report in the centre: same frame as other records. */
.ch-rpt-body { font-size: 14px; line-height: 1.7; padding: 6px 0; max-width: 720px; overflow-wrap: anywhere; }
.ch-rpt-body ul, .ch-rpt-body ol { padding-inline-start: 22px; }

/* Report editor in the centre, styled like the note. */
.ch-rpt-head { padding: 14px 24px 8px; flex: none; }
.ch-rpt-form { padding: 14px 24px 24px; max-width: 800px; display: flex; flex-direction: column; gap: 14px; }
.ch-rpt-field { display: flex; flex-direction: column; gap: 4px; }
.ch-rpt-field .ch-sec-label { margin: 0; }
.ch-input {
  width: 100%; box-sizing: border-box; height: 36px; padding: 0 10px; border: 1px solid var(--ch-ctrl-line); border-radius: 4px;
  background: var(--surface); color: var(--text); font: 400 14px var(--font);
}
.ch-input:focus, .ch-rpt-body-edit:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.ch-rpt-body-edit {
  min-height: 320px; padding: 10px 12px; border: 1px solid var(--ch-ctrl-line); border-radius: 4px; background: var(--surface);
  color: var(--text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere;
}
.ch-rpt-insert { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 2px; font-size: 12px; padding-inline-start: 4px; }
.ch-rpt-insert .ch-tb-text { font-size: 12px; color: var(--primary); }
.ch-rpt-foot { justify-content: flex-end; }


/* Patient strip: one consistent label-over-value rhythm for every fact (problems included),
   sans digits with tabular figures instead of mono, a smaller avatar. Desktop and tablet. */
@media (min-width: 768px) {
  .ch-strip { align-items: center; }
  .ch-avatar { width: 40px; height: 40px; font-size: 14px; }
  .ch-name { font-size: 17px; line-height: 22px; }
  .ch-meta { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
  .ch-num { font-family: var(--font); font-variant-numeric: tabular-nums; }
  .ch-alerts { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 18px; }
  .ch-problems { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; font-size: 12px; color: inherit; }
  .ch-problems .ch-fact-k, .ch-facts dt { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-tertiary); }
  .ch-problems .ch-fact-v, .ch-facts dd { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
  .ch-facts dd.ch-num, .ch-facts dd.ch-mono { font-family: var(--font); font-variant-numeric: tabular-nums; }
  .ch-strip .ch-fee-status { font: 500 13px/18px var(--font); }
  .ch-strip-note { align-self: flex-end; font-size: 13px; line-height: 18px; color: var(--success); font-weight: 500; }
}

@media (max-width: 767px) { .ch-problems .ch-fact-k::after { content: ": "; } .ch-num { font-variant-numeric: tabular-nums; } }

/* Problems in the strip open a list of every active problem. */
.ch-problems-btn { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; padding: 2px 6px; margin: -2px -6px; background: none; border: 0; border-radius: 4px; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.ch-problems-btn:hover { background: var(--hover-neutral, rgba(15,30,50,.05)); }
.ch-problems-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ch-problems-btn .ch-fact-v { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-problems-btn .ch-fact-v svg { flex: none; width: 12px; height: 12px; color: var(--text-tertiary); }
.ch-probs-count { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 3px; background: var(--hover-neutral, rgba(15,30,50,.06)); font-size: 11px; line-height: 16px; text-align: center; color: var(--text-secondary); }
.ch-probs-menu { inset-inline-start: 0; inset-inline-end: auto; min-width: 240px; max-width: min(420px, calc(100vw - 32px)); max-height: 320px; overflow-y: auto; }
.ch-menu-label { padding: 6px 10px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); }
.ch-menu-text { padding: 7px 10px; font-size: 13px; line-height: 18px; color: var(--text); white-space: normal; }
@media (max-width: 767px) { .ch-problems-btn { flex-direction: row; flex-wrap: wrap; gap: 0 4px; } }
.ch-strip .ch-problems.ch-menu-wrap { position: relative; overflow: visible; min-width: 0; margin: 0; }
.ch-strip .ch-problems-btn { margin: 0; padding: 2px 4px; }
.ch-strip .ch-probs-menu { top: calc(100% + 4px); }
.ch-strip .ch-alerts { overflow: visible; }

/* Strip: second details line (occupation · address · email) and a hover pencil to edit. */
.ch-name { display: flex; align-items: center; gap: 4px; }
.ch-edit-pt { width: 26px; height: 26px; opacity: 0; color: var(--text-tertiary); transition: opacity .12s; }
.ch-who-text:hover .ch-edit-pt, .ch-edit-pt:focus-visible { opacity: 1; }
@media (hover: none) { .ch-edit-pt { opacity: 1; } }
.ch-edit-pt:hover { color: var(--text); background: var(--hover-neutral, rgba(15,30,50,.05)); }
.ch-meta2 { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.ch-meta-link { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 3px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-meta-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.ch-meta-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ch-meta-addr { max-width: 260px; }
@media (max-width: 767px) { .ch-who-text .ch-meta2 { display: none; } .ch-edit-pt { display: none; } }

/* Free patient: the one strip fact that must not be missed, as a solid badge. */
.ch-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ch-fee-fact { align-self: center; }
.ch-free-badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 4px; background: #0f6b58; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; }
.ch-free-badge svg { flex: none; }
[data-theme="dark"] .ch-free-badge { background: #1c7a64; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ch-free-badge { background: #1c7a64; } }

/* Strip alerts re-render on their own when the Summary lists change. */
.ch-alerts-host { display: contents; }

/* Summary lists: quiet rows, pencil and × on hover / focus, always visible on touch. */
.ch-summary .sl-list { margin: 0; padding: 0; list-style: none; }
.ch-summary .sl-row { display: flex; align-items: center; gap: 8px; min-height: 34px; border-bottom: 1px solid var(--ch-soft); font-size: 13px; font-weight: 500; color: var(--text); }
.ch-summary .sl-row:last-child { border-bottom: 0; }
.ch-summary .sl-text { flex: 1 1 auto; min-width: 0; padding: 7px 0; overflow-wrap: anywhere; }
.ch-summary .sl-acts { display: flex; gap: 2px; flex: none; opacity: 0; transition: opacity .12s; }
.ch-summary .sl-row:hover .sl-acts, .ch-summary .sl-row:focus-within .sl-acts { opacity: 1; }
@media (hover: none) { .ch-summary .sl-acts { opacity: 1; } }
.ch-summary .sl-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text-secondary); cursor: pointer; }
@media (hover: none) { .ch-summary .sl-btn { width: 36px; height: 36px; } }
.ch-summary .sl-btn:hover { background: var(--hover-neutral); color: var(--text); }
.ch-summary .sl-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; opacity: 1; }
.ch-summary .sl-input { width: 100%; box-sizing: border-box; margin: 4px 0; padding: 6px 8px; font: 500 13px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.ch-summary .sl-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.ch-summary .sl-row.sl-editing { border-bottom: 0; }
.ch-summary .sl-add { display: block; margin: 4px 0 0; padding: 4px 0; background: none; border: 0; font: 500 13px var(--font); color: var(--primary); cursor: pointer; border-radius: 3px; }
.ch-summary .sl-add:hover { text-decoration: underline; }
.ch-summary .sl-add:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ch-summary .sl-empty { padding: 6px 0; font-size: 13px; }

/* Note alerts: up to three small dots after "Summary", one colour per note type. */
.ch-ndots { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; vertical-align: middle; }
.ch-ndot { display: block; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px var(--surface); }
.ch-ndot-danger { background: var(--danger); }
.ch-ndot-warn { background: #b45309; }
.ch-ndot-info { background: var(--primary); }
.ch-ndots-nav { position: absolute; top: 6px; inset-inline-end: calc(50% - 16px); margin: 0; }
.ch-ndots-nav .ch-ndot { width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--surface); }
.chm-nav-btn { position: relative; }
.ch-note-flag { margin: 0 0 3px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.ch-note-flag-danger { color: var(--danger); }
.ch-note-flag-warn { color: #b45309; }
.ch-note-flag-info { color: var(--primary); }

/* Rail: one quiet line per record type under a visit (icon, label, count) plus a muted preview. */
.ch-rec-sub .ch-grp-row, .ch-grp-row { min-height: 0; padding-block: 6px; padding-inline: 16px; }
.ch-rec-sub .ch-grp-row { padding-inline: 22px 16px; }
.ch-grp-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--text); }
.ch-grp-ico { flex: none; color: var(--text-secondary); }
/* Labs / scans icon: one or two 14px glyphs, neutral colour, never shrinks. */
.ch-kind-ico { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--text-secondary); align-self: center; }
.ch-rec-top .ch-kind-ico { margin-inline-end: -2px; }
.ch-kind-ico .ch-grp-ico { display: block; }
.ch-grp-label { white-space: nowrap; }
.ch-grp-n { color: var(--text-secondary); font-weight: 400; font-variant-numeric: tabular-nums; }
.ch-grp-date { margin-inline-start: auto; }
.ch-grp-sum { margin-top: 1px; padding-inline-start: 20px; color: var(--text-secondary); }
.ch-draft-groups { list-style: none; margin: 0; padding: 0; }
.ch-draft-groups .ch-rec-sub { border-bottom: 0; }

/* Centre: stacked records of one type, and the files gallery. */
.ch-rec-head-grp { border-bottom: 1px solid var(--ch-line); }
.ch-grp-stack { display: flex; flex-direction: column; }
.ch-grp-item { padding: 18px 0 8px; border-bottom: 1px solid var(--ch-soft); }
.ch-grp-item:last-child { border-bottom: 0; }
.ch-grp-head .ch-rec-actions { margin-top: 8px; }
.ch-grp-t { font-size: 14px; font-weight: 600; }
.ch-grp-body .ch-rec-secs { padding-top: 6px; }
.ch-gal-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 10px; }
/* Result photos: square tiles like the grid under a saved note (features/media-grid.css). */
.ch-gal-tile { width: 100%; }
.ch-gal-tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ch-gal-tools { position: absolute; top: 6px; inset-inline-end: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.ch-gal-tile:is(:hover, :focus-within) .ch-gal-tools { opacity: 1; }
@media (hover: none) { .ch-gal-tools { opacity: 1; } }
.ch-gal-tool {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 0; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; text-decoration: none;
}
.ch-gal-tool svg { width: 15px; height: 15px; }
.ch-gal-tool:hover { background: rgba(0, 0, 0, .75); }
.ch-gal-del:hover { background: #b42318; }
.ch-gal-below { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; }
.ch-gal-below .ch-btn { margin-inline-start: -8px; }
.ch-gal-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-gal-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; cursor: zoom-in; background: var(--bg-secondary); border: 1px solid var(--ch-line); }
.ch-gal-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-gal-acts { display: flex; flex-wrap: wrap; gap: 2px; margin-inline-start: -8px; }
.ch-gal-acts .ch-danger { color: var(--danger); }
.ch-gal-docs { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--ch-soft); }
.ch-gal-doc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ch-soft); }
.ch-gal-docico { flex: none; color: var(--text-secondary); display: inline-flex; }
.ch-gal-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ch-gal-doc .ch-gal-acts { margin: 0; flex: none; }

/* AI verdict in the rail and Summary (chip styles live in lab-extract.css) */
.ch-rec-tline { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; min-width: 0; }
.ch-rec-tline .ch-rec-title { margin: 0; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-rec-tline .lx-vd { flex: none; }
.ch-rec-sub .ch-rec-tline { display: inline-flex; max-width: calc(100% - 76px); vertical-align: bottom; margin-top: 0; }
.ch-rec-sub .ch-rec-tline .ch-rec-title { max-width: none; }
.ch-grp-line .lx-vd { margin-inline-start: 4px; }
.ch-vflag-wrap { display: inline-flex; align-items: center; color: var(--danger); align-self: center; }
.ch-h1-vd { margin-inline-start: 6px; vertical-align: middle; }
.ch-rec-head > .lx-vd-reason { margin-top: 2px; }
.ch-grp-head > .lx-vd-reason { margin-top: 2px; }
.ch-flag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ch-flag-item { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.ch-flag-item:hover .ch-flag-t { text-decoration: underline; }
.ch-flag-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.ch-flag-t { font-weight: 600; }
