:root {
  --ink: #2a2140;
  --muted: #6b6480;
  --bg: #fff8f4;
  --card: #ffffff;
  --line: #f0e1da;
  --brand: #e85d75;
  --brand-dark: #c8455e;
  --brand-soft: #fde7eb;
  --mint: #1f9d84;
  --mint-soft: #e2f6f1;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn-bg: #fff3c4;
  --warn-line: #e6c200;
  --warn-ink: #5c4a00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 33, 64, 0.06), 0 6px 20px rgba(42, 33, 64, 0.06);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
code, pre { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.9em; }
pre { background: #231c35; color: #f7eef2; padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
:not(pre) > code { background: var(--brand-soft); padding: 1px 5px; border-radius: 5px; }
[hidden] { display: none !important; }

.qa-banner { background: var(--warn-bg); border-bottom: 2px solid var(--warn-line); color: var(--warn-ink); text-align: center; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.narrow { max-width: 480px; }

/* header / nav */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .bar { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--brand); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a, .nav button { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 0.95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--brand-soft); }
.nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 0.9rem; }
.site-footer .bar { max-width: 1040px; margin: 0 auto; padding: 16px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.muted { color: var(--muted); }
.big-number { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { font-size: 2.4rem; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin: 0 auto 20px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }

/* forms */
form .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid #dccfc9; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--danger); }
.hint { font-size: 0.85rem; color: var(--muted); margin: 4px 0 0; }
.field-error { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; min-height: 0; }
.field-error:empty { display: none; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 500; }
.radio-row input { width: auto; }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #dccfc9; }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 0.9rem; }

/* alerts */
.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-weight: 500; }
.alert:empty { display: none; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c2c2; }
.alert.success { background: var(--mint-soft); color: #136b59; border: 1px solid #b9e6da; }
.alert.info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #f7c7d1; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.amount-pos { color: var(--mint); }
.amount-neg { color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.badge.closed { background: #eee; color: #666; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }

.confirm-panel { border: 2px solid var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 14px; margin-top: 12px; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; font-size: 0.9rem; color: var(--muted); }
.steps .on { color: var(--brand-dark); font-weight: 700; }
.reference { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .nav { margin-left: 0; }
  .dl { grid-template-columns: 1fr; }
}
.center { justify-content: center; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }

/* register: password show toggle + live checklist */
.pw-wrap { display: flex; gap: 8px; align-items: center; }
.pw-wrap input { flex: 1; }
.pw-rules { list-style: none; padding: 0; margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); display: grid; gap: 2px; }
.pw-rules li::before { content: '○'; display: inline-block; width: 1.3em; }
.pw-rules li.met { color: var(--mint); }
.pw-rules li.met::before { content: '✓'; font-weight: 700; }
.pw-rules.attempted li:not(.met) { color: var(--danger); }
.pw-rules.attempted li:not(.met)::before { content: '✗'; }

/* "Show locators" practice aid (footer toggle) */
.loc-toggle { font: inherit; font-size: 0.85rem; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--brand); background: transparent; color: var(--brand-dark); cursor: pointer; }
.loc-toggle[aria-pressed='true'] { background: var(--brand); color: #fff; border-style: solid; }
.loc-badge { position: fixed; z-index: 1000; pointer-events: none; font: 600 11px/1 ui-monospace, Consolas, monospace; padding: 3px 5px; border-radius: 4px; background: rgba(42, 33, 64, 0.88); color: #fff; white-space: nowrap; }
.show-locators [data-testid] { outline: 1px dashed rgba(232, 93, 117, 0.7); outline-offset: 1px; }
.loc-badge[hidden] { display: none; }
.loc-bar { background: var(--ink); color: #fff; font-size: 0.85rem; padding: 8px 16px; text-align: center; }
