@import url('/demo/mock/tokens.css');

/* ══════════════════════════════════════════════════════════════════
   HYPERCADE — PUBLISHER PORTFOLIO MOCK · SHELL

   Shared chrome for the four dark screens: app-shell header replica,
   a 1600 x 1000 page frame, and the KPI tile / table / card / chip /
   dot / rail atoms every lens uses. Dark mode only.

   Tokens come from shared/hypercade-ui.css, imported above. Nothing
   here redefines a colour — only layout, density and composition.
   ══════════════════════════════════════════════════════════════════ */

/* ── Page frame ─────────────────────────────────────────────────── */

html, body {
  width: 1600px;
  height: 1000px;
  overflow: hidden;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.page {
  position: relative;
  width: 1600px;
  height: 1000px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 900px 520px at 12% -8%, rgba(83, 74, 183, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 760px 420px at 96% 4%, rgba(216, 90, 48, 0.08) 0%, transparent 70%),
    var(--bg);
}

.page-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 24px 0;
}

/* ── Header replica ─────────────────────────────────────────────── */

.page .hyp-header {
  position: static;
  margin-bottom: 0;
  background: rgba(10, 10, 16, 0.72);
  flex-shrink: 0;
}

.page .hyp-header-inner {
  max-width: none;
  padding: 10px 24px 8px;
}

.page .hyp-header-primary { padding-bottom: 9px; }

.page .hyp-header-secondary {
  min-height: 0;
  padding-top: 8px;
  gap: 6px;
  flex-wrap: nowrap;
}

.hyp-logo-link { display: inline-flex; align-items: center; gap: 10px; }
.logo-icon { box-shadow: 0 2px 10px rgba(216, 90, 48, 0.35); }
.logo-text { display: flex; flex-direction: column; }

.hyp-tool-switcher-pill { cursor: default; }
.hyp-game-switcher-trigger { cursor: default; }
.header-btn { cursor: default; }

.lens-tab {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.lens-tab.is-current {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-light);
}

.route-label {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
}

/* ── Section headings ───────────────────────────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.section-head .section-label { margin-bottom: 0; }

.section-note {
  font-size: 11.5px;
  color: var(--text-muted);
}

.section-note strong { color: var(--text-secondary); font-weight: 500; }

/* ── KPI tiles ──────────────────────────────────────────────────── */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 18px;
}

.kpi {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(18, 18, 28, 0.55) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px 13px;
  overflow: hidden;
}

.kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--border-light);
}

.kpi.is-accent::before { background: var(--accent); }
.kpi.is-purple::before { background: var(--purple); }
.kpi.is-critical::before { background: var(--critical); }
.kpi.is-warning::before { background: var(--warning); }
.kpi.is-green::before { background: var(--green); }

.kpi-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  display: block;
}

.kpi-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-left: 4px;
}

.kpi-note {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.kpi-note.mono { font-family: var(--mono); font-size: 10.5px; color: var(--text-muted); }

/* ── Main split: content + right rail ───────────────────────────── */

.grid-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 306px;
  gap: 18px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 26, 40, 0.45);
}

.panel-head .section-label { margin-bottom: 0; }

.panel-head .count-pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 1px 8px;
}

/* ── Surface table ──────────────────────────────────────────────── */

.surface-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.surface-table th {
  background: transparent;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: bottom;
}

.surface-table th .th-sub {
  display: block;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #4a5468;
  margin-top: 2px;
}

.surface-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 12px;
}

.surface-table tbody tr:last-child td { border-bottom: none; }
.surface-table tbody tr:nth-child(even) td { background: rgba(10, 10, 16, 0.35); }

.surface-table td + td { border-left: 1px solid rgba(34, 34, 53, 0.7); }

/* Title block */
.t-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 5px;
}

