/* ============================================================
   1380 Tool — Design Tokens (v2: mobile-first)
   Restrained, calm, professional. Optimized for locked-down
   gov browsers + drill-weekend phone use.
   Base styles target ~375px width; enhancements layer at
   min-width: 720px and 1024px.
   ============================================================ */

:root {
  /* Neutrals */
  --bg:        #F7F8FA;
  --bg-sunk:   #F1F2F5;
  --surface:   #FFFFFF;
  --border:    #E5E7EB;
  --border-strong: #D1D5DB;
  --text:      #1A1A1A;
  --text-2:    #4B5563;
  --text-3:    #6B7280;
  --text-4:    #9CA3AF;

  /* Accent — navy */
  --accent:        #1E3A5F;
  --accent-hover:  #16304E;
  --accent-active: #112644;
  --accent-soft:   #EAEFF6;
  --accent-ring:   rgba(30, 58, 95, 0.22);
  --on-accent:     #FFFFFF;

  /* Status colors — used only on badges */
  --status-generated-bg:  #F1F2F5;
  --status-generated-fg:  #4B5563;
  --status-submitted-bg:  #FEF6E0;
  --status-submitted-fg:  #92580A;
  --status-signed-bg:     #E6EEFB;
  --status-signed-fg:     #1D4D9E;
  --status-pay-bg:        #ECEAFB;
  --status-pay-fg:        #4338CA;
  --status-paid-bg:       #E2F4EA;
  --status-paid-fg:       #1F7A45;
  --status-partially_paid-bg: #FFF3D6;
  --status-partially_paid-fg: #9A6700;
  --status-rejected-bg:   #FCE9E9;
  --status-rejected-fg:   #B42318;
  --status-voided-bg:     #F1F2F5;
  --status-voided-fg:     #9CA3AF;

  /* Type scale */
  --t-12: 12px;
  --t-13: 13px;
  --t-14: 14px;
  --t-16: 16px;
  --t-18: 18px;
  --t-24: 24px;
  --t-32: 32px;
  --lh-tight:  1.25;
  --lh-snug:   1.35;
  --lh-body:   1.5;

  /* Spacing — 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;

  /* Density — overridden by .density-compact */
  --row-py: 14px;
  --field-h: 40px;
  --card-p: 24px;

  /* Radius */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-4: 12px;
  --r-pill: 999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.04);
  --sh-2: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --sh-modal: 0 12px 32px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);

  /* Type stack */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Safe-area padding for sticky bottom action bar (iOS notch) */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ===== Bottom action bar — mobile primary nav for forms ===== */
.action-bar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-b));
  display: flex;
  gap: 8px;
  z-index: 30;
  margin: 24px -16px 0;
}
.action-bar .btn { flex: 1; }
.action-bar .btn-ghost { flex: 0 0 auto; }
@media (min-width: 720px) {
  /* Desktop: action bar becomes a plain inline row, no sticky chrome */
  .action-bar {
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
  }
  .action-bar .btn { flex: 0 0 auto; }
}

.density-compact {
  --row-py: 10px;
  --field-h: 36px;
  --card-p: 18px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--t-14);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus rings — restyled, never removed */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* Selection */
::selection { background: var(--accent-soft); color: var(--text); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: var(--lh-snug); }
p { margin: 0; }

/* ===== Layout shell ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-header {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s-4);
  position: sticky;
  top: 0;
  z-index: 20;
}
@media (min-width: 720px) {
  .app-header { height: 56px; padding: 0 var(--s-6); }
}
.app-header .wordmark {
  font-weight: 600;
  font-size: var(--t-16);
  letter-spacing: -0.01em;
  color: var(--text);
}
.app-header .wordmark .num { color: var(--accent); }
.app-header nav { display: none; }
@media (min-width: 720px) {
  .app-header nav { display: flex; gap: var(--s-1); margin-left: var(--s-7); }
}
.app-header nav a {
  color: var(--text-2);
  font-size: var(--t-14);
  padding: 6px 10px;
  border-radius: var(--r-2);
  text-decoration: none;
}
.app-header nav a:hover { background: var(--bg-sunk); color: var(--text); }
.app-header nav a.active { color: var(--accent); background: var(--accent-soft); }
.app-header .spacer { flex: 1; }
.app-header .user {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: var(--t-13);
  color: var(--text-2);
}
.app-header .user .name { color: var(--text); font-weight: 500; }
.app-header .user .rank-name { display: none; }
@media (min-width: 720px) {
  .app-header .user .rank-name { display: inline; }
}
.app-header .user .logout {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 6px 8px; border-radius: var(--r-2);
}
.app-header .user .logout:hover { color: var(--text); background: var(--bg-sunk); }

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-8);
}
@media (min-width: 720px) {
  .app-main { padding: var(--s-7) var(--s-6) var(--s-9); }
}

/* ===== Page header ===== */
.page-h {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
  margin-bottom: var(--s-6);
}
.page-h h1 { font-size: var(--t-24); }
.page-h .sub { color: var(--text-3); margin-top: 2px; font-size: var(--t-14); }
.page-h .actions { display: flex; gap: var(--s-2); }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--sh-1);
}
.card-pad { padding: var(--card-p); }
.card-row + .card-row { border-top: 1px solid var(--border); }

/* ===== Buttons ===== */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: var(--field-h);
  padding: 0 16px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  background: transparent;
  font-size: var(--t-14);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
/* Force white text when used on <a> links, including :visited */
a.btn-primary, a.btn-primary:visited, a.btn-primary:hover, a.btn-primary:active {
  color: var(--on-accent);
  text-decoration: none;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-active); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-sunk); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-sunk); color: var(--text); }
