/* Squyr Portal — Operational interface layer
   Mirrors squyr/styles.css tokens (t-* prefix) and adds portal-only primitives.
   CSS vars are inlined here so the @import is not required for the browser. */

html { height: 100%; }
body { margin: 0; background: var(--t-bg-canvas); min-height: 100vh; }

/* ── SHARED TOKENS (mirrors squyr/styles.css) ─────────────────────── */
:root {
  --t-bg:           #08080A;
  --t-bg-canvas:    #0A0A0C;
  --t-surface:      #111114;
  --t-raised:       #16161A;
  --t-input:        #0E0E11;
  --t-border:       #1F1F24;
  --t-border-strong:#2C2C33;
  --t-text:         #F3F3F5;
  --t-dim:          #8A8A92;
  --t-mute:         #5B5B62;
  --t-faint:        #3A3A40;
  --t-summit:       #EB0557;
  --t-summit-soft:   rgba(235,5,87,0.12);
  --t-summit-line:   rgba(235,5,87,0.35);
  --t-cyan:         #00FFFF;
  --t-cyan-soft:     rgba(0,255,255,0.10);
  --t-cyan-line:     rgba(0,255,255,0.30);
  --t-warn:         #F0B429;
  --t-warn-soft:     rgba(240,180,41,0.10);
  --t-fail:         #E84A4A;
  --t-fail-soft:     rgba(232,74,74,0.10);
  --t-font: "Inter","Inter Tight",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  --t-mono: "JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}

/* ─── PORTAL SHELL LAYOUT ─────────────────────────────────────────── */
.tp-root, .tp-root * { box-sizing: border-box; }
.tp-root {
  font-family: var(--t-font);
  color: var(--t-text);
  background: var(--t-bg-canvas);
  width: 100%;
  height: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "header header" "sidebar main" "footer footer";
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
}
.tp-root::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0.1));
  z-index: 0;
}
.tp-root > * { position: relative; z-index: 1; }
.tp-root *::-webkit-scrollbar { display: none; }
.tp-root * { scrollbar-width: none; }

/* ─── HEADER ─────────────────────────────────────────────────────── */
.tp-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--t-border);
  background: rgba(8,8,10,0.92);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.tp-headerleft { display: flex; align-items: center; gap: 14px; }
.tp-headermark { height: 36px; width: auto; display: block; }
.tp-headerbrand {
  font-family: var(--t-font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
}
.tp-headerbrand-dot { color: var(--t-summit); font-weight: 700; }
.tp-headerdivider { width: 1px; height: 22px; background: var(--t-border); }
.tp-headersub { font-size: 13px; color: var(--t-dim); letter-spacing: 0.04em; }
.tp-headernav { display: flex; align-items: center; gap: 2px; }
.tp-headerlink {
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--t-font);
  font-size: 13px;
  color: var(--t-dim);
  cursor: pointer;
  transition: all .14s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tp-headerlink:hover { color: var(--t-text); background: rgba(255,255,255,0.03); }
.tp-headerlinkactive { color: var(--t-text); background: var(--t-summit-soft); }
.tp-headerlink-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--t-cyan);
  box-shadow: 0 0 0 3px rgba(0,255,255,0.18);
}
.tp-headerright { display: flex; align-items: center; gap: 14px; }
.tp-org {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--t-input);
  border: 1px solid var(--t-border);
  border-radius: 6px;
  font-family: var(--t-mono);
  font-size: 12px;
  cursor: pointer;
}
.tp-org-name { color: var(--t-text); font-weight: 500; }
.tp-org-key { color: var(--t-mute); letter-spacing: 0.04em; }
.tp-session {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--t-dim);
  letter-spacing: 0.1em;
}
.tp-session b { color: var(--t-cyan); font-weight: 500; }
.tp-user {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--t-summit);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* ─── SIDEBAR ───────────────────────────────────────────────────── */
.tp-sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--t-border);
  background: #06060A;
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.tp-sidebargroup { display: flex; flex-direction: column; gap: 2px; }
.tp-sidebarheading {
  font-family: var(--t-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t-mute);
  padding: 14px 10px 8px;
  font-weight: 600;
}
.tp-sidebarheading:first-child { padding-top: 4px; }
.tp-sidebaritem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--t-dim);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
}
.tp-sidebaritem:hover { color: var(--t-text); background: rgba(255,255,255,0.03); }
.tp-sidebaritemactive { background: var(--t-summit-soft); color: var(--t-text); }
.tp-sidebaritemactive::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 0 1px 1px 0;
  background: var(--t-summit);
}
.tp-sidebaricon { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.85; }
.tp-sidebarbadge {
  margin-left: auto;
  font-family: var(--t-mono);
  font-size: 9.5px;
  background: var(--t-cyan);
  color: #000;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tp-sidebarspacer { flex: 1 1 auto; }
.tp-sidebarfootitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  font-size: 12.5px;
  color: var(--t-mute);
  border-top: 1px solid var(--t-border);
  margin-top: 8px;
}

