/* Cat Town Log Reader.
   Self-hosted IBM Plex — see assets/fonts/README.md for why it is not linked. */
@font-face { font-family: 'Plex Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('../assets/fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('../assets/fonts/plex-mono-500.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('../assets/fonts/plex-mono-600.woff2') format('woff2'); }
@font-face { font-family: 'Plex Sans'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('../assets/fonts/plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'Plex Sans'; font-style: italic; font-weight: 400;
  font-display: swap; src: url('../assets/fonts/plex-sans-400i.woff2') format('woff2'); }
@font-face { font-family: 'Press Start 2P'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('../assets/fonts/press-start-2p.ttf') format('truetype'); }

/* Single-theme by choice: sibling of the town dashboard, which is committedly
   dark. Every colour is painted explicitly so the page holds on any ground. */
:root {
  --ground: #12121e; --panel: #0d1117; --panel-2: #191926; --raised: #21212f;
  --rule: #2b2b3d; --rule-soft: #20202c;
  --ink: #e4e2da; --read: #dcdad1; --ink-dim: #9296ab; --ink-faint: #62667a;
  --gold: #ffd700; --green: #a0e0a0; --ok: #8fc9a8; --warn: #d6b476; --bad: #e08f8f;
  --violet: #a68fd6;
  --m-food: #7fdca0; --m-water: #6fd6e6; --m-energy: #e0c060; --m-social: #c9a0e0;
  --mono: 'Plex Mono', ui-monospace, 'Courier New', monospace;
  --sans: 'Plex Sans', system-ui, -apple-system, sans-serif;
  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --shadow: #090b11;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--ground); color: var(--ink); font-family: var(--mono);
  font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
mark { background: rgba(255,215,0,.28); color: #fff3bf; border-radius: 1px; }
button, select, input { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---- sticky top: identity, then the day as a strip ---- */
.top { position: sticky; top: 0; z-index: 30; background: var(--ground);
  border-bottom: 1px solid var(--rule); }
.top-in { max-width: 1500px; margin: 0 auto; padding: 9px 20px 0; }
.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wordmark { display: flex; align-items: center; gap: 10px; flex: none; font-weight: 400; }
.wordmark-home { display: flex; align-items: center; gap: 9px; color: var(--ink);
  font-family: var(--pixel); font-size: 13px; line-height: 1; text-decoration: none;
  text-shadow: 2px 2px 0 var(--panel); }
.wordmark-home:hover { color: var(--ink); }
.wordmark-home:hover .spot { color: #ffe348; }
.wordmark-cat { width: 24px; height: 24px; flex: none;
  background: url('../assets/cat.png') -22px -36px / 512px 640px;
  image-rendering: pixelated; }
.wordmark .spot { color: var(--gold); }
.section-name { padding-left: 10px; border-left: 1px solid var(--rule);
  color: var(--ink-dim); font-family: var(--mono); font-size: 10px;
  font-weight: 500; letter-spacing: 2px; line-height: 24px; text-transform: uppercase;
  text-shadow: none; }
.mockchip { font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--ground); background: var(--gold); font-weight: 600; padding: 2px 6px; border-radius: 2px; }
.brand .src { font-size: 11.5px; color: var(--ink-faint); }
.brand .src b { color: var(--ink-dim); font-weight: 400; }
.at { margin-left: auto; font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.at b { color: var(--gold); font-weight: 500; font-size: 15px; }
#nav { display: block; width: 100%; height: 46px; cursor: pointer; margin-top: 6px; }
.navhint { display: flex; justify-content: space-between; padding-bottom: 7px;
  font-size: 10px; color: var(--ink-faint); }

/* ---- page ---- */
.page { max-width: 1500px; margin: 0 auto; padding: 0 20px 80px;
  display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 34px; align-items: start; }
.schema { grid-column: 1 / -1; display: flex; gap: 10px; margin: 14px 0 4px;
  border-left: 2px solid var(--warn); background: rgba(214,180,118,.05);
  padding: 7px 12px; font-size: 11.5px; color: #c6bba4; }
.schema b { color: var(--warn); font-weight: 500; }

/* ---- the read ---- */
.stream { min-width: 0; padding-top: 8px; }
.hour { display: flex; align-items: center; gap: 12px; margin: 26px 0 6px;
  font-size: 10px; letter-spacing: 2px; color: var(--ink-faint); text-transform: uppercase; }
.hour::after { content: ''; flex: 1; height: 1px; background: var(--rule-soft); }
.deploy { display: flex; align-items: center; gap: 12px; margin: 22px 0;
  font-size: 10.5px; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; }
.deploy::before, .deploy::after { content: ''; flex: 1; height: 1px; background: rgba(255,215,0,.3); }

.t { padding: 13px 0 14px; border-bottom: 1px solid var(--rule-soft);
  content-visibility: auto; contain-intrinsic-size: 0 132px; scroll-margin-top: 128px; }
.t.sel { background: rgba(255,215,0,.045); box-shadow: -12px 0 0 rgba(255,215,0,.045),
  inset 2px 0 0 var(--gold); padding-left: 12px; }
.head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 11.5px; margin-bottom: 7px; }
.time { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.del { font-family: var(--sans); font-size: 15px; line-height: 1.66; color: var(--read);
  max-width: 68ch; }
.del.none { color: var(--ink-faint); font-style: italic; font-size: 13px; }
.foot { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap;
  margin-top: 8px; font-size: 11px; color: var(--ink-faint); }
.foot .sep { color: var(--rule); }
.op { margin-top: 8px; font-size: 12px; color: var(--ink-dim);
  border-left: 2px solid var(--m-social); padding-left: 10px; }
.op .q { font-family: var(--sans); font-size: 13.5px; color: var(--read); }

/* consolidation: the best prose in the log, so it reads like a passage */
.c { padding: 16px 0 16px 14px; border-left: 2px solid var(--violet);
  margin: 8px 0; background: rgba(122,111,168,.06);
  content-visibility: auto; contain-intrinsic-size: 0 220px; scroll-margin-top: 128px; }
.c .dream { font-family: var(--sans); font-style: italic; font-size: 15px; line-height: 1.66;
  color: #cfc7e4; max-width: 66ch; margin: 4px 0 12px; }
.c ol { margin: 0 0 0 20px; font-size: 12px; color: var(--ink-dim); }
.c ol li { padding: 1px 0; }
.c ol li.new { color: var(--read); }

.drop { padding: 7px 0; font-size: 11.5px; color: var(--warn);
  border-bottom: 1px solid var(--rule-soft); opacity: .85;
  content-visibility: auto; contain-intrinsic-size: 0 28px; }
.drop b { font-weight: 500; }

/* ---- tokens: everything you read is a filter ---- */
.tok { display: inline-flex; align-items: center; gap: 5px; padding: .16em .5em;
  border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-dim);
  cursor: pointer; background: none; font-size: 11.5px; white-space: nowrap; }
.tok:hover { border-color: var(--ink-faint); color: var(--ink); background: var(--raised); }
.tok--action { color: var(--green); border-color: rgba(160,224,160,.28); }
.tok--call { color: var(--ink); font-size: 13px; letter-spacing: 1px; }
.tok--ease { color: var(--ok); border-color: rgba(143,201,168,.26); }
.tok--unease { color: var(--warn); border-color: rgba(214,180,118,.26); }
.tok--alarm { color: var(--bad); border-color: rgba(224,143,143,.28); }
.tok--plain { border-color: transparent; padding-left: 0; padding-right: .35em; }
.tok--plain:hover { border-color: var(--rule); padding-left: .5em; }
.cat { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--ink); }
.cat .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lo { color: var(--warn); }

/* ---- rail ---- */
.rail { position: sticky; top: 118px; max-height: calc(100vh - 134px); overflow-y: auto;
  margin-top: 8px; padding: 14px; background: var(--panel);
  border: 1px solid var(--rule); box-shadow: 4px 4px 0 var(--shadow); }
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--rule); }
.eyebrow { font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; display: block; margin-bottom: 8px; }
.blk { border-top: 1px solid var(--rule-soft); padding: 14px 0; }
.blk:first-child { border-top: none; padding-top: 0; }
#q { width: 100%; background: var(--panel); border: 1px solid var(--rule); color: var(--ink);
  padding: 7px 9px; font-size: 12.5px; border-radius: 2px; }
#q::placeholder { color: var(--ink-faint); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11px; padding: 3px 8px; border: 1px solid var(--rule); border-radius: 2px;
  color: var(--ink-faint); cursor: pointer; background: none; display: inline-flex; gap: 5px; align-items: center; }
.chip:hover { color: var(--ink); }
.chip.on { color: var(--ground); background: var(--c, var(--ink-dim)); border-color: transparent; font-weight: 500; }
.chip .n { opacity: .6; font-size: 10px; }
.cut { background: var(--panel-2); border: 1px solid var(--rule); padding: 12px;
  box-shadow: 3px 3px 0 var(--shadow); }
.cut .big { font-size: 21px; color: var(--gold); font-variant-numeric: tabular-nums; }
.cut .big span { font-size: 12px; color: var(--ink-faint); }
.cut .desc { font-size: 11.5px; color: var(--ink-dim); margin: 5px 0 10px; line-height: 1.55; }
.mix { display: flex; height: 6px; border-radius: 1px; overflow: hidden; margin-bottom: 8px; }
.btn { width: 100%; padding: 7px; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  background: var(--gold); color: var(--ground); border: none; border-radius: 2px;
  font-weight: 600; cursor: pointer; }
.btn:hover { background: #ffe348; }
.btn.sec { background: none; color: var(--ink-dim); border: 1px solid var(--rule); font-weight: 400; }
.btn.sec:hover { color: var(--ink); border-color: var(--ink-faint); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; }

/* ---- measure: a table, now a view rather than a modal ---- */
select { background: var(--panel-2); color: var(--ink); border: 1px solid var(--rule);
  border-radius: 2px; padding: 4px 6px; font-size: 11.5px; max-width: 100%; }
table.d { width: 100%; border-collapse: collapse; font-size: 12px;
  font-variant-numeric: tabular-nums; margin-top: 6px; }
table.d th { text-align: right; font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--ink-faint); padding: 0 0 6px; border-bottom: 1px solid var(--rule); font-weight: 600; }
table.d th:first-child { text-align: left; }
table.d td { padding: 4px 0; text-align: right; border-bottom: 1px solid var(--rule-soft); }
table.d td:first-child { text-align: left; color: var(--ink-dim); }
table.d td.a { color: var(--gold); } table.d td.b { color: var(--m-water); }
table.d td.dl { color: var(--ink-faint); width: 84px; }
table.d td.dl.mv { color: var(--bad); font-weight: 500; }
table.d tr.g td { padding-top: 12px; border-bottom: none; color: var(--ink-faint);
  font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase; }
.reading { margin-top: 14px; padding: 11px 13px; background: var(--panel-2);
  border-left: 2px solid var(--gold); font-family: var(--sans); font-size: 13px;
  line-height: 1.6; color: #d0cdc4; }
.reading b { font-family: var(--mono); font-size: 12px; color: var(--gold); font-weight: 500; }
.empty { padding: 60px 0; text-align: center; color: var(--ink-faint); font-size: 13px; }
.more { padding: 20px 0 40px; text-align: center; color: var(--ink-faint); font-size: 11px;
  letter-spacing: 1.5px; text-transform: uppercase; }
footer.note { grid-column: 1 / -1; margin-top: 30px; padding-top: 14px;
  border-top: 1px solid var(--rule); font-size: 11.5px; color: var(--ink-faint);
  line-height: 1.7; max-width: 92ch; }
footer.note code { color: var(--ink-dim); }
@media (max-width: 1020px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; border-top: 1px solid var(--rule); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- chrome the mock did not need: a day is chosen, not baked in --- */
.daypick { display: inline-flex; align-items: center; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#day { font-size: 11.5px; padding: 3px 6px; }
.keys { font-size: 11.5px; color: var(--ink-faint); line-height: 1.8; }
.keys b { color: var(--ink-dim); font-weight: 500; }
.loading { padding: 60px 0; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* Colours that used to ride in style attributes. They are static, so they are
   classes; the three that vary per cat or per action come through data-* and
   the CSSOM (see paint() in main.js) — style-src 'self' blocks the attribute. */
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.dim { color: var(--ink-faint); }
.tok--sleep { color: var(--violet); border-color: rgba(166, 143, 214, .3); }
.ab { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 2px; }
.mk-a { color: var(--gold); }
.mk-b { color: var(--m-water); }

/* --- navigation: three peer views over one cut --- */
.viewtabs { display: inline-flex; border: 1px solid var(--rule); border-radius: 2px;
  overflow: hidden; background: var(--panel); }
.viewtab {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .5px;
  background: var(--panel); color: var(--ink-dim); border: none;
  border-right: 1px solid var(--rule); padding: 4px 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.viewtab:last-child { border-right: none; }
.viewtab:hover { color: var(--ink); background: var(--raised); }
.viewtab[aria-selected="true"] { background: var(--raised); color: var(--ink); font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--gold); }
.viewtab kbd {
  font-family: var(--mono); font-size: 9px; opacity: .55;
  border: 1px solid currentColor; border-radius: 2px; padding: 0 3px; line-height: 1.4;
}
.views { min-width: 0; padding-top: 8px; }
.viewhead {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--rule-soft);
}

/* --- map --- */
.mapwrap { border: 1px solid var(--rule); background: #0b0e16; line-height: 0;
  box-shadow: 4px 4px 0 var(--shadow); }
#mapc { display: block; width: 100%; }
.maptip {
  font-size: 11.5px; color: var(--ink-dim); padding: 9px 2px 0; min-height: 30px;
}
.mapnote { font-size: 11.5px; color: var(--ink-faint); margin: 14px 0 8px; max-width: 70ch; }
.mapcaveat {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.6; color: var(--ink-faint);
  border-left: 2px solid var(--rule); padding-left: 12px; margin-top: 20px; max-width: 68ch;
}
.mapcaveat em { color: var(--ink-dim); font-style: italic; }
ol.flows { list-style: none; display: grid; gap: 3px; margin: 0; max-width: 560px; }
ol.flows li { display: grid; grid-template-columns: 78px 1fr auto; gap: 12px; align-items: center;
  font-size: 12px; }
.fbar { height: 6px; background: var(--raised); border-radius: 1px; display: block; overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--gold); width: 0; }
.froute { color: var(--ink); overflow-wrap: anywhere; }
.fn { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.chip[disabled] { opacity: .42; cursor: default; }
.chip[disabled]:hover { color: var(--ink-faint); }
.deploy b { color: var(--gold); font-weight: 600; text-transform: none; letter-spacing: .3px; }
.dsha { color: var(--ink-faint); font-weight: 400; }

/* --- the clock, and following a live day --- */
.clockbtn { font-variant-numeric: tabular-nums; }
.readhead { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; }
.tailbtn.on {
  color: var(--ground); background: var(--ok); border-color: transparent; font-weight: 500;
}
.tailbtn.on::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ground);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .tailbtn.on::before { animation: none } }

/* --- talk: the emoji channel --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 26px;
  box-shadow: 4px 4px 0 var(--shadow); }
.tile { background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 24px; color: var(--gold); font-weight: 500; font-variant-numeric: tabular-nums; }
.tile span { font-size: 11.5px; color: var(--ink); }
.tile i { font-size: 11px; color: var(--ink-faint); font-style: normal; }

.talkblk { margin-bottom: 30px; }
.talkblk.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; }
.mx-title { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.mx-note { font-family: var(--sans); font-size: 12.5px; line-height: 1.55;
  color: var(--ink-faint); max-width: 62ch; margin-bottom: 12px; }
.mx-note b { color: var(--ink); font-weight: 500; }

table.mx { border-collapse: separate; border-spacing: 2px; font-variant-numeric: tabular-nums; }
table.mx th { font-weight: 400; font-size: 11px; color: var(--ink-dim); padding: 2px 4px; }
th.mx-row { text-align: right; white-space: nowrap; }
.mx-cat { font-size: 13px; }
td.mx-cell { width: 46px; height: 30px; text-align: center; font-size: 11.5px;
  color: var(--ink); background: var(--raised); border-radius: 2px; }
td.mx-self { background: repeating-linear-gradient(45deg, transparent, transparent 3px,
  var(--rule-soft) 3px, var(--rule-soft) 4px); border-radius: 2px; }

ol.census, ol.phrases { list-style: none; display: grid; gap: 4px; margin: 0; max-width: 560px; }
ol.census li { display: grid; grid-template-columns: 26px 1fr 52px 88px; gap: 10px; align-items: center; }
ol.phrases li { display: grid; grid-template-columns: 90px 52px; gap: 10px; align-items: center; }
.gl { font-size: 15px; letter-spacing: 2px; }
.gbar { height: 7px; background: var(--raised); border-radius: 1px; display: block; overflow: hidden; }
.gbar i { display: block; height: 100%; width: 0; background: var(--ink-faint); border-radius: 0 2px 2px 0; }
.gbar i.is-mark { background: var(--gold); }
.gn { font-size: 11.5px; color: var(--ink-dim); text-align: right; font-variant-numeric: tabular-nums; }
.gk { font-size: 11px; color: var(--ink-faint); }
td.mx-cell.on-gold { color: var(--ground); font-weight: 500; }

/* Cat references occupy one emoji-sized slot; names remain available to
   assistive technology and on hover. Loading failures retain [cat-id]. */
.cat-emoji { display: inline-block; vertical-align: -0.16em; line-height: 1; letter-spacing: normal; }
.cat-emoji img { display: block; width: 1.25em; height: 1.25em; object-fit: contain; image-rendering: pixelated; }
