/* ==========================================================================
   Bradawl · Conversion Check
   Night ground, amber as light, Newsreader for display and big numbers,
   IBM Plex for text and mono labels. Tokens from the approved night identity.
   ========================================================================== */

/* Self-hosted faces (SIL Open Font License, from the Fontsource OFL packages).
   Nothing is requested from a third party; the files sit beside this page and
   the licences are in the same folder. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 500;
  font-display: block;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --night: #15140F;
  --soot: #1E1A15;
  --raised: #27221B;
  --border: #2E2820;
  --border-soft: #26211A;
  --paper: #F5F2EB;
  --cream: #E9E0CF;
  --taupe: #A8A094;
  --graphite: #8C8882;
  --amber: #C8821A;
  --amber-light: #E2A14A;
  --deep-amber: #9A6212;
  --will-break: #E4584B;
  --resolved: #7FBF7F;

  --serif: "Newsreader";
  --sans: "IBM Plex Sans";
  --mono: "IBM Plex Mono";

  --radius: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --max: 1240px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(200, 130, 26, .32); color: var(--paper); }

a { color: var(--amber-light); }
a:hover { color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--amber-light);
  outline-offset: 3px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--night);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  border-radius: 4px;
}
.skip:focus { top: 16px; }

/* --------------------------------------------------------------------------
   The light in the room, and the faint grid
   -------------------------------------------------------------------------- */

.glow {
  position: fixed;
  z-index: 0;
  /* The screen's own width, never wider (a 900px box scrolled phones sideways, bradawl-0241); the same 450px light is
     painted at the same centre, 170px left of the middle, so wide screens look as before. */
  top: -520px;
  left: 0;
  right: 0;
  height: 900px;
  background: radial-gradient(circle 450px at calc(50% - 170px) 50%, rgba(200, 130, 26, .20), rgba(200, 130, 26, 0));
  pointer-events: none;
}

.grid-veil {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 242, 235, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 242, 235, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, .35) 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, .35) 70%, transparent);
  pointer-events: none;
}

.topbar, main, .footer { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Top bar and lock-up
   -------------------------------------------------------------------------- */

.topbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 40px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.mark {
  position: relative;
  display: inline-block;
  width: 72px;
  height: 14px;
  flex: none;
}
.mark .rule {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 2px;
  background: var(--paper);
}
.mark .point {
  position: absolute;
  left: 28px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 16px 4px rgba(200, 130, 26, .45);
}

.word {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -.01em;
  color: var(--paper);
}

.topbar-note {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--graphite);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Page furniture
   -------------------------------------------------------------------------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 40px 72px;
}

.eyebrow,
.eyebrow-sm {
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  margin: 0;
  color: var(--amber);
}
.eyebrow { font-size: 11.5px; letter-spacing: .15em; }
.eyebrow-sm { font-size: 10.5px; letter-spacing: .14em; }

.intro { padding-top: 58px; }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 64px;
  line-height: 1.04;
  letter-spacing: -.015em;
  color: var(--paper);
  margin: 16px 0 14px;
}

.strap {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.3;
  color: var(--paper);
  margin: 0 0 16px;
  max-width: 760px;
}

.works {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--taupe);
  margin: 0 0 22px;
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--cream);
  max-width: 720px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   The drop zone
   -------------------------------------------------------------------------- */

.check { margin-top: 34px; }

.drop {
  background: var(--soot);
  border: 1px dashed #3B342A;
  border-radius: var(--radius);
  padding: 24px 26px 22px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.drop.is-dragging {
  border-color: var(--amber);
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(200, 130, 26, .25), 0 0 34px rgba(200, 130, 26, .12);
}

.drop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.drop-head .num { color: var(--amber-light); margin-right: 4px; }

.file-chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--taupe);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.drop-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.25;
  color: var(--paper);
  margin: 16px 0 4px;
}

.drop-hint {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--taupe);
  margin: 0;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.btn:active { transform: translateY(1px); }
