/* ============================================================================
   CARDCORE — domain components
   The card face and the things only this product has: the lifecycle rail, the
   clock chips, the chain visualiser, the custody map, the funnel, the heatmap,
   the risk meter, the channel simulators (phone, USSD, WhatsApp), the ledger
   viewer and the compliance clause blocks.
   ==========================================================================*/

/* ------------------------------------------------------------- card faces */
.cc-card { display: inline-block; border-radius: var(--r-card); box-shadow: var(--shadow-card); line-height: 0; position: relative; }
.cc-card svg { border-radius: var(--r-card); display: block; }
.cc-tilt { transition: transform var(--t-slow) var(--ease-out), box-shadow var(--t-slow) var(--ease-out); transform-style: preserve-3d; will-change: transform; }
.cc-tilt:hover { transform: perspective(900px) rotateX(4deg) rotateY(-7deg) translateY(-5px); box-shadow: 0 34px 60px -20px rgba(13, 18, 40, 0.6), 0 6px 16px rgba(13, 18, 40, 0.2); }
.cc-mini { display: inline-flex; align-items: flex-end; width: 34px; height: 22px; border-radius: 4px; padding: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.25); flex-shrink: 0; }
.cc-mini i { width: 8px; height: 6px; border-radius: 1.5px; display: block; }