.btn-destructive {
  background: var(--surface);
  color: var(--status-rejected-fg);
  border-color: var(--border-strong);
}
.btn-destructive:hover:not(:disabled) { background: var(--status-rejected-bg); border-color: var(--status-rejected-fg); }
.btn-sm { height: 32px; padding: 0 10px; font-size: var(--t-13); }
.btn-block { width: 100%; }
.btn-icon { padding: 0 8px; width: var(--field-h); }

/* ===== Form fields ===== */
.field { display: block; }
.field + .field { margin-top: var(--s-5); }
.field-row { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.label {
  display: block;
  font-size: var(--t-13);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--s-2);
}
.label .req { color: var(--status-rejected-fg); margin-left: 2px; }
.help {
  font-size: var(--t-12);
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.4;
}
.err {
  font-size: var(--t-12);
  color: var(--status-rejected-fg);
  margin-top: 6px;
}
.input, .select, .textarea {
  width: 100%;
  height: var(--field-h);
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  font-size: var(--t-14);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 10px 12px; min-height: 88px; line-height: 1.5; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #B7BDC6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input.is-error, .select.is-error, .textarea.is-error {
  border-color: var(--status-rejected-fg);
}
.input.is-error:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16); }
.input-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-2); overflow: hidden; height: var(--field-h); background: var(--surface); }
.stepper button {
  width: 36px; height: 100%; border: none; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: 18px; line-height: 1;
}
.stepper button:hover:not(:disabled) { background: var(--bg-sunk); color: var(--text); }
.stepper button:disabled { color: var(--text-4); cursor: not-allowed; }
.stepper .val { min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Radio cards — single column on mobile, 2 cols on desktop */
.radio-cards { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 720px) { .radio-cards { grid-template-columns: 1fr 1fr; } }
.radio-card {
  display: flex; flex-direction: column;
  padding: 16px; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  cursor: pointer;
  text-align: left;
  font: inherit; color: inherit;
  transition: border-color .12s, box-shadow .12s, background .12s;
  position: relative;
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.radio-card .abbr {
  font-weight: 600; font-size: var(--t-16);
  color: var(--text);
}
.radio-card .desc {
  font-size: var(--t-13);
  color: var(--text-3);
  line-height: 1.4;
}
.radio-card .tick {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
}
.radio-card.is-selected .tick { background: var(--accent); border-color: var(--accent); }
.radio-card.is-selected .tick::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: white;
}

/* Inline radio (half/full day) */
.radio-inline { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-2); padding: 3px; background: var(--bg-sunk); gap: 2px; }
.radio-inline button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 4px;
  font-size: var(--t-13); color: var(--text-2); cursor: pointer;
}
.radio-inline button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); font-weight: 500; }

/* ===== Status badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-12);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-generated { background: var(--status-generated-bg); color: var(--status-generated-fg); }
.badge-generated .dot { background: var(--status-generated-fg); }
.badge-submitted { background: var(--status-submitted-bg); color: var(--status-submitted-fg); }
.badge-submitted .dot { background: var(--status-submitted-fg); }
.badge-signed { background: var(--status-signed-bg); color: var(--status-signed-fg); }
.badge-signed .dot { background: var(--status-signed-fg); }
.badge-pay { background: var(--status-pay-bg); color: var(--status-pay-fg); }
.badge-pay .dot { background: var(--status-pay-fg); }
.badge-paid { background: var(--status-paid-bg); color: var(--status-paid-fg); }
.badge-paid .dot { background: var(--status-paid-fg); }
.badge-partially_paid { background: var(--status-partially_paid-bg); color: var(--status-partially_paid-fg); }
.badge-partially_paid .dot { background: var(--status-partially_paid-fg); }
.badge-rejected { background: var(--status-rejected-bg); color: var(--status-rejected-fg); }
.badge-rejected .dot { background: var(--status-rejected-fg); }
.badge-voided { background: var(--status-voided-bg); color: var(--status-voided-fg); text-decoration: line-through; }
.badge-voided .dot { background: var(--status-voided-fg); }

/* ===== Cap-usage tally (dashboard) ===== */
.cap-tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cap-tally-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 12px 14px;
  box-shadow: var(--sh-1);
}
.cap-tally-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.cap-tally-duty { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; }
.cap-tally-period { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.cap-tally-counts { display: flex; align-items: baseline; gap: 8px; }
.cap-tally-counts .used { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.cap-tally-counts .of   { font-size: 13px; color: var(--text-3); }
.cap-tally-counts .remaining { font-size: 11px; color: var(--text-3); margin-left: auto; }
.cap-tally-bar {
  height: 4px; background: var(--bg-sunk); border-radius: 999px;
  margin-top: 8px; overflow: hidden;
}
.cap-tally-bar-fill {
  height: 100%; background: var(--status-paid-fg); border-radius: 999px;
  transition: width 0.2s ease;
}
.cap-tone-warn .cap-tally-bar-fill { background: var(--status-submitted-fg); }
.cap-tone-over .cap-tally-bar-fill { background: var(--status-rejected-fg); }
.cap-tone-warn .cap-tally-duty { color: var(--status-submitted-fg); }
.cap-tone-over .cap-tally-duty { color: var(--status-rejected-fg); }
.cap-tally-note { font-size: 10px; color: var(--text-3); margin-top: 6px; letter-spacing: 0.02em; }

/* ===== Table ===== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
.tbl thead th {
  text-align: left;
  font-weight: 500;
  font-size: var(--t-12);
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 16px;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl tbody td {
  padding: var(--row-py) 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--bg-sunk); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* Mobile-first: card-list is default; table appears at desktop */
.table-wrap { display: none; }
.card-list { display: flex; flex-direction: column; gap: var(--s-3); }
@media (min-width: 768px) {
  .table-wrap { display: block; }
  .card-list { display: none; }
}
.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--sh-1);
}
.record-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.record-card .meta { color: var(--text-3); font-size: var(--t-13); }
.record-card .title { font-weight: 600; font-size: var(--t-16); }
.record-card .actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.filter-bar .field-inline { display: flex; align-items: center; gap: var(--s-2); }
.filter-bar .label-inline { font-size: var(--t-13); color: var(--text-3); }
.filter-bar .select { height: 36px; font-size: var(--t-13); padding-right: 28px; min-width: 140px; }
.filter-bar .input { height: 36px; font-size: var(--t-13); }
.filter-bar .spacer { flex: 1; }
.filter-bar .count { color: var(--text-3); font-size: var(--t-13); }