/* ─── MAIN ──────────────────────────────────────────────────────── */
.tp-main {
  grid-area: main;
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 0;
}
.tp-mainno-rail { grid-template-columns: 1fr; }
.tp-content {
  padding: 28px 36px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.tp-rail {
  border-left: 1px solid var(--t-border);
  background: #07070A;
  padding: 22px 22px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── PAGE HEADER ────────────────────────────────────────────────── */
.tp-pagehead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--t-border);
  gap: 24px;
}
.tp-pageheadkicker {
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t-mute);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.tp-pageheadkicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--t-summit);
}
.tp-pageheadtitle {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.1;
}
.tp-pageheadtitle em { font-style: normal; color: var(--t-cyan); }
.tp-pageheadsub {
  font-size: 13.5px;
  color: var(--t-dim);
  margin-top: 6px;
  max-width: 720px;
}

/* ─── KPI CELLS (TOP STRIP) ─────────────────────────────────────── */
.tp-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--t-border);
  border: 1px solid var(--t-border);
  border-radius: 10px;
  overflow: hidden;
}
.tp-kpi-cell {
  background: rgba(17,17,20,0.6);
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tp-kpi-cap {
  font-family: var(--t-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-mute);
  font-weight: 600;
}
.tp-kpi-val {
  font-family: var(--t-mono);
  font-variant-numeric: tabular-nums;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-top: 2px;
  background: linear-gradient(180deg, var(--t-summit) 0%, var(--t-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tp-kpi-sub { font-size: 12px; color: var(--t-dim); margin-top: 4px; }

/* ─── PANEL ──────────────────────────────────────────────────────── */
.tp-panel {
  border: 1px solid var(--t-border);
  background: rgba(17,17,20,0.6);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  overflow: hidden;
}
.tp-panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--t-border);
  background: rgba(255,255,255,0.012);
}
.tp-panelhead-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-dim);
  font-weight: 600;
}
.tp-panelhead-title b { color: var(--t-text); font-weight: 600; }
.tp-panelhead-key { font-family: var(--t-mono); font-size: 10px; color: var(--t-mute); letter-spacing: 0.12em; font-weight: 600; }
.tp-panelbody { padding: 18px; }
.tp-panelbodyflush { padding: 0; }

/* ─── BUTTONS / PILLS ────────────────────────────────────────────── */
.tp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 7px;
  font-family: var(--t-font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .14s;
  text-decoration: none;
}
.tp-btnprimary { background: var(--t-summit); color: #fff; }
.tp-btnprimary:hover { background: #c4044a; }
.tp-btncyan { background: transparent; border-color: var(--t-cyan-line); color: var(--t-cyan); }
.tp-btncyan:hover { background: var(--t-cyan-soft); }
.tp-btnghost { background: transparent; border-color: var(--t-border-strong); color: var(--t-text); }
.tp-btnghost:hover { background: rgba(255,255,255,0.04); }
.tp-btnsm { padding: 7px 12px; font-size: 11.5px; }
.tp-btnfail { background: transparent; border-color: rgba(232,74,74,0.35); color: var(--t-fail); }
.tp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--t-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--t-input);
  color: var(--t-mute);
  font-weight: 600;
  width: fit-content;
}
.tp-pillok { background: var(--t-cyan-soft); color: var(--t-cyan); }
.tp-pillaccent { background: var(--t-summit-soft); color: var(--t-summit); }
.tp-pillwarn { background: rgba(240,180,41,0.10); color: var(--t-warn); }
.tp-pillfail { background: var(--t-fail-soft); color: var(--t-fail); }

