/* Arklive design tokens.
   Ledger paper: pale rule lines, deep teal for anything held, copper for
   anything to watch, brick for anything wrong.
   Every tool imports this first. Don't redefine these locally — extend them. */

:root{
  /* surface */
  --paper:      #F1F3EE;
  --paper-alt:  #E7EBE5;
  --paper-card: #FFFFFF;
  --rule:       #C1CFC9;

  /* ink */
  --ink:        #14211D;
  --ink-soft:   #55675F;
  --ink-lift:   #24352E;   /* pressed/hover state of an ink surface */

  /* semantic — these carry meaning, not decoration.
     seal  = locked, healthy, constrained
     amber = watch it
     flag  = free to move, thin, broken, wrong

     Measured against every surface these sit on — paper, card and paper-alt.
     Worst case of the three, all clearing WCAG AA (4.5:1) for body text:
     seal 8.1:1 · amber 4.6:1 · flag 5.9:1 · ink 13.8:1 · ink-soft 5.0:1
     Amber is the tight one: it was drawn a shade deeper than a display
     copper so it still passes on paper-alt. Lighten it and it fails. */
  --seal:       #0F4C4A;
  --amber:      #945B0A;
  --flag:       #A32C1C;

  /* type */
  --font-display: "IBM Plex Sans Condensed", system-ui, sans-serif;
  --font-body:    "IBM Plex Serif", Georgia, serif;
  --font-data:    "IBM Plex Mono", ui-monospace, monospace;

  /* scale */
  --pad:      clamp(16px, 3vw, 34px);
  --gap:      14px;
  --rule-w:   1px;
}

/* ── ROLLBACK ──────────────────────────────────────────────────────────
   Everything replaced in the refresh is kept below, inert, behind an
   attribute. To restore the original look, add the attribute to the <html>
   tag of any page — nothing else needs touching:

     <html lang="en" data-palette="legacy">   original navy / oxblood
     <html lang="en" data-layout="legacy">    pre-bento mobile stacking

   Both may be set at once. Remove the attribute to return to current.
   The layout rollback lives with the layout rules it undoes: in this file
   at the foot, and in each tool's own <style> block.
   ──────────────────────────────────────────────────────────────────── */
:root[data-palette="legacy"]{
  --paper:      #F2F4EF;
  --paper-alt:  #E9EDE5;
  --paper-card: #FFFFFF;
  --rule:       #C3D0C0;

  --ink:        #1B2A24;
  --ink-soft:   #5A6B62;
  --ink-lift:   #2E4238;

  --seal:       #1F4B7A;
  --amber:      #8A6A12;
  --flag:       #8C2A1E;
}

*{ box-sizing: border-box }
html,body{ margin:0; padding:0 }

body{
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* nothing should ever push the page sideways */
  overflow-x: hidden;
}

.wrap{ max-width: 1180px; margin: 0 auto; padding: var(--pad) }

/* eyebrow / section labels */
.eyebrow{
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

h2.sec{
  font-size: 12px;
  font-family: var(--font-data);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: var(--rule-w) solid var(--ink);
  padding-bottom: 6px;
  margin: 34px 0 14px;
}

/* controls */
input[type=text],input[type=number],select{
  font-family: var(--font-data);
  font-size: 13px;
  padding: 9px 10px;
  border: var(--rule-w) solid var(--rule);
  background: var(--paper-card);
  color: var(--ink);
  border-radius: 0;
  width: 100%;
}
input:focus,select:focus{ outline: 2px solid var(--seal); outline-offset: -1px }

button{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border: var(--rule-w) solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background .12s;
}
button:hover{ background: var(--ink-lift) }
button:focus-visible{ outline: 2px solid var(--seal); outline-offset: 2px }
button.ghost{ background: transparent; color: var(--ink) }
button.ghost:hover{ background: var(--rule) }
button:disabled{ opacity: .45; cursor: not-allowed }

label{
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hint{
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 0;
  max-width: 80ch;
}
.hint code{
  font-family: var(--font-data);
  font-size: 12px;
  background: var(--paper-card);
  padding: 1px 4px;
  border: var(--rule-w) solid var(--rule);
}

a{ color: var(--seal) }

/* semantic value colouring — consistent across every tool */
.v-bad { color: var(--flag);  font-weight: 600 }
.v-warn{ color: var(--amber); font-weight: 600 }
.v-good{ color: var(--seal);  font-weight: 600 }
.v-dim { color: var(--ink-soft) }

.legend{
  display: flex; flex-wrap: wrap; gap: 16px;
  font-family: var(--font-data);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 14px;
}
.legend span::before{
  content:''; display:inline-block; width:9px; height:9px;
  margin-right:6px; vertical-align:middle;
}
.legend .lg::before{ background: var(--seal) }
.legend .lw::before{ background: var(--amber) }
.legend .lb::before{ background: var(--flag) }

/* data tables */
table.ledger{
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
table.ledger th{
  text-align: left;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500;
  padding: 6px 10px 6px 0;
  border-bottom: var(--rule-w) solid var(--ink);
}
table.ledger td{
  padding: 5px 9px 5px 0;
  border-bottom: var(--rule-w) solid var(--rule);
  vertical-align: top;
  /* break only where a line would otherwise overflow, not every character */
  overflow-wrap: anywhere;
}
table.ledger td.num, table.ledger th.num{
  text-align: right; padding-right: 0; white-space: nowrap;
}
table.ledger tr:nth-child(even) td{ background: rgba(193,207,201,.20) }

/* A wide table stays a table on a narrow screen — it scrolls sideways in its
   own box rather than being crushed. Wrap one in .scrollx to opt in. */
.scrollx{ overflow-x: auto; -webkit-overflow-scrolling: touch }
.scrollx > table{ min-width: 520px }

/* panels */
.panel{
  background: var(--paper-alt);
  border: var(--rule-w) solid var(--rule);
  padding: 16px;
  margin-bottom: 20px;
}
.row{ display:flex; flex-wrap:wrap; gap: var(--gap); align-items: flex-end }
.field{ display:flex; flex-direction:column; gap:5px; flex:1 1 240px; min-width:0 }

.empty{
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-soft);
  border: 1px dashed var(--rule);
  padding: 22px; text-align: center; font-size: 14px;
}

.status{
  font-family: var(--font-data);
  font-size: 11.5px; color: var(--ink-soft);
  margin: 0 0 12px; min-height: 17px;
}

/* the finding stamp — Arklive's signature element.
   A verdict in plain language, stamped like a clerk approved it. */
.stamp{
  display: inline-block;
  font-family: var(--font-data);
  font-size: 11px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  border: 1.5px solid currentColor;
  padding: 4px 9px; margin-bottom: 9px;
  transform: rotate(-1.1deg);
}

@media (prefers-reduced-motion: reduce){ *{ transition: none !important } }

@media (max-width: 620px){
  .stamp{ transform: none }
  /* touch targets: a 10px button is not tappable */
  button{ min-height: 44px }
  .row{ gap: 10px }
}