/* ===== Empty states ===== */
.empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-3);
  padding: var(--s-9) var(--s-6);
  text-align: center;
  color: var(--text-3);
}
.empty h3 { font-size: var(--t-16); color: var(--text); margin-bottom: 4px; }
.empty .body { font-size: var(--t-14); margin-bottom: var(--s-5); }
.empty .ico {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg-sunk); margin: 0 auto var(--s-4);
  display: flex; align-items: center; justify-content: center;
}

/* ===== Metric tiles ===== */
.metric-grid {
  display: grid; gap: var(--s-3);
  grid-template-columns: 1fr;
}
@media (min-width: 520px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } }
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-5);
  box-shadow: var(--sh-1);
}
.metric .lbl { font-size: var(--t-12); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.metric .val { font-size: var(--t-32); font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric .delta { font-size: var(--t-12); color: var(--text-3); margin-top: 6px; }
.metric .delta .up { color: var(--status-paid-fg); }
.metric .delta .down { color: var(--status-rejected-fg); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4); z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-4);
  box-shadow: var(--sh-modal);
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-head { padding: 20px 24px 0; }
.modal-head h3 { font-size: var(--t-18); }
.modal-head .sub { font-size: var(--t-13); color: var(--text-3); margin-top: 4px; }
.modal-body { padding: 16px 24px; overflow: auto; }
.modal-foot { padding: 12px 24px 20px; display: flex; gap: var(--s-2); justify-content: flex-end; border-top: 1px solid var(--border); margin-top: var(--s-3); padding-top: var(--s-4); }

/* ===== Toast ===== */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none; }
.toast {
  pointer-events: auto;
  background: var(--text);
  color: white;
  padding: 12px 16px;
  border-radius: var(--r-3);
  font-size: var(--t-13);
  box-shadow: var(--sh-modal);
  display: flex; align-items: center; gap: var(--s-3);
  min-width: 280px; max-width: 420px;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.is-success { background: #0F4D2B; }
.toast.is-error { background: #7A1810; }

/* ===== Auth pages ===== */
.auth-shell {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center;
  padding: var(--s-9) var(--s-4);
}
.auth-mark {
  font-weight: 600; font-size: var(--t-18); letter-spacing: -0.01em;
  margin-bottom: var(--s-7);
}
.auth-mark .num { color: var(--accent); }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--sh-2);
  padding: var(--s-7);
}
.auth-card h1 { font-size: var(--t-18); margin-bottom: 6px; }
.auth-card .sub { color: var(--text-3); font-size: var(--t-14); margin-bottom: var(--s-6); line-height: 1.45; }
.auth-foot {
  margin-top: var(--s-5);
  font-size: var(--t-12); color: var(--text-3);
  text-align: center;
}

/* OTP input */
.otp { display: flex; gap: var(--s-2); justify-content: center; }
.otp input {
  width: 44px; height: 56px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 22px;
  text-align: center;
  color: var(--text);
}
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }

/* Backup codes grid */
.codes {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.codes div { padding: 4px 8px; }

/* ===== Soldier info panel (form step 2) ===== */
.soldier-panel {
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
  display: flex; flex-wrap: wrap;
  gap: var(--s-5);
  align-items: baseline;
  font-size: var(--t-13);
  margin-bottom: var(--s-6);
}
.soldier-panel .item .lbl { color: var(--text-3); font-size: var(--t-12); display: block; margin-bottom: 2px; }
.soldier-panel .item .val { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.soldier-panel .panel-foot { flex: 1; text-align: right; font-size: var(--t-12); }

/* ===== Stepper indicator (multi-step) ===== */
.steps {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-6);
  font-size: var(--t-13);
  color: var(--text-3);
}
.steps .s { display: flex; align-items: center; gap: var(--s-2); }
.steps .s .n {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-sunk); color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--t-12); font-weight: 500;
  border: 1px solid var(--border);
}
.steps .s.is-active .n { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.steps .s.is-active .lbl { color: var(--text); font-weight: 500; }
.steps .s.is-done .n { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.steps .sep { flex: 0 0 24px; height: 1px; background: var(--border); }

/* ===== Date chip list (for multi-date) ===== */
.date-list { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-3); }
.date-list .row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 8px 12px;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.date-list .row .d { font-variant-numeric: tabular-nums; font-weight: 500; }
.date-list .row .spacer { flex: 1; }
.date-list .row button.x { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }
.date-list .row button.x:hover { color: var(--status-rejected-fg); }

/* ===== Timeline ===== */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 8px;
  width: 1px; background: var(--border);
}
.timeline li {
  position: relative;
  padding: 0 0 var(--s-5) var(--s-7);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li .marker {
  position: absolute; left: 1px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
}
.timeline li.is-current .marker { border-color: var(--accent); background: var(--accent); }
.timeline li .when { font-size: var(--t-12); color: var(--text-3); }
.timeline li .what { font-size: var(--t-14); margin-top: 2px; display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.timeline li .note { font-size: var(--t-13); color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.timeline li .who { font-size: var(--t-12); color: var(--text-3); margin-top: 2px; }

/* ===== Summary review (preview step) ===== */
.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
}
.review-head {
  padding: 16px 20px;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.review-head h3 { font-size: var(--t-16); }
.review-head .meta { color: var(--text-3); font-size: var(--t-13); }
.review-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 0;
  font-size: var(--t-14);
}
.review-body dt { color: var(--text-3); margin-top: 12px; }
.review-body dt:first-child { margin-top: 0; }
@media (min-width: 600px) {
  .review-body {
    grid-template-columns: 200px 1fr;
    gap: 12px 24px;
  }
  .review-body dt { margin-top: 0; }
}
.review-body dt { color: var(--text-3); font-weight: 400; }
.review-body dd { margin: 0; color: var(--text); font-weight: 500; }

/* Collapsible panel */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--surface);
}
.collapsible summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  display: flex; align-items: center; gap: var(--s-2);
  font-weight: 500;
  font-size: var(--t-14);
  color: var(--text);
}
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible summary .chev {
  margin-left: auto;
  transition: transform .15s;
  color: var(--text-3);
}
.collapsible[open] summary .chev { transform: rotate(90deg); }
.collapsible .body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: var(--t-13);
  color: var(--text-2);
  line-height: 1.6;
}
.collapsible .body dl { display: grid; grid-template-columns: 200px 1fr; gap: 8px 20px; margin: 0; }
.collapsible .body dt { color: var(--text-3); }
.collapsible .body dd { margin: 0; color: var(--text); font-family: var(--font-mono); font-size: 12px; }

