/* ──────────────────────────────────────────────────────────────────────────
   DND — The Lens (/lens.html)

   What the desk covers: three subjects read as vocabularies over every
   story, twelve desks with their own arcs and words, and the evidence
   behind each digest.

   House rules: 4px grid, radius 0, no shadow, no blur, depth by surface
   colour only, every number that changes in tabular mono, uppercase
   display labels with wide letter-spacing, and no region that earns its
   space by being empty.
   ────────────────────────────────────────────────────────────────────────── */

.ln-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--s5) var(--s4) var(--s8);
}

/* ── masthead ───────────────────────────────────────────────────────── */

.ln-mast {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--s6) var(--s7);
  align-items: start;
  margin-bottom: var(--s5);
}
.ln-mast h1 {
  font-family: var(--font-display);
  font-size: var(--size-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s3);
}
.ln-lede {
  font-size: var(--size-body);
  line-height: 1.55;
  color: var(--text-1);
  max-width: 60ch;
  margin: 0;
}
.ln-lede b { color: var(--text); font-weight: 600; }
.ln-stamp {
  font-family: var(--font-mono);
  font-size: var(--size-caption);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  margin-top: var(--s3);
  max-width: 62ch;
}

.ln-thesis {
  border-left: 4px solid var(--accent);
  padding-left: var(--s3);
  margin: var(--s4) 0 0;
}
.ln-thesis p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.42;
  color: var(--text);
  letter-spacing: -0.005em;
  max-width: 56ch;
}
.ln-thesis em { font-style: normal; color: var(--accent-ink); }
.ln-thesis-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s2);
}

/* ── panels ─────────────────────────────────────────────────────────── */

.ln-panel {
  border-top: 2px solid var(--line-2);
  padding-top: var(--s3);
  margin-bottom: var(--s6);
  min-width: 0;
}
.ln-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s1);
}
.ln-panel h2 {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s2);
}
.ln-q {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 0 var(--s4);
  max-width: 78ch;
}
.ln-q strong { color: var(--text-1); font-weight: 600; }
.ln-q b { color: var(--text-1); font-weight: 600; }

.ln-section-title {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: var(--s6) 0 var(--s3);
  border-bottom: 2px solid var(--line-2);
  padding-bottom: var(--s2);
}

.ln-subject { margin-bottom: var(--s6); }
.ln-sub-head { margin-bottom: var(--s4); }
.ln-sub-head h2 { margin-bottom: var(--s2); }
.ln-sub-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s2);
  padding-bottom: var(--s1);
  border-bottom: 1px solid var(--line);
}

/* Two subjects side by side. align-items:start so the shorter panel
   does not carry the space its neighbour needs. */
.ln-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6) var(--s5);
  align-items: start;
}
.ln-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}

/* ── charts ─────────────────────────────────────────────────────────── */

.ln-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ln-chart text { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ln-axis { fill: var(--text-2); font-size: 10px; letter-spacing: 0.08em; }
.ln-axis-dim { fill: var(--text-3); opacity: 0.7; }
.ln-value { font-size: 11px; font-weight: 600; }
.ln-gridline { stroke: var(--line); stroke-width: 1; }
.ln-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ln-dot { stroke: none; }
.ln-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s4);
  margin-top: var(--s3);
  font-size: 0.78rem;
  color: var(--text-2);
}
.ln-legend span { display: inline-flex; align-items: center; gap: var(--s1); }
.ln-legend-note { color: var(--text-3); }
.ln-key {
  width: 18px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
  border-top-color: var(--text-3);
  display: inline-block;
}
.ln-spark { width: 128px; height: 28px; display: block; }

/* ── the finding under a chart ──────────────────────────────────────── */

.ln-finding {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-1);
  margin: var(--s4) 0 0;
  max-width: 86ch;
}
.ln-finding strong { color: var(--accent-ink); font-weight: 600; }
.ln-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-3);
  margin: var(--s3) 0 0;
  max-width: 92ch;
}
.ln-note b { color: var(--text-2); font-weight: 600; }
.ln-boundary {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-2);
  margin: var(--s4) 0 0;
  max-width: 92ch;
  border-left: 2px solid var(--line);
  padding-left: var(--s3);
}
.ln-boundary a { color: var(--text-1); }

/* ── tables ─────────────────────────────────────────────────────────── */

.ln-check { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.78rem; }
.ln-check th {
  text-align: left;
  font-weight: 400;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 var(--s2) var(--s1) 0;
  border-bottom: 1px solid var(--line-2);
}
.ln-check td {
  padding: var(--s1) var(--s2) var(--s1) 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ln-check td:first-child { text-align: left; }
.ln-check td:nth-child(2),
.ln-check td:nth-child(3) { text-align: right; }
.ln-check tr:last-child td { border-bottom: 0; }
.ln-dim td { color: var(--text-3); }
.ln-dotmark {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--s2);
  vertical-align: baseline;
}

/* ── the desk table ─────────────────────────────────────────────────── */