.btn-amber {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--night);
}
.btn-amber:hover { background: var(--amber-light); border-color: var(--amber-light); }
.btn-amber:disabled {
  background: transparent;
  border-color: #4A4035;
  color: var(--graphite);
  cursor: not-allowed;
}
.btn-quiet {
  background: transparent;
  border-color: #4A4035;
  color: var(--cream);
}
.btn-quiet:hover { background: var(--raised); border-color: var(--graphite); }

.link {
  background: none;
  border: 0;
  padding: 4px 2px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--amber-light);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}
.link:hover { color: var(--paper); }
.link.small { font-size: 12.5px; }

.error {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--will-break);
}

.drop-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.compact-name {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--cream);
  word-break: break-all;
}

.privacy {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--graphite);
  margin: 10px 0 0;
}

/* --------------------------------------------------------------------------
   Before the run
   -------------------------------------------------------------------------- */

.preface {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 20px;
  margin-top: 22px;
}
.preface-card {
  border-left: 1px solid var(--border);
  padding: 2px 0 2px 18px;
}
.plain-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.plain-list li {
  font-size: 14.5px;
  color: var(--cream);
  padding: 3px 0;
}
.plain-list li::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 1px;
  background: var(--amber);
  vertical-align: middle;
  margin-right: 10px;
}
.preface-date {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--cream);
  margin: 12px 0 6px;
}
.preface-small {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--taupe);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Reading: the point travels the rule
   -------------------------------------------------------------------------- */

.reading { margin-top: 38px; }
.rule-track {
  position: relative;
  height: 2px;
  background: var(--border);
  overflow: visible;
}
.rule-track .fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--deep-amber), var(--amber));
  transform: scaleX(0);
  transform-origin: left;
}
.reading.is-running .rule-track .fill {
  animation: reading-fill 1.45s var(--ease) forwards;
}
.rule-track .traveller {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 16px 5px rgba(200, 130, 26, .5);
}
.reading.is-running .rule-track .traveller {
  animation: travel 1.45s var(--ease) forwards;
}
.reading-count {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--taupe);
  margin: 14px 0 0;
}

@keyframes reading-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes travel {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: calc(100% - 10px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */

.results { margin-top: 42px; animation: rise .5s var(--ease) both; }

.pkg-line {
  display: flex;
  align-items: baseline;
  gap: 8px 18px;
  flex-wrap: wrap;
}
.pkg-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  color: var(--paper);
  margin: 0;
}
.pkg-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--taupe);
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.stat {
  background: var(--soot);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  position: relative;
  overflow: hidden;
  animation: rise .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--taupe);
  margin: 0 0 8px;
}
.stat-number {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 84px;
  line-height: .95;
  letter-spacing: -.02em;
  color: var(--paper);
  margin: 0;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-rule {
  display: block;
  height: 2px;
  background: var(--border);
  margin: 16px 0 12px;
  position: relative;
}
.stat-fill {
  position: absolute;
  inset: 0;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.15s var(--ease) .18s;
}
.stats.is-filled .stat-fill { transform: scaleX(1); }
.stat-caveat {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--taupe);
  margin: 0;
  min-height: 2.9em;
}
.stat[data-stat="needs-work"] .stat-number { color: var(--amber-light); }
.stat[data-stat="needs-work"] .stat-fill { background: var(--amber); }
.stat[data-stat="will-break"] .stat-number { color: var(--amber-light); }
.stat[data-stat="will-break"] .stat-fill { background: var(--amber); }
/* Held back until a real export confirms the format: neither cleared nor a finding. */
.stat[data-stat="unconfirmed"] .stat-number { color: var(--taupe); }
.stat[data-stat="unconfirmed"] .stat-fill { background: var(--graphite); }

.date-note {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--taupe);
  border-left: 2px solid var(--amber);
  padding: 2px 0 2px 12px;
  margin: 20px 0 0;
  max-width: 980px;
}

/* --------------------------------------------------------------------------
   The work area
   -------------------------------------------------------------------------- */

.work {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 18px;
  margin-top: 24px;
  align-items: start;
}