/* ===== Caution banner ===== */
.note-banner {
  display: flex; gap: 10px;
  padding: 12px 14px;
  background: #FEF6E0;
  border: 1px solid #F2D88B;
  border-radius: var(--r-2);
  font-size: var(--t-13);
  color: #6E440A;
  line-height: 1.5;
}

/* ===== Viewport frame (Tweaks) ===== */
.vp-shell { min-height: 100vh; display: flex; flex-direction: column; background: #ECEDEF; }
.vp-bar { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: var(--t-12); color: var(--text-3); display: flex; gap: var(--s-3); align-items: center; }
.vp-bar .label { font-weight: 500; color: var(--text); }
.vp-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #C9CDD3; }
.vp-bar .path { font-family: var(--font-mono); color: var(--text-3); }
.vp-stage { flex: 1; display: flex; justify-content: center; padding: 24px; overflow: auto; }
.vp-frame {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(16,24,40,0.08);
  overflow: hidden;
  width: 100%;
  transition: max-width .2s;
}
.vp-frame.size-mobile { max-width: 390px; border-radius: 36px; padding: 6px; background: #1a1a1a; }
.vp-frame.size-mobile .vp-frame-inner { border-radius: 30px; overflow: auto; height: 780px; background: var(--bg); }
.vp-frame.size-tablet { max-width: 820px; }
.vp-frame.size-tablet .vp-frame-inner { height: 720px; overflow: auto; }
.vp-frame.size-desktop { max-width: none; }
.vp-frame.size-desktop .vp-frame-inner { min-height: 80vh; }

/* When inside a frame, header is no longer sticky to viewport */
.vp-frame .app-header { position: relative; top: 0; }

/* ============================================================
   v2 ADDITIONS — mobile-first content/behavior deltas
   ============================================================ */

/* ===== Citation chip ===== */
.citation {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-sunk);
  padding: 2px 8px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .12s, color .12s, background .12s;
}
.citation:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

/* ===== Cap-remaining line on duty-type cards ===== */
.cap-line {
  font-size: var(--t-12);
  color: var(--text-2);
  margin-top: 8px;
  display: flex; align-items: center; gap: 6px;
}
.cap-line.is-low { color: var(--status-submitted-fg); }
.cap-line.is-out { color: var(--status-rejected-fg); }
.cap-line .bar {
  flex: 0 0 80px; height: 4px; border-radius: 2px;
  background: var(--border); overflow: hidden;
}
.cap-line .bar > i {
  display: block; height: 100%;
  background: var(--text-3);
}
.cap-line.is-low .bar > i { background: var(--status-submitted-fg); }
.cap-line.is-out .bar > i { background: var(--status-rejected-fg); }
.signer-line {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}
.radio-card .citation { align-self: flex-start; margin-top: 10px; }
.radio-card .card-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.radio-card.is-selected .card-meta { border-top-color: var(--accent-ring); }

/* ===== Step dots indicator (mobile) ===== */
.steps {
  display: flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-5);
  font-size: var(--t-13);
}
.steps-mobile {
  display: flex; align-items: center; gap: 10px;
}
.steps-mobile .dots { display: flex; gap: 6px; }
.steps-mobile .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.steps-mobile .dot.is-done { background: var(--accent-soft); }
.steps-mobile .dot.is-active { background: var(--accent); transform: scale(1.25); }
.steps-mobile .label {
  font-size: var(--t-13);
  color: var(--text-2);
}
.steps-mobile .label strong { color: var(--text); font-weight: 500; }
.steps-desktop { display: none; }
@media (min-width: 720px) {
  .steps-mobile { display: none; }
  .steps-desktop { display: flex; align-items: center; gap: var(--s-3); }
  .steps-desktop .s { display: flex; align-items: center; gap: var(--s-2); color: var(--text-3); }
  .steps-desktop .s .n {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--bg-sunk); color: var(--text-3);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--t-12); font-weight: 500;
    border: 1px solid var(--border);
  }
  .steps-desktop .s.is-active .n { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .steps-desktop .s.is-active .lbl { color: var(--text); font-weight: 500; }
  .steps-desktop .s.is-done .n { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
  .steps-desktop .sep { flex: 0 0 24px; height: 1px; background: var(--border); }
}

/* ===== Hours selector ===== */
.hours-locked {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 12px;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-size: var(--t-13);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

/* ===== Doctrine side panel (slide-in on desktop, full sheet on mobile) ===== */
.doctrine-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 24, 40, 0.42);
  z-index: 110;
  display: flex; justify-content: flex-end;
}
.doctrine-panel {
  background: var(--surface);
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: auto;
  box-shadow: var(--sh-modal);
  animation: doc-slide-up .22s ease;
}
@keyframes doc-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 1024px) {
  .doctrine-panel {
    max-width: 420px;
    animation: doc-slide-right .22s ease;
  }
  @keyframes doc-slide-right { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.doctrine-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.doctrine-head .code {
  font-family: var(--font-mono);
  font-size: var(--t-13);
  color: var(--text);
  font-weight: 500;
  flex: 1;
}
.doctrine-head .close {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: var(--r-2);
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
}
.doctrine-head .close:hover { background: var(--bg-sunk); color: var(--text); }

.doctrine-body { padding: 20px; }
.doctrine-sec { margin-bottom: 24px; }
.doctrine-sec:last-child { margin-bottom: 0; }
.doctrine-sec h4 {
  font-size: var(--t-12);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 10px;
}
.doctrine-source {
  display: grid; grid-template-columns: 100px 1fr; gap: 4px 12px;
  font-size: var(--t-13); color: var(--text);
}
.doctrine-source dt { color: var(--text-3); }
.doctrine-source dd { margin: 0; }
.doctrine-rule {
  display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px;
  font-size: var(--t-13);
}
.doctrine-rule dt { color: var(--text-3); }
.doctrine-rule dd { margin: 0; line-height: 1.55; }
.doctrine-caps { list-style: none; padding: 0; margin: 0; }
.doctrine-caps li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--t-13);
}
.doctrine-caps li:last-child { border-bottom: none; }
.doctrine-caps .lbl { font-weight: 500; }
.doctrine-caps .cite { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; font-family: var(--font-mono); }
.doctrine-links { display: flex; flex-direction: column; gap: 8px; }
.doctrine-links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-size: var(--t-13);
  text-decoration: none; color: var(--text);
}
.doctrine-links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ===== Cap-violation banner ===== */
.violation-banner {
  background: var(--status-rejected-bg);
  border: 1px solid #F1B7B0;
  border-radius: var(--r-3);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.violation-banner h4 {
  font-size: var(--t-14);
  color: var(--status-rejected-fg);
  margin-bottom: 8px;
  display: flex; gap: 8px; align-items: center;
}
.violation-banner ul { list-style: none; padding: 0; margin: 0; }
.violation-banner li {
  font-size: var(--t-13);
  color: #5A140C;
  padding: 6px 0;
  line-height: 1.5;
}
.violation-banner .src {
  display: block; font-size: 11px; color: #8A3A33;
  margin-top: 2px; font-family: var(--font-mono);
}
.violation-banner a {
  display: inline-block;
  margin-top: 4px;
  font-size: var(--t-12);
  color: var(--status-rejected-fg);
  text-decoration: underline;
}

/* ===== Filter bar — wraps on mobile, inline on desktop ===== */
@media (max-width: 719px) {
  .filter-bar {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    gap: 8px;
  }
  .filter-bar .field-inline { width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  .filter-bar .label-inline { color: var(--text-3); font-size: var(--t-12); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
  .filter-bar .select,
  .filter-bar .input { width: 100% !important; height: 44px; font-size: var(--t-14); }
  .filter-bar .spacer { display: none; }
  .filter-bar .count { width: 100%; text-align: center; padding-top: 4px; border-top: 1px solid var(--border); }
}

/* ===== IDT Roll-up grid (admin) ===== */
.rollup-card-list { display: flex; flex-direction: column; gap: 10px; }
.rollup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 16px;
  box-shadow: var(--sh-1);
}
.rollup-card .head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; gap: 12px;
}
.rollup-card .name { font-weight: 500; font-size: var(--t-14); }
.rollup-card .meta { color: var(--text-3); font-size: var(--t-12); }
.rollup-card .months { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: var(--t-13); }
.rollup-card .months .m { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.rollup-card .months .v { color: var(--text); font-variant-numeric: tabular-nums; }
.rollup-card .months .v.empty { color: var(--text-4); }
.rollup-card .at {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: var(--t-13); display: flex; gap: 8px; align-items: baseline;
}
.rollup-card .at .lbl { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

.rollup-table-wrap { display: none; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); }
@media (min-width: 1024px) {
  .rollup-card-list { display: none; }
  .rollup-table-wrap { display: block; }
}
.rollup-tbl { width: 100%; border-collapse: collapse; font-size: var(--t-13); min-width: 1100px; }
.rollup-tbl th, .rollup-tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.rollup-tbl thead th {
  background: var(--bg-sunk);
  font-weight: 500; font-size: var(--t-12); color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em;
  position: sticky; top: 0;
}
.rollup-tbl tbody td.soldier { font-weight: 500; white-space: nowrap; }
.rollup-tbl tbody td.month { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; position: relative; }
.rollup-tbl tbody td.month.empty { color: var(--border-strong); }
.rollup-tbl tbody td.at { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.rollup-tbl .pill-cap {
  display: inline-block; margin-top: 4px;
  padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 500;
}
.rollup-tbl .dot-warn {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--status-submitted-fg);
  position: absolute; top: 8px; right: 8px;
}

/* ===== Block 9 footer note on Step 1 ===== */
.block9-note {
  margin-top: 20px; padding: 12px 14px;
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-size: var(--t-12);
  color: var(--text-2);
  line-height: 1.55;
}
.block9-note strong { color: var(--text); font-weight: 500; }
.block9-note a { font-size: var(--t-12); }

/* ===== Tap-target bump for mobile ===== */
@media (max-width: 719px) {
  .btn { height: 44px; padding: 0 18px; }
  .btn-sm { height: 36px; padding: 0 12px; }
  .btn-icon { width: 44px; padding: 0 10px; }
  .input, .select, .textarea, .stepper { min-height: 44px; }
  .stepper button { width: 44px; }
}

/* ============================================================
   PUBLIC PAGES — home.html, doctrine_ar_140_185.html
   ============================================================ */

/* Public shell — no auth nav, just wordmark on top */
.pub-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.pub-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px var(--s-4);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.pub-bar .wordmark {
  font-weight: 600; font-size: var(--t-16);
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.pub-bar .wordmark .num { color: var(--accent); }
.pub-bar .actions { display: flex; gap: 8px; align-items: center; }
.pub-bar .actions a {
  font-size: var(--t-13);
  color: var(--text-2);
  padding: 6px 10px; border-radius: var(--r-2);
  text-decoration: none;
}
.pub-bar .actions a:hover { background: var(--bg-sunk); color: var(--text); }
/* Override: when the link is a primary button, keep the white text */
.pub-bar .actions a.btn-primary,
.pub-bar .actions a.btn-primary:hover,
.pub-bar .actions a.btn-primary:visited {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
.pub-bar .actions a.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
@media (min-width: 720px) {
  .pub-bar { padding: 16px var(--s-7); }
}

.pub-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s-7) var(--s-4) var(--s-9);
}
@media (min-width: 720px) {
  .pub-main { padding: var(--s-9) var(--s-6) var(--s-10); }
}

.pub-foot {
  border-top: 1px solid var(--border);
  padding: var(--s-6) var(--s-4);
  text-align: center;
  font-size: var(--t-12);
  color: var(--text-3);
  line-height: 1.6;
}

/* ===== Section heads ===== */
.pub-section { margin-top: var(--s-9); }
.pub-section:first-child { margin-top: 0; }
.pub-section .eyebrow {
  font-size: var(--t-12);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 8px;
}
.pub-section h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
@media (min-width: 720px) {
  .pub-section h2 { font-size: 26px; }
}
.pub-section .lead {
  color: var(--text-3);
  font-size: var(--t-14);
  max-width: 640px;
  line-height: 1.6;
}

/* ===== Hero ===== */
.pub-hero {
  padding: var(--s-7) 0 var(--s-9);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-9);
}
.pub-hero .badge-row {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: var(--t-12);
  font-weight: 500;
  margin-bottom: var(--s-5);
}
.pub-hero h1 {
  font-size: 36px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--s-4);
  max-width: 720px;
  text-wrap: pretty;
}
@media (min-width: 720px) { .pub-hero h1 { font-size: 56px; } }
.pub-hero .tagline {
  font-size: var(--t-18);
  color: var(--text-2);
  line-height: 1.5;
  max-width: 620px;
  margin-bottom: var(--s-6);
}
@media (min-width: 720px) { .pub-hero .tagline { font-size: 20px; } }
.pub-hero .hero-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.pub-hero .hero-actions .btn { width: 100%; }
@media (min-width: 600px) {
  .pub-hero .hero-actions { flex-direction: row; align-items: center; }
  .pub-hero .hero-actions .btn { width: auto; }
}
.pub-hero .hero-actions .sub {
  font-size: var(--t-13);
  color: var(--text-3);
}