.card-stack { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* --------------------------------------------------------- hero card fan */
.hero-fan { position: relative; height: 340px; display: flex; align-items: center; justify-content: center; perspective: 1400px; }
.hero-card { position: absolute; transition: transform var(--t-slow) var(--ease-out); }
.hero-card .cc-card { box-shadow: 0 30px 60px -24px rgba(13, 18, 40, 0.68), 0 4px 14px rgba(13, 18, 40, 0.18); }
.hc0 { transform: translate(-96px, -46px) rotate(-13deg) scale(0.9); z-index: 1; opacity: 0.96; }
.hc1 { transform: translate(52px, 12px) rotate(9deg) scale(0.95); z-index: 2; }
.hc2 { transform: translate(-16px, 62px) rotate(-3deg); z-index: 3; }
.hero-fan:hover .hc0 { transform: translate(-124px, -62px) rotate(-16deg) scale(0.9); }
.hero-fan:hover .hc1 { transform: translate(74px, 22px) rotate(12deg) scale(0.95); }
.hero-fan:hover .hc2 { transform: translate(-16px, 52px) rotate(-3deg) scale(1.02); }
@media (max-width: 900px) { .hero-fan { height: 280px; transform: scale(0.82); } }
@media (max-width: 520px) { .hero-fan { height: 240px; transform: scale(0.64); } }

/* ------------------------------------------------------- lifecycle rail */
.lifecycle { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.lifecycle::-webkit-scrollbar { display: none; }
.lc-step { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 92px; position: relative; flex: 1; }
.lc-step::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.lc-step:first-child::before { display: none; }
.lc-step.done::before, .lc-step.now::before { background: var(--ultra); }
.lc-dot { width: 27px; height: 27px; border-radius: 50%; background: var(--bg-3); color: var(--ink-4); display: flex; align-items: center; justify-content: center; z-index: 1; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); transition: all var(--t-base) var(--ease-out); }
.lc-step.done .lc-dot { background: var(--ultra-solid); color: #fff; box-shadow: 0 0 0 1px var(--ultra-solid); }
.lc-step.now .lc-dot { background: var(--ultra-solid); color: #fff; box-shadow: 0 0 0 1px var(--ultra-solid), 0 0 0 5px var(--ultra-wash); }
.lc-step.bad .lc-dot { background: var(--rose-solid); color: #fff; box-shadow: 0 0 0 1px var(--rose-solid), 0 0 0 5px var(--rose-wash); }
.lc-step.bad::before { background: var(--rose); }
.lc-lbl { font-size: 10.5px; font-weight: 600; color: var(--ink-3); text-align: center; line-height: 1.25; max-width: 92px; }
.lc-step.done .lc-lbl, .lc-step.now .lc-lbl { color: var(--ink); }
.lc-ts { font-size: 9.5px; color: var(--ink-4); font-family: var(--font-mono); }

/* ------------------------------------------------------------ clock chips */
.clock-tile { border: 1px solid var(--line); border-radius: var(--r-2); padding: 11px 13px; background: var(--card); display: flex; gap: 11px; align-items: flex-start; position: relative; overflow: hidden; }
.clock-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--jade); }
.clock-tile.warn::before { background: var(--amber); }
.clock-tile.bad::before { background: var(--rose); }
.clock-tile.done::before { background: var(--ink-4); }
.clock-time { font-family: var(--font-mono); font-size: 17px; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.clock-tile.bad .clock-time { color: var(--rose-ink); }
.clock-tile.warn .clock-time { color: var(--amber-ink); }

/* --------------------------------------------------------------- funnel */
.funnel-row { display: flex; flex-direction: column; gap: 3px; }
.funnel-bar { height: 22px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.funnel-bar > i { display: block; height: 100%; border-radius: 6px; transition: width 900ms var(--ease-out); }

/* --------------------------------------------------------------- heatmap */
.heat { display: flex; flex-direction: column; gap: 3px; }
.heat-row { display: flex; align-items: center; gap: 3px; }
.heat-lbl { width: 96px; flex-shrink: 0; text-align: right; padding-right: 6px; }
.heat-cell { flex: 1; height: 20px; border-radius: 3px; min-width: 8px; }
.heat-cell.heat-axis { background: none !important; opacity: 1 !important; display: flex; align-items: center; justify-content: center; height: 14px; }

/* ---------------------------------------------------------------- chain */
.chain { display: flex; flex-direction: column; gap: 0; position: relative; }
.chain-node { display: flex; gap: 12px; padding-bottom: 12px; position: relative; }
.chain-node:not(:last-child)::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: -2px; width: 2px; background: linear-gradient(var(--ultra), var(--line)); }
.chain-dot { width: 26px; height: 26px; border-radius: 8px; background: var(--ultra-wash); border: 1px solid var(--ultra); color: var(--ultra-ink); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; font-family: var(--font-mono); flex-shrink: 0; }
.chain-node.head .chain-dot { background: var(--ultra); color: #fff; }
.chain-body { min-width: 0; flex: 1; }

/* ------------------------------------------------------------ custody map */
.custody-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.node-tile { border: 1px solid var(--line); border-radius: var(--r-2); padding: 11px 12px; background: var(--card); display: flex; flex-direction: column; gap: 5px; transition: all var(--t-fast); cursor: pointer; text-align: left; }
.node-tile:hover { border-color: var(--ultra); box-shadow: var(--shadow-1); }
.node-tile .nt-top { display: flex; align-items: center; gap: 6px; }
.node-tile .nt-name { font-size: 12.5px; font-weight: 600; }
.node-tile .nt-qty { font-family: var(--font-mono); font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.node-tile.low { border-color: var(--amber); background: var(--amber-wash); }
.node-tile.out { border-color: var(--rose); background: var(--rose-wash); }

/* ------------------------------------------------------------- risk meter */
.risk-meter { display: inline-block; width: 54px; height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; vertical-align: middle; }
.risk-meter > span { display: block; height: 100%; border-radius: 999px; transition: width var(--t-slow) var(--ease-out); }
.pips { display: inline-flex; gap: 3px; align-items: center; }
.pip { width: 6px; height: 6px; border-radius: 50%; }

/* ------------------------------------------------- channel simulators */
.device-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .device-split { grid-template-columns: minmax(0, 1fr); } }

.device { width: 320px; max-width: 100%; border-radius: 34px; background: var(--vault); padding: 11px; box-shadow: var(--shadow-3); position: relative; flex-shrink: 0; }
.device::before { content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 76px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); z-index: 3; }
.device-screen { background: var(--bg); border-radius: 26px; overflow: hidden; height: 590px; display: flex; flex-direction: column; position: relative; }
.device-status { height: 30px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 18px 3px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); flex-shrink: 0; background: var(--bg); }
.device-body { flex: 1; overflow-y: auto; min-height: 0; }
.device-nav { display: flex; border-top: 1px solid var(--line); background: var(--card); flex-shrink: 0; }
.device-nav button { flex: 1; padding: 8px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 9.5px; font-weight: 600; color: var(--ink-4); }
.device-nav button.on { color: var(--ultra-ink); }

.ussd { background: #0B1020; color: #DDEBFF; border-radius: 14px; padding: 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; min-height: 210px; white-space: pre-wrap; border: 1px solid rgba(255,255,255,.14); }
.ussd .ussd-hd { color: #7FB3FF; font-size: 11px; margin-bottom: 8px; letter-spacing: .06em; }
.ussd-input { display: flex; gap: 6px; margin-top: 10px; }

.wa { background: #0B141A; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; height: 480px; border: 1px solid rgba(255,255,255,.1); }
.wa-hd { background: #1F2C34; padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: #E9EDEF; flex-shrink: 0; }
.wa-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 7px; background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.02) 0 2px, transparent 2px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.02) 0 2px, transparent 2px); background-size: 44px 44px; }
.wa-msg { max-width: 82%; padding: 7px 11px; border-radius: 9px; font-size: 13.5px; line-height: 1.45; color: #E9EDEF; box-shadow: 0 1px 1px rgba(0,0,0,.2); position: relative; word-wrap: break-word; }
.wa-msg.me { align-self: flex-end; background: #005C4B; border-top-right-radius: 2px; }
.wa-msg.them { align-self: flex-start; background: #202C33; border-top-left-radius: 2px; }
/* .6 put the timestamp at 3.48:1 on the outgoing bubble's #005C4B. WhatsApp's
   own chrome is not an excuse for text a person cannot read. */
.wa-msg .wa-t { font-size: 10px; opacity: .78; margin-top: 3px; text-align: right; }
.wa-msg .wa-who { font-size: 10px; font-weight: 700; color: #53BDEB; margin-bottom: 2px; }
.wa-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.wa-quick button { background: #202C33; color: #8FD3FF; border: 1px solid #2A3942; border-radius: 999px; padding: 5px 11px; font-size: 12px; }
.wa-in { background: #1F2C34; padding: 8px 12px; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.wa-in input { flex: 1; background: #2A3942; border: 0; border-radius: 999px; padding: 8px 14px; color: #E9EDEF; font-size: 13.5px; outline: none; }

/* ------------------------------------------------------------ atm / kiosk */
.kiosk-screen { background: linear-gradient(160deg, #101A34, #060A16); border-radius: 18px; padding: 26px; color: #EAF0FF; min-height: 380px; border: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 18px; }
.kiosk-screen .ks-t { font-family: var(--font-display); font-size: 27px; font-weight: 600; letter-spacing: -0.02em; }
.kiosk-btn { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 14px 16px; color: #EAF0FF; text-align: left; font-size: 14px; font-weight: 600; transition: all var(--t-fast); }
.kiosk-btn:hover { background: rgba(59,79,228,.3); border-color: #6B7BFF; }
.kiosk-pin { display: flex; gap: 9px; justify-content: center; }
.kiosk-pin i { width: 15px; height: 15px; border-radius: 50%; background: rgba(255,255,255,.2); display: block; }
.kiosk-pin i.on { background: var(--chip); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 260px; margin: 0 auto; }
.keypad button { aspect-ratio: 1.6; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #EAF0FF; font-size: 19px; font-family: var(--font-mono); }
.keypad button:hover { background: rgba(255,255,255,.16); }

/* --------------------------------------------------------- printer bay */
.printer { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card); padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.printer-slot { width: 100%; max-width: 320px; height: 12px; background: var(--vault); border-radius: 4px; position: relative; overflow: visible; }
.printer-card { position: absolute; left: 50%; transform: translateX(-50%) translateY(-6px); transition: transform 1.4s var(--ease-out); }
.printer-card.out { transform: translateX(-50%) translateY(28px); }

/* ------------------------------------------------------------- clause box */
.clause { border-left: 3px solid var(--ultra); background: var(--ultra-wash); padding: 10px 13px; border-radius: 0 var(--r-2) var(--r-2) 0; }
.clause .cl-ref { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ultra-ink); }
.clause .cl-t { font-size: 13px; font-weight: 600; margin-top: 1px; }
.clause .cl-x { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.clause .cl-ctl { font-size: 12px; color: var(--jade-ink); margin-top: 5px; display: flex; gap: 5px; align-items: flex-start; }
.clause.jade { border-color: var(--jade); background: var(--jade-wash); } .clause.jade .cl-ref { color: var(--jade-ink); }
.clause.rose { border-color: var(--rose); background: var(--rose-wash); } .clause.rose .cl-ref { color: var(--rose-ink); }
.clause.amber { border-color: var(--amber); background: var(--amber-wash); } .clause.amber .cl-ref { color: var(--amber-ink); }
.clause.gold { border-color: var(--chip); background: var(--chip-wash); } .clause.gold .cl-ref { color: var(--chip-ink); }
.clause.cyan { border-color: var(--cyan); background: var(--cyan-wash); } .clause.cyan .cl-ref { color: var(--cyan-ink); }
.clause.violet { border-color: var(--violet); background: var(--violet-wash); } .clause.violet .cl-ref { color: var(--violet-ink); }
.clause.vault { border-color: var(--vault); background: var(--vault-wash); } .clause.vault .cl-ref { color: var(--vault-ink); }

/* --------------------------------------------------------- check results */
.check-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-ic { width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.check-ic.ok { background: var(--jade-wash); color: var(--jade-ink); }
.check-ic.warn { background: var(--amber-wash); color: var(--amber-ink); }
.check-ic.block { background: var(--rose-wash); color: var(--rose-ink); }

/* ------------------------------------------------------------- kore panel */
.kore-panel { background: linear-gradient(150deg, var(--violet-wash), transparent 62%); border: 1px solid var(--violet); border-radius: var(--r-3); padding: 16px; }
.kore-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--violet-solid); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.kore-line { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; font-size: 13.5px; line-height: 1.5; }
.kore-line .kl-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.kore-sug { border: 1px solid var(--line); border-radius: var(--r-2); padding: 11px 13px; background: var(--card); display: flex; gap: 10px; align-items: flex-start; }
.autonomy-scale { display: flex; gap: 3px; }
.autonomy-scale button { flex: 1; padding: 5px 4px; font-size: 10.5px; font-weight: 600; border-radius: 6px; background: var(--bg-2); color: var(--ink-3); }
.autonomy-scale button.on { background: var(--violet-solid); color: #fff; }

/* ------------------------------------------------------------ ledger view */
.jentry { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; font-size: 13px; }
.jentry:last-child { border-bottom: 0; }
.jentry:hover { background: var(--bg-2); }
.jseq { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); padding-top: 2px; }
.jtype { font-weight: 600; font-size: 12.5px; }
.jhash { font-family: var(--font-mono); font-size: 10.5px; color: var(--ultra-ink); opacity: .8; word-break: break-all; }

/* ---------------------------------------------------------------- misc */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.split.wide-side { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1180px) { .split, .split.wide-side { grid-template-columns: minmax(0, 1fr); } }
.sticky-side { position: sticky; top: calc(var(--topbar) + 16px); }
@media (max-width: 1180px) { .sticky-side { position: static; } }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-tile { border: 1px solid var(--line); border-radius: var(--r-2); padding: 9px 11px; background: var(--card-2); }
.mini-tile .mt-k { font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.mini-tile .mt-v { font-family: var(--font-mono); font-size: 16px; font-weight: 600; letter-spacing: -0.03em; }

.banner { border-radius: var(--r-3); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); }
.banner.ultra { background: var(--ultra-wash); border-color: var(--ultra); }
.banner.jade { background: var(--jade-wash); border-color: var(--jade); }
.banner.amber { background: var(--amber-wash); border-color: var(--amber); }
.banner.rose { background: var(--rose-wash); border-color: var(--rose); }
.banner.violet { background: var(--violet-wash); border-color: var(--violet); }
.banner.vault { background: var(--vault-wash); border-color: var(--line-2); }
.banner .bn-ic { flex-shrink: 0; margin-top: 1px; }

.code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; overflow-x: auto; white-space: pre; line-height: 1.6; color: var(--ink-2); }
.code .k { color: var(--ultra-ink); } .code .s { color: var(--jade-ink); } .code .c { color: var(--ink-4); font-style: italic; }

.legend { display: flex; gap: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: block; }

.mask-toggle { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 13px; }

/* stepper for multi-step flows (new request, ceremony, destruction) */
.stepper { display: flex; gap: 0; margin-bottom: 18px; }
.step { flex: 1; display: flex; flex-direction: column; gap: 5px; position: relative; padding-top: 22px; }
.step::before { content: ''; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: var(--line); }
.step.done::before, .step.on::before { background: var(--ultra); }
.step::after { content: ''; position: absolute; top: 3px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--bg-3); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.step.done::after, .step.on::after { background: var(--ultra); box-shadow: 0 0 0 1px var(--ultra); }
.step .st-l { font-size: 11px; font-weight: 600; color: var(--ink-4); text-align: center; }
.step.on .st-l, .step.done .st-l { color: var(--ink); }

/* the "prove it" strip that appears under numbers that must be defensible */
.proof { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-3); }
.proof .ic { color: var(--jade-ink); }

/* scrollable side list (requests, cards, disputes) */
.list-pane { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--card); overflow: hidden; display: flex; flex-direction: column; }
.list-row { display: flex; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t-fast); align-items: flex-start; text-align: left; width: 100%; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--bg-2); }
.list-row.on { background: var(--ultra-wash); box-shadow: inset 3px 0 0 var(--ultra); }
