/* LMMHA public browser — restrained government-data aesthetic.
   Generated/maintained by hand alongside app.js; no build step. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #888;
  --paper: #faf9f7;
  --panel: #ffffff;
  --line: #e3e0db;
  --line-soft: #efece8;
  --accent: #1f4e79;
  --accent-soft: #eaf1f8;

  /* account-class accents (muted, legible) */
  --c0: #2e7d5b;  /* revenue receipts  */
  --c2: #b5572a;  /* revenue expenditure */
  --c4: #7b4ca0;  /* capital expenditure */
  --c6: #2f6f9e;  /* debt / loans */
  --c8: #6b6256;  /* contingency / public account */

  --mono: "SF Mono", "JetBrains Mono", "Menlo", monospace;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;            /* no sideways scroll on small screens */
}

a { color: var(--accent); }

/* ---------- header ---------- */
.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: clamp(16px, 4vw, 22px) clamp(16px, 4vw, 32px) 18px;
}
.masthead h1 { margin: 0; font-size: clamp(18px, 5vw, 22px); font-weight: 700; letter-spacing: -0.01em; }
.masthead .sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 760px; }
.masthead .meta-line { margin-top: 8px; color: var(--ink-faint); font-size: 12.5px; }
.masthead .meta-line strong { color: var(--ink-soft); font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
.tab {
  border: 1px solid var(--line); border-bottom: none;
  background: var(--paper); color: var(--ink-soft);
  padding: 7px 16px; border-radius: 6px 6px 0 0; cursor: pointer;
  font-size: 13.5px; font-weight: 600;
}
.tab.active { background: var(--panel); color: var(--ink); box-shadow: 0 -2px 0 var(--accent) inset; }

/* ---------- search ---------- */
.searchbar { padding: 14px clamp(16px, 4vw, 32px); border-bottom: 1px solid var(--line); background: var(--panel); }
.searchbar input {
  width: 100%; max-width: 520px; padding: 9px 13px;
  border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: var(--sans);
}
.searchbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-hint { color: var(--ink-faint); font-size: 12px; margin-left: 10px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: calc(100vh - 230px); }
/* grid/flex children default to min-width:auto and refuse to shrink below their
   content — this is the usual source of mobile horizontal overflow. */
.nav-pane, .detail-pane { min-width: 0; }
.row .code, .d-code, .note, .ccode { overflow-wrap: anywhere; }
.nav-pane { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 230px); }
.detail-pane { overflow-y: auto; max-height: calc(100vh - 230px); padding: 24px clamp(16px, 4vw, 32px) 80px; }