/* ─── TABLE ─────────────────────────────────────────────────────── */
.tp-table { display: flex; flex-direction: column; }
.tp-th, .tp-tr {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 11px 18px;
}
.tp-th {
  background: rgba(255,255,255,0.012);
  border-bottom: 1px solid var(--t-border);
  font-family: var(--t-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-mute);
  font-weight: 600;
}
.tp-tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s;
}
.tp-tr:last-child { border-bottom: none; }
.tp-tr:hover { background: rgba(255,255,255,0.02); }
.tp-trnew { animation: tp-flash 1.2s ease; }
@keyframes tp-flash {
  0% { background: var(--t-cyan-soft); }
  100% { background: transparent; }
}
.tp-mono { font-family: var(--t-mono); font-variant-numeric: tabular-nums; }
.tp-mono-fade { font-family: var(--t-mono); color: var(--t-mute); font-size: 10.5px; letter-spacing: 0.04em; }

/* ─── PENDING ACTION CARD ───────────────────────────────────────── */
.tp-action {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 16px;
  padding: 16px 18px 16px 14px;
  background: rgba(17,17,20,0.6);
  border: 1px solid var(--t-border);
  border-radius: 10px;
  align-items: center;
}
.tp-actionbar { width: 3px; background: var(--t-summit); align-self: stretch; border-radius: 1px; }
.tp-actionwarn .tp-actionbar { background: var(--t-warn); }
.tp-actionfail .tp-actionbar { background: var(--t-fail); }
.tp-actiontitle { font-size: 14px; font-weight: 600; color: var(--t-text); }
.tp-actionbody { font-size: 12.5px; color: var(--t-dim); margin-top: 4px; line-height: 1.5; }

/* ─── UPLOAD ZONE ───────────────────────────────────────────────── */
.tp-drop {
  border: 1.5px dashed var(--t-cyan-line);
  border-radius: 12px;
  padding: 42px 32px;
  text-align: center;
  background: rgba(0,255,255,0.025);
  transition: all .15s;
}
.tp-drop:hover {
  background: var(--t-cyan-soft);
  border-color: var(--t-cyan);
  box-shadow: inset 0 0 24px rgba(0,255,255,0.06);
}
.tp-dropicon { font-size: 30px; color: var(--t-cyan); }
.tp-droptitle { font-size: 16px; font-weight: 600; color: var(--t-text); margin-top: 12px; }
.tp-dropmeta { font-family: var(--t-mono); font-size: 11px; color: var(--t-mute); letter-spacing: 0.08em; margin-top: 6px; }
.tp-dropfoot { font-size: 12px; color: var(--t-mute); margin-top: 6px; font-style: italic; }

/* ─── COUNTERPARTY IDENTITY ──────────────────────────────────────── */
.tp-identity { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tp-identitycol {
  padding: 16px 18px;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  background: rgba(17,17,20,0.5);
}
.tp-identitycolsender { border-color: var(--t-summit-line); background: rgba(235,5,87,0.03); }
.tp-identitycolrecipient { border-color: var(--t-cyan-line); background: rgba(0,255,255,0.03); }
.tp-identitylabel { font-family: var(--t-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-mute); font-weight: 600; }
.tp-identityname { font-size: 15px; font-weight: 600; margin-top: 6px; }
.tp-identityrows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tp-identityrow {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.tp-identityrow:last-child { border-bottom: none; }
.tp-identityrow-k { color: var(--t-mute); font-family: var(--t-mono); font-size: 10.5px; letter-spacing: 0.06em; }
.tp-identityrow-v { color: var(--t-text); font-family: var(--t-mono); font-size: 11.5px; word-break: break-all; }
.tp-identityrow-vcyan { color: var(--t-cyan); }
.tp-identityrow-vcoral { color: var(--t-summit); }

/* ─── RAIL ITEMS ─────────────────────────────────────────────────── */
.tp-rail-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.tp-rail-row:last-child { border-bottom: none; }
.tp-rail-label { color: var(--t-dim); }
.tp-rail-val { font-family: var(--t-mono); font-size: 11.5px; color: var(--t-cyan); }
.tp-rail-valtext { color: var(--t-text); }
.tp-rail-valwarn { color: var(--t-warn); }
.tp-rail-events { padding: 4px 0; display: flex; flex-direction: column; }
.tp-rail-event {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
  font-size: 12px;
}
.tp-rail-event:last-child { border-bottom: none; }
.tp-rail-event-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; background: var(--t-cyan); flex-shrink: 0; }
.tp-rail-event-dotcoral { background: var(--t-summit); }
.tp-rail-event-dotwarn { background: var(--t-warn); }
.tp-rail-event-msg { color: var(--t-dim); line-height: 1.4; }
.tp-rail-event-msg b { color: var(--t-text); font-weight: 500; }
.tp-rail-event-ts { font-family: var(--t-mono); font-size: 9.5px; color: var(--t-faint); letter-spacing: 0.04em; }

/* ─── FOOTER ────────────────────────────────────────────────────── */
.tp-footer {
  grid-area: footer;
  border-top: 1px solid var(--t-border);
  background: #06060A;
  padding: 9px 32px;
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--t-mono);
  font-size: 10.5px;
  color: var(--t-mute);
  letter-spacing: 0.06em;
}
.tp-footer b { color: var(--t-text); font-weight: 500; }
.tp-footer-spacer { flex: 1; }