.panel {
  background: var(--soot);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tree-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tree-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 20px 16px;
}
.tree-view.is-returning { animation: tree-in .3s var(--ease) both; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  color: var(--paper);
  margin: 0;
}
.panel-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--graphite);
  margin: 0;
}

.legend {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--graphite);
  margin: 8px 0 14px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--graphite);
  vertical-align: 1px;
}
.legend .dot { margin: 0 6px 0 14px; }
.legend .dot:first-child { margin-left: 0; }
.dot.needs-work { background: var(--amber-light); box-shadow: 0 0 8px rgba(200, 130, 26, .4); }
.dot.will-break { background: var(--amber-light); box-shadow: 0 0 8px rgba(200, 130, 26, .4); }
.dot.aggregate { background: transparent; border: 1px solid var(--amber-light); }

.tree-scroll {
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #3B342A transparent;
}
.tree-scroll::-webkit-scrollbar { width: 8px; }
.tree-scroll::-webkit-scrollbar-thumb { background: #3B342A; border-radius: 4px; }

.tree, .tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree ul {
  margin-left: 15px;
  padding-left: 8px;
  border-left: 1px solid rgba(245, 242, 235, .065);
}

.node {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.node:hover { background: var(--raised); color: var(--paper); }
.node.is-folder { font-weight: 600; }
.node .glyph {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--graphite);
  display: inline-flex;
}
.node .glyph svg { width: 15px; height: 15px; display: block; }
.node.is-folder .glyph { color: var(--taupe); }
.node .label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node .chevron {
  width: 11px;
  height: 11px;
  flex: none;
  color: var(--graphite);
  transition: transform .25s var(--ease);
}
.node[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.node .dot { flex: none; }
.node .aggregate { opacity: .8; }

.tree-children {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s var(--ease);
}
.tree-children.is-closed { grid-template-rows: 0fr; }
.tree-children > ul { overflow: hidden; min-height: 0; }

.coursewide {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.coursewide .eyebrow-sm { color: var(--graphite); margin: 0 0 6px; }

/* --------------------------------------------------------------------------
   The drill-in detail
   -------------------------------------------------------------------------- */

.detail-view {
  padding: 22px 20px 20px;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #3B342A transparent;
}
.detail-view::-webkit-scrollbar { width: 8px; }
.detail-view::-webkit-scrollbar-thumb { background: #3B342A; border-radius: 4px; }

@keyframes detail-in {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}
.detail-view.is-in {
  animation: detail-in .36s var(--ease) both;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}
@keyframes tree-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

.detail-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.back {
  background: none;
  border: 0;
  padding: 4px 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--amber-light);
  cursor: pointer;
}
.back:hover { color: var(--paper); }
.detail-kind {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--graphite);
}
.detail-crumb {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--taupe);
  margin: 20px 0 4px;
}
.detail-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
  color: var(--paper);
  margin: 0 0 10px;
}
.detail-status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin: 0;
  color: var(--amber-light);
}
.detail-status .dot { margin-right: 7px; }

.finding-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.finding-block.is-marked {
  border-left: 2px solid var(--amber);
  padding-left: 14px;
  margin-left: -16px;
}
.finding-block + .finding-block { margin-top: 22px; }

.detail-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 6px;
}
.detail-label.second { margin-top: 18px; }
.detail-reason {
  font-size: 18px;
  line-height: 1.45;
  color: var(--cream);
  margin: 0;
}
.detail-finding-kind {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--amber-light);
}
.detail-fix {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--cream);
  margin: 0;
}
.detail-owner {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--paper);
  margin: 0;
}
.owner-note {
  font-weight: 400;
  color: var(--taupe);
  font-size: 13px;
}
.detail-extra {
  font-size: 13px;
  line-height: 1.6;
  color: var(--taupe);
  margin: 12px 0 0;
}
.detail-official {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--taupe);
  margin: 16px 0 0;
}
.detail-official strong {
  color: var(--amber-light);
  font-weight: 500;
}
.detail-found {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  color: var(--graphite);
  margin: 16px 0 0;
  word-break: break-word;
}
.detail-found span {
  display: block;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.detail-caveat {
  font-size: 12px;
  line-height: 1.6;
  color: var(--taupe);
  border-left: 1px solid var(--border);
  padding-left: 10px;
  margin: 14px 0 0;
}
.detail-clean {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.25;
  color: var(--resolved);
  margin: 22px 0 10px;
}
.detail-clean-note {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--cream);
  margin: 0;
}
.detail-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.nav-btn {
  background: transparent;
  border: 1px solid #4A4035;
  border-radius: 999px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 12px;
  cursor: pointer;
}
.nav-btn:hover { border-color: var(--amber); color: var(--amber-light); }