.ln-desks { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.76rem; }
.ln-desks th {
  text-align: left;
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 var(--s2) var(--s1) 0;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.ln-desks td {
  padding: var(--s2) var(--s2) var(--s2) 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.ln-desks tr:last-child td { border-bottom: 0; }
.ln-desk-name {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
}
.ln-desk-arc { width: 128px; }
.ln-desk-sig { white-space: normal; }
.ln-sig {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-2);
  margin-right: var(--s3);
  white-space: nowrap;
}
.ln-sig b { color: var(--text); font-weight: 600; }
.ln-sig-none { color: var(--text-3); }
.ln-glyph { color: var(--text-2); margin-right: var(--s2); }

/* ── lists ──────────────────────────────────────────────────────────── */

.ln-list { display: flex; flex-direction: column; }
/* The name takes its own width, the bar takes the slack, the count sits at
   the right edge. A bar pinned to the far right of a wide row reads as
   belonging to no row at all. */
.ln-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}
.ln-row:last-child { border-bottom: 0; }
.ln-row-k {
  font-size: 0.85rem;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ln-row-bar { height: 8px; background: var(--bg-3); position: relative; min-width: 0; }
.ln-row-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); display: block; }
.ln-row-n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: right;
  white-space: nowrap;
}

.ln-quotes { list-style: none; margin: 0; padding: 0; }
.ln-quotes li {
  border-left: 2px solid var(--line);
  padding-left: var(--s3);
  margin-bottom: var(--s2);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-1);
}
.ln-quotes a { color: var(--text-1); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.ln-quotes a:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.ln-qcount {
  font-size: 0.85rem;
  color: var(--text-2);
  margin: 0 0 var(--s3);
  line-height: 1.5;
}
.ln-qcount strong { color: var(--text); font-family: var(--font-mono); }
.ln-misses { list-style: none; margin: 0; padding: 0; }
.ln-audit { margin-top: var(--s5); }
.ln-misses li {
  border-left: 2px solid var(--line);
  padding-left: var(--s3);
  margin-bottom: var(--s2);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-1);
}
.ln-miss-why { color: var(--text-3); font-size: 0.78rem; }

/* ── the desk's own economics label ─────────────────────────────────── */

.ln-econ {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}
.ln-econ-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: var(--s5);
}
.ln-econ-list li {
  break-inside: avoid;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text-1);
}
.ln-econ-list a { color: var(--text-1); text-decoration: none; }
.ln-econ-list a:hover { color: var(--accent-ink); }
.ln-econ-date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  color: var(--text-3);
  margin-right: var(--s2);
}

/* ── the evidence layer ─────────────────────────────────────────────── */

.ln-ev-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--s6);
  align-items: start;
}
.ln-stats { display: flex; flex-direction: column; gap: var(--s3); margin: 0; }
.ln-stat { border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.ln-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.ln-stat dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s1);
}
.ln-stat dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--text);
}
.ln-stat dd small {
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.ln-ev-list { list-style: none; margin: 0; padding: 0; }
.ln-ev-list li {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}
.ln-ev-list li:last-child { border-bottom: 0; }
.ln-ev-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-1);
}
.ln-ev-src {
  margin: var(--s1) 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
}
.ln-ev-src a { color: var(--text-2); text-decoration: none; }
.ln-ev-src a:hover { color: var(--accent-ink); }

/* ── the method ─────────────────────────────────────────────────────── */

.ln-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5) var(--s6);
  align-items: start;
}
.ln-method-subject { min-width: 0; }
.ln-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0 0 var(--s1);
  word-spacing: 0.1em;
}
.ln-mono-dim { color: var(--text-3); }

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .ln-mast { grid-template-columns: 1fr; gap: var(--s4); }
  .ln-two, .ln-split, .ln-econ, .ln-ev-grid, .ln-method-grid { grid-template-columns: 1fr; }
  .ln-econ-list { columns: 1; }
}

@media (max-width: 760px) {
  .ln-page { padding: var(--s4) var(--s3) var(--s7); }
  .ln-mast h1 { font-size: 2.4rem; }
  .ln-panel { margin-bottom: var(--s5); }
  .ln-check { font-size: 0.72rem; }
  .ln-desk-name { font-size: 0.8rem; }

  /* The desk table has eight columns and a phone has 366 of them. It
     becomes a stack: the desk's name on its own line, then its numbers
     wrapped under it, each with the label it lost from the header. */
  .ln-desks, .ln-desks tbody, .ln-desks tr { display: block; }
  .ln-desks thead { display: none; }
  .ln-desks tr {
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1) var(--s3);
    align-items: baseline;
  }
  .ln-desks tr:last-child { border-bottom: 0; }
  .ln-desks td {
    display: block;
    border: 0;
    padding: 0;
    font-size: 0.74rem;
    color: var(--text-2);
  }
  .ln-desks td::before {
    content: attr(data-l) " ";
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
  }
  .ln-desks td.ln-desk-name::before { content: none; }
  .ln-desks td.ln-desk-arc::before { content: none; }
  .ln-desk-name {
    flex: 1 0 100%;
    font-size: 0.95rem;
    color: var(--text);
  }
  .ln-desk-arc { flex: 0 0 auto; }
  .ln-desk-sig { flex: 1 0 100%; margin-top: var(--s1); }
  .ln-desk-sig::before { display: block; margin-bottom: 4px; }

  /* On a phone the bar goes under its own label rather than being
     squeezed into a column too narrow to read. */
  .ln-row { grid-template-columns: max-content minmax(0, 1fr) auto; }
  .ln-row-k { white-space: normal; }
}

/* The charts come in two geometries. A 940-unit-wide viewBox scaled into
   a 342px phone renders its 10px labels at 4px, so the chart is drawn
   twice — once wide, once compact — and the CSS picks one. */
.ln-chart-compact { display: none; }

@media (max-width: 760px) {
  .ln-chart-wide { display: none; }
  .ln-chart-compact { display: block; }
}