/* ─── MOMENT (bundle detail) ────────────────────────────────────── */
.tp-moment {
  border: 1px solid var(--t-border);
  border-radius: 12px;
  background: rgba(17,17,20,0.6);
  overflow: hidden;
}
.tp-momenthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--t-border);
  background: rgba(255,255,255,0.012);
}
.tp-momentnum {
  font-family: var(--t-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--t-summit);
  color: #fff;
  font-weight: 700;
}
.tp-momentname {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-dim);
}
.tp-momentname b { color: var(--t-text); font-weight: 500; }
.tp-momentright {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--t-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--t-mute);
}
.tp-momentbody { padding: 20px 22px 22px; }
.tp-momentsub {
  font-family: var(--t-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-mute);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tp-momentsub::before { content: ""; width: 14px; height: 1px; background: var(--t-summit); }
.tp-hash {
  border: 1.5px solid var(--t-cyan);
  border-radius: 8px;
  background: rgba(0,255,255,0.04);
  padding: 14px 16px;
  font-family: var(--t-mono);
  font-size: 13.5px;
  color: var(--t-cyan);
  word-break: break-all;
  letter-spacing: 0.02em;
}
.tp-hashsmall { font-size: 12px; padding: 10px 12px; }

/* Sticky action bar at bottom of bundle detail */
.tp-actionbar-sticky {
  position: sticky;
  bottom: 0;
  margin: 0 -36px -36px;
  background: rgba(8,8,10,0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--t-border);
  padding: 16px 36px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  z-index: 5;
}

/* Form fields (Settings page) */
.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field-label {
  font-family: var(--t-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-mute);
  font-weight: 600;
}
.tp-field-input {
  background: var(--t-input);
  border: 1px solid var(--t-border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--t-text);
  font-family: var(--t-font);
}
.tp-field-input:focus { border-color: var(--t-border-strong); outline: none; }
.tp-field-input-mono { font-family: var(--t-mono); }

/* Settings left sub-nav */
.tp-subnav { display: flex; flex-direction: column; gap: 2px; }
.tp-subnav-item {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--t-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tp-subnav-item:hover { color: var(--t-text); background: rgba(255,255,255,0.03); }
.tp-subnav-itemactive { background: var(--t-summit-soft); color: var(--t-text); }

/* Onboarding stepper */
.tp-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 32px 0 28px;
}
.tp-stepper-node { display: flex; align-items: center; gap: 12px; font-family: var(--t-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-mute); }
.tp-stepper-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--t-border-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--t-dim);
}
.tp-stepper-nodedone .tp-stepper-circle { background: var(--t-cyan); border-color: var(--t-cyan); color: #000; }
.tp-stepper-nodeactive .tp-stepper-circle { background: var(--t-summit); border-color: var(--t-summit); color: #fff; box-shadow: 0 0 0 4px rgba(235,5,87,0.15); }
.tp-stepper-nodeactive .tp-stepper-name { color: var(--t-text); }
.tp-stepper-bar { width: 80px; height: 1px; background: var(--t-border); margin: 0 16px; }
.tp-stepper-bardone { background: var(--t-cyan); }

/* ─── KEY ROTATION TABLE (Settings) ──────────────────────────────── */
.tp-keytable { display: flex; flex-direction: column; }
.tp-keyrow {
  display: grid;
  grid-template-columns: 140px 1fr 120px 120px;
  gap: 14px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12.5px;
}
.tp-keyrow:last-child { border-bottom: none; }
.tp-keyrow-label { font-family: var(--t-mono); color: var(--t-mute); letter-spacing: 0.06em; }
.tp-keyrow-val { font-family: var(--t-mono); font-size: 12px; }
.tp-keyrow-val-active { color: var(--t-cyan); }
.tp-keyrow-val-faded { color: var(--t-dim); }
.tp-keyrow-email { font-size: 12px; color: var(--t-dim); }

/* ─── PROTOCOL STATUS (rail) ──────────────────────────────────────── */
.tp-proto { display: flex; flex-direction: column; gap: 6px; }
.tp-proto-name { font-family: var(--t-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-mute); }
.tp-proto-val { font-family: var(--t-mono); font-size: 12px; color: var(--t-cyan); }
.tp-proto-valwarn { color: var(--t-warn); }
.tp-proto-sep { height: 1px; background: rgba(255,255,255,0.04); margin: 4px 0; }

/* ─── BUNDLE HISTORY TABLE ───────────────────────────────────────── */
.tp-bundletable { display: flex; flex-direction: column; }
.tp-bundlerow {
  display: grid;
  grid-template-columns: 140px 80px 100px 1fr 100px;
  gap: 14px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s;
}
.tp-bundlerow:hover { background: rgba(255,255,255,0.02); }
.tp-bundlerow:last-child { border-bottom: none; }
.tp-bundlerow-id { font-family: var(--t-mono); font-size: 11.5px; color: var(--t-cyan); }
.tp-bundlerow-count { font-family: var(--t-mono); font-size: 11.5px; color: var(--t-text); }
.tp-bundlerow-status { }
.tp-bundlerow-date { font-family: var(--t-mono); font-size: 10.5px; color: var(--t-mute); }

/* ─── AGREEMENT TERMS GRID ───────────────────────────────────────── */
.tp-terms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tp-term { display: flex; flex-direction: column; gap: 4px; }
.tp-term-label { font-family: var(--t-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-mute); font-weight: 600; }
.tp-term-val { font-family: var(--t-mono); font-size: 14px; font-weight: 600; color: var(--t-text); }

/* ─── EMPTY STATE ────────────────────────────────────────────────── */
.tp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.tp-empty-icon { font-size: 28px; color: var(--t-mute); }
.tp-empty-title { font-size: 15px; font-weight: 600; color: var(--t-dim); margin: 0; }
.tp-empty-sub { font-size: 13px; color: var(--t-mute); margin: 0; }

/* ─── FILTER BAR ─────────────────────────────────────────────────── */
.tp-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}
.tp-filter-input, .tp-filter-select {
  background: var(--t-input);
  border: 1px solid var(--t-border);
  border-radius: 6px;
  padding: 7px 12px;
  font-family: var(--t-font);
  font-size: 12.5px;
  color: var(--t-text);
  outline: none;
}
.tp-filter-input:focus, .tp-filter-select:focus { border-color: var(--t-border-strong); }
.tp-filter-select { appearance: none; cursor: pointer; }
.tp-filter-label { font-family: var(--t-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-mute); font-weight: 600; white-space: nowrap; }
.tp-table-wrap { border: 1px solid var(--t-border); border-radius: 0 0 12px 12px; overflow: hidden; }

/* ─── KICKER + SEPARATOR ─────────────────────────────────────────── */
.tp-kicker { font-family: var(--t-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--t-mute); }
.tp-sep { height: 1px; background: var(--t-border); width: 100%; }
.tp-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--t-cyan); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .tp-root { grid-template-columns: 1fr; grid-template-areas: "header" "main" "footer"; }
  .tp-sidebar { display: none; }
  .tp-main { grid-template-columns: 1fr; }
  .tp-kpi { grid-template-columns: repeat(2, 1fr); }
  .tp-identity { grid-template-columns: 1fr; }
  .tp-terms { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tp-content { padding: 20px 16px; }
  .tp-kpi { grid-template-columns: 1fr 1fr; }
  .tp-actionbar-sticky { padding: 12px 16px; margin: 0 -16px -16px; }
}