/* --------------------------------------------------------------------------
   The work list
   -------------------------------------------------------------------------- */

.findings-panel { padding: 22px 20px 20px; }

.findings-table-wrap { margin-top: 14px; }

table.findings {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
@media (min-width: 721px) {
  .findings th:nth-child(1), .findings td:nth-child(1) { width: 17%; }
  .findings th:nth-child(2), .findings td:nth-child(2) { width: 16%; }
  .findings th:nth-child(3), .findings td:nth-child(3) { width: 35%; }
  .findings th:nth-child(4), .findings td:nth-child(4) { width: 18%; }
  .findings th:nth-child(5), .findings td:nth-child(5) { width: 14%; }
}
.findings th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--taupe);
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.findings td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  overflow-wrap: break-word;
}
.cell-where {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--taupe);
}
.findings tbody tr {
  cursor: pointer;
  transition: background .15s;
  animation: row-in .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.findings tbody tr:hover,
.findings tbody tr:focus-within { background: var(--raised); }
.findings tbody tr:last-child td { border-bottom: 0; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cell-item .item-title {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
}
.cell-item .item-title:hover { color: var(--amber-light); }
.cell-item .where {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  color: var(--taupe);
  margin-top: 3px;
}
.cell-what {
  font-size: 13px;
  line-height: 1.45;
  color: var(--cream);
}
.cell-what .finding-kind {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  color: var(--amber-light);
}
.cell-what .fix-line {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--taupe);
}
.fix-k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-right: 5px;
}
.cell-owner {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cream);
}
.cell-owner .owner-note { display: block; margin-top: 2px; font-weight: 400; font-size: 11px; line-height: 1.4; }
.cell-status { white-space: nowrap; }
.status-pill {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber-light);
}
.status-pill .dot { margin-right: 6px; }

.findings tbody tr.is-marked { background: var(--raised); }
.findings tbody tr.is-marked td:first-child { box-shadow: inset 2px 0 0 var(--amber); }

.caption {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--graphite);
  margin: 14px 0 0;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.download-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--graphite);
  max-width: 240px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Notes, ask, foot
   -------------------------------------------------------------------------- */

.notes { margin-top: 22px; }
.notes h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  color: var(--paper);
  margin: 0 0 12px;
}
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.note-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.note-card h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cream);
  margin: 0 0 5px;
}
.note-card p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--taupe);
  margin: 0;
}
.note-card .note-flag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-light);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin: 0 0 7px;
}
.notes-grid-unconfirmed { margin-top: 14px; }
.notes-foot {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--graphite);
  margin: 10px 0 0;
}

.ask {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.35;
  color: var(--paper);
  margin: 38px 0 0;
}
.ask a { color: var(--amber-light); text-decoration: underline; text-underline-offset: 4px; }
.ask a:hover { color: var(--paper); }

.foot-cards {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  margin-top: 48px;
}
.foot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.foot-card p:not(.eyebrow-sm) {
  font-size: 13px;
  line-height: 1.65;
  color: var(--taupe);
  margin: 10px 0 0;
}
.signature-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  color: var(--paper) !important;
  margin: 8px 0 2px !important;
}
.signature-line { font-size: 11.5px !important; }

.sourcing {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--graphite);
  max-width: 900px;
  margin: 24px 0 0;
}

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 40px 42px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--taupe);
}
.footer .mark { width: 48px; height: 12px; }
.footer .mark .rule { top: 5px; }
.footer .mark .point { left: 18px; width: 12px; height: 12px; }
.footer .word { font-size: 16px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Width
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-number { font-size: 72px; }
}