/* ===== "What this tool does" bullets ===== */
.feat-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
.feat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.feat .num {
  font-family: var(--font-mono);
  font-size: var(--t-12);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}
.feat h3 {
  font-size: var(--t-16);
  margin-bottom: 6px;
}
.feat p {
  font-size: var(--t-13);
  color: var(--text-3);
  line-height: 1.55;
}

/* ===== Source cards ===== */
.source-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .source-grid { grid-template-columns: repeat(3, 1fr); }
}
.source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px;
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.source-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.source-card .id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.source-card h3 {
  font-size: var(--t-16);
  margin-bottom: 4px;
}
.source-card .sub {
  font-size: var(--t-13);
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}
.source-card .meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
  font-size: var(--t-12); color: var(--text-3);
}
.source-card .meta dt { font-weight: 500; }
.source-card .pdf-link {
  margin-top: 14px;
  font-size: var(--t-13);
  color: var(--accent);
  display: flex; align-items: center; gap: 6px;
}
.source-card .status-pending {
  display: inline-flex; padding: 2px 8px;
  background: var(--status-submitted-bg);
  color: var(--status-submitted-fg);
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 500;
  margin-top: 4px;
}

/* ===== Duty card grid for the home page ===== */
.pub-duty-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .pub-duty-grid { grid-template-columns: 1fr 1fr; } }
.pub-duty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px;
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column;
  gap: 4px;
}
.pub-duty-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 4px; flex-wrap: wrap;
}
.pub-duty-card .abbr {
  font-weight: 600;
  font-size: var(--t-18);
  letter-spacing: -0.01em;
}
.pub-duty-card .name {
  font-size: var(--t-13);
  color: var(--text-2);
  margin-bottom: 6px;
}
.pub-duty-card .desc {
  font-size: var(--t-13);
  color: var(--text-3);
  line-height: 1.5;
}
.pub-duty-card .citation {
  align-self: flex-start;
  margin-top: 12px;
}
.pub-duty-card .row-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: auto 1fr; gap: 6px 12px;
  font-size: var(--t-12); color: var(--text-2);
}
.pub-duty-card .row-meta dt { color: var(--text-3); }
.pub-duty-card .row-meta dd { margin: 0; }