/* ---- PORTAL SHELL ---- */
.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
}

/* ---- HEADER ---- */
.portal-header {
  width: 100%;
  max-width: 640px;
  padding: 48px 0 0;
  text-align: center;
}

.portal-logo {
  display: inline-block;
  margin-bottom: 32px;
}

.portal-logo svg {
  height: 36px;
  width: auto;
}

.portal-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.portal-subtitle {
  font-size: 14px;
  color: var(--c-text-mute);
  margin: 0;
}

/* ---- PROGRESS BAR ---- */
.progress-track {
  width: 100%;
  max-width: 640px;
  margin: 36px 0 0;
}

.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.progress-step {
  display: flex;
  align-items: center;
  flex: 1;
}

.progress-step:last-child {
  flex: 0 0 auto;
}

.progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  background: var(--c-bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-mute);
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  font-family: var(--c-mono);
}

.progress-dot.active {
  border-color: var(--c-coral);
  background: var(--c-coral-soft);
  color: var(--c-coral);
}

.progress-dot.done {
  border-color: var(--c-cyan);
  background: var(--c-cyan-soft);
  color: var(--c-cyan);
}

.progress-label {
  font-size: 11px;
  color: var(--c-text-mute);
  margin-top: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.progress-label.active {
  color: var(--c-coral);
}

.progress-label.done {
  color: var(--c-cyan);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--c-border);
  margin: 0 8px;
  margin-bottom: 22px;
  transition: background 0.2s;
}

