/* Terminal page: rounded panels on the dark ground, paper receipt on the right. */

body.terminal {
  --r: 99px;
  background: radial-gradient(90% 60% at 50% 0%, #101a13 0%, var(--void) 62%) no-repeat, var(--void);
  min-height: 100vh;
}
.shell { padding-block: 0 40px; }

.t-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-block: 18px; }
.t-bar .crumb { color: var(--fg-dim); font-size: 0.8125rem; }
.t-bar nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.t-bar nav a:not(.btn) { font-size: 0.8125rem; color: var(--fg-soft); text-decoration: none; }
.t-bar nav a:not(.btn):hover { color: var(--fg); text-decoration: underline; }
.clock { font-size: 0.8125rem; color: var(--fg-soft); font-variant-numeric: tabular-nums; }

.t-hero { display: grid; justify-items: center; gap: 12px; text-align: center; padding-block: clamp(12px, 3vw, 34px) 26px; }
.t-hero h1 { font-family: var(--font-pixel); font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 300; }
.t-hero > p:not(.lookup-msg) { color: var(--fg-soft); }
.t-lookup {
  display: grid; gap: 6px; width: min(100%, 720px); margin-top: 10px; padding: 8px 10px 10px 18px;
  border: 1px solid var(--line); border-radius: 22px; background: rgba(16, 23, 19, 0.85);
}
.t-lookup:focus-within { border-color: var(--lime); }
.t-lookup input { width: 100%; min-height: 48px; border: 0; background: transparent; color: var(--fg); font-family: var(--font-mono); font-size: 1rem; }
.t-lookup input::placeholder { color: var(--fg-dim); }
.t-lookup input:focus-visible { outline: none; }
.t-lookup-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.keyhint { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--fg-dim); }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 5px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-soft); }
.t-hero .lookup-msg { min-height: 1.6em; font-size: 0.8125rem; color: var(--fg-soft); }
.t-hero .lookup-msg button { border: 0; padding: 0; background: none; color: var(--lime); text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }

.tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 22px; }
.tab { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--fg-soft); cursor: pointer; font-size: 0.8125rem; }
.tab:hover { border-color: var(--fg-soft); color: var(--fg); }
.tab[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
.tab span { opacity: 0.7; margin-left: 8px; }

.card { border: 1px solid var(--line); border-radius: 20px; background: rgba(16, 23, 19, 0.9); min-width: 0; }
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 20px 22px 12px; }
.card-head h2 { font-family: var(--font-pixel-sm); font-size: 1.625rem; font-weight: 500; line-height: 1.1; letter-spacing: 0; }
.mini { font-size: 0.75rem; color: var(--fg-dim); }
.pill { padding: 3px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 0.75rem; color: var(--fg-soft); white-space: nowrap; }

.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 396px); gap: 18px; align-items: start; }

.list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 0 22px 14px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--void); }
.seg button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-dim); cursor: pointer; font-size: 0.75rem; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: #24361d; color: var(--lime); }