/* ---------- account-class cards ---------- */
.class-grid { padding: 20px 24px; display: grid; gap: 12px; }
.class-card {
  border: 1px solid var(--line); border-left: 4px solid var(--cls, var(--accent));
  border-radius: 9px; padding: 14px 16px; cursor: pointer; background: var(--panel);
  transition: box-shadow .12s, transform .12s;
}
.class-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); transform: translateY(-1px); }
.class-card.active { box-shadow: 0 0 0 2px var(--cls); }
.class-card .digits {
  font-family: var(--mono); font-size: 11px; color: #fff; background: var(--cls, var(--accent));
  padding: 1px 7px; border-radius: 4px; display: inline-block; margin-bottom: 6px;
}
.class-card h3 { margin: 0 0 3px; font-size: 15.5px; }
.class-card p { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.class-card .count { float: right; font-size: 12px; color: var(--ink-faint); }

/* ---------- tree ---------- */
.tree { padding: 8px 10px 40px; }
.crumbs { padding: 12px 20px; font-size: 12.5px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.crumbs a { cursor: pointer; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--ink-faint); margin: 0 6px; }

.row {
  display: flex; align-items: baseline; gap: 10px; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; border: 1px solid transparent;
}
.row:hover { background: var(--line-soft); }
.row.selected { background: var(--accent-soft); border-color: #cfe0f0; }
.row .code { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); min-width: 92px; }
.row .desc { flex: 1; font-size: 14px; }
.row .chev { color: var(--ink-faint); font-size: 12px; }
.row .tag { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.row.has-note .desc::after { content: "§"; color: var(--accent); margin-left: 6px; font-weight: 700; }

/* ---------- detail ---------- */
.detail-empty { color: var(--ink-faint); margin-top: 40px; max-width: 520px; }
.detail-empty h2 { color: var(--ink-soft); font-weight: 600; }

.d-class-pill {
  display: inline-block; font-size: 12px; font-weight: 600; color: #fff;
  background: var(--cls, var(--accent)); padding: 2px 10px; border-radius: 5px;
}
.d-code { font-family: var(--mono); font-size: 30px; font-weight: 700; margin: 12px 0 2px; letter-spacing: -0.01em; }
.d-type { color: var(--ink-faint); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.d-desc { font-size: 20px; font-weight: 600; margin: 6px 0 18px; line-height: 1.35; }

.d-breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 22px; }
.d-breadcrumb .step { display: block; padding: 3px 0 3px 14px; border-left: 2px solid var(--line); cursor: pointer; }
.d-breadcrumb .step:hover { border-left-color: var(--accent); }
.d-breadcrumb .step .c { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-right: 8px; }
.d-breadcrumb .step.cur { font-weight: 600; color: var(--ink); border-left-color: var(--cls, var(--accent)); }

.d-section { margin: 22px 0; }
.d-section h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
  margin: 0 0 8px; border-bottom: 1px solid var(--line-soft); padding-bottom: 5px;
}
.note { background: #fbf8f0; border: 1px solid #efe6d2; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; }
.note .num { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.class-explain { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-soft); }

.children-list .row { padding: 5px 10px; }

/* correction-slip history */
.event { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.event .ev-head { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 13px; background: var(--paper); }
.event .ev-slip { font-weight: 600; font-size: 13.5px; }
.event .ev-date { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.event .ev-changes { padding: 4px 13px 11px; }
.chg { display: flex; gap: 9px; align-items: baseline; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--line-soft); }
.chg:first-child { border-top: none; }
.chg .act { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; min-width: 52px; text-align: center; }
.chg .act.insert { background: #e3f3e8; color: #1d6b3f; }
.chg .act.delete { background: #fae3e3; color: #a13030; }
.chg .act.rename { background: #fdf0d9; color: #8a5a14; }
.chg .ccode { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); min-width: 86px; }
.chg .old { color: var(--ink-faint); text-decoration: line-through; }
.chg.match { background: var(--accent-soft); border-radius: 5px; }

.caveat { font-size: 12px; color: var(--ink-faint); font-style: italic; margin-top: 6px; }

/* observed reporting */
.ob-bars { display: flex; align-items: flex-end; gap: 14px; height: 130px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.ob-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 0 0 auto; min-width: 56px; }
.ob-val { font-size: 11.5px; color: var(--ink-soft); font-family: var(--mono); margin-bottom: 3px; }
.ob-bar { width: 30px; background: var(--c0); border-radius: 3px 3px 0 0; opacity: .85; }
.ob-fy { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); margin-top: 5px; }

/* ---------- timeline tab ---------- */
.timeline-wrap { padding: 24px clamp(16px, 4vw, 32px) 80px; max-width: 1100px; margin: 0 auto; }
.tl-intro { color: var(--ink-soft); font-size: 14px; max-width: 760px; margin-bottom: 8px; }
.tl-coverage { font-size: 12.5px; color: var(--ink-faint); font-style: italic; margin-bottom: 22px; }
.year-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin: 18px 0 30px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.year-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer; }
.year-bar .bar { width: 70%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .82; }
.year-bar:hover .bar { opacity: 1; }
.year-bar.active .bar { background: var(--c2); opacity: 1; }
.year-bar .yr { font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; font-family: var(--mono); }
.year-bar .n { font-size: 10px; color: var(--ink-faint); }

/* ---------- about / methodology ---------- */
.about-wrap { max-width: 760px; margin: 0 auto; padding: 30px clamp(16px, 4vw, 32px) 80px; }
.about-wrap h2 { font-size: 22px; margin: 0 0 14px; }
.about-wrap h3 { font-size: 15px; margin: 26px 0 6px; color: var(--accent); scroll-margin-top: 16px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 22px; }
.toc span { color: var(--ink-faint); font-size: 12.5px; }
.toc button { border: 1px solid var(--line); background: var(--paper); color: var(--accent);
  padding: 4px 11px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-family: var(--sans); }
.toc button:hover { background: var(--accent-soft); }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 40px; height: 40px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); border-radius: 50%;
  cursor: pointer; font-size: 17px; box-shadow: 0 2px 10px rgba(0,0,0,.14);
  opacity: 0; pointer-events: none; transition: opacity .15s; }
.to-top.show { opacity: 1; pointer-events: auto; }
.about-wrap p { font-size: 15px; line-height: 1.65; color: #2b2b2b; margin: 0 0 12px; }
.aside-wry {
  margin-top: 30px; padding: 18px 20px; border-left: 3px solid var(--c2);
  background: #fbf6f2; border-radius: 0 8px 8px 0;
}
.aside-wry p { font-size: 14px; color: #4a4441; font-style: italic; margin-bottom: 10px; }
.aside-wry p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.colophon { border-top: 1px solid var(--line); padding: 20px clamp(16px, 4vw, 32px) 36px; color: var(--ink-faint); font-size: 12.5px; background: var(--panel); }
.colophon a { margin-right: 16px; }
.colophon .downloads { margin-top: 8px; }

.hidden { display: none !important; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .nav-pane { border-right: none; border-bottom: 1px solid var(--line); max-height: none; }
  .detail-pane { max-height: none; }
}
