/* TIERCEL app pages (mews, tiercel, verify, jess, docs). Loaded after /shared/base.css; uses its tokens only.
   Components: .page .page-head · .badge(-live|-sim|-idle|-hood|-kill|-refused|-hold|-lure|-off) · .dot · .tiles/.tile
   · .panel · .chips/.chip · .meter · .feed/.feed-row · .table · .sk (skeleton) · .field/.input/.select/.switch
   · .notice · .receipt · .checks/.check · .toc · .status-pill · .modal · .kv · .hash · .mock-ribbon */

[hidden] { display: none !important; }
.page { padding-top: calc(var(--nav-h) + clamp(28px, 5vw, 64px)); min-height: 70vh; }
.page-head { margin-bottom: clamp(28px, 4vw, 48px); }
.page-head h1 { font: 600 clamp(52px, 8vw, 104px)/0.92 var(--f-display); letter-spacing: -0.015em; margin: 14px 0 0; }
.page-head h1 em { font-style: italic; color: var(--gold); }
.page-head .lead { margin: 18px 0 0; }
.h3 { font: 600 clamp(28px, 3.2vw, 40px)/1 var(--f-display); margin: 0; letter-spacing: -0.005em; }
.h3 em { font-style: italic; color: var(--gold); }
.label { font: 500 10.5px/1.2 var(--f-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-head p { margin: 6px 0 0; }
a.link { color: var(--gold); border-bottom: 1px solid rgba(217, 180, 106, 0.35); transition: border-color 0.2s, color 0.2s; }
a.link:hover { color: var(--gold-2); border-color: var(--gold-2); }

/* ── badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 600 9.5px/1 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--muted); background: rgba(239, 232, 218, 0.03);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.no-dot::before { display: none; }
.badge-live { color: var(--up); border-color: rgba(127, 209, 160, 0.4); background: rgba(127, 209, 160, 0.07); }
.badge-live::before { box-shadow: 0 0 0 0 rgba(127, 209, 160, 0.6); animation: pulse 2.2s infinite; }
.badge-sim { color: var(--amber); border: 1px dashed rgba(240, 166, 58, 0.6); background: rgba(240, 166, 58, 0.06); }
.badge-idle { color: var(--muted); }
.badge-hood { color: #ff8f84; border-color: rgba(184, 50, 42, 0.7); background: rgba(184, 50, 42, 0.14); }
.badge-kill { color: var(--gold-2); border-color: rgba(217, 180, 106, 0.5); background: rgba(217, 180, 106, 0.08); }
.badge-refused { color: #ff9a8f; border-color: rgba(184, 50, 42, 0.55); background: rgba(184, 50, 42, 0.08); }
.badge-hold { color: var(--steel); border-color: rgba(154, 163, 173, 0.35); }
.badge-lure { color: var(--sky); border-color: rgba(143, 180, 217, 0.45); background: rgba(143, 180, 217, 0.06); }
.badge-off { color: var(--muted); border-style: dashed; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(127, 209, 160, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(127, 209, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 209, 160, 0); } }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--gold)); box-shadow: 0 0 0 2px rgba(9, 8, 7, 0.9), 0 0 10px color-mix(in srgb, var(--c, var(--gold)) 50%, transparent); flex: none; }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(9, 8, 7, 0.6); font: 500 10.5px/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-pill[data-s='open'] { color: var(--text); }
.status-pill[data-s='open'] i { background: var(--up); animation: pulse 2.2s infinite; }
.status-pill[data-s='retrying'] i, .status-pill[data-s='connecting'] i { background: var(--amber); }

/* ── tiles ──────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tile { background: linear-gradient(180deg, var(--panel-2), var(--panel)); padding: 18px 20px 16px; min-width: 0; }
.tile .label { display: block; }
.tile .v { display: block; margin-top: 10px; font: 500 clamp(24px, 2.6vw, 32px)/1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }

.panel { padding: clamp(18px, 2.4vw, 26px); }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── chips (filters) ────────────────────────────────── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font: 500 10.5px/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); transition: 0.18s; }
.chip:hover { color: var(--text); border-color: rgba(217, 180, 106, 0.5); }
.chip[aria-pressed='true'] { color: #1a1205; background: var(--gold); border-color: var(--gold); }
.chip[aria-pressed='true'] .dot { box-shadow: 0 0 0 2px var(--gold); }

/* ── meter (spend vs cap) ───────────────────────────── */
.meter { position: relative; height: 6px; border-radius: 999px; background: rgba(239, 232, 218, 0.07); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width 0.6s cubic-bezier(.2,.7,.2,1); }
.meter.warn > i { background: linear-gradient(90deg, #a8701e, var(--amber)); }
.meter.full > i { background: linear-gradient(90deg, var(--hood-deep), var(--hood)); }

/* ── feed ───────────────────────────────────────────── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-row {
  display: grid; align-items: center; gap: 4px 14px;
  grid-template-columns: 74px 118px minmax(140px, 1fr) 92px 112px 56px;
  grid-template-areas: 'time who what amt tx ver' 'time who why why why why';
  padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.feed-row:last-child { border-bottom: 0; }
.feed-row > * { min-width: 0; }
.feed-row .f-time { grid-area: time; align-self: start; font: 400 12px/1.4 var(--f-mono); color: var(--muted); padding-top: 3px; }
.feed-row .f-who { grid-area: who; align-self: start; display: flex; align-items: center; gap: 8px; font-weight: 500; padding-top: 2px; }
.feed-row .f-who a:hover { color: var(--gold-2); }
.feed-row .f-what { grid-area: what; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 500 13px/1.3 var(--f-mono); }
.feed-row .f-amt { grid-area: amt; text-align: right; font: 500 13px/1.3 var(--f-mono); font-variant-numeric: tabular-nums; }
.feed-row .f-tx { grid-area: tx; text-align: right; font: 400 12px/1.3 var(--f-mono); color: var(--muted); }
.feed-row .f-ver { grid-area: ver; text-align: right; font: 500 10.5px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.feed-row .f-why { grid-area: why; color: #c2baa9; font-size: 13.5px; line-height: 1.5; }
.feed-row.is-new { animation: arrive 1.6s ease-out; }
@keyframes arrive { from { background: rgba(217, 180, 106, 0.14); } to { background: transparent; } }
.feed-row.k-refusal .f-why { color: #d8b0a8; }
.feed-row.k-hold .f-why { color: var(--muted); font-style: italic; }
.hash { font-family: var(--f-mono); color: var(--text); border-bottom: 1px dotted rgba(217, 180, 106, 0.45); }
.hash:hover { color: var(--gold-2); border-bottom-color: var(--gold-2); }
.f-ver a { color: var(--gold); }
.f-ver a:hover { color: var(--gold-2); }
@media (max-width: 760px) {
  .feed-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'who time' 'what amt' 'why why' 'tx ver'; gap: 6px 10px; padding: 14px 0; }
  .feed-row .f-time { padding: 0; text-align: right; }
  .feed-row .f-tx { text-align: left; }
}

/* ── tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 10px/1.2 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table td.num, .table td .num { font-variant-numeric: tabular-nums; }

/* ── skeletons ──────────────────────────────────────── */
.sk { display: inline-block; min-width: 3em; height: 0.9em; border-radius: 4px; background: linear-gradient(90deg, rgba(239,232,218,0.05), rgba(239,232,218,0.11), rgba(239,232,218,0.05)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; vertical-align: middle; color: transparent !important; }
.sk-block { display: block; height: 72px; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── forms ──────────────────────────────────────────── */
.field { display: grid; gap: 8px; }
.field > .label { display: flex; justify-content: space-between; gap: 8px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: rgba(9, 8, 7, 0.6); color: var(--text); font: 400 14px/1 var(--f-mono); transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.5; font-family: var(--f-body); resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 180, 106, 0.14); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type='range'] { width: 100%; accent-color: var(--gold); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 24px; border-radius: 999px; background: rgba(239, 232, 218, 0.1); border: 1px solid var(--line-2); position: relative; transition: 0.2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: 0.2s; }
.switch input:checked + .track { background: rgba(184, 50, 42, 0.35); border-color: var(--hood); }
.switch input:checked + .track::after { left: 23px; background: #ff8f84; }
.switch input:focus-visible + .track { outline: 1.5px solid var(--gold); outline-offset: 3px; }

/* ── notices ────────────────────────────────────────── */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r); border: 1px solid rgba(217, 180, 106, 0.28); background: rgba(217, 180, 106, 0.05); color: #d6cdbb; font-size: 14px; }
.notice b { color: var(--text); font-weight: 600; }
.notice .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--f-mono); color: #1a1205; background: var(--gold); margin-top: 1px; }
.notice-sim { border-color: rgba(240, 166, 58, 0.45); border-style: dashed; background: rgba(240, 166, 58, 0.05); }
.notice-sim .ic { background: var(--amber); }
.notice-hood { border-color: rgba(184, 50, 42, 0.55); background: rgba(184, 50, 42, 0.07); }
.notice-hood .ic { background: var(--hood); color: #fff; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── key/value lists ────────────────────────────────── */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { font: 500 10.5px/1.9 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── receipt (ivory paper) ──────────────────────────── */
.receipt {
  position: relative; color: #241b10; background: linear-gradient(180deg, #f7f0e1, #ece2cc);
  border-radius: 6px; padding: 30px 28px 34px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  font: 400 13px/1.55 var(--f-mono);
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 100% / 18px 100% repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 7px) no-repeat;
          mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 100% / 18px 100% repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 7px) no-repeat;
}
.receipt h3 { margin: 0; font: 600 34px/1 var(--f-display); color: #1a1205; text-align: center; letter-spacing: 0.02em; }
.receipt .rc-sub { text-align: center; font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: #8a6d38; margin-top: 8px; }
.receipt hr { border: 0; border-top: 1px dashed rgba(36, 27, 16, 0.35); margin: 18px 0; }
.receipt dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.receipt dt { color: #7a6a52; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.12em; padding-top: 2px; }
.receipt dd { margin: 0; text-align: right; overflow-wrap: anywhere; color: #1a1205; }
.receipt a { color: #6b4d12; border-bottom: 1px dotted #6b4d12; }
.receipt .rc-stamp { position: absolute; right: 18px; top: 18px; transform: rotate(8deg); border: 2px solid currentColor; border-radius: 6px; padding: 4px 8px; font: 700 11px/1 var(--f-mono); letter-spacing: 0.2em; color: #8a6d38; opacity: 0.85; }
.receipt .rc-stamp.bad { color: #a3241b; }
.receipt .rc-why { font-family: var(--f-body); font-size: 14px; color: #3a2d1c; font-style: italic; }

/* ── verifier checks ────────────────────────────────── */
.checks { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.check { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .mk { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font: 600 14px/1 var(--f-mono); color: var(--muted); }
.check[data-s='pass'] .mk { background: rgba(127, 209, 160, 0.12); border-color: rgba(127, 209, 160, 0.6); color: var(--up); }
.check[data-s='fail'] .mk { background: rgba(255, 107, 91, 0.12); border-color: rgba(255, 107, 91, 0.6); color: var(--down); }
.check[data-s='warn'] .mk { background: rgba(240, 166, 58, 0.12); border-color: rgba(240, 166, 58, 0.6); color: var(--amber); }
.check[data-s='run'] .mk { border-color: var(--gold); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.check h4 { margin: 4px 0 4px; font: 600 22px/1.15 var(--f-display); }
.check p { margin: 0; color: #c2baa9; font-size: 14px; }
.check .detail { margin-top: 8px; font: 400 12px/1.6 var(--f-mono); color: var(--muted); overflow-wrap: anywhere; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── docs TOC ───────────────────────────────────────── */
.toc { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; max-height: calc(100vh - var(--nav-h) - 48px); overflow: auto; padding-right: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13.5px; color: var(--muted); transition: 0.15s; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--gold-2); border-left-color: var(--gold); }

/* ── modal ──────────────────────────────────────────── */
.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid rgba(217, 180, 106, 0.3); border-radius: var(--r); background: linear-gradient(180deg, var(--panel-2), var(--ink-2)); color: var(--text); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.modal::backdrop { background: rgba(5, 4, 3, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal .m-body { padding: 26px 26px 22px; }
.modal .m-x { position: absolute; top: 14px; right: 14px; }
.steps { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--muted); }
.steps li b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 11px/1 var(--f-mono); }
.steps li.on { color: var(--text); }
.steps li.on b { border-color: var(--gold); color: var(--gold); }
.steps li.done b { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.steps li.err b { background: var(--hood); color: #fff; border-color: var(--hood); }

/* ── misc ───────────────────────────────────────────── */
.mock-ribbon { position: fixed; left: 12px; bottom: 12px; z-index: 300; padding: 7px 12px; border-radius: 6px; background: repeating-linear-gradient(-45deg, #f0a63a, #f0a63a 8px, #d48d24 8px, #d48d24 16px); color: #1a1205; font: 700 10.5px/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; box-shadow: 0 6px 20px rgba(0,0,0,0.5); pointer-events: none; }
.addr-link { font-family: var(--f-mono); font-size: 13px; }
.addr-link:hover { color: var(--gold-2); }
.code { font: 400 12.5px/1.6 var(--f-mono); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; overflow: auto; white-space: pre; color: #d8cfbd; max-height: 360px; }
.code.wrap-any { white-space: pre-wrap; overflow-wrap: anywhere; }
.btn-ghost { background: transparent; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid rgba(217, 180, 106, 0.35); background: rgba(217, 180, 106, 0.06); font: 500 11.5px/1 var(--f-mono); color: var(--gold-2); letter-spacing: 0.04em; }
.tag.off { color: var(--muted); border-color: var(--line-2); background: transparent; text-decoration: line-through; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 9px 12px; border-radius: 8px; background: rgba(9, 8, 7, 0.94); border: 1px solid var(--line-2); font: 400 12px/1.45 var(--f-mono); color: var(--muted); white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.chart-tip b { display: block; color: var(--text); font-size: 14px; font-weight: 600; }
.img-ph { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle at 50% 35%, var(--panel-3), var(--ink)); }
.img-ph svg { width: 58%; height: 58%; }
