/* ==================================================================
   U of I × MindRouter App Gallery — shared styles
   Brand tokens from brand/starter.html (U of I Brand Book 2023)
   ================================================================== */

@font-face {
  font-family: "Public Sans";
  src: url("fonts/PublicSans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* primary palette — U of I Brand Book 2023 */
  --ui-pride-gold: #F1B300;   /* FILLS, accents, focus rings. Never body/headline text on white. */
  --ui-gold-ink:   #906900;   /* gold-family TEXT on white (5:1) — links, small labels */
  --ui-black:      #191919;
  --ui-steel:      #323232;
  --ui-silver:     #808080;
  --ui-white:      #FFFFFF;
  /* secondary palette — use for data/series colors, sparingly elsewhere */
  --ui-clearwater:  #008080;
  --ui-palouse:     #034441;
  --ui-lupine:      #5E48FF;
  --ui-huckleberry: #261882;
  --ui-raspberry:   #D7003F;
  --ui-garnet:      #7A0017;
  --ui-leather:     #AB4700;
  --ui-bark:        #552301;
  /* neutrals & surfaces */
  --bg:        #F6F5F1;
  --surface:   #FFFFFF;
  --surface-2: #EFEDE6;
  --line:      #DEDAD0;
  --text:      #191919;
  --text-2:    #4A4A4A;
  --muted:     #6B6B6B;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(25,25,25,.06), 0 8px 24px rgba(25,25,25,.07);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* categorical data palette (brand-derived) */
  --series-1: #008080; --series-2: #F1B300; --series-3: #5E48FF; --series-4: #D7003F;
  --series-5: #034441; --series-6: #AB4700; --series-7: #261882; --series-8: #808080;
  --t-fast: 150ms ease;
  --t-med: 220ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55;
       -webkit-font-smoothing: antialiased; font-size: 16px; }
img { max-width: 100%; height: auto; }
/* long unbroken text (URLs, paths, prompts) must wrap, never widen the layout */
p, li, dt, dd, td, th, blockquote, summary, figcaption { overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; }
pre { overflow-x: auto; }
/* grid/flex tracks can shrink below their content */
.panel, .hcard, .card, .toolbar__row, .ui-header__inner, .apphead,
.buildgrid > *, .panelcols > *, .harnesses__grid > *, .md-tablewrap, table { min-width: 0; }
.md { min-width: 0; }
.md pre { max-width: 100%; }
.md-tablewrap { overflow-x: auto; }
.round summary .round__kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a { color: var(--ui-gold-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #6e4f00; }
:focus-visible { outline: 3px solid var(--ui-pride-gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { letter-spacing: -.015em; line-height: 1.2; margin: 0 0 .5em; font-weight: 750; }
p { margin: 0 0 1em; }
code, pre, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; 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: -9999px; top: 0; z-index: 100;
  background: var(--ui-pride-gold); color: var(--ui-black);
  padding: 10px 16px; font-weight: 700; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- brand header (from starter.html, extended) ---------- */
.ui-header { background: var(--ui-black); color: #fff; border-bottom: 4px solid var(--ui-pride-gold); }
.ui-header__inner { max-width: 1320px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ui-header__brand { display: block; }
.uidaho-logo { height: 40px; width: auto; display: block; }
.ui-header__divider { width: 1px; align-self: stretch; background: rgba(255,255,255,.25); }
.ui-header__title { display: flex; flex-direction: column; min-width: 0; }
.ui-header__site { margin: 0; font-size: 1.1rem; font-weight: 750; letter-spacing: -.01em; color: #fff; font-family: inherit; }
.ui-header__crumb { margin: 0; font-size: .8rem; color: rgba(255,255,255,.72); }
.ui-header__meta { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ui-chip--status { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.ui-chip--status-ok { color: #9BE3A0; border-color: rgba(155,227,160,.4); }
.ui-chip--status-warn { color: #FFC9A3; border-color: rgba(255,201,163,.5); }
.ui-chip { font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px;
           border-radius: 999px; border: 1px solid rgba(255,255,255,.3); color: #fff; white-space: nowrap; }
.ui-chip--gold { background: var(--ui-pride-gold); color: var(--ui-black); border-color: var(--ui-pride-gold); }

/* ---------- site nav ---------- */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav__inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; }
.sitelink {
  display: inline-block; padding: 10px 14px; font-size: .875rem; font-weight: 600;
  color: var(--text-2); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.sitelink:hover { color: var(--text); }
.sitelink[aria-current="page"] { color: var(--text); border-bottom-color: var(--ui-pride-gold); }

/* ---------- page frame ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 32px 24px 64px; }
.small { font-size: .85rem; color: var(--muted); }

/* ---------- hero ---------- */
.hero { padding: 40px 0 8px; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero__text { max-width: 560px; min-width: 0; }
.hero__kicker {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ui-gold-ink); margin: 0 0 12px;
}
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; margin: 0 0 16px; }
.hero__lede { font-size: 1.02rem; color: var(--text-2); max-width: 52ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 0; }
.hero__collage { position: relative; height: 420px; min-width: 0; }
.hero__card {
  position: absolute; display: block; width: 62%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 10px 30px rgba(25,25,25,.14);
  text-decoration: none;
}
.hero__card img { display: block; width: 100%; height: auto; }
.hero__card span {
  display: block; padding: 9px 12px; font-size: .8rem; font-weight: 700; color: var(--text);
  background: var(--surface); border-top: 1px solid var(--line);
}
.hero__card--1 { top: 6%; left: 0; transform: rotate(-3.5deg); z-index: 1; }
.hero__card--1 span { display: none; } /* caption sits under the front card */
.hero__card--2 { top: 0; right: 0; width: 58%; transform: rotate(2.5deg); z-index: 2; }
.hero__card--3 { bottom: 0; left: 12%; transform: rotate(1.5deg); z-index: 3; }
@media (max-width: 980px) { .hero__inner { grid-template-columns: 1fr; } .hero__collage { display: none; } }

/* totals strip */
.totals-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  margin: 28px 0 0; padding: 0;
}
.totals-strip__item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  border-top: 4px solid var(--ui-pride-gold);
}
.totals-strip__item dt { font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.totals-strip__item dd { margin: 4px 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- toolbar / filters ---------- */
/* .galleryzone is the sticky boundary: it contains the chip toolbar,
   the compact pinned search bar (.pinbar) and the card grid. A sticky
   element only pins while its own parent box is on screen, so the
   pinbar is a direct child of this wrapper (not nested in .toolbar) —
   it pins exactly as long as the grid is visible and releases where
   the grid ends. */
.galleryzone { min-width: 0; }
.toolbar {
  margin: 8px -24px 0; padding: 6px 24px 8px;
}
/* compact pinned bar: search, sort, result count, "Clear filters".
   Opaque background so nothing washes through; at most ~52px tall. */
.pinbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  margin: 0 -24px; padding: 8px 24px;
  display: flex; gap: 10px; align-items: center;
  max-width: none; min-width: 0;
}
.toolbar__row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; max-width: 1272px; margin: 0 auto; min-width: 0; }
.toolbar__row + .toolbar__row { margin-top: 6px; }
/* chip row: small label in front of a single scrollable row of chips.
   The scroller is the flex child, so min-width: 0 lets it shrink below
   its content instead of widening the whole page. */
.chiprow { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.chiprow__label {
  font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; flex: 0 0 auto;
  /* all three rows share one label width, sized to the longest label
     ("Critic status"), so the first chip of every row starts at the
     same x; the generous size keeps every label on one line */
  flex-basis: 9.5em;
}
.chiprow__scroll { display: flex; gap: 8px; min-width: 0; flex: 1 1 auto; overflow-x: auto; padding-bottom: 2px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: .82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text-2); border: 1.5px solid var(--line);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.fchip:hover { border-color: var(--ui-gold-ink); color: var(--text); }
.fchip[aria-pressed="true"] {
  background: var(--ui-pride-gold); border-color: var(--ui-pride-gold); color: var(--ui-black);
}
.fchip__count {
  font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums;
}
.fchip[aria-pressed="true"] .fchip__count { background: rgba(25,25,25,.12); color: var(--ui-black); }
.searchbox { position: relative; flex: 1 1 260px; max-width: 420px; }
.searchbox__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input {
  width: 100%; font: inherit; font-size: .9rem; padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast);
}
.searchbox input:focus { border-color: var(--ui-gold-ink); outline: none; box-shadow: 0 0 0 3px rgba(241,179,0,.35); }
.sortbox select {
  font: inherit; font-size: .88rem; font-weight: 600; padding: 8px 34px 8px 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234A4A4A' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer;
}
.resultcount { margin: 0 0 0 auto; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
#clearfilters2 { font-weight: 650; white-space: nowrap; }
#clearfilters2[hidden] { display: none; }

/* ---------- card grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px; margin-top: 26px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.card:hover, .card:focus-within { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(25,25,25,.07), 0 16px 40px rgba(25,25,25,.12); }
.card.is-hidden { display: none; }
.card__shot { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.card__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block;
  transition: transform var(--t-med); }
.card:hover .card__shot img { transform: scale(1.025); }
.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
/* fixed height for both possible chip layouts (2 or 3 chips) so titles line up */
.card__chips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 46px; align-items: flex-start; }
.card__chips .chip { max-width: 100%; }
.card__statusbadge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface); color: #7A0017; border: 1px solid #F3B8B8;
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 1px 3px rgba(25,25,25,.18);
}
.chip {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.chip--status { background: #FDECEC; color: #7A0017; }
.chip--cat { background: var(--surface-2); color: var(--ui-steel); }
.chip--harness { background: #FFF4D6; color: var(--ui-gold-ink); }
.card__title { margin: 2px 0 0; font-size: 1.18rem; font-weight: 750; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a:hover { color: var(--ui-gold-ink); }
.card__subtitle { margin: 0; font-size: .88rem; color: var(--muted); font-style: italic; }
.card__blurb-label {
  margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); opacity: .85;
}
.card__blurb { margin: 2px 0 0; font-size: .88rem; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__actions { margin-top: auto; padding-top: 12px; display: flex; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: .92rem;
  padding: 11px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--ui-pride-gold); color: var(--ui-black); }
.btn--primary:hover { box-shadow: 0 6px 18px rgba(241,179,0,.4); color: var(--ui-black); }
.btn--ghost { background: var(--surface); color: var(--text-2); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ui-gold-ink); color: var(--ui-gold-ink); }
.btn--sm { padding: 8px 14px; font-size: .84rem; }

.spotchecks-more { margin: 4px 0 8px; }
.spotchecks-more summary { cursor: pointer; font-size: .88rem; font-weight: 650; color: var(--ui-gold-ink); }
.spotchecks-more summary:hover { color: #6e4f00; }
.spotchecks--more { margin-top: 8px; }
/* ---------- empty state ---------- */
.empty {
  text-align: center; padding: 72px 24px; color: var(--muted);
  border: 1.5px dashed var(--line); border-radius: var(--radius); margin-top: 26px;
  background: var(--surface);
}
.empty__title { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.empty .btn { margin-top: 10px; }

/* ---------- section heads ---------- */
.section-head { margin: 56px 0 20px; max-width: 720px; }
.section-head h2 { font-size: 1.6rem; }
.section-head p { color: var(--text-2); margin: 6px 0 0; }

/* ---------- harness cards ---------- */
.harnesses__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
@media (min-width: 1200px) { .harnesses__grid { grid-template-columns: repeat(5, 1fr); } }
.hcard__apps { display: flex; flex-direction: column; gap: 5px; }
.hcard__apps a { display: inline-block; }
.hcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border-left: 4px solid var(--ui-pride-gold);
}
.hcard__head { display: flex; align-items: baseline; gap: 10px; }
.hcard__head h3 { margin: 0; font-size: 1.15rem; }
.hcard__version { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.hcard__links { margin: 6px 0 10px; font-size: .85rem; }
.hcard__apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: .88rem; color: var(--text-2); }
.hcard__apps a { color: var(--ui-gold-ink); }
.hcard__label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.hcard__stats { display: flex; gap: 24px; margin: 4px 0 0; }
.hcard__stats div { display: flex; flex-direction: column; }
.hcard__stats dt { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hcard__stats dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- panels (app + about pages) ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.3rem; margin-bottom: 14px; }
.panel h4 { font-size: .95rem; margin: 22px 0 8px; font-weight: 750; }
.panel h4:first-of-type { margin-top: 0; }

.appblurb { font-size: 1.05rem; color: var(--text-2); max-width: 80ch; }

/* AI-written note badge */
.ai-note {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  color: var(--ui-gold-ink); background: #FFF4D6;
  border-radius: 999px; padding: 2px 9px; margin-left: 8px; white-space: nowrap;
}
.ai-note--inline { font-size: .66rem; }

/* app head */
.apphead { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 8px; }
.apphead__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.apphead__chip {
  font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ui-steel); border: 1px solid var(--line);
}
.apphead__chip--gold { background: #FFF4D6; color: var(--ui-gold-ink); border-color: #F3DfA0; }
.apphead__chip--status { border-color: var(--line); background: var(--surface); }
.apphead__chip--status-ok { color: #1E7A33; border-color: #BFE3C8; background: #F0FAF2; }
.apphead__chip--status-warn { color: #9A4B00; border-color: #F0CFA8; background: #FDF6EC; }
.apphead__title { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 800; margin: 0 0 6px; }
.apphead__subtitle { font-size: 1.05rem; color: var(--muted); font-style: italic; margin: 0 0 12px; }
.apphead__pitch { max-width: 68ch; color: var(--text-2); margin: 0; }
.apphead__actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }

/* screenshots */
.shots { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; margin: 28px 0; }
.shot { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot--desktop { display: block; }
.shot--desktop img { display: block; width: 100%; height: auto; }
.shot__tag {
  position: absolute; left: 10px; bottom: 10px;
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(25,25,25,.72); color: #fff; padding: 4px 10px; border-radius: 999px;
}
/* decorative browser chrome above the desktop screenshot (part of the
   lightbox trigger; hidden from assistive technology) */
.shot__frame {
  display: flex; align-items: center; gap: 10px;
  background: #E9E6DE; border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}
.shot__frame-dots { display: flex; gap: 5px; }
.shot__frame-dots span { width: 9px; height: 9px; border-radius: 50%; background: #C9C4B8; display: block; }
.shot__frame-pill {
  height: 12px; width: 46%; max-width: 320px; border-radius: 999px;
  background: rgba(25,25,25,.08);
}
.shot--phone { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.shot--phone .shot__tag { position: static; color: var(--muted); background: none; }
.shot__phone { display: block; }
.device {
  background: var(--ui-black); border-radius: 34px; padding: 10px;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255,255,255,.08);
  width: 230px;
}
.device__screen { border-radius: 26px; overflow: hidden; background: #fff; }
.device__screen img { display: block; width: 100%; height: auto; }
a.shot img { transition: filter var(--t-fast); }
a.shot:hover img { filter: brightness(1.04); }

/* "What it is" two-column body (wide screens) */
.whatis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 32px; align-items: start; }
.whatis__col h3:first-child { margin-top: 0; }
@media (max-width: 760px) {
  /* phone / small tablet: stack the two groups into one column in
     reading order (Try this, Highlights, Who it's for, Features) */
  .whatis { grid-template-columns: 1fr; gap: 8px; }
}

/* lists in panels */
.trythis, .hl, .features, .limits, .datasources, .rules { padding-left: 20px; margin: 0; }
.trythis li, .hl li, .features li, .limits li, .datasources li, .rules li { margin-bottom: 6px; }
.trythis { counter-reset: step; list-style: none; padding-left: 0; }
.trythis li { counter-increment: step; position: relative; padding-left: 36px; }
.trythis li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ui-pride-gold); color: var(--ui-black);
  font-weight: 800; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
}
.limits li { border-left: 3px solid var(--line); padding-left: 12px; margin-left: 4px; }

/* data spot checks */
.spotchecks { padding-left: 20px; margin: 0; }
.spotchecks li { margin-bottom: 6px; }

/* badges */
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 650; padding: 5px 12px; border-radius: 999px;
}
.badge small { font-weight: 500; opacity: .75; }
.badge--ok { background: #E4F2E9; color: #1B5E20; }
.badge--warn { background: #FDECEC; color: #7A0017; }

/* scores */
.scores { display: grid; gap: 8px; margin: 10px 0 18px; }
.score { display: grid; grid-template-columns: 110px 1fr 26px; gap: 10px; align-items: center; }
.score__label { font-size: .82rem; font-weight: 650; color: var(--text-2); text-transform: capitalize; }
.score__bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: block; }
.score__fill { display: block; height: 100%; border-radius: 999px; background: var(--ui-pride-gold); }
.score__num { font-size: .82rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }

/* build grid stats */
.buildgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.buildstat {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 2px;
}
.buildstat__num { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.buildstat__label { font-size: .74rem; color: var(--muted); }

.panelcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 8px; }

/* data tables */
.datatable { border-collapse: collapse; width: 100%; font-size: .88rem; }
.datatable th, .datatable td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.datatable th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.datatable .num { text-align: right; font-variant-numeric: tabular-nums; }
.md-tablewrap { overflow-x: auto; }
.md table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.md th, .md td { text-align: left; padding: 6px 10px; border: 1px solid var(--line); }
.md th { background: var(--surface-2); font-size: .78rem; }

/* expandable panels */
.expand { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.expand summary {
  cursor: pointer; list-style: none; padding: 12px 16px;
  font-weight: 700; font-size: .92rem; display: flex; align-items: center; gap: 8px;
}
.expand summary::-webkit-details-marker { display: none; }
.expand summary::before { content: "▸"; color: var(--ui-gold-ink); transition: transform var(--t-fast); font-size: .8rem; }
.expand[open] summary::before { transform: rotate(90deg); }
.expand .md { padding: 4px 16px 16px; }

/* markdown body */
.md { font-size: .92rem; color: var(--text-2); }
.md h2, .md h3, .md h4, .md h5, .md h6 {
  color: var(--text); font-size: 1.02rem; font-weight: 750;
  margin: 18px 0 8px; line-height: 1.3;
}
.md p { margin: 0 0 10px; }
.md pre {
  background: var(--ui-black); color: #F2EFE8; padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; font-size: .78rem; line-height: 1.5;
}
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .82em; color: var(--ui-steel); }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { border-left: 3px solid var(--ui-pride-gold); margin: 0 0 10px; padding: 4px 14px; color: var(--muted); background: #FFF9E8; border-radius: 0 8px 8px 0; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 10px; }
.md li { margin-bottom: 4px; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.md a { word-break: break-all; }

/* rounds timeline */
.rounds { list-style: none; margin: 14px 0 0; padding: 0; }
.round { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.round summary {
  display: grid; grid-template-columns: 34px 92px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 14px; cursor: pointer; list-style: none; font-size: .86rem;
  transition: background var(--t-fast);
}
.round summary::-webkit-details-marker { display: none; }
.round summary:hover { background: var(--bg); }
.round__num {
  font-family: var(--mono); font-weight: 700; font-size: .8rem;
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.round--build .round__num { background: #D7EDEB; color: var(--ui-palouse); }
.round--feedback .round__num { background: #EAE8FF; color: var(--ui-huckleberry); }
.round--continue .round__num { background: #FDE8EF; color: var(--ui-garnet); }
.round--critic .round__num { background: #FFF1D6; color: var(--ui-gold-ink); }
.round__kind { font-weight: 750; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.round__stats { font-family: var(--mono); font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.round__toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 700; color: var(--ui-gold-ink); white-space: nowrap;
}
.round summary:hover .round__toggle, .round summary:focus-visible .round__toggle { color: #6e4f00; }
@media (max-width: 640px) { .round__toggle-text { display: none; } }
.round__chevron { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface-2); color: var(--ui-gold-ink);
  transition: transform var(--t-fast), background var(--t-fast); text-align: center; }
.round summary:hover .round__chevron, .round summary:focus-visible .round__chevron { background: #FFF1C9; }
.round__chevron::before { content: "▸"; }
.round[open] .round__chevron { transform: rotate(90deg); }
.round__body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.round__meta { font-size: .85rem; margin: 12px 0 6px; }
.round__meta--dim { color: var(--muted); }
.round__prompt {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: .78rem; white-space: pre-wrap; word-break: break-word;
  max-height: 280px; overflow-y: auto; margin: 0;
}

/* prev / next */
.appnav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 18px; }
.appnav__link {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.appnav__link:hover { transform: translateY(-2px); border-color: var(--ui-gold-ink); }
.appnav__link--next { text-align: right; align-items: flex-end; }
.appnav__dir { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.appnav__name { font-weight: 750; font-size: 1rem; }
.backlink { margin-top: 4px; }

/* ---------- about page ---------- */
.about .panel h2 { font-size: 1.5rem; margin-bottom: 16px; }

/* six-step process strip */
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: flex; flex-wrap: wrap; gap: 10px 0;
}
.step {
  position: relative; flex: 1 1 150px; min-width: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 30px 12px 14px; margin-right: 26px;
}
.step::before {
  content: counter(step); counter-increment: step;
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ui-pride-gold); color: var(--ui-black);
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step:not(:last-child)::after {
  content: "→"; position: absolute; right: -21px; top: 50%;
  transform: translateY(-50%);
  color: var(--ui-gold-ink); font-weight: 800; font-size: .95rem;
}
.step__name { display: block; font-size: .85rem; font-weight: 750; margin-bottom: 2px; padding-right: 20px; }
.step__cap { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; }
.about .datatable a { white-space: nowrap; }
.about .datatable { table-layout: auto; }
.about .datatable th, .about .datatable td { text-align: left; }
.about .datatable .hname {
  font-size: 1rem; font-weight: 750; letter-spacing: normal; text-transform: none;
  color: var(--text); white-space: nowrap; text-align: left;
}
.about .datatable th.num { text-align: right; font-variant-numeric: tabular-nums; }
.about .datatable td.num { text-align: right; font-family: var(--mono); font-size: .9rem; font-variant-numeric: tabular-nums; }
.about .datatable .appmini { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.about__head { margin: 8px 0 24px; max-width: 820px; }
.about__head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; margin-bottom: 10px; }
.about__lede { font-size: 1.05rem; color: var(--text-2); }

/* ---------- footer ---------- */
.ui-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .8rem; margin-top: 40px; }
.ui-footer__inner {
  max-width: 1320px; margin: 0 auto; padding: 18px 24px;
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center;
}
.ui-footer a { color: var(--ui-gold-ink); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(25,25,25,.88);
  display: flex; align-items: center; justify-content: center; padding: 24px 24px 72px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1400px, 100%); width: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 116px); width: auto; height: auto;
  object-fit: contain; border-radius: 8px; box-shadow: 0 20px 80px rgba(0,0,0,.5); }
.lightbox figcaption { color: #fff; text-align: center; padding-top: 10px; font-size: .9rem; }
.lightbox__close {
  position: absolute; top: 14px; right: 18px;
  background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 50%;
  width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; cursor: pointer;
  transition: background var(--t-fast);
}
.lightbox__close:hover { background: rgba(255,255,255,.28); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .shots { grid-template-columns: 1fr; }
  .shot--phone { align-self: flex-start; }
  .apphead { grid-template-columns: 1fr; align-items: start; }
  .apphead__actions { flex-direction: row; }
}
@media (max-width: 640px) {
  /* about harness table -> stacked cards, each label on its own line above the value */
  .about .md-tablewrap { overflow: visible; }
  .about .datatable { width: 100%; }
  .about .datatable thead, .about .datatable tbody,
  .about .datatable th, .about .datatable td { display: block; min-width: 0; width: 100%; }
  .about .datatable thead { display: none; }
  .about .datatable tr { display: block; width: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; box-sizing: border-box; }
  .about .datatable th, .about .datatable td { text-align: left; border: none; border-bottom: 1px solid var(--line); padding: 8px 14px; width: 100%; box-sizing: border-box; overflow-wrap: break-word; }
  .about .datatable td.num { text-align: left; }
  .about .datatable tr > *:last-child { border-bottom: none; }
  .about .datatable .hname { font-size: 1.05rem; background: var(--surface-2); }
  .about .datatable td { position: relative; padding-left: 14px; padding-top: 12px; }
  .about .datatable td::before {
    position: absolute; left: 14px; top: 2px;
    font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  }
  .about .datatable td:nth-of-type(1)::before { content: "Version"; }
  .about .datatable td:nth-of-type(2)::before { content: "Official site"; }
  .about .datatable td:nth-of-type(3)::before { content: "Rounds"; }
  .about .datatable td:nth-of-type(4)::before { content: "Hours"; }
  .about .datatable td:nth-of-type(5)::before { content: "Apps it built"; }
  .about .datatable td .appmini { margin: 6px 0 0; padding-left: 0; }
  /* compact phone header: logo + site title on one row, crumb hidden */
  .ui-header__divider { display: none; }
  .ui-header__meta { margin-left: 0; }
  .ui-header__inner { flex-wrap: nowrap; padding: 8px 14px; gap: 12px; }
  .ui-header__title { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
  .ui-header__site { font-size: .9rem; }
  .ui-header__crumb { display: none; }
  .uidaho-logo { height: 30px; }
  .site-nav__inner { padding: 0 14px; }
  .sitelink { padding: 8px 10px; font-size: .84rem; }
  .page { padding: 20px 14px 48px; }
  .hero { padding: 20px 0 4px; }
  .toolbar { margin: 8px -14px 0; padding: 6px 14px 8px; }
  /* the three chip groups stack vertically: one group per line, each group
     exactly as wide as the toolbar content box (flex basis 100% +
     flex-wrap), label in front, chips scrolling sideways inside the group.
     Every flex ancestor is allowed to shrink below its content width. */
  .toolbar__row { flex-wrap: wrap; gap: 8px; }
  .chiprow { flex: 0 0 100%; min-width: 0; }
  .chiprow__scroll { flex: 1 1 auto; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fchip { white-space: nowrap; flex: 0 0 auto; padding: 5px 10px; font-size: .78rem; }
  .pinbar { position: static; margin: 0 -14px; padding: 8px 14px; flex-wrap: wrap; row-gap: 8px; }
  /* search takes the full first line; sort, clear and count share the second */
  .searchbox { flex: 1 1 100%; max-width: none; min-width: 0; }
  .resultcount { margin-left: auto; width: auto; white-space: nowrap; }
  .shot__frame { display: none; }
  .panel { padding: 18px 16px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .appnav { grid-template-columns: 1fr; }
  .appnav__link--next { text-align: left; align-items: flex-start; }
  .round summary { grid-template-columns: 34px 1fr 40px; }
  .round__stats { display: block; grid-column: 2 / 3; grid-row: 2;
    white-space: normal; overflow: visible; text-overflow: clip; font-size: .7rem; }
  .score { grid-template-columns: 92px 1fr 26px; }
  .ui-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .card:hover, .card:focus-within { transform: none; }
  .card:hover .card__shot img { transform: none; }
}

/* ---------- long content must never widen the page ---------- */
p, li, dt, dd, th, td, blockquote, summary, figcaption { overflow-wrap: break-word; }
code { overflow-wrap: anywhere; }
pre { overflow-x: auto; max-width: 100%; }
.panel, .card, .hcard, .round, .apphead, .apphead__text, .apphead__actions, .shots, .galleryzone,
.pinbar, .pinbar > *, .toolbar__row--chips,
.shots > *, .buildstat, .score, .badges, .badge, .searchbox, .sortbox,
.whatis, .whatis__col,
.hero__inner > *, .ui-header__inner > *, .toolbar__row > *, .ui-footer__inner > *, .chiprow,
hcard, .hcard__stats > * { min-width: 0; }
.md { min-width: 0; }
.md pre, .round__prompt { max-width: 100%; }
.md-tablewrap { overflow-x: auto; max-width: 100%; }
/* identifiers in table cells (file names, site numbers, parameter codes)
   must never break mid-word; long URLs may still wrap */
.md table code { overflow-wrap: normal; }
.md table td { word-break: normal; }
.md table td a { overflow-wrap: anywhere; }
