/* Henlabs V2 · Flock view: landing, loading, today, Hens and the Hen sheet. */

/* --------------------------------------------------------------- Landing -- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: 40px;
  padding: 56px 0 24px;
}

.hero-copy .lookup { margin-top: 32px; }

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
}

.hero-blob {
  position: absolute;
  inset: 6% 6% 4% 10%;
  border: 3px solid var(--ink);
  border-radius: 46% 54% 52% 48% / 52% 44% 56% 48%;
  background:
    radial-gradient(60% 60% at 30% 25%, rgba(255, 255, 255, .45), transparent 70%),
    var(--sky);
  box-shadow: 0 8px 0 var(--ink);
}

.hero-hen {
  position: relative;
  width: min(62%, 290px);
  filter: drop-shadow(0 26px 30px rgba(14, 14, 18, .22));
  animation: bob 5s ease-in-out infinite alternate;
}

.float {
  position: absolute;
  display: grid;
  gap: 2px;
  min-width: 156px;
  padding: 12px 16px;
  border: 2px solid var(--sticker-line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
}
.float span { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.float strong { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.float-a { top: 8%; left: 0; transform: rotate(-3deg); }
.float-b { top: 44%; right: -8px; transform: rotate(2.5deg); }
.float-c { bottom: 5%; left: 8%; transform: rotate(-1.5deg); }
.float-b strong { color: var(--fuchsia-ink); }

/* Three numbered steps: how Henlabs is used, each a way in. */
.how { margin-top: 40px; }
.how-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; }
.how-step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  min-height: 210px;
  padding: 24px 26px 26px;
  border: 2px solid var(--card-line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.how-list li:nth-child(1) .how-step { background: linear-gradient(160deg, var(--good-bg), var(--surface) 70%); }
.how-list li:nth-child(2) .how-step { background: linear-gradient(160deg, var(--warn-bg), var(--surface) 70%); }
.how-list li:nth-child(3) .how-step { background: linear-gradient(160deg, var(--info-bg), var(--surface) 70%); }
.how-step:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--sticker-drop); }
.how-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--gloss), var(--lime);
  box-shadow: 0 2px 0 var(--ink);
  color: #0e0e12;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--fs-ui);
}
.how-list li:nth-child(2) .how-num { background: var(--gloss), #ff6fbb; }
.how-list li:nth-child(3) .how-num { background: var(--gloss), var(--sky); }
.how-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
}
.how-title .i { width: 19px; height: 19px; transition: transform .25s var(--ease); }
.how-step:hover .how-title .i { transform: translateX(3px); }
.how-text { max-width: calc(100% - 100px); color: var(--muted); font-size: var(--fs-ui); }
.how-step img {
  position: absolute;
  right: -6px;
  bottom: -10px;
  width: 112px;
  transition: transform .3s var(--ease);
}
.how-step:hover img { transform: rotate(-4deg) translateY(-4px); }

/* --------------------------------------------------------------- Loading -- */

.loading-card {
  display: grid;
  justify-items: center;
  max-width: 520px;
  margin: 56px auto 0;
  text-align: center;
}
.loading-card img { width: 104px; margin-bottom: 18px; }
.loading-card .kicker { margin-bottom: 4px; }
.loading-card .muted { margin-top: 8px; min-height: 1.5em; }
.loading-card .fineprint { max-width: 26em; }

/* ----------------------------------------------------------------- Today -- */

.address-title { display: flex; align-items: center; gap: 8px; }
/* One plain-words line on how weight and claims work, for anyone new. */
.flock-explain { max-width: 60ch; margin-top: 10px; color: var(--muted); font-size: var(--fs-ui); line-height: 1.5; }

.today {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "main clock hen"
    "actions actions actions";
  align-items: center;
  gap: 22px 36px;
  padding: 34px 34px 24px;
  overflow: hidden;
}
.today-main { grid-area: main; min-width: 0; }
.today .mega { margin: 10px 0 14px; }

.today-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.today-facts li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: var(--fs-ui);
  font-variant-numeric: tabular-nums;
}
.today-facts strong { color: var(--text); }