/* ===== Rule cards (doctrine page) ===== */
.rule-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .rule-grid { grid-template-columns: 1fr 1fr; } }
.rule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 20px;
  box-shadow: var(--sh-1);
}
.rule-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.rule-card .id {
  font-family: var(--font-mono);
  font-size: var(--t-13);
  font-weight: 500;
}
.rule-card .duty {
  font-size: var(--t-12);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-weight: 500;
}
.rule-card .col-grid {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px 16px;
  font-size: var(--t-13);
}
.rule-card .col-grid dt {
  color: var(--text-3);
  font-weight: 500;
}
.rule-card .col-grid dd {
  margin: 0;
  line-height: 1.55;
}
.rule-card .para-cite {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ===== Paragraph blocks (doctrine page) ===== */
.para-list {
  display: flex; flex-direction: column;
  gap: 16px;
}
.para-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.para-card h3 {
  font-size: var(--t-14);
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
}
.para-card p {
  font-size: var(--t-14);
  color: var(--text-2);
  line-height: 1.65;
}

/* ===== Glossary table ===== */
.glossary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
}
.glossary dl {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
}
@media (min-width: 600px) {
  .glossary dl { grid-template-columns: 100px 1fr; }
}
.glossary dt, .glossary dd {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin: 0;
}
.glossary dl > dt:first-of-type,
.glossary dl > dt:first-of-type + dd { border-top: none; }
.glossary dt {
  font-family: var(--font-mono);
  font-size: var(--t-13);
  font-weight: 500;
  color: var(--text);
  background: var(--bg-sunk);
}
@media (max-width: 599px) {
  .glossary dt { padding-bottom: 4px; background: transparent; border-top: 1px solid var(--border); }
  .glossary dd { padding-top: 0; border-top: none; }
  .glossary dl > dd:first-of-type { padding-top: 0; }
}
.glossary dd {
  font-size: var(--t-13);
  color: var(--text-2);
  line-height: 1.55;
}