@media (max-width: 960px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .tree-panel { position: static; max-height: none; }
  .tree-view { padding-bottom: 14px; }
  .total-panel { position: static; }
}

@media (max-width: 720px) {
  .topbar { padding: 20px 20px 4px; }
  main { padding: 0 20px 56px; }
  .footer { padding: 20px 20px 36px; }
  .intro { padding-top: 40px; }
  h1 { font-size: 44px; }
  .strap { font-size: 20px; }
  .lede { font-size: 15.5px; }
  .drop { padding: 20px 18px; }
  .drop-title { font-size: 20px; }
  .actions { gap: 10px; }
  .btn { width: 100%; }
  .actions .link { width: 100%; text-align: left; }
  .preface { grid-template-columns: 1fr; gap: 16px; }
  .stats { gap: 10px; }
  .stat { padding: 16px 16px 14px; }
  .stat-number { font-size: 54px; }
  .stat-label { font-size: 9.5px; }
  .stat-caveat { font-size: 11.5px; }
  .pkg-title { font-size: 24px; }
  .work { margin-top: 18px; gap: 14px; }
  .tree-view, .detail-view, .findings-panel { padding: 18px 16px 16px; }
  .panel-head h2 { font-size: 22px; }
  .notes-grid, .foot-cards { grid-template-columns: 1fr; }
  .ask { font-size: 21px; }
  .download-note { display: none; }
  .detail-title { font-size: 26px; }

  .findings thead { display: none; }
  .findings,
  .findings tbody,
  .findings tr,
  .findings td { display: block; width: 100%; }
  .findings tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 14px;
    margin-bottom: 10px;
  }
  .findings tbody tr:last-child { margin-bottom: 0; }
  .findings td { border: 0; padding: 4px 0; }
  .findings td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--graphite);
    margin-bottom: 2px;
  }
  .findings td.cell-item::before { display: none; }
  .findings td.cell-item { padding-bottom: 8px; }
  .findings tbody tr.is-marked td:first-child { box-shadow: none; }
  .findings tbody tr.is-marked { border-color: var(--amber); }
}

@media (max-width: 380px) {
  .stat-number { font-size: 46px; }
  h1 { font-size: 38px; }
}

/* --------------------------------------------------------------------------
   Reduced motion: the end state, at once
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .rule-track .fill { transform: scaleX(1); }
  .stat-fill { transform: scaleX(1); }
  .tree-children { transition: none; }
}

/* --------------------------------------------------------------------------
   Embed mode (?embed=1): the run-it-here view inside the Bradawl page.
   The surrounding page supplies the lock-up and footer, so the tool's own go;
   the invented package is already loaded and checked beneath the bar.
   -------------------------------------------------------------------------- */
.embed-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 32px 18px;
  border-bottom: 1px solid var(--border);
}
.embed-note {
  margin: 0;
  max-width: 58ch;
  color: var(--cream);
  font-size: 14px;
  line-height: 1.5;
}
.embed-tag {
  margin-right: 8px;
  color: var(--amber-light);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
}
.embed-bar .btn { padding: 12px 20px; font-size: 15px; }
body.is-embed .topbar { display: none; }
body.is-embed .footer { display: none; }
body.is-embed .embed-bar { display: flex; }
@media (max-width: 640px) {
  .embed-bar { padding: 16px 20px 14px; align-items: flex-start; }
  .embed-bar .btn { width: 100%; }
}

/* In the embed the example's result comes first: the host card already names
   the tool, so the tool's own heading goes and the work list sits under the
   bar. The input stays below for anyone replacing the example. */
body.is-embed main { display: flex; flex-direction: column; }
body.is-embed .embed-bar { order: -3; }
body.is-embed .results { order: -1; }
body.is-embed .intro,
body.is-embed .preface { display: none; }

/* Keep the input card below the result in the embed; "Use your own file"
   opens it without a trip through the page. */
body.is-embed .check { order: 2; }
