/* TickrLens. Green-bar ledger paper, pine ink, and one punched tape for the process. */

@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --paper: #f3f7f2;
  --sheet: #fcfdfb;
  --bar: #e4eee3;
  --rule: #c9d8cb;
  --pine: #10352e;
  --pine-2: #1b4a40;
  --ink: #17302b;
  --ink-2: #4b635c;
  --ink-3: #6a7f78;
  --cobalt: #2340c8;
  --up: #0f7b5c;
  --up-soft: #d8efe6;
  --down: #c2332e;
  --down-soft: #f8e0dd;
  --amber: #8a5a10;
  --amber-soft: #f6e9cd;
  --tape: #f0dfae;
  --tape-edge: #dcc684;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); font-variant-numeric: tabular-nums; }
a { color: var(--cobalt); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; color: var(--pine); }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; font-family: var(--body); }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* Frame */
.frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--pine); color: #d7e6df; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.mark { display: block; color: #fff; text-decoration: none; padding: 0 10px; }
.mark img { display: block; width: 176px; height: auto; }
.mark small { display: block; white-space: normal; color: #a8c6ba; font: 400 13px/1.4 var(--body); margin-top: 6px; }
.rail-group h2 { color: #a8c6ba; font: 500 13px/1 var(--body); padding: 0 10px 7px; }
.rail-group ul { list-style: none; margin: 0; padding: 0; }
.rail a.item { display: block; padding: 6px 10px; border-radius: 5px; color: #eaf3ee; text-decoration: none; font-weight: 500; font-size: 15px; line-height: 1.3; }
.rail a.item span { display: block; color: #a8c6ba; font-weight: 400; font-size: 13px; }
.rail a.item:hover { background: var(--pine-2); }
.rail a.item[aria-current="page"] { background: var(--tape); color: var(--pine); }
.rail a.item[aria-current="page"] span { color: #5b5230; }
.rail-foot { margin-top: auto; font-size: 13px; color: #a8c6ba; padding: 0 10px; }
.rail-foot a { color: #d7e6df; }

.page { padding: 26px 34px 56px; min-width: 0; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.lede { color: var(--ink-2); max-width: 68ch; margin-top: 6px; }

.clock { text-align: right; font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.clock strong { display: block; font: 650 17px/1.3 var(--display); color: var(--pine); }
.clock .open { color: var(--up); }

.flash { padding: 10px 14px; border-radius: 5px; margin-bottom: 16px; border-left: 4px solid; color: var(--ink); }
.flash.ok { background: var(--up-soft); border-color: var(--up); }
.flash.bad { background: var(--down-soft); border-color: var(--down); }
.flash.warn { background: var(--amber-soft); border-color: var(--amber); }

/* The tape: the one loud thing on the desk */
.tape-wrap { margin: 0 -8px 22px; }
.tape { list-style: none; margin: 0; padding: 20px 10px 18px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; background-color: var(--tape); position: relative; border-top: 1px solid var(--tape-edge); border-bottom: 1px solid var(--tape-edge);
  background-image: radial-gradient(circle at center, var(--paper) 3.4px, var(--tape-edge) 3.9px, transparent 4.4px), radial-gradient(circle at center, var(--paper) 3.4px, var(--tape-edge) 3.9px, transparent 4.4px);
  background-size: 18px 12px, 18px 12px; background-repeat: repeat-x; background-position: 0 2px, 0 calc(100% - 2px); }
.station { padding: 0 16px; border-left: 1px dashed var(--tape-edge); min-width: 0; }
.station:first-child { border-left: 0; }
.station .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--pine); font: 700 13px/1 var(--display); color: var(--pine); background: transparent; margin-right: 7px; flex: none; }
.station header { display: flex; align-items: center; font: 650 16px/1.2 var(--display); color: var(--pine); }
.station p { font-size: 14px; color: #4a4326; margin-top: 6px; line-height: 1.35; overflow-wrap: anywhere; }
.station .time { font-size: 13px; color: #6b6238; margin-top: 2px; }
.station[data-status="done"] .num { background: var(--pine); color: var(--tape); }
.station[data-status="note"] .num { background: var(--amber); border-color: var(--amber); color: #fff; }
.station[data-status="failed"] .num { background: var(--down); border-color: var(--down); color: #fff; }
.station[data-status="skipped"] { opacity: .62; }
.station[data-status="running"] .num { background: var(--cobalt); border-color: var(--cobalt); color: #fff; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(35 64 200 / .18); } }
.tape.moving { animation: feed 1s linear infinite; }
@keyframes feed { to { background-position: 18px 2px, 18px calc(100% - 2px); } }
@media (prefers-reduced-motion: reduce) { .tape.moving, .station[data-status="running"] .num { animation: none; } }

.tape.small { padding: 16px 6px 14px; }
.tape.small .station { padding: 0 10px; }
.tape.small .station header { font-size: 14px; }
.tape.small .station header a { color: inherit; text-decoration: none; }
.tape.small .station header a:hover { text-decoration: underline; }
.tape.small .num { width: 20px; height: 20px; font-size: 12px; margin-right: 5px; }
.tape.small p { font-size: 13px; margin-top: 3px; }
.station.here header { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.console { background: var(--pine); color: #d6e7df; font: 13px/1.5 var(--mono); padding: 12px 14px; border-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; margin: 0; }

/* Controls */
.btn { font: 600 15px/1.2 var(--body); padding: 9px 15px; border-radius: 5px; border: 1.5px solid var(--pine); background: var(--pine); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--pine-2); }
.btn.plain { background: transparent; color: var(--pine); }
.btn.plain:hover { background: var(--bar); }
.btn.quiet { border-color: var(--rule); background: var(--sheet); color: var(--ink); font-weight: 500; padding: 6px 11px; font-size: 14px; }
.btn.quiet:hover { background: var(--bar); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.runbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.runbar form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 15px; }
.inline-field { display: inline-flex; gap: 7px; align-items: center; font-size: 15px; }
.inline-field input { width: 84px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=time], select { font: inherit; color: inherit; padding: 7px 9px; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); min-height: 38px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 18px; align-items: start; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.field input, .field select { width: 100%; }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.field .error { font-size: 14px; color: var(--down); margin-top: 3px; }
.field.boolean label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-top: 28px; }
.field.boolean input { width: auto; }

/* Day tabs */
.daytabs { display: flex; gap: 0; flex-wrap: wrap; border-bottom: 2px solid var(--pine); }
.daytab { padding: 9px 16px 8px; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-bottom: 0; margin-right: -1px; background: var(--bar); line-height: 1.25; font-weight: 600; font-size: 15px; }
.daytab small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.daytab[aria-current="true"] { background: var(--pine); color: #fff; border-color: var(--pine); }
.daytab[aria-current="true"] small { color: #c5dbd1; }

.funnel { display: flex; flex-wrap: wrap; gap: 6px 26px; padding: 12px 0; align-items: baseline; color: var(--ink-2); font-size: 15px; }
.funnel b { font: 650 22px/1 var(--display); color: var(--pine); margin-right: 5px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { width: 200px; }
.pill { font: 500 14px/1.2 var(--body); padding: 6px 11px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 99px; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }

/* Green-bar tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--sheet); }
table.ledger { border-collapse: collapse; width: 100%; font-size: 15px; }
.ledger th { text-align: left; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 8px 12px; border-bottom: 1.5px solid var(--pine); background: var(--sheet); white-space: nowrap; }
.ledger th button { all: unset; cursor: pointer; }
.ledger th button:focus-visible { outline: 2px solid var(--cobalt); }
.ledger th[aria-sort="ascending"] button::after { content: " ↑"; }
.ledger th[aria-sort="descending"] button::after { content: " ↓"; }
.ledger td { padding: 7px 12px; border-bottom: 1px solid #e7efe6; vertical-align: top; }
.ledger tbody tr:nth-child(6n+1), .ledger tbody tr:nth-child(6n+2), .ledger tbody tr:nth-child(6n+3) { background: #edf4ec; }
.ledger td.n, .ledger th.n { text-align: right; }
.ledger tbody tr.link { cursor: pointer; }
.ledger tbody tr.link:hover { background: var(--tape); }
.ledger .sym { font-weight: 700; color: var(--cobalt); text-decoration: none; }
.ledger .co { color: var(--ink-2); font-size: 14px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 13px; line-height: 1.3; padding: 1px 7px; border-radius: 3px; background: var(--bar); color: var(--pine); white-space: nowrap; margin: 1px 2px 1px 0; }
.ticks { display: inline-flex; gap: 3px; vertical-align: middle; }
.ticks i { width: 8px; height: 14px; background: var(--bar); border: 1px solid var(--rule); }
.ticks i.on { background: var(--pine); border-color: var(--pine); }
.pos { color: var(--up); } .neg { color: var(--down); } .mute { color: var(--ink-3); }

/* Sections */
.block { margin-top: 24px; }
.block > h2 { margin-bottom: 10px; }
.sheet { background: var(--sheet); border: 1px solid var(--rule); padding: 16px 18px; }
.sheet + .sheet { margin-top: 14px; }
.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px 20px; }
.stat b { display: block; font: 650 24px/1.15 var(--display); color: var(--pine); }
.stat b.pos { color: var(--up); } .stat b.neg { color: var(--down); }
.stat span { font-size: 14px; color: var(--ink-2); }
.verdict { font: 650 22px/1.25 var(--display); color: var(--pine); }
.note-list { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.badge { display: inline-block; font-weight: 700; padding: 2px 9px; border-radius: 3px; font-size: 14px; }
.badge.pass { background: var(--up-soft); color: var(--up); }
.badge.block { background: var(--down-soft); color: var(--down); }
.badge.wait { background: var(--amber-soft); color: var(--amber); }

.oddsbar { display: flex; height: 26px; gap: 2px; margin: 10px 0 8px; }
.oddsbar div { display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; }
.oddsbar .t { background: var(--up); border-radius: 4px 0 0 4px; }
.oddsbar .n { background: #7d8f88; }
.oddsbar .s { background: var(--down); border-radius: 0 4px 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; }

/* Chart */
.chart-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; background: var(--sheet); }
.seg button { font: 500 14px/1 var(--body); padding: 9px 11px; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-right: 1px solid var(--rule); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--pine); color: #fff; }
.range-dates { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
#chart { height: 440px; background: var(--sheet); border: 1px solid var(--rule); position: relative; }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); padding: 20px; text-align: center; z-index: 5; pointer-events: none; }
.listnav { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.pillar-row { display: grid; grid-template-columns: 96px 44px minmax(0, 1fr); gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid #e7efe6; font-size: 15px; }
.pillar-row b { font-family: var(--display); }
.pillar-row span { color: var(--ink-2); font-size: 14px; }
.ticket { border-left: 5px solid var(--tape-edge); }
.ticket.ready { border-left-color: var(--up); }
.ticket h3 { font: 650 19px/1.25 var(--display); color: var(--pine); }
.ticket form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ticket input[type=text] { width: 220px; }
.progress { height: 12px; background: var(--bar); border-radius: 2px; overflow: hidden; margin: 6px 0; }
.progress div { height: 100%; background: var(--pine); }
details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.empty { padding: 28px 20px; text-align: left; background: var(--sheet); border: 1px dashed var(--rule); }
.empty h3 { font: 650 19px/1.25 var(--display); }
.small { font-size: 14px; color: var(--ink-2); }
.stack > * + * { margin-top: 12px; }
.fan { width: 100%; height: auto; display: block; }

/* Sign in */
.rail button.item { all: unset; display: block; box-sizing: border-box; width: 100%; padding: 6px 10px; border-radius: 5px; color: #eaf3ee; font-weight: 500; font-size: 15px; cursor: pointer; }
.rail button.item:hover { background: var(--pine-2); }
.rail button.item:focus-visible { outline: 2px solid var(--tape); }

/* Settings */
.settings-tabs { margin-bottom: 16px; }
.venue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #e7efe6; }
.venue input { margin-top: 5px; }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field textarea { width: 100%; font: 13px/1.4 var(--mono); padding: 8px 9px; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); color: inherit; }
.ledger td form { margin: 0; }
.row-actions { display: inline-flex; gap: 6px; }
.ledger td input[type=email] { width: min(320px, 100%); }

/* Landing */
.landing { background: var(--paper); }
.lp-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; background: var(--pine); }
.lp-mark { display: block; }
.lp-mark img { display: block; width: 190px; height: auto; }
.lp-hero { background: var(--pine); color: #eaf3ee; padding: 44px 32px 58px; }
.lp-hero-text { max-width: 760px; margin: 0 auto; }
.lp-slogan { color: var(--tape); font: 600 18px/1.3 var(--display); margin-bottom: 12px; }
.lp-hero h1 { color: #fff; font-size: clamp(36px, 6vw, 60px); line-height: 1.05; letter-spacing: -.02em; }
.lp-lede { font-size: 19px; line-height: 1.5; max-width: 62ch; margin: 18px 0 24px; color: #d7e6df; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lp-note { font-size: 14px; color: #a8c6ba; margin-top: 12px; }
.sso { display: flex; flex-wrap: wrap; gap: 10px; }
.sso:empty { display: none; }
.sso-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 5px; font: 600 15px/1.2 var(--body); text-decoration: none; }
.sso-btn.google { background: #fff; color: #1f1f1f; }
.sso-btn.apple { background: #000; color: #fff; }
.lp-tape { margin: -22px 0 0; }
.tape.moving-once { animation: feed 1s linear 3; grid-auto-columns: minmax(0, 1fr); }
@media (prefers-reduced-motion: reduce) { .tape.moving-once { animation: none; } }
.lp-section { max-width: 1040px; margin: 44px auto 0; padding: 0 32px; }
.lp-section h2 { font-size: 30px; margin-bottom: 14px; }
.lp-ledger th { font: 650 16px/1.3 var(--display); color: var(--pine); width: 230px; white-space: normal; border-bottom: 1px solid #e7efe6; vertical-align: top; }
.lp-bar { display: flex; gap: 40px; align-items: center; justify-content: space-between; }
.lp-bar p { max-width: 62ch; }
.lp-figure { flex: none; text-align: right; }
.lp-figure b { display: block; font: 700 76px/1 var(--display); color: var(--pine); }
.lp-figure span { color: var(--ink-2); }
.lp-foot { max-width: 1040px; margin: 48px auto 0; padding: 18px 32px 36px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.lp-prose { max-width: 720px; }
.lp-prose h1 { margin-bottom: 12px; }
.lp-prose h2 { font-size: 20px; margin: 20px 0 6px; }
@media (max-width: 900px) {
  .lp-top, .lp-hero { padding-left: 16px; padding-right: 16px; }
  .lp-section, .lp-foot { padding-left: 16px; padding-right: 16px; }
  .lp-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lp-figure { text-align: left; }
  .lp-ledger th { width: 130px; }
}

/* Chat */
.chat-frame { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.chat-threads ul { list-style: none; margin: 12px 0 0; padding: 0; }
.chat-threads li a { display: block; padding: 6px 8px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.chat-threads li a:hover { background: var(--bar); }
.chat-threads li a[aria-current="page"] { background: var(--bar); font-weight: 600; }
.chat-main { min-width: 0; }
.chat-log { height: calc(100vh - 340px); min-height: 280px; overflow-y: auto; background: var(--sheet); border: 1px solid var(--rule); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 76ch; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--pine); color: #fff; padding: 8px 13px; border-radius: 8px 8px 2px 8px; white-space: pre-wrap; }
.bubble.claude { align-self: flex-start; width: 100%; }
.chat-tools:empty { display: none; }
.chat-tools { margin-bottom: 6px; }
.chat-text > :first-child { margin-top: 0; }
.chat-text > :last-child { margin-bottom: 0; }
.chat-text p, .chat-text ul, .chat-text ol { margin: 0 0 8px; }
.chat-text h1, .chat-text h2, .chat-text h3 { font-size: 16px; font-family: var(--body); margin: 10px 0 4px; }
.chat-text code { font-family: var(--mono); font-size: 14px; background: var(--bar); padding: 0 4px; border-radius: 3px; }
.chat-text table { border-collapse: collapse; font-size: 15px; margin: 6px 0 10px; display: block; overflow-x: auto; }
.chat-text th { text-align: left; border-bottom: 1.5px solid var(--pine); padding: 4px 12px 4px 0; }
.chat-text td { border-bottom: 1px solid #e7efe6; padding: 4px 12px 4px 0; }
.chat-state { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .chat-state { animation: none; } }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0; }
.chat-form { margin-top: 10px; }
.chat-form select { margin-bottom: 8px; }
.chat-form > .small { margin-bottom: 6px; }
.chat-form textarea { width: 100%; font: inherit; color: inherit; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); resize: vertical; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 8px; }

@media (max-width: 900px) {
  .chat-frame { grid-template-columns: minmax(0, 1fr); }
  .chat-log { height: 56vh; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; }
  .rail-group ul { display: flex; flex-wrap: wrap; gap: 2px; }
  .rail a.item span { display: none; }
  .rail-foot { display: none; }
  .page { padding: 18px 16px 40px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .tape { grid-auto-flow: row; }
  .station { border-left: 0; border-top: 1px dashed var(--tape-edge); padding: 9px 12px; }
  .station:first-child { border-top: 0; }
  .clock { text-align: left; }
  h1 { font-size: 28px; }
  #chart { height: 340px; }
}