/* ===== Simple table for Table 3-1 codes ===== */
.codes-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  font-size: var(--t-13);
}
.codes-table th, .codes-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.codes-table th {
  background: var(--bg-sunk);
  font-weight: 500;
  font-size: var(--t-12);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.codes-table tr:last-child td { border-bottom: none; }
.codes-table td.letter {
  font-family: var(--font-mono);
  font-weight: 500;
  width: 60px;
}

/* ===== Doctrine page intro callout ===== */
.doctrine-intro {
  background: var(--accent-soft);
  border: 1px solid #C8D2E1;
  border-radius: var(--r-3);
  padding: 18px 20px;
  font-size: var(--t-14);
  color: var(--text);
  line-height: 1.6;
  margin-bottom: var(--s-7);
}
.doctrine-intro .lbl {
  display: block;
  font-size: var(--t-12);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

/* ===== Doctrine page header strip ===== */
.doctrine-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s-6);
  margin-bottom: var(--s-7);
}
.doctrine-header h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  text-wrap: pretty;
}
@media (min-width: 720px) { .doctrine-header h1 { font-size: 36px; } }
.doctrine-header .meta {
  font-size: var(--t-13);
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 14px;
}
.doctrine-header .source-links {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.doctrine-header .source-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-2);
  font-size: var(--t-13);
  color: var(--text);
  text-decoration: none;
}
.doctrine-header .source-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Print friendliness for doctrine page ===== */
@media print {
  .pub-bar, .pub-foot, .doctrine-header .source-links { display: none !important; }
  .pub-main { padding: 0 !important; max-width: none !important; }
  .rule-card, .para-card, .feat, .source-card, .pub-duty-card,
  .glossary, .codes-table, .doctrine-intro {
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  body { background: white !important; }
}

/* ============================================================
   DOCTRINE EXPANSION — hub, duty-type pages, glossary, sources
   ============================================================ */

/* Breadcrumb back-link at top of inner doctrine pages */
.doc-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-13);
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: var(--s-5);
}
.doc-back:hover { color: var(--accent); text-decoration: none; }

/* ===== Hub page — two big lens cards ===== */
.lens-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
  margin-top: var(--s-6);
}
@media (min-width: 820px) { .lens-grid { grid-template-columns: 1fr 1fr; } }
.lens-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: 24px;
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column;
}
.lens-card .lens-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lens-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.lens-card .lens-sub {
  color: var(--text-3);
  font-size: var(--t-14);
  line-height: 1.55;
  margin-bottom: 18px;
}
.lens-card .lens-items {
  display: flex; flex-direction: column;
  gap: 8px;
}
.lens-card .lens-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color .12s, background .12s;
}
.lens-card .lens-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.lens-card .lens-item .lbl {
  flex: 1;
  font-size: var(--t-14);
  font-weight: 500;
}
.lens-card .lens-item .meta {
  font-size: var(--t-12);
  color: var(--text-3);
  font-family: var(--font-mono);
}
.lens-card .lens-item .arr {
  color: var(--text-4);
  flex: none;
}

/* ===== Duty-type doctrine page ===== */
.duty-header {
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-7);
}
.duty-header .badge-abbr {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: var(--t-13);
  padding: 4px 12px;
  border-radius: var(--r-2);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}
.duty-header .citation-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.duty-header h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: pretty;
}
@media (min-width: 720px) { .duty-header h1 { font-size: 36px; } }
.duty-header .summary {
  font-size: var(--t-16);
  color: var(--text-2);
  line-height: 1.6;
  max-width: 720px;
  margin-top: var(--s-3);
}

/* When / When NOT lists */
.use-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
  margin: var(--s-6) 0;
}
@media (min-width: 720px) { .use-grid { grid-template-columns: 1fr 1fr; } }
.use-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.use-card h3 {
  font-size: var(--t-14);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.use-card.use-do h3 .ico {
  color: var(--status-paid-fg);
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--status-paid-bg); border-radius: 50%;
  font-weight: 600; font-size: 12px;
}
.use-card.use-dont h3 .ico {
  color: var(--status-rejected-fg);
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--status-rejected-bg); border-radius: 50%;
  font-weight: 600; font-size: 12px;
}
.use-card ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.use-card li {
  font-size: var(--t-14);
  color: var(--text);
  line-height: 1.5;
  padding-left: 18px;
  position: relative;
}
.use-card.use-do li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 10px; height: 6px;
  border-left: 2px solid var(--status-paid-fg);
  border-bottom: 2px solid var(--status-paid-fg);
  transform: rotate(-45deg);
}
.use-card.use-dont li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 8px; height: 2px;
  background: var(--status-rejected-fg);
}
.use-card li .cite {
  display: inline;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-left: 4px;
}