.caller-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 22px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--void); }
.caller-bar .who { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.caller-bar .who div { display: grid; line-height: 1.35; min-width: 0; }
.caller-bar .who span { font-size: 0.75rem; color: var(--fg-soft); }

.call-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 640px; overflow-y: auto; border-radius: 0 0 20px 20px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.call-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 72px 78px; align-items: center; gap: 12px;
  width: 100%; padding: 11px 20px 11px 18px;
  border: 0; border-bottom: 1px solid var(--line-soft); border-left: 3px solid transparent;
  background: transparent; color: var(--fg); text-align: left; cursor: pointer;
}
.call-row:hover { background: rgba(255, 255, 255, 0.03); }
.call-row[aria-current="true"] { background: #1c2a18; border-left-color: var(--lime); }
.call-row[aria-current="true"] .call-main > span { color: var(--fg-soft); }
.call-main { display: grid; min-width: 0; line-height: 1.35; }
.call-main strong { font-size: 0.875rem; font-weight: 600; }
.call-main > span { font-size: 0.75rem; color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-row .spark { width: 72px; height: 24px; }
.call-row .result { justify-self: end; font-size: 0.8125rem; }
.ca-tag { margin-left: 8px; font-size: 0.6875rem; font-weight: 400; color: var(--fg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.empty { padding: 28px 22px; color: var(--fg-soft); max-width: 40em; }

.detail { position: sticky; top: 14px; min-width: 0; }
.detail-paper { filter: drop-shadow(0 16px 22px var(--paper-shadow)); }
.detail .receipt { border-radius: 18px 18px 0 0; }

.evidence { margin-top: 18px; padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px clamp(20px, 4vw, 44px); }
.ev-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ev-head h2 { font-family: var(--font-pixel-sm); font-size: 1.5rem; font-weight: 500; letter-spacing: 0; }
.ev-left { display: grid; gap: 16px; align-content: start; min-width: 0; }
.ev-token { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ev-token strong { font-family: var(--font-pixel-sm); font-size: 2.25rem; font-weight: 500; line-height: 1; }
.ev-by { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--fg-soft); }
.ev-by .avatar { width: 26px; height: 26px; font-size: 0.75rem; }
.ev-by b { color: var(--lime); font-weight: 500; }
.ev-check { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--void); }
.ev-check .top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.ev-check .big { font-family: var(--font-pixel-sm); font-size: 2.5rem; font-weight: 500; line-height: 1; color: var(--lime); }
.ev-check.down .big { color: var(--down); }
.ev-check .verdict { font-size: 0.875rem; font-weight: 600; color: var(--lime); }
.ev-check.down .verdict { color: var(--down); }
.ev-check ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ev-check li { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--fg-dim); }
.ev-check li b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.ev-note { font-size: 0.8125rem; color: var(--fg-soft); max-width: 44em; }
.ev-right { display: grid; gap: 16px; align-content: start; min-width: 0; }
.ev-quote { padding: 16px 18px; border: 1px solid var(--line); border-left: 2px solid var(--lime); border-radius: 0 14px 14px 0; background: var(--void); line-height: 1.55; }
.ev-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 0.8125rem; }
.ev-list dt { color: var(--fg-dim); }
.ev-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.table-scroll { position: relative; overflow-x: auto; padding: 0 10px 10px; }
.callers { width: 100%; min-width: 740px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.callers th { text-align: left; font-size: 0.75rem; font-weight: 400; color: var(--fg-dim); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.callers td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.callers tr:last-child td { border-bottom: 0; }
.callers .num { text-align: right; }
.caller-link { display: inline-flex; align-items: center; gap: 10px; border: 0; padding: 0; background: none; color: var(--fg); cursor: pointer; text-align: left; }
.caller-link div { display: grid; line-height: 1.3; }
.caller-link strong { font-weight: 600; text-decoration: underline; text-decoration-color: var(--fg-dim); text-underline-offset: 0.22em; }
.caller-link:hover strong { text-decoration-color: var(--lime); }
.caller-link span { font-size: 0.75rem; color: var(--fg-dim); }
.callers .best { white-space: nowrap; color: var(--fg-soft); }
.btn[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }

.t-foot { display: grid; gap: 6px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 0.75rem; color: var(--fg-dim); }

@media (max-width: 940px) {
  .t-grid { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; width: 100%; max-width: 430px; justify-self: center; }
  .evidence { grid-template-columns: minmax(0, 1fr); }
  .call-list { max-height: 420px; }
}
@media (max-width: 640px) {
  .t-bar nav a:not(.btn), .clock { display: none; }
  .call-row { grid-template-columns: auto minmax(0, 1fr) auto; padding-inline: 12px 14px; }
  .call-row .spark { display: none; }
  .card-head, .list-tools { padding-inline: 16px; }
  .caller-bar { margin-inline: 16px; }
  .evidence { padding: 16px; }
  .ev-check ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { padding: 0 13px; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .t-hero h1 { animation: scan-in 0.9s steps(20, end) 0.1s backwards; }
  .t-hero h1 .cursor { animation: blink 0.5s steps(1) 1.1s 4; }
  .t-hero > p:not(.lookup-msg) { animation: lock-in 0.8s cubic-bezier(0.18, 0.66, 0.17, 1) 0.3s backwards; }
  .t-lookup { animation: swap 0.7s cubic-bezier(0.16, 0.75, 0.25, 1) 0.35s backwards; }
  .tabs { animation: fade 0.5s 0.55s backwards; }
  .list-card { animation: swap 0.7s cubic-bezier(0.16, 0.75, 0.25, 1) 0.55s backwards; }
  .detail-paper.fresh { animation: print 0.5s steps(14, end) both; }
  .evidence.fresh .ev-left > *, .evidence.fresh .ev-right > * { animation: swap 0.45s cubic-bezier(0.16, 0.75, 0.25, 1) both; }
  .evidence.fresh .ev-left > *:nth-child(2), .evidence.fresh .ev-right > *:nth-child(2) { animation-delay: 60ms; }
  .evidence.fresh .ev-left > *:nth-child(3) { animation-delay: 120ms; }
  .evidence.fresh .ev-left > *:nth-child(4) { animation-delay: 180ms; }
  .call-row[aria-current="true"] .spark path { stroke-dasharray: 1; animation: draw 0.8s ease-out both; }
  .call-row { transition: background 0.15s; }
}

.ev-link { justify-self: start; font-size: 0.8125rem; color: var(--lime); }
