/* DESIGN.md — GOV.UK-like civic clarity. System sans for now; Source Sans 3
   self-hosting is a production step (DESIGN Typography). Sharp corners, warm
   paper, high contrast, generous spacing. */
:root {
  --bg: #fbfaf7;
  --panel: #f3f2f1;
  --ink: #0b0c0c;
  --muted: #505a5f;
  --primary: #1d70b8;
  --primary-hover: #003078;
  --action: #00703c;
  --action-hover: #005a30;
  --focus: #ffdd00;
  --border: #b1b4b6;
  --error: #d4351c;
}
* {
  box-sizing: border-box;
}
body {
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
}
.masthead {
  background: var(--primary);
  color: #fff;
  padding: 12px 0;
}
.wrap {
  max-width: 990px;
  margin: 0 auto;
  padding: 0 16px;
}
.masthead .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.masthead strong {
  font-size: 21px;
}
.masthead a {
  color: #fff;
}
.masthead strong a {
  text-decoration: none;
}
.masthead .lang a:hover {
  color: #fff;
}
.masthead .lang {
  font-size: 16px;
}
.mast-right {
  display: flex;
  gap: 18px;
  align-items: center;
}
.lang-toggle {
  font-size: 16px;
}
/* Account dropdown (native <details>, no JS, CSP-clean) */
details.account {
  position: relative;
}
details.account > summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
}
details.account > summary::-webkit-details-marker {
  display: none;
}
details.account > summary::after {
  content: " \25BE";
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  min-width: 190px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.account-menu a,
.account-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  color: var(--primary);
  font-size: 16px;
  text-decoration: none;
  background: none;
  border: 0;
  box-shadow: none;
  margin: 0;
  cursor: pointer;
}
.account-menu a:hover,
.account-menu .menu-item:hover {
  background: var(--panel);
}

/* Two-column layout with a sidebar anchor nav (GOV.UK-style). */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  margin-top: 24px;
}
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
}
.sidebar .side-title {
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 16px;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 2px solid var(--primary);
}
.sidebar li {
  border-bottom: 1px solid var(--border);
}
.sidebar li a {
  display: block;
  padding: 8px 0;
  font-size: 16px;
}
.content .result {
  margin-top: 0;
}
@media print {
  .layout {
    display: block;
  }
  .sidebar {
    display: none;
  }
}
.inline {
  display: inline;
}
.linkbtn {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  color: #fff;
  font-size: 16px;
  text-decoration: underline;
  cursor: pointer;
}
.linkbtn:hover {
  background: none;
}
.wrap.narrow {
  max-width: 480px;
}
.mt {
  margin-top: 24px;
}
.error-summary {
  border: 4px solid var(--error);
  padding: 12px 16px;
  margin: 16px 0;
  color: var(--error);
  font-weight: 600;
}
.saved-banner {
  background: #f3f2f1;
  border-left: 8px solid var(--action);
  padding: 12px 16px;
  margin-top: 24px;
}
.copybox {
  display: block;
  background: #f3f2f1;
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-family: ui-monospace, monospace;
  font-size: 14px;
  word-break: break-all;
}
.chart {
  margin: 16px 0 8px;
  max-width: 680px;
}

/* Print: strip the app chrome and render the report black-on-white (DESIGN Print). */
@media print {
  .masthead,
  form,
  .no-print,
  button,
  .tag {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .result {
    background: #fff;
    border: 0;
    padding: 0;
  }
  a {
    color: #000;
    text-decoration: none;
  }
  .report,
  table {
    page-break-inside: avoid;
  }
  .provenance,
  .muted {
    color: #333;
  }
}
main {
  padding: 32px 0 64px;
}
h1 {
  font-size: 40px;
  line-height: 1.2;
  margin: 0 0 8px;
}
h2 {
  font-size: 24px;
  margin: 32px 0 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.lede {
  color: var(--muted);
  margin: 0 0 24px;
}
h3 {
  font-size: 19px;
  margin: 24px 0 4px;
}
label {
  display: block;
  font-weight: 600;
  margin: 24px 0 4px;
}
.hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 16px;
  margin: 0 0 8px;
}
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
  font-size: 19px;
  padding: 8px;
  max-width: 100%;
  border: 2px solid var(--ink);
  border-radius: 0;
}
input[type="number"] {
  width: 12rem;
}
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 20rem;
}
input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px var(--ink);
}
button {
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  background: var(--action);
  border: 0;
  border-radius: 0;
  padding: 12px 20px;
  margin-top: 24px;
  cursor: pointer;
  box-shadow: 0 2px 0 #002d18;
}
button:hover {
  background: var(--action-hover);
}
button:focus {
  outline: 3px solid var(--focus);
  box-shadow: 0 2px 0 var(--ink);
}
a {
  color: var(--primary);
}
a:hover {
  color: var(--primary-hover);
}
.result {
  margin-top: 32px;
  padding: 24px;
  background: var(--panel);
  border-left: 8px solid var(--primary);
}
.figure {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.provenance {
  color: var(--muted);
  font-size: 16px;
  margin: 8px 0 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 16px;
}
th,
td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block;
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  padding: 0 6px;
  text-transform: uppercase;
}