/* Today's claims under the headline: a lime mark for claimed, an open ring for still to claim. */
.today-claims { display: grid; gap: 6px; margin-top: 16px; list-style: none; color: var(--muted); font-size: var(--fs-ui); }
.today-claims li { position: relative; padding-left: 20px; }
.today-claims li::before {
  content: '';
  position: absolute;
  top: .42em;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soft-2);
}
.today-claims .is-claimed::before { background: var(--lime); }
.today-claims .is-open::before { background: transparent; box-shadow: inset 0 0 0 2px var(--fuchsia); }
.today-claims strong { color: var(--text); font-variant-numeric: tabular-nums; }
.today-claims.is-done { display: flex; align-items: flex-start; gap: 8px; color: var(--text); }
.today-claims.is-done .i { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--lime); stroke-width: 3; }

.today-clock { grid-area: clock; padding-left: 32px; border-left: 1px solid var(--line); }
.clock {
  margin: 6px 0 2px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.today-clock .sub { font-size: var(--fs-small); }
.today-clock .today-roll { max-width: 15em; margin-top: 8px; }

.today-hen {
  grid-area: hen;
  align-self: end;
  width: 132px;
  margin-bottom: -26px;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .35));
}

.today-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 2px solid var(--card-line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tile-value {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tile-value small { font-size: .55em; color: var(--muted); letter-spacing: 0; }
.tile .sub { font-size: var(--fs-small); }
.tile-link { background: linear-gradient(160deg, var(--info-bg), var(--surface) 75%); }
.tile-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--link);
  font-size: var(--fs-small);
  font-weight: 700;
  text-decoration: none;
}
.tile-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.tile-more::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.tile-link:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--sticker-drop); }

/* Small visuals in the tiles and the track record (views/viz.js): a bar split into named
   parts under a line saying what the whole bar is, a row of day squares, a row of day columns. */
