/* ==========================================================================
   THE CLAIM FILE — MASTER STYLESHEET
   Design system: internal legal brief meets redacted government file.
   Semi-monospace: IBM Plex Mono for chrome/labels/data, IBM Plex Sans for
   long-form body prose. Near-white paper ground, near-black ink, one
   dark teal accent used only for stamps, rules, and active states.
   ========================================================================== */

:root {
  /* ---- colour ---- */
  --bg:            #F7F6F2;  /* paper */
  --bg-alt:        #EFEDE6;  /* deeper paper — rail, stamp, footer, table head */
  --ink:           #16191B;  /* near-black text */
  --ink-muted:     #5C6360;  /* metadata / secondary text */
  --teal:          #0B3D3D;  /* single accent — dark teal */
  --teal-tint:     #E1EAE8;  /* pale teal — hover / selection backgrounds */
  --rule:          #D9D5C9;  /* hairline dividers */
  --rule-strong:   #B9B4A6;
  --focus:         #0B3D3D;

  /* ---- type ---- */
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ---- layout ---- */
  --rail-width: 264px;
  --content-max: 1180px;
  --prose-max: 700px;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--teal-tint); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.6em 1em;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   BANNER — top classification strip, present on every page
   ========================================================================== */

.file-banner {
  border-bottom: 2px solid var(--teal);
  background: var(--bg);
}
.file-banner__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}
.file-banner__mark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}
.file-banner__mark:hover { color: var(--teal); }
.file-banner__classification {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ==========================================================================
   SHELL — rail + main grid
   ========================================================================== */

.file-shell {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .file-shell {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    align-items: start;
  }
}

/* ---- file index (nav) ---- */

.file-index {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-alt);
}
@media (min-width: 900px) {
  .file-index {
    border-bottom: none;
    border-right: 1px solid var(--rule);
    min-height: 100%;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
  }
}

.file-index__toggle summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.file-index__toggle summary::-webkit-details-marker { display: none; }
.file-index__toggle summary::marker { content: ""; }
.file-index__toggle summary::after {
  content: "▾";
  font-family: var(--font-mono);
  color: var(--teal);
  transition: transform 0.15s ease;
}
.file-index__toggle[open] summary::after { transform: rotate(180deg); }

@media (min-width: 900px) {
  /* Rail is always expanded on desktop; the disclosure control is
     disabled and re-labelled as a static section heading. */
  .file-index__toggle summary {
    pointer-events: none;
    padding: 1.1rem 1.25rem 0.6rem;
  }
  .file-index__toggle summary::after { content: ""; }
}

.file-index__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem;
  border-top: 1px solid var(--rule);
}
@media (min-width: 900px) {
  .file-index__list { border-top: none; }
}

.file-index__list li { border-top: 1px solid var(--rule); }
.file-index__list li:first-child { border-top: none; }

.file-index__list a {
  display: flex;
  gap: 0.6em;
  align-items: baseline;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
  border-left: 3px solid transparent;
}
.file-index__list a:hover {
  background: var(--teal-tint);
  color: var(--teal);
}
.file-index__list .rec-no {
  color: var(--teal);
  flex-shrink: 0;
}
.file-index__list li.is-current a {
  border-left-color: var(--teal);
  background: var(--teal-tint);
  font-weight: 600;
}

/* ---- main / record ---- */

.record {
  padding: 1.75rem 1.25rem 4rem;
}
@media (min-width: 900px) {
  .record { padding: 2.5rem 3rem 5rem; }
}

.record__stamp {
  border: 1px solid var(--ink);
  background: var(--bg-alt);
  max-width: var(--prose-max);
  margin: 0 0 2rem;
  padding: 0.9rem 1.1rem;
}
.record__stamp dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem 1.5rem;
}
.record__stamp div { display: block; }
.record__stamp dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.15rem;
}
.record__stamp dd {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.record__kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.5rem;
}

.record__header { max-width: var(--prose-max); }
.record__header h1 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
.record__standfirst {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin: 0;
  max-width: 56ch;
}

.redaction-rule {
  height: 10px;
  max-width: var(--prose-max);
  margin: 1.6rem 0 2rem;
  background-image: repeating-linear-gradient(
    90deg,
    var(--teal) 0, var(--teal) 22px,
    transparent 22px, transparent 28px
  );
}

.record__body { max-width: var(--prose-max); }

.record__section { margin: 0 0 2.25rem; }
.record__section h2 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.4rem;
  margin: 0 0 0.9rem;
  scroll-margin-top: 1rem;
}
.record__section h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 1.3rem 0 0.5rem;
}
.record__section p { margin: 0 0 1rem; }
.record__section ul,
.record__section ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.record__section li { margin: 0 0 0.4rem; }
.record__section a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.record__section strong { font-weight: 600; }

/* ---- callout (decision / note / warning) ---- */

.callout {
  border-left: 4px solid var(--teal);
  background: var(--bg-alt);
  padding: 0.9rem 1.1rem;
  margin: 0 0 2rem;
  max-width: var(--prose-max);
}
.callout__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.4rem;
}
.callout p:last-child { margin-bottom: 0; }

/* ---- template block (e.g. letter before action) ---- */

.template-block {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--bg-alt);
  border-left: 4px solid var(--teal);
  padding: 1.1rem 1.25rem;
  margin: 0;
  max-width: var(--prose-max);
  overflow-x: auto;
}

/* ---- numbered steps (only for genuine procedural sequences) ---- */

.steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  counter-reset: step;
  max-width: var(--prose-max);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.15rem 0 0.9rem 3.1rem;
  border-left: 1px solid var(--rule-strong);
  margin-left: 0.6rem;
}
.steps li:last-child { border-left-color: transparent; }
.steps li::before {
  content: "STEP " counter(step, decimal-leading-zero);
  position: absolute;
  left: -0.6rem;
  top: 0;
  transform: translateX(-100%);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--teal);
  background: var(--bg);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .steps li::before { position: static; display: block; transform: none; margin-bottom: 0.3rem; }
  .steps li { padding-left: 0.9rem; }
}

/* ---- fee / data table ---- */

.fee-table {
  width: 100%;
  max-width: var(--prose-max);
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.92rem;
}
.fee-table caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}
.fee-table th, .fee-table td {
  border: 1px solid var(--rule-strong);
  padding: 0.55rem 0.75rem;
  text-align: left;
}
.fee-table thead th {
  background: var(--bg-alt);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fee-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.015); }

/* ---- home page index grid ---- */

.index-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
  max-width: var(--prose-max);
}
.index-grid li {
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0;
}
.index-grid a {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.index-grid a:hover { color: var(--teal); }
.index-grid p {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.file-footer {
  border-top: 2px solid var(--teal);
  background: var(--bg-alt);
}
.file-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}
@media (min-width: 900px) {
  .file-footer__inner { padding: 1.75rem 3rem 2.25rem; }
}
.file-footer__classification {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.9rem;
}
.file-footer nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.file-footer nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
}
.file-footer nav a:hover { color: var(--teal); border-color: var(--teal); }
.file-footer__end {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
}