.progress-line.done {
  background: var(--c-cyan);
}

/* ---- WIZARD CARD ---- */
.wizard-card {
  width: 100%;
  max-width: 640px;
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 40px;
  margin: 28px 0;
}

.step-header {
  margin-bottom: 28px;
}

.step-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-coral);
  margin-bottom: 8px;
  font-family: var(--c-mono);
}

.step-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.step-description {
  font-size: 14px;
  color: var(--c-text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ---- FORM FIELDS ---- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-label .required {
  color: var(--c-coral);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  background: var(--c-bg-input);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--c-text);
  font-family: var(--c-font);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: var(--c-text-faint);
}

.form-input:focus {
  border-color: var(--c-coral);
}

.form-input.error {
  border-color: #FF4444;
}

.form-hint {
  font-size: 12px;
  color: var(--c-text-mute);
  margin-top: 5px;
}

.form-error-msg {
  font-size: 12px;
  color: #FF4444;
  margin-top: 5px;
  display: none;
}

.form-error-msg.visible {
  display: block;
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-coral);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--c-font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: -0.01em;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--c-text-mute);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--c-font);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--c-border-hover);
  color: var(--c-text-dim);
}

.btn-link {
  background: none;
  border: none;
  color: var(--c-text-mute);
  font-size: 13px;
  font-family: var(--c-font);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  color: var(--c-text-dim);
}

/* ---- KEY PAIR DISPLAY ---- */
.key-explainer {
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.key-explainer p {
  font-size: 14px;
  color: var(--c-text-dim);
  margin: 0 0 12px;
  line-height: 1.6;
}

.key-explainer p:last-child {
  margin-bottom: 0;
}

.key-explainer strong {
  color: var(--c-text);
}

.key-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-coral-soft);
  border: 1px solid var(--c-coral-line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--c-coral);
  font-family: var(--c-mono);
}

.key-display {
  background: var(--c-bg-input);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.key-display-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  margin-bottom: 8px;
}

.key-display-value {
  font-family: var(--c-mono);
  font-size: 13px;
  color: var(--c-cyan);
  word-break: break-all;
  line-height: 1.5;
}

.key-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,216,58,0.06);
  border: 1px solid rgba(255,216,58,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 16px;
}

.key-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.key-warning p {
  font-size: 12px;
  color: var(--c-yellow);
  margin: 0;
  line-height: 1.5;
}

/* ---- SUCCESS STATE ---- */
.success-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--c-cyan-soft);
  border: 1px solid var(--c-cyan-line);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.success-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-text h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 4px;
}

.success-text p {
  font-size: 13px;
  color: var(--c-text-dim);
  margin: 0;
}

/* ---- WIZARD FOOTER (nav buttons) ---- */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}

.wizard-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- STEP-SPECIFIC LAYOUTS ---- */
.step-2-explainer {
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 28px;
}

.step-2-explainer h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.step-2-explainer p {
  font-size: 14px;
  color: var(--c-text-dim);
  margin: 0 0 14px;
  line-height: 1.6;
}

.step-2-explainer p:last-child {
  margin-bottom: 0;
}

.step-2-explainer ul {
  margin: 0 0 14px;
  padding-left: 18px;
}

.step-2-explainer li {
  font-size: 14px;
  color: var(--c-text-dim);
  margin-bottom: 6px;
  line-height: 1.5;
}

.step-2-explainer strong {
  color: var(--c-text);
}

.key-visual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-bg-input);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
}

.key-pair-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.key-pair-col span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-mute);
}

.key-lock-icon {
  width: 36px;
  height: 36px;
}

.key-pair-arrow {
  color: var(--c-text-faint);
  font-size: 20px;
}

/* ---- SPINNER ---- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .wizard-card {
    padding: 24px 20px;
    border-radius: 8px;
    margin: 16px 0;
  }

  .progress-label {
    display: none;
  }

  .portal-header {
    padding-top: 32px;
  }
}