/* Rules-at-a-glance compact block */
.rules-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
  margin: var(--s-6) 0;
}
.rules-block h3 {
  font-size: var(--t-14);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 12px;
}
.rules-block ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.rules-block li {
  font-size: var(--t-14);
  color: var(--text);
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
}
.rules-block li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.rules-block li .cite {
  display: inline;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* Form-mapping card — shows how the duty appears on DA 1380 */
.form-map {
  background: var(--bg-sunk);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px 20px;
  margin: var(--s-6) 0;
}
.form-map h3 {
  font-size: var(--t-14);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 12px;
}
.form-map dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 0;
  margin: 0;
}
@media (min-width: 600px) {
  .form-map dl { grid-template-columns: 180px 1fr; gap: 10px 24px; }
}
.form-map dt { color: var(--text-3); font-size: var(--t-13); }
.form-map dd { margin: 0; font-size: var(--t-13); color: var(--text); }
.form-map dd .v {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px; border-radius: var(--r-2);
}

/* Description examples list */
.desc-examples {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}
.desc-examples h3 {
  font-size: var(--t-14);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 12px;
}
.desc-examples ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.desc-examples li {
  font-size: var(--t-14);
  padding: 10px 12px;
  background: var(--bg-sunk);
  border-radius: var(--r-2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

/* "Read the regulation" chip list */
.cite-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.cite-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  font-size: var(--t-13);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
}
.cite-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.cite-list a .arr { margin-left: auto; color: var(--text-4); }

/* Generate CTA at bottom of duty-type page */
.duty-cta {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-4);
  padding: 24px;
  margin-top: var(--s-7);
  text-align: center;
}
.duty-cta h3 {
  font-size: var(--t-18);
  color: var(--on-accent);
  margin-bottom: 6px;
}
.duty-cta p {
  color: rgba(255,255,255,0.75);
  font-size: var(--t-14);
  margin-bottom: 16px;
}
.duty-cta a.btn {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--surface);
  text-decoration: none;
}
.duty-cta a.btn:hover { background: var(--bg-sunk); }

/* Section heading inside duty page */
.duty-section { margin: var(--s-7) 0 0; }
.duty-section h2 {
  font-size: 18px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.duty-section .lead {
  color: var(--text-3);
  font-size: var(--t-14);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ===== TOC sidebar for the AR 140-185 page on desktop ===== */
.doctrine-with-toc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 960px) {
  .doctrine-with-toc {
    grid-template-columns: 200px 1fr;
  }
}
.doctrine-toc {
  display: none;
}
@media (min-width: 960px) {
  .doctrine-toc {
    display: block;
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow: auto;
    font-size: var(--t-13);
  }
  .doctrine-toc h4 {
    font-size: var(--t-12);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    font-weight: 500;
    margin-bottom: 10px;
  }
  .doctrine-toc ul { list-style: none; padding: 0; margin: 0; }
  .doctrine-toc li { margin-bottom: 2px; }
  .doctrine-toc a {
    display: block;
    padding: 6px 10px;
    color: var(--text-2);
    border-radius: var(--r-2);
    text-decoration: none;
    border-left: 2px solid transparent;
  }
  .doctrine-toc a:hover {
    background: var(--bg-sunk);
    color: var(--text);
    text-decoration: none;
  }
  .doctrine-toc a.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 500;
  }
  .doctrine-toc .sub {
    padding-left: 18px;
    font-size: var(--t-12);
    color: var(--text-3);
  }
}

/* ============================================================
   POST-V2 FIXES — re-applied on top of v2 baseline. These were
   added incrementally during integration and aren't yet folded
   into the v2 source. Keep at end of file for easy auditing.
   ============================================================ */

/* The HTML `hidden` attribute should always hide. Several rules above
   set `display: <x>` which beats the UA `[hidden]{display:none}` due
   to specificity. Force the semantics back globally so we don't have
   to add an override on every new class. */
[hidden] { display: none !important; }
.modal-overlay[hidden] { display: none !important; }

/* .radio-inline originally only had button children styled. Extend to
   <label> children so the per-row Half/Full toggles render correctly
   (the wizard uses labels wrapping hidden radio inputs). */
.radio-inline label {
  display: inline-flex; align-items: center;
  border: none; background: transparent; padding: 6px 14px; border-radius: 4px;
  font-size: var(--t-13); color: var(--text-2); cursor: pointer;
  user-select: none;
}
.radio-inline label.is-on {
  background: var(--surface); color: var(--text); box-shadow: var(--sh-1); font-weight: 500;
}
.radio-inline label:hover { color: var(--text); }

/* User-menu dropdown — replaces the old rank-name + sign-out pair in the
   header. Built on <details>/<summary>: open-on-click, accessible, no JS
   needed for the toggle itself. */
.user-menu {
  position: relative;
}
.user-menu > summary {
  list-style: none;            /* hide native disclosure triangle (Firefox) */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-2);
  color: var(--text);
  font-size: var(--t-14);
  white-space: nowrap;
}
.user-menu > summary::-webkit-details-marker { display: none; } /* Safari/Chrome */
.user-menu > summary::marker { content: ""; }
.user-menu > summary:hover {
  background: var(--bg-sunk);
}
.user-menu > summary .caret {
  color: var(--text-3);
  transition: transform 120ms ease;
}
.user-menu[open] > summary .caret {
  transform: rotate(180deg);
}
.user-menu > summary .name {
  font-weight: 500;
}
.user-menu .user-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  box-shadow: var(--sh-modal);
  padding: 6px;
  z-index: 50;
}
.user-menu .user-menu-panel a,
.user-menu .user-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: var(--t-14);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}
.user-menu .user-menu-panel a:hover,
.user-menu .user-menu-panel button:hover {
  background: var(--bg-sunk);
}
.user-menu .user-menu-panel hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 4px;
}
.user-menu .user-menu-panel svg {
  color: var(--text-3);
  flex-shrink: 0;
}