.t-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.t-meta .sep { color: #333349; margin: 0 5px; }
.t-budget { font-family: var(--mono); color: var(--text-secondary); }

/* Generic cell atoms */
.metric {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.2;
}

.metric .of { font-size: 10.5px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }

.metric-row { display: flex; align-items: center; gap: 8px; }

.sub {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.sub.mono { font-family: var(--mono); font-size: 10px; }
.sub.strong { color: var(--text-secondary); }

.cell-stack > * + * { margin-top: 4px; }

.cell-empty {
  font-size: 11px;
  color: #4a5468;
  line-height: 1.4;
}

.finding {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trend {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.trend.is-up { color: var(--green); }
.trend.is-down { color: var(--critical); }

/* ── Chips ──────────────────────────────────────────────────────── */

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}

.chip-live      { color: var(--green);    background: rgba(34, 197, 94, 0.11);  border-color: rgba(34, 197, 94, 0.30); }
.chip-production{ color: var(--accent);   background: rgba(216, 90, 48, 0.11);  border-color: rgba(216, 90, 48, 0.32); }
.chip-preproduction { color: #8b83e8;     background: rgba(83, 74, 183, 0.16);  border-color: rgba(83, 74, 183, 0.42); }
.chip-concept   { color: var(--text-secondary); background: rgba(148, 163, 184, 0.09); border-color: var(--border-light); }
.chip-critical  { color: var(--critical); background: rgba(239, 68, 68, 0.11);  border-color: rgba(239, 68, 68, 0.32); }
.chip-warning   { color: var(--warning);  background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.30); }
.chip-advisory  { color: var(--advisory); background: rgba(59, 130, 246, 0.11); border-color: rgba(59, 130, 246, 0.32); }
.chip-green     { color: var(--green);    background: rgba(34, 197, 94, 0.11);  border-color: rgba(34, 197, 94, 0.30); }
.chip-muted     { color: var(--text-muted); background: rgba(100, 116, 139, 0.08); border-color: var(--border); }

.chip-lg { font-size: 9.5px; padding: 3px 9px; }

/* ── Dots ───────────────────────────────────────────────────────── */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
}

.dot-green  { background: var(--green);      box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14); }
.dot-red    { background: var(--critical);   box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14); }
.dot-amber  { background: var(--warning);    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14); }
.dot-blue   { background: var(--advisory);   box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14); }
.dot-muted  { background: #3a3a52; }

.dot-sm { width: 6px; height: 6px; box-shadow: none; }

/* ── Right rail ─────────────────────────────────────────────────── */

.rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.alert-list { padding: 4px 0; }

.alert-item {
  padding: 11px 14px 12px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--border);
}

.alert-list .alert-item:last-child { border-bottom: none; }

.alert-item.sev-critical { border-left-color: var(--critical); }
.alert-item.sev-warning  { border-left-color: var(--warning); }
.alert-item.sev-advisory { border-left-color: var(--advisory); }

.alert-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.alert-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}

.alert-lens {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.alert-headline {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 3px;
}

.alert-text {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.note-card {
  background: rgba(83, 74, 183, 0.07);
  border: 1px solid rgba(83, 74, 183, 0.28);
  border-radius: 8px;
  padding: 11px 13px;
}

.note-card .note-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b83e8;
  display: block;
  margin-bottom: 4px;
}

.note-card p { font-size: 10.5px; line-height: 1.5; color: var(--text-secondary); }

/* ── Page footer ────────────────────────────────────────────────── */

.page-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px 10px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.foot-flag {
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 3px;
  padding: 1px 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9px;
}

.foot-mark { margin-left: auto; color: #3f4759; }

/* ── Misc ───────────────────────────────────────────────────────── */

.spark { display: block; }

.stack-h { display: flex; align-items: center; gap: 6px; }
.stack-h.wrap { flex-wrap: wrap; }

/* ── Fill helpers: let a panel and its table use the full column height ── */

.panel.fill {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.table-wrap {
  flex: 1;
  min-height: 0;
}

.table-wrap .surface-table { height: 100%; }

.rail { height: 100%; }
.rail > .panel.fill { flex: 1; }

.alert-list {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.alert-list .alert-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Vertically centre cell content when rows are stretched to fill the panel. */
.surface-table.v-middle td { vertical-align: middle; }

/* Second note line in a KPI tile sits tight under the first. */
.kpi-note + .kpi-note { margin-top: 2px; }