.viz { display: grid; gap: 6px; margin: 12px 0 10px; }
.viz-days { grid-template-columns: minmax(0, max-content); }
.viz-scale, .viz-ends { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; margin: 0; color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.viz-scale span:last-child { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-bar {
  display: flex;
  height: 16px;
  border: 2px solid var(--sticker-line);
  border-radius: 999px;
  background: var(--soft-2);
  box-shadow: 0 2px 0 var(--sticker-drop);
  overflow: hidden;
}
.viz-bar span { flex: none; min-width: 4px; height: 100%; }
.viz-bar span + span { box-shadow: inset 2px 0 0 var(--sticker-line); }
.viz .is-lime { background: var(--gloss), var(--lime); }
.viz .is-pink { background: var(--gloss), var(--fuchsia); }
.viz .is-blush { background: var(--gloss), #ffa6d3; }
.viz .is-candy { background: var(--candy); }
.viz .is-hatch { background: repeating-linear-gradient(-45deg, var(--lime) 0 4px, color-mix(in srgb, var(--lime) 30%, var(--surface)) 4px 8px); }
.viz-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-small); }
.viz-key li { display: inline-flex; align-items: baseline; gap: 6px; }
.viz-key i { flex: none; width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(1px); }
.viz-key strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
/* A hatched part's key square shows the hatching at a size it can be seen. */
.viz-key i.is-hatch { background: repeating-linear-gradient(-45deg, var(--lime) 0 2px, var(--surface) 2px 4px); }
.viz-day-key { font-size: var(--fs-label); }
.viz-day-key .is-claimed { background: var(--gloss), var(--lime); }
.viz-day-key .is-missed { background: var(--candy); }
.viz-day-key .is-open { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.ink .viz-day-key .is-open { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }
.viz-pips, .viz-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 22px); gap: 4px; }
.viz-pips span { height: 18px; border-radius: 5px; }
.viz-pips .is-claimed { background: var(--gloss), var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.viz-pips .is-missed { background: var(--candy); box-shadow: inset 0 0 0 1.5px var(--ink); }
.viz-pips .is-open { box-shadow: inset 0 0 0 2px var(--line-strong); }
.ink .viz-pips .is-open { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.viz-cols { align-items: end; height: 48px; }
.viz-cols > span { display: flex; align-items: flex-end; height: 100%; }
.viz-cols i { display: block; width: 100%; border-radius: 5px 5px 3px 3px; background: var(--gloss), var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.viz-cols .is-missed::after { content: ''; width: 100%; height: 5px; border-radius: 3px; background: var(--candy); box-shadow: inset 0 0 0 1px var(--ink); }
.viz-cols .is-open::after { content: ''; width: 100%; height: 10px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--line-strong); }

.notes { margin-top: 14px; }

/* ------------------------------------------------------ Since yesterday -- */
/* Why today's share moved: the net change, then each cause as a bar from the middle. */

.change { margin-top: 18px; }
.change:empty { display: none; }
.change-card {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 8px 40px;
  padding: 24px 28px;
  border: 2px solid var(--card-line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
}
.change-head { grid-row: span 2; }
.change-net {
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.change-net.is-up { color: var(--good-text); }
.change-net.is-down { color: var(--fuchsia-ink); }
.change-lede { margin-top: 10px; font-size: var(--fs-ui); line-height: 1.5; color: var(--muted); }
.change-lede strong { color: var(--text); font-variant-numeric: tabular-nums; }
/* The causes share one set of columns, so their bars line up. */
.causes { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(120px, 1fr) max-content; column-gap: 16px; margin: 0; padding: 0; list-style: none; }
.cause {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  row-gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.cause:first-child { border-top: 0; padding-top: 0; }
.cause-text strong { display: block; font-size: var(--fs-ui); }
.cause-text small { display: block; margin-top: 2px; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.cause-track { position: relative; height: 12px; border-radius: 6px; background: var(--soft); }
.cause-track::before { content: ''; position: absolute; top: -4px; bottom: -4px; left: 50%; width: 1px; background: var(--line-strong); }
.cause-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; box-shadow: inset 0 0 0 1.5px rgba(14, 14, 18, .85); }
.cause.is-up .cause-bar { left: 50%; background: var(--lime-bar); }
.cause.is-down .cause-bar { right: 50%; background: var(--fuchsia); }
.cause-value { font-family: var(--display); font-weight: 800; font-size: 16px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cause-value small { font-family: var(--body); font-weight: 600; font-size: var(--fs-small); color: var(--muted); }
.cause.is-flat .cause-value { font-family: var(--body); font-weight: 600; font-size: var(--fs-small); color: var(--muted); }
.change-foot { grid-column: 2; margin-top: 4px; }
.note-action { margin-top: 12px; }

/* ------------------------------------------------------------------ Hens -- */

.hens { margin-top: 48px; }

.hen-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within { border-color: var(--sticker-line); box-shadow: 0 3px 0 var(--fuchsia); }
/* Sits beside the sort buttons rather than spreading out with them. */
.claim-toggle { height: 40px; margin-right: auto; }
.search input { width: 130px; border: 0; outline: none; background: transparent; color: var(--text); font-size: var(--fs-ui); }

.hen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
}

.hen-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px 10px 14px;
  border: 2px solid var(--card-line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
  color: var(--text);
  text-align: left;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.hen-card:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 7px 0 var(--sticker-drop); }
.hen-art {
  position: relative;
  display: block;
  aspect-ratio: 1;
  margin-bottom: 8px;
  border-radius: 15px;
  background: var(--info-bg);
  overflow: hidden;
}
.hen-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.hen-card:hover .hen-art img { transform: scale(1.04); }
.hen-card .badge { position: absolute; top: 18px; left: 18px; }
.hen-name { padding: 0 4px; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.hen-row {
  display: flex;
  flex-wrap: wrap;
  column-gap: 6px;
  padding: 0 4px;
  font-size: var(--fs-small);
  color: var(--muted);
}
/* A value too long for its row drops whole onto the next line instead of splitting from its unit. */
.hen-row strong { margin-left: auto; color: var(--text); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hen-row small { font-size: .8em; color: var(--muted); }

/* Badges on a Hen's picture are stickers too: ink-outlined, on a small drop. */
.hen-card .badge { border: 1.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.badge-weightless { background: var(--gloss), var(--sky); color: #0e0e12; }

/* Today's claim, over the bottom of a Hen's picture. */
.hen-card .hen-art .claim-badge { top: auto; bottom: 8px; left: 8px; }
.claim-badge.is-claimed { background: var(--gloss), var(--lime); color: #0e0e12; }
.claim-badge.is-open { background: var(--gloss), #ffc2e1; color: #0e0e12; }
.claim-badge.is-blocked { background: #ffffff; color: #4a4a57; }
/* In a narrow card the claim badge steps down a size, and wraps rather than run off the picture. */
.hen-art { container-type: inline-size; }
.hen-card .hen-art .claim-badge { max-width: calc(100% - 16px); white-space: normal; text-wrap: balance; }
@container (max-width: 180px) {
  .hen-card .hen-art .claim-badge { gap: 3px; padding: 3px 6px; border-radius: 11px; font-size: 10.5px; }
  .hen-card .hen-art .claim-badge .i { width: 12px; height: 12px; }
}

.more { margin-top: 20px; text-align: center; }

/* The Hens as a table, for big flocks. On wide screens its heading row sticks under the
   page header; narrower, the figures scroll sideways while the Hen column stays put. */
.view-toggle .i { width: 18px; height: 18px; }
.hen-table-wrap {
  border: 2px solid var(--card-line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
  overflow: clip;
}
.hen-table-wrap:focus-visible { outline: 2px solid var(--fuchsia); outline-offset: 3px; }
.hen-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.hen-table th, .hen-table td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-ui);
  font-weight: 400;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.hen-table .num { text-align: right; }
.hen-table thead th {
  position: sticky;
  top: var(--header-h);
  z-index: 2;
  padding: 0;
  background: var(--soft);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.hen-table thead button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.hen-table thead .num button { justify-content: flex-end; }
.hen-table thead button:hover, .hen-table [aria-sort] button { color: var(--text); }
.hen-table thead button:focus-visible { outline: 2px solid var(--fuchsia); outline-offset: -5px; border-radius: 12px; }
.sort-way { display: inline-block; min-width: 1ch; color: var(--fuchsia-ink); }
/* A heading's second line says what its figures are, in plain words. */
.th-text { display: grid; gap: 2px; padding: 8px 0; }
.th-text small { font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: normal; max-width: 150px; line-height: 1.25; }
.hen-table thead .num .th-text { justify-items: end; text-align: right; }
.hen-table .claim-col { padding: 0 18px; }
.hen-table tbody tr:hover > * { background: var(--soft); }
.hen-table tbody th { padding: 6px 12px; }
.hen-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 4px 4px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--text);
  text-align: left;
}
.hen-cell img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; background: var(--info-bg); }
.hen-cell span { display: grid; }
.hen-cell strong { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.hen-cell small { font-size: 12px; color: var(--muted); }
.hen-cell:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.hen-cell:focus-visible { outline: 2px solid var(--fuchsia); outline-offset: 2px; }
.usd-cell { display: block; font-size: 12px; color: var(--muted); }
.hen-table .allowance { width: 100%; max-width: 120px; height: 5px; margin-top: 6px; }
.claim-cell small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.claim-cell small:empty { display: none; }
.claim-worth.is-short { color: var(--warn-text); }
.claim-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-label); font-weight: 700; }
.claim-pill .i { width: 14px; height: 14px; stroke-width: 3; }
.claim-cell.is-claimed .claim-pill { background: var(--gloss), var(--lime); color: #0e0e12; box-shadow: inset 0 0 0 1.5px var(--ink); }
.claim-cell.is-open .claim-pill { background: var(--gloss), #ffc2e1; color: #0e0e12; box-shadow: inset 0 0 0 1.5px var(--ink); }
.claim-cell.is-blocked .claim-pill { background: var(--soft-2); color: var(--muted); }
.hen-table tfoot th, .hen-table tfoot td { border-bottom: 0; background: var(--soft); font-weight: 700; }
.hen-table tfoot th { padding-left: 18px; }

/* ------------------------------------------------------------- Hen sheet -- */

.sheet-art {
  width: min(220px, 70%);
  margin: 4px auto 18px;
  border: 2.5px solid var(--ink);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 5px 0 var(--ink);
}
.sheet-art img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.sheet-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }

.facts { margin-top: 18px; }
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-ui);
}
.facts dt { color: var(--muted); }
.facts dd { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.allowance {
  display: block;
  width: 140px;
  height: 7px;
  margin: 7px 0 0 auto;
  border-radius: 999px;
  background: var(--soft-2);
  overflow: hidden;
}
.allowance span { display: block; height: 100%; border-radius: 999px; background: var(--candy); }

.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1 1 auto; }

/* --------------------------------------------------------- Track record -- */

.record { margin-top: 56px; }
.record-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.record-since { color: var(--muted); font-size: var(--fs-ui); }
.record-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
.record-stat {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 2px solid var(--card-line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--sticker-drop);
}
.record-stat.ink { border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--fuchsia); }
.record-value {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.record-value small { font-size: .5em; color: var(--muted); letter-spacing: 0; }
.record-stat .sub { margin-top: auto; font-size: var(--fs-small); }
.record-cost { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); font-size: var(--fs-small); }
.record-cost strong { color: inherit; }
.record-cost .usd { color: inherit; }
.record-skeleton { height: 136px; }
.record-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 20px 22px; color: var(--muted); }
.record-note p { display: flex; gap: 10px; align-items: flex-start; }
.record-note .i { flex: none; color: var(--warn-text); }
.record-error { display: flex; gap: 10px; align-items: flex-start; }

.record-days { margin-top: 18px; padding: 22px; }
.record-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.record-strip li, .record-legend i { width: 20px; height: 20px; border-radius: 6px; background: var(--soft-2); }
.record-strip .is-claimed, .record-legend .is-claimed { background: var(--gloss), var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.record-strip .is-missed, .record-legend .is-missed { background: var(--candy); box-shadow: inset 0 0 0 1.5px var(--ink); }
.record-strip .is-open, .record-legend .is-open { background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); }
/* The first day's date and "Today" sit at either end of the squares, on whichever row they land. */
.record-strip .record-mark { width: auto; height: 20px; background: none; color: var(--muted); font-size: var(--fs-small); font-weight: 600; line-height: 20px; white-space: nowrap; }
/* The legend and the note sit under the squares, on the same left edge. */
.record-foot { display: grid; justify-items: start; gap: 12px; margin-top: 14px; }
.record-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
.record-legend li { display: inline-flex; align-items: center; gap: 7px; }
.record-legend i { width: 12px; height: 12px; border-radius: 4px; }
.record-foot .fineprint { max-width: 62ch; margin: 0; }

/* Charts of the record's days: GLD claimed so far on ink, then four daily charts in a grid
   that drops to one column when a chart would be narrower than 440px. */
.record-charts { display: grid; gap: 18px; margin-top: 18px; }
.record-lead { padding: 24px 26px 18px; border-radius: var(--r-xl); }
.record-lead-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; margin-bottom: 6px; }
.record-lead-value {
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.record-lead-value small { font-size: .4em; color: var(--muted); letter-spacing: 0; }
.record-lead .sub { min-height: 1.4em; margin-top: 8px; font-size: var(--fs-small); }
.record-lead .chart .area { fill-opacity: .2; }
.record-lead-facts { display: flex; margin: 0; }
.record-lead-facts > div { padding: 2px 24px; border-left: 1px solid var(--line); }
.record-lead-facts > div:last-child { padding-right: 0; }
.record-lead-facts dd { margin: 6px 0 0; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.record-lead-facts dd small { font-size: .55em; color: var(--muted); letter-spacing: 0; }
.record-lead-facts dd.sub { margin-top: 4px; font-family: var(--body); font-weight: 400; letter-spacing: 0; }
.record-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px 14px; }
.record-chart { min-width: 0; padding: 20px 22px 16px; }
.record-chart .chart-title { margin: 0; }
.record-chart .muted { max-width: 52ch; margin-top: 4px; font-size: var(--fs-small); }
.record-chart-skeleton { height: 288px; margin-top: 12px; }
.record-chart-gap { display: grid; place-content: center; justify-items: center; gap: 12px; min-height: 288px; margin-top: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--soft); color: var(--muted); text-align: center; }
.record-charts > .fineprint { max-width: 62ch; margin: 0; }

/* -------------------------------------------------------- Error details -- */

/* The technical text behind an error, folded away under the plain message (lookup hints, track record). */
.hint-details { display: inline; }
.hint-details summary { display: inline; color: var(--link); font-weight: 700; cursor: pointer; }
.hint-details[open] summary { margin-right: 6px; }
.hint-details span { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Responsive -- */

@media (max-width: 1080px) {
  .tiles, .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 36px; }
  .hero-art { min-height: 400px; }
  .how-list { grid-template-columns: minmax(0, 1fr); }
  .how-step { min-height: 0; }
  .today {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main hen"
      "clock clock"
      "actions actions";
  }
  .today-clock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .today-clock .clock { margin: 0; font-size: 28px; }
  .today-clock .today-roll { flex-basis: 100%; max-width: none; margin-top: 2px; }
  .today-hen { align-self: start; width: 104px; margin: 0; }
}

@media (max-width: 1100px) {
  .hen-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
  .hen-table { min-width: 860px; }
  .hen-table thead th { position: static; top: auto; }
  /* The Hen column stays put while the figures scroll under it. */
  .hen-table tbody th, .hen-table tfoot th, .hen-table thead .hen-col { position: sticky; top: auto; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
  .hen-table thead .hen-col, .hen-table tfoot th { background: var(--soft); }
}

/* Small tablets: "Since yesterday" stacks its headline above the causes so their figures fit. */
@media (max-width: 860px) {
  .change-card { grid-template-columns: minmax(0, 1fr); }
  .change-head { grid-row: auto; }
  .change-foot { grid-column: auto; }
}

@media (max-width: 760px) {
  /* The hen tucks into the corner so the figure gets the card's full width. */
  .today { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "clock" "actions"; gap: 18px; padding: 24px 20px 20px; }
  .today .label { padding-right: 76px; }
  .today .mega { font-size: clamp(36px, 11vw, 56px); }
  .today-hen { position: absolute; top: 14px; right: 14px; width: 72px; }
  .today-actions { padding-top: 16px; }
  .today-actions .btn { flex: 1 1 100%; }
  .today-actions .text-button { margin: 0 auto; }
  .hens { margin-top: 40px; }
  .hen-tools .segmented { width: 100%; }
  .hen-tools .segmented button { flex: 1 1 0; }
  /* The view switch and the claim toggle share a row; the search and the CSV button share the next. */
  .hen-tools .view-toggle { width: auto; }
  .hen-tools .view-toggle button { flex: none; }
  .hen-tools .card-sort, .search, .hen-csv { order: 1; }
  .search { flex: 1 1 180px; width: auto; }
  .hen-csv-long { display: none; }
  .hen-table th, .hen-table td { padding: 9px 12px; }
  .hen-table thead button, .hen-table .claim-col { padding: 0 12px; }
  .hen-table tbody th { padding: 5px 8px; }
  .hen-cell img { width: 34px; height: 34px; border-radius: 9px; }
  .search input { flex: 1; width: auto; min-width: 0; }
  .change-card { grid-template-columns: minmax(0, 1fr); padding: 22px 20px; }
  .change-head { grid-row: auto; }
  .change-net { font-size: 38px; }
  .change-foot { grid-column: auto; }
  /* Each cause: its words across the top, then the bar and the figure. */
  .causes { grid-template-columns: minmax(0, 1fr) max-content; column-gap: 14px; }
  .cause-text { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  /* One panel to a row, so each bar and its key read on a line. */
  .tiles, .record-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { min-height: 330px; }
  .hero-hen { width: 180px; }
  .float { min-width: 0; padding: 9px 12px; border-radius: 14px; }
  .float strong { font-size: 16px; }
  .float span { font-size: 10px; }
  .float-b { right: 0; }
  .how-step { padding: 20px 20px 22px; }
  .how-text { max-width: calc(100% - 84px); }
  .how-step img { width: 90px; }
  .tiles { gap: 10px; }
  .tile { padding: 14px 16px; }
  .tile-value { font-size: 21px; }
  .record { margin-top: 44px; }
  .record-grid { gap: 10px; }
  .record-stat { padding: 14px 16px; }
  .record-value { font-size: 23px; }
  .record-days { padding: 18px 16px; }
  .record-strip { gap: 5px; }
  .record-strip li { width: 16px; height: 16px; border-radius: 5px; }
  .record-strip .record-mark { height: 16px; line-height: 16px; font-size: var(--fs-label); }
  .record-charts, .record-chart-grid { gap: 10px; }
  .record-lead { padding: 20px 16px 14px; }
  .record-lead-value { font-size: 36px; }
  .record-lead-facts { width: 100%; }
  .record-lead-facts > div { flex: 1 1 0; padding: 0 0 0 16px; }
  .record-lead-facts > div:first-child { padding-left: 0; border-left: 0; }
  .record-lead-facts dd { font-size: 19px; }
  .record-chart { padding: 16px 16px 12px; }
  .hen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hen-card { padding: 8px 8px 12px; border-radius: 18px; }
  .hen-card .badge { top: 14px; left: 14px; font-size: 11.5px; padding: 3px 8px; }
  .hen-name { font-size: 17px; }
  .hen-row { font-size: var(--fs-small); }
  .view-toggle .i { display: none; }
  .hen-cell { gap: 8px; padding-right: 6px; }
  .hen-cell strong { font-size: 15px; }
  .hen-cell small { max-width: 92px; white-space: normal; }
}

@media (max-width: 380px) {
  .today-facts li { font-size: var(--fs-small); }
}

@media print {
  .hero-art, .today-hen { display: none !important; }
}
