* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --c-bg:      #040408;
  --c-surface: #080810;
  --c-border:  #0d1117;
  --c-cyan:    #00ffff;
  --c-magenta: #ff00ff;
  --c-orange:  #ff9500;
  --c-yellow:  #ffe600;
  --c-text:    #8892a4;
  --c-dim:     #1e2535;
  --font-hud:  'Orbitron', 'SF Pro Display', monospace;
}

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* hex grid background */
  background-image:
    radial-gradient(circle at 1px 1px, #0d1520 1px, transparent 0);
  background-size: 28px 28px;
}
/* scanline overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px 0 20px;
  border-bottom: 1px solid #00ffff22;
  flex-shrink: 0;
  background: #04040a;
  box-shadow: 0 1px 0 #00ffff11, inset 0 -1px 20px rgba(0,255,255,0.03);
}
.topbar-title {
  font-family: var(--font-hud);
  font-size: 10px;
  font-weight: 900;
  color: var(--c-cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 12px #00ffff88;
  padding-right: 20px;
  flex-shrink: 0;
}
/* ── Splash ── */
.pse-splash {
  display: none;
  position: fixed;
  inset: 0;
  background: #020b18;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
body.pse-locked .pse-splash { display: flex; }
body.pse-locked .topbar,
body.pse-locked .main,
body.pse-locked .bottombar { filter: blur(6px); pointer-events: none; }

.pse-splash-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.pse-splash-title {
  font-family: var(--font-hud);
  font-size: 22px;
  font-weight: 900;
  color: #00ffff;
  letter-spacing: 0.12em;
  text-shadow: 0 0 24px #00ffff66;
}
.pse-splash-sub {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}
.pse-splash-btn {
  padding: 12px 28px;
  background: #00ffff18;
  border: 1.5px solid #00ffff66;
  border-radius: 8px;
  color: #00ffff;
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.pse-splash-btn:hover {
  background: #00ffff28;
  box-shadow: 0 0 20px #00ffff33;
}
.pse-splash-hint {
  font-size: 11px;
  color: #334155;
  line-height: 1.7;
}
.pse-splash-hint code {
  color: #00ffff44;
  font-family: var(--font-hud);
}

/* ── Loader button ── */
.loader-btn {
  margin-left: auto;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #ffffff18;
  border-radius: 4px;
  color: #ffffff55;
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.loader-btn:hover { border-color: #00ffff55; color: #00ffff; }
.loader-btn:disabled { opacity: 0.4; cursor: default; }
.loader-badge {
  margin-left: 6px;
  font-family: var(--font-hud);
  font-size: 9px;
  color: #00ffff66;
  letter-spacing: 0.08em;
}
.topbar-count {
  margin-left: 12px;
  padding-left: 20px;
  font-family: var(--font-hud);
  font-size: 9px;
  font-weight: 700;
  color: #00ffff44;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Left panel persona tabs ── */
.left-panel {
  width: 112px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 8px;
  border-right: 1px solid #00ffff0d;
  background: #04040a;
  overflow-y: auto;
}
.left-panel::-webkit-scrollbar { width: 2px; }
.left-panel::-webkit-scrollbar-thumb { background: #1e293b; }
.filter-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px;
  width: 100%;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-hud);
}
.filter-btn:hover { border-color: #0f172a; color: #64748b; background: #06080f; }
.filter-btn.active { background: transparent; }
.fb-av {
  width: 76px; height: 76px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid transparent;
  opacity: 0.2; filter: grayscale(0.9) brightness(0.55);
  transition: opacity 0.3s, filter 0.3s, box-shadow 0.2s, border-color 0.2s;
}
.filter-btn:hover .fb-av { opacity: 0.7; filter: grayscale(0.15) brightness(0.9); }
.filter-btn.active .fb-av { opacity: 1; filter: none; }
/* Radial matrix container */
#matrix-radial { flex: 1; overflow: hidden; position: relative; min-width: 0; }
.filter-btn[data-p="javlon"]  .fb-av { border-color: #00ffff55; }
.filter-btn[data-p="malika"]  .fb-av { border-color: #ff00ff55; }
.filter-btn[data-p="sanzhar"] .fb-av { border-color: #ff950055; }
.filter-btn[data-p="zilola"]  .fb-av { border-color: #ffe60055; }
.filter-btn[data-p="javlon"].active  .fb-av { border-color: #00ffff; box-shadow: 0 0 14px #00ffff88; }
.filter-btn[data-p="malika"].active  .fb-av { border-color: #ff00ff; box-shadow: 0 0 14px #ff00ff88; }
.filter-btn[data-p="sanzhar"].active .fb-av { border-color: #ff9500; box-shadow: 0 0 14px #ff950088; }
.filter-btn[data-p="zilola"].active  .fb-av { border-color: #ffe600; box-shadow: 0 0 14px #ffe60088; }
.filter-btn[data-p="javlon"].active  span { color: #00ffff; text-shadow: 0 0 6px #00ffff88; }
.filter-btn[data-p="malika"].active  span { color: #ff00ff; text-shadow: 0 0 6px #ff00ff88; }
.filter-btn[data-p="sanzhar"].active span { color: #ff9500; text-shadow: 0 0 6px #ff950088; }
.filter-btn[data-p="zilola"].active  span { color: #ffe600; text-shadow: 0 0 6px #ffe60088; }

/* ── Main layout ── */
.main-inner {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Main ── */
.main { flex: 1; display: flex; overflow: hidden; min-height: 0; min-width: 0; }

/* ── Matrix ── */
.matrix {
  flex: 1;
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  grid-template-rows: 28px 1fr 1fr;
  gap: 1px;
  background: #00ffff0a;
  min-width: 0;
  overflow: hidden;
}

.m-corner { background: #040408; }

.m-col-lbl {
  background: #040408;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hud);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1e3a4a;
}

.m-row-lbl {
  background: #040408;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-family: var(--font-hud);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1e3a4a;
}

.quadrant {
  background: #04060f;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}
.quadrant::-webkit-scrollbar { width: 3px; }
.quadrant::-webkit-scrollbar-thumb { background: #00ffff22; border-radius: 2px; }

/* quadrant neon accent borders */
.q-cb { border-top: 2px solid var(--c-cyan);    box-shadow: inset 0 1px 30px rgba(0,255,255,0.04); }
.q-cs { border-top: 2px solid var(--c-magenta);  box-shadow: inset 0 1px 30px rgba(255,0,255,0.04); }
.q-fb { border-top: 2px solid var(--c-orange);   box-shadow: inset 0 1px 30px rgba(255,149,0,0.04); }
.q-fs { border-top: 2px solid var(--c-yellow);   box-shadow: inset 0 1px 30px rgba(255,230,0,0.04); }

/* ── Scenario card ── */
.sc {
  padding: 7px 9px 7px 12px;
  cursor: pointer;
  border: 1px solid #0d1520;
  border-left: none;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  background: #06080f;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.sc:hover { border-color: #1e3a4a; background: #080c18; box-shadow: 0 0 8px rgba(0,255,255,0.06); }
.sc.active { border-color: var(--c-active, #00ffff55); background: #080c18; box-shadow: 0 0 12px rgba(0,255,255,0.1); }

.sc-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }

.sc-head { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.sc-em { font-size: 11px; line-height: 1; }
.sc-name { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8892a4; }
.sc-dot { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.dot1 { background: var(--c-cyan);    box-shadow: 0 0 4px var(--c-cyan); }
.dot2 { background: var(--c-orange);  box-shadow: 0 0 4px var(--c-orange); }
.dot3 { background: #1e3a4a; }

.sc-jtbd {
  font-size: 11px; color: #3a4a5a; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.q-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hud); font-size: 9px; color: #0d1520;
  letter-spacing: 0.15em; text-transform: uppercase;
}

/* ── Detail panel ── */
.detail {
  width: 0; overflow: hidden;
  transition: width 0.18s ease;
  border-left: 1px solid #00ffff22;
  background: #060818; flex-shrink: 0;
  box-shadow: -8px 0 24px #00000060, inset 1px 0 0 #00ffff10;
}
.detail.open { width: 680px; }

.detail-inner {
  width: 680px; height: 100%; overflow-y: auto;
  padding: 20px 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.detail-inner::-webkit-scrollbar { width: 3px; }
.detail-inner::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.d-persona { display: flex; align-items: center; gap: 7px; }
.d-em { font-size: 18px; }
.d-pname { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.d-qtag {
  margin-left: auto; font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  background: #0f172a; border: 1px solid #1e293b; color: #475569;
  white-space: nowrap;
}

.d-jtbd { font-size: 14px; font-weight: 600; line-height: 1.45; color: #f1f5f9; }

.d-lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #334155; margin-bottom: 4px;
}

.d-trigger { font-size: 12px; color: #64748b; line-height: 1.55; }

.d-steps { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.d-steps li {
  font-size: 11px; color: #64748b; line-height: 1.5;
  padding: 4px 0 4px 18px; position: relative;
  border-bottom: 1px solid #0f172a;
}
.d-steps li:last-child { border-bottom: none; }
.d-steps li::before {
  content: attr(data-n); position: absolute; left: 0;
  color: #1e293b; font-size: 10px; font-weight: 700; line-height: 1.8;
}

/* ── Detail phone ── */
.d-phone-wrap {
  display: flex; justify-content: center;
  padding: 4px 0 8px; flex-shrink: 0;
}
.d-phone {
  width: 144px; height: 264px;
  background: #020510; border-radius: 22px;
  border: 1.5px solid;
  display: flex; flex-direction: column;
  align-items: center; padding: 18px 10px 14px;
}
.d-phone-cam {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: 0.3;
  flex-shrink: 0; margin-bottom: 12px;
}
.d-phone-screen {
  flex: 1; width: 100%; background: #00061a;
  border-radius: 4px; border: 1px solid;
  display: flex; flex-direction: column;
  padding: 10px; gap: 8px; overflow: hidden;
}
.d-phone-step-n {
  font-family: var(--font-hud); font-size: 7px;
  letter-spacing: 0.15em; opacity: 0.5; flex-shrink: 0;
}
.d-phone-step-txt {
  font-size: 12px; line-height: 1.55; flex: 1;
  display: flex; align-items: center; color: #cbd5e1;
  transition: opacity 0.28s;
}
.d-phone-home {
  width: 36px; height: 4px; border-radius: 2px;
  background: currentColor; opacity: 0.22;
  margin-top: 12px; flex-shrink: 0;
}
.d-step-dots {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; padding: 6px 0 2px;
}
.d-step-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dc, #00ffff);
  opacity: 0.18;
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
}
.d-step-dot.active {
  opacity: 1;
  transform: scale(1.4);
  box-shadow: 0 0 8px var(--dc, #00ffff);
}

.d-ctx {
  background: #06080f; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--cc,#00ffff) 12%, transparent);
  padding: 10px 12px 12px;
}
.d-ctx-header { display: flex; align-items: baseline; gap: 8px; }
.d-ctx-time {
  font-family: var(--font-hud); font-size: 22px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1;
}
.d-ctx-note {
  font-size: 10px; color: #4a5a70; font-family: var(--font-hud);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.d-objects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.d-obj {
  font-size: 10px; font-family: var(--font-hud); letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 4px;
  border: 1px solid; background: #04060d;
  white-space: nowrap;
}

.d-outcome {
  font-size: 11px; color: #475569; line-height: 1.55; font-style: italic;
  padding: 9px 11px; background: #0c1120; border-radius: 7px;
  border-left: 2px solid #1e293b;
}

.d-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 4px; }

.d-btn {
  padding: 8px 12px; border-radius: 7px; border: 1px solid #1e293b;
  background: transparent; color: #475569; font-size: 11px; font-weight: 500;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: all 0.12s; display: flex; align-items: center; gap: 6px;
}
.d-btn:hover { border-color: #334155; color: #94a3b8; }
.d-btn.primary { background: #0c1829; border-color: #1e3a8a; color: #60a5fa; }
.d-btn.primary:hover { border-color: #2563eb; }
.d-stub { font-size: 9px; color: #1e293b; margin-left: auto; }

/* ── Bottom bar ── */
.bottombar {
  display: flex; align-items: center; gap: 16px;
  padding: 6px 20px;
  border-top: 1px solid #00ffff14;
  background: #04040a; flex-shrink: 0; flex-wrap: wrap;
  box-shadow: 0 -1px 0 #00ffff08;
}
.b-stat {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-hud); font-size: 8px;
  font-weight: 700; letter-spacing: 0.1em; color: #1e3a4a; text-transform: uppercase;
}
.b-dot { width: 6px; height: 6px; border-radius: 50%; }
.b-meta {
  margin-left: auto; font-family: var(--font-hud);
  font-size: 7px; color: #0d1a26; letter-spacing: 0.14em; text-transform: uppercase;
}

/* ── View tabs ── */
.view-tabs { flex: 1; display: flex; gap: 1px; }
.view-tab {
  flex: 1; height: 42px; padding: 0 12px;
  border: none; border-bottom: 2px solid transparent;
  border-right: 1px solid #00ffff0a;
  background: transparent; color: #1e3a4a;
  font-size: 11px; font-weight: 700; cursor: pointer;
  font-family: var(--font-hud); letter-spacing: 0.14em; text-transform: uppercase;
  transition: all 0.15s;
}
.view-tab:last-child { border-right: none; }
.view-tab:hover { color: var(--c-cyan); background: #00ffff06; border-bottom-color: #00ffff33; }
.view-tab.active {
  background: #00ffff10; border-bottom-color: var(--c-cyan); color: var(--c-cyan);
  text-shadow: 0 0 10px #00ffff; box-shadow: inset 0 -4px 20px rgba(0,255,255,0.06);
}

/* ── View containers ── */
#view-matrix   { flex: 1; display: flex; overflow: hidden; min-height: 0; }
#view-graph    { flex: 1; display: none; flex-direction: column; overflow: hidden; min-height: 0; background: #040408; }
#graph-svg     { flex: 1; min-height: 0; display: block; }
/* ── Elements library view ── */
#view-elements { flex: 1; display: none; overflow-y: auto; background: #040408; flex-direction: column; }
#view-elements::-webkit-scrollbar { width: 4px; }
#view-elements::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.el-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid #0a1020;
  background: #040408; position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.el-bar-title {
  font-family: var(--font-hud); font-size: 9px; font-weight: 700;
  letter-spacing: 0.2em; color: #1e3a4a; flex: 1;
}
.el-bar-personas { display: flex; gap: 8px; align-items: center; }
.el-persona-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid;
  cursor: pointer; transition: all 0.15s; padding: 0;
}
.el-persona-dot:hover { transform: scale(1.15); }
.el-persona-dot.active { transform: scale(1.2); box-shadow: 0 0 8px currentColor; }

.el-bar-contexts { display: flex; gap: 6px; align-items: center; }
.el-ctx-chip {
  font-family: var(--font-hud); font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid #00ffff22; border-radius: 4px;
  background: #04081a; color: #5b8395;
  cursor: pointer; transition: all 0.12s;
}
.el-ctx-chip:hover { border-color: #00ffff55; color: #a8c5d6; }
.el-ctx-chip.active {
  border-color: #00ffff88; color: #00ffff;
  background: #06102a;
  box-shadow: 0 0 8px #00ffff33;
}

.el-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px; background: #0a1020;
  padding: 0;
}

.el-card {
  background: #060a14; display: flex; flex-direction: column;
  border: 1px solid #00ffff1f; border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.el-card:hover { background: #0a1220; border-color: #00ffff44; }

.el-card-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 14px 8px; border-bottom: 1px solid #0a1020;
  flex-shrink: 0;
}
.el-card-key {
  font-size: 9px; font-family: var(--font-hud); font-weight: 700;
  letter-spacing: 0.08em; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.el-card-label {
  font-size: 10px; color: #4a5a70; white-space: nowrap; flex-shrink: 0;
}

.el-preview {
  background: #020408; border-bottom: 1px solid #0a1020;
  display: flex; align-items: center; justify-content: center;
  padding: 16px 12px; flex-shrink: 0;
}
.el-preview-phone {
  width: 196px; min-height: 60px; max-height: 260px;
  background: #010611; border-radius: 12px;
  border: 1px solid #0f1a2e; overflow: hidden;
  display: flex; flex-direction: column;
}

.el-card-foot {
  padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 5px;
}
.el-card-desc { font-size: 10px; color: #4a5a70; line-height: 1.45; }
.el-card-usage {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700;
  letter-spacing: 0.1em;
}
.el-sc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.el-sc-chip {
  font-size: 8px; font-family: var(--font-hud); letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 3px; border: 1px solid;
  background: #02040a; white-space: nowrap;
}

.el-skins {
  border-top: 1px dashed #00ffff1a;
  padding: 10px 14px 12px;
}
.el-skins-head {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700;
  letter-spacing: 0.18em; color: #5b8395; margin-bottom: 6px;
}
.el-skins-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.el-skin-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px;
  border: 1px solid #00ffff33;
  border-radius: 5px;
  background: #04081a;
  font-size: 10px; color: #a8c5d6;
  cursor: default;
  transition: border-color 0.12s, background 0.12s, opacity 0.12s;
  min-width: 64px;
}
.el-skin-img {
  width: 56px; height: 96px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #00ffff22;
  background: #02040c;
}
.el-skin-img-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #1e3a4a; font-weight: 700;
  border-style: dashed;
}
.el-skin-meta { display: flex; align-items: center; gap: 4px; }
.el-skin-tile:hover {
  border-color: #00ffff66;
  background: #06102a;
}
.el-skin-tile.active {
  border-color: #00ffff99;
  background: #062048;
  box-shadow: 0 0 8px #00ffff33;
  color: #d6f0ff;
}
.el-skin-tile.dim {
  opacity: 0.45;
  border-color: #00ffff1a;
  border-style: dashed;
}
.el-skin-name { font-weight: 600; }
.el-skin-status {
  font-size: 8px; font-family: var(--font-hud);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #fbbf24;
  padding: 1px 5px;
  border: 1px solid #fbbf2444;
  border-radius: 3px;
}

#view-personas { flex: 1; display: none; overflow-y: auto; padding: 24px; background: #040408; }
#view-personas::-webkit-scrollbar { width: 4px; }
#view-personas::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

#view-screens { flex: 1; display: none; overflow-y: auto; background: #040408; flex-direction: column; }
#view-screens::-webkit-scrollbar { width: 4px; }
#view-screens::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

#view-lifecycle { flex: 1; display: none; overflow-y: auto; background: #040408; flex-direction: column; }
#view-lifecycle::-webkit-scrollbar { width: 4px; }
#view-lifecycle::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.scr-body { padding: 20px 24px 32px; max-width: 980px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.scr-header {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid; border-radius: 8px;
  background: #060a18;
}
.scr-header-name { font-family: var(--font-hud); font-size: 14px; font-weight: 700; letter-spacing: 0.05em; }
.scr-header-id { font-size: 11px; color: #5b8395; }
.scr-header-state { margin-left: auto; font-size: 10px; color: #5b8395; font-family: var(--font-hud); letter-spacing: 0.1em; }

.scr-rows { display: flex; flex-direction: column; gap: 10px; }
.scr-row {
  border: 1px solid #00ffff1f; border-radius: 6px;
  background: #060a14;
  padding: 10px 14px;
}
.scr-row-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.scr-row-idx { font-family: var(--font-hud); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.scr-row-id { font-size: 11px; }
.scr-row-name { font-size: 12px; color: #a8c5d6; }
.scr-row-warn {
  margin-left: auto; font-size: 10px; color: #fbbf24;
  padding: 1px 6px; border: 1px solid #fbbf2444; border-radius: 3px;
}
.scr-row-noskins {
  font-size: 10px; color: #5b8395; font-style: italic;
  padding: 4px 0;
}
.scr-empty {
  padding: 24px; color: #5b8395; font-size: 12px; line-height: 1.6;
  border: 1px dashed #1e3a4a; border-radius: 6px;
}

/* ── E3: screen selector ── */
.scr-select-wrap {
  margin-left: auto;
}
.scr-select {
  background: #04081a;
  border: 1px solid #00ffff33;
  border-radius: 4px;
  color: #a8c5d6;
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 5px 8px;
  cursor: pointer;
  min-width: 220px;
  max-width: 320px;
  transition: border-color 0.15s, color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300ffff55'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.scr-select:hover { border-color: #00ffff66; color: #d6f0ff; }
.scr-select:focus { outline: none; border-color: #00ffff88; box-shadow: 0 0 8px #00ffff33; }
.scr-select option { background: #040814; color: #a8c5d6; }

/* ── E3: phone-frame layout for screens view ── */
.scr-body-phone {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 32px;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.scr-phone-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.scr-phone {
  width: 200px;
  min-height: 380px;
  background: #020510;
  border-radius: 28px;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 18px;
  position: relative;
}
.scr-phone-cam {
  width: 9px; height: 9px; border-radius: 50%;
  background: currentColor; opacity: 0.28;
  flex-shrink: 0; margin-bottom: 14px;
}
.scr-phone-screen {
  flex: 1; width: 100%; background: #00061a;
  border-radius: 6px; border: 1px solid;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  padding: 0;
}
.scr-phone-screen::-webkit-scrollbar { width: 2px; }
.scr-phone-screen::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 1px; }
.scr-phone-hdr {
  padding: 8px 10px 7px;
  border-bottom: 1px solid;
  flex-shrink: 0;
  background: #01040f;
}
.scr-phone-hdr-name {
  display: block;
  font-family: var(--font-hud);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scr-phone-hdr-id {
  font-size: 8px; color: #5b8395;
  display: block; margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scr-phone-hdr-state {
  font-size: 8px; color: #3a5060;
  font-family: var(--font-hud); letter-spacing: 0.08em;
  display: block;
}
.scr-phone-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 0;
}
.scr-phone-rows .scr-row {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #0a1020;
  padding: 6px 8px;
  background: transparent;
}
.scr-phone-rows .scr-row:last-child { border-bottom: none; }
.scr-phone-rows .scr-row-head { margin-bottom: 3px; gap: 5px; }
.scr-phone-rows .scr-row-idx { font-size: 8px; }
.scr-phone-rows .scr-row-id { font-size: 8px; }
.scr-phone-rows .scr-row-name { font-size: 9px; color: #7ba8c0; }
.scr-phone-rows .scr-row-warn { font-size: 8px; }
.scr-phone-rows .scr-row-noskins { font-size: 8px; padding: 2px 0; }
.scr-phone-rows .el-skins-row { display: none; } /* hide skin tiles inside phone frame — too wide */
.scr-phone-empty {
  padding: 16px 10px; color: #5b8395;
  font-size: 10px; font-style: italic; line-height: 1.5;
}
.scr-phone-home {
  width: 44px; height: 4px; border-radius: 2px;
  opacity: 0.2; margin-top: 14px; flex-shrink: 0;
}

/* ── Personas grid ── */
.personas-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; max-width: 1020px; margin: 0 auto;
}

.persona-card {
  --pc: #fff;
  background: #06080e;
  border: 1px solid color-mix(in srgb, var(--pc) 18%, transparent);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  animation: pcEnter 0.4s ease both;
}
.persona-card:nth-child(2) { animation-delay: 0.08s; }
.persona-card:nth-child(3) { animation-delay: 0.16s; }
.persona-card:nth-child(4) { animation-delay: 0.24s; }
.persona-card:hover {
  border-color: color-mix(in srgb, var(--pc) 55%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--pc) 14%, transparent),
              inset 0 0 20px color-mix(in srgb, var(--pc) 4%, transparent);
  transform: translateY(-3px);
}
@keyframes pcEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pc-header {
  position: relative; height: 180px; overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--pc) 25%, transparent);
}
.pc-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 25%;
  display: block; filter: saturate(0.8) contrast(1.05);
}
.pc-photo-placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(140deg, color-mix(in srgb, var(--pc) 18%, #04080f), #04080f);
  display: flex; align-items: center; justify-content: center; font-size: 48px;
}
.pc-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(4,6,14,0) 20%, rgba(4,6,14,0.5) 60%, rgba(4,6,14,0.96) 100%);
}
.pc-tint { position: absolute; inset: 0; background: color-mix(in srgb, var(--pc) 8%, transparent); mix-blend-mode: color; }
.pc-header::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.12) 3px, rgba(0,0,0,0.12) 4px);
  pointer-events: none;
}
.pc-caption {
  position: absolute; bottom: 12px; left: 16px; right: 12px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.pc-caption-text { min-width: 0; }
.pc-name {
  font-family: var(--font-hud); font-size: 18px; font-weight: 900;
  color: var(--pc); letter-spacing: 0.08em; line-height: 1.1;
  text-shadow: 0 0 20px color-mix(in srgb, var(--pc) 70%, transparent);
  margin-bottom: 4px; text-transform: uppercase;
}
.pc-segment {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700;
  color: color-mix(in srgb, var(--pc) 60%, #8892a4);
  letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8;
}
.pc-meta-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pc-som {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700;
  color: var(--pc); background: rgba(4,8,15,0.75);
  border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent);
  padding: 2px 8px;
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
  letter-spacing: 0.1em; text-shadow: 0 0 6px color-mix(in srgb, var(--pc) 80%, transparent);
  backdrop-filter: blur(4px);
}
.pc-pri {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700; letter-spacing: 0.14em;
  color: #1e3a4a; background: rgba(4,8,15,0.7); border: 1px solid #0d1a26;
  padding: 2px 7px;
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
  backdrop-filter: blur(4px);
}

.pc-quote {
  padding: 12px 18px; font-size: 11.5px; font-style: italic;
  color: #8aa0b8; line-height: 1.7; border-bottom: 1px solid #0a0d14;
  border-left: 2px solid color-mix(in srgb, var(--pc) 30%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 4%, transparent), transparent);
}
.pc-quote::before { display: none; }

.pc-stats {
  display: flex; gap: 5px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid #0a0d14;
}
.pc-stat {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700; letter-spacing: 0.08em;
  color: #6a8aa0; background: #080c14; border: 1px solid #0d1520;
  padding: 3px 8px;
  clip-path: polygon(3px 0%, 100% 0%, calc(100% - 3px) 100%, 0% 100%);
  text-transform: uppercase; white-space: nowrap;
}

.pc-section { padding: 11px 16px; border-bottom: 1px solid #0a0d14; }
.pc-section:last-child { border-bottom: none; }
.pc-slbl {
  font-family: var(--font-hud); font-size: 7px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: color-mix(in srgb, var(--pc) 45%, transparent);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.pc-slbl::before { content: '//'; color: color-mix(in srgb, var(--pc) 25%, transparent); font-size: 9px; }

.pc-jtbd-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.pc-jtbd-list li { font-size: 11px; color: #90a8be; padding-left: 22px; position: relative; line-height: 1.5; }
.pc-jtbd-list li::before {
  content: '▶'; position: absolute; left: 0; font-size: 8px;
  color: var(--pc); opacity: 0.6; top: 2px;
}

.pc-triggers { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-trigger {
  font-size: 9px; color: #6a8aa0; background: #060910;
  border: 1px solid #0d1520; border-left: 2px solid color-mix(in srgb, var(--pc) 35%, transparent);
  padding: 3px 8px; line-height: 1.5; font-family: var(--font-hud); letter-spacing: 0.04em;
}

.pc-quad-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pc-quad-row:last-child { margin-bottom: 0; }
.pc-quad-name { font-size: 9.5px; color: #6a8898; width: 96px; flex-shrink: 0; }
.pc-quad-track { flex: 1; height: 4px; background: #0c1120; border-radius: 2px; overflow: hidden; }
.pc-quad-fill {
  height: 100%; border-radius: 2px; background: var(--pc); width: 0;
  box-shadow: 0 0 4px var(--pc);
  transition: width 0.65s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.pc-quad-n { font-family: var(--font-hud); font-size: 8px; color: #5a7a8a; width: 14px; text-align: right; flex-shrink: 0; }

/* ── SVG animations ── */
@keyframes flowEdge {
  from { stroke-dashoffset: 24; }
  to   { stroke-dashoffset: 0; }
}
@keyframes nodePulse {
  0%, 100% { opacity: 0.18; }
  50%       { opacity: 0.45; }
}

/* ── HUD detail panel label ── */
.d-lbl {
  font-family: var(--font-hud);
  font-size: 7px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #1e3a4a; margin-bottom: 5px;
}
.d-lbl::before { content: '// '; color: #00ffff22; }

/* ══ Proto Modal ══════════════════════════════════════════════════════════════ */

.pm-modal { position: fixed; inset: 0; z-index: 1000; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.pm-modal.open { opacity: 1; pointer-events: auto; }

.pm-overlay {
  position: absolute; inset: 0;
  background: #000810cc; backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}

.pm-card {
  background: #060a18; border: 1px solid #00ffff33;
  border-radius: 16px; width: 100%; max-width: 980px;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  box-shadow: 0 0 60px #00ffff1a, 0 32px 80px #000000c0;
  overflow: hidden;
}

.pm-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid #0a1020;
  flex-shrink: 0;
}
.pm-head-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.pm-head-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid; flex-shrink: 0; }
.pm-head-name { font-size: 13px; font-weight: 700; font-family: var(--font-hud); letter-spacing: 0.05em; }
.pm-head-jtbd { font-size: 10px; color: #4a5a70; margin-top: 2px; }
.pm-close {
  background: none; border: 1px solid #0f1a2e; color: #334155;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px;
  flex-shrink: 0; transition: all 0.12s;
}
.pm-close:hover { border-color: #ef4444; color: #ef4444; }

.pm-body { display: flex; flex: 1; overflow: hidden; }

/* Phone area */
.pm-phone-wrap {
  padding: 20px; display: flex; align-items: flex-start; justify-content: center;
  border-right: 1px solid #0a1020; flex-shrink: 0;
}
.pm-phone {
  width: 280px; background: #010611; border-radius: 36px;
  border: 2px solid #0f1a2e; display: flex; flex-direction: column;
  box-shadow: 0 0 0 6px #020814, 0 0 40px #00000080, inset 0 0 30px #00000060;
  overflow: hidden;
}
.pm-status-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 4px; font-size: 9px; font-family: var(--font-hud);
  font-weight: 700; letter-spacing: 0.04em; color: #4a5a70; flex-shrink: 0;
}
.pm-screen {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-height: 480px;
}
.pm-home-bar { height: 4px; border-radius: 2px; width: 80px; margin: 10px auto 12px; flex-shrink: 0; }

/* Meta panel */
.pm-meta {
  flex: 1; display: flex; flex-direction: column; gap: 0;
  overflow-y: auto; padding: 20px 24px; min-width: 0;
}
.pm-meta::-webkit-scrollbar { width: 3px; }
.pm-meta::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

.pm-step-header { margin-bottom: 14px; }
.pm-step-counter { font-family: var(--font-hud); font-size: 9px; font-weight: 700; letter-spacing: 0.18em; margin-bottom: 6px; }
.pm-step-text { font-size: 15px; font-weight: 600; color: #e2e8f0; line-height: 1.45; }

.pm-step-nav {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  padding-bottom: 20px; border-bottom: 1px solid #0a1020;
}
.pm-nav-btn {
  background: none; border: 1px solid; border-radius: 8px; cursor: pointer;
  padding: 6px 14px; font-size: 11px; font-family: var(--font-hud);
  font-weight: 700; letter-spacing: 0.08em; transition: all 0.12s;
  flex-shrink: 0;
}
.pm-nav-btn:hover:not(:disabled) { filter: brightness(1.4); }
.pm-nav-btn:disabled { opacity: 0.25; cursor: default; }
.pm-sdots-row { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
.pm-sdot { width: 6px; height: 6px; border-radius: 50%; background: #1e293b; transition: all 0.2s; flex-shrink: 0; }
.pm-sdot.active { width: 18px; border-radius: 3px; }

.pm-elements-panel { margin-bottom: 16px; }
.pm-el-header {
  font-family: var(--font-hud); font-size: 8px; font-weight: 700; letter-spacing: 0.2em;
  color: #1e3a4a; margin-bottom: 8px;
}
.pm-el-grid { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.pm-el-all { display: flex; flex-wrap: wrap; gap: 5px; }
.pm-el-chip {
  font-size: 9px; font-family: var(--font-hud); letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 4px; border: 1px solid; cursor: default;
  transition: all 0.15s; white-space: nowrap;
}
.pm-el-chip.active { font-weight: 700; }

/* Phone element components */
.pe { display: flex; flex-shrink: 0; }

.pe-app_bar { height: 44px; align-items: center; padding: 0 14px; gap: 0; border-bottom: 1px solid #0a1020; }
.pe-ab-back { font-size: 22px; width: 28px; flex-shrink: 0; line-height: 1; }
.pe-ab-title { flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: #94a3b8; font-family: var(--font-hud); letter-spacing: 0.06em; }
.pe-ab-act { font-size: 16px; width: 28px; text-align: right; flex-shrink: 0; }

.pe-balance_hero { flex-direction: column; align-items: center; justify-content: center; padding: 16px 12px 10px; gap: 2px; }
.pe-bl-lbl { font-size: 9px; color: #4a5a70; font-family: var(--font-hud); letter-spacing: 0.14em; text-transform: uppercase; }
.pe-bl-num { font-size: 28px; font-weight: 700; font-family: var(--font-hud); letter-spacing: -0.01em; line-height: 1.1; }
.pe-bl-cur { font-size: 10px; color: #4a5a70; font-family: var(--font-hud); letter-spacing: 0.12em; }

.pe-balance_mini { height: 32px; align-items: center; padding: 0 14px; gap: 4px; border-bottom: 1px solid #0a1020; }
.pe-bm-num { font-size: 12px; font-weight: 700; font-family: var(--font-hud); }
.pe-bm-cur { font-size: 10px; color: #4a5a70; }

.pe-qr_frame {
  flex: 1; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: #000208; position: relative; min-height: 160px;
}
.pe-qr-corners {
  width: 130px; height: 130px; position: relative; flex-shrink: 0;
}
.pe-qr-corners > div {
  position: absolute; width: 22px; height: 22px;
  border-color: var(--qc); border-style: solid;
}
.pe-qr-tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.pe-qr-tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.pe-qr-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.pe-qr-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }
.pe-qr-hint { font-size: 9px; font-family: var(--font-hud); letter-spacing: 0.08em; text-align: center; }

.pe-amount_display { flex-direction: column; align-items: center; justify-content: center; padding: 12px 14px; gap: 2px; }
.pe-am-lbl { font-size: 9px; color: #4a5a70; font-family: var(--font-hud); letter-spacing: 0.12em; text-transform: uppercase; }
.pe-am-num { font-size: 22px; font-weight: 700; font-family: var(--font-hud); }

.pe-numpad { display: grid !important; grid-template-columns: repeat(3,1fr); gap: 1px; padding: 6px 10px; background: #0a1020; }
.pe-np-btn { height: 42px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500; color: #cbd5e1; border-radius: 4px; border: 1px solid; cursor: default; font-family: var(--font-hud); background: #02040a; }

.pe-confirm_btn { padding: 0 14px 10px; flex-direction: column; }
.pe-cb { width: 100%; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: var(--font-hud); letter-spacing: 0.06em; cursor: default; }

.pe-biometric { flex-direction: column; align-items: center; justify-content: center; padding: 16px 12px; gap: 6px; }
.pe-bio-ring { width: 56px; height: 56px; border-radius: 50%; border: 2px solid; display: flex; align-items: center; justify-content: center; }
.pe-bio-icon { font-size: 26px; }
.pe-bio-lbl { font-size: 9px; font-family: var(--font-hud); letter-spacing: 0.1em; }

.pe-success_screen { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 160px; }
.pe-ok-ring { width: 64px; height: 64px; border-radius: 50%; border: 2px solid; display: flex; align-items: center; justify-content: center; }
.pe-ok-check { font-size: 28px; }
.pe-ok-title { font-size: 16px; font-weight: 700; font-family: var(--font-hud); }
.pe-ok-sub { font-size: 10px; color: #4a5a70; font-family: var(--font-hud); letter-spacing: 0.06em; }

.pe-contact_list { flex-direction: column; flex: 1; overflow: hidden; }
.pe-cl-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #0a1020; flex-shrink: 0; }
.pe-cl-av { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #e2e8f0; flex-shrink: 0; }
.pe-cl-name { flex: 1; font-size: 12px; color: #94a3b8; }
.pe-cl-arr { font-size: 18px; }

.pe-stories_row { height: 68px; align-items: center; gap: 10px; padding: 0 12px; overflow: hidden; border-bottom: 1px solid #0a1020; flex-shrink: 0; }
.pe-st-item { flex-shrink: 0; }
.pe-st-av { width: 42px; height: 42px; border-radius: 50%; border: 2px solid; display: flex; align-items: center; justify-content: center; font-size: 16px; background: #0a1020; }

.pe-offer_card { flex-direction: column; gap: 3px; margin: 6px 12px; padding: 10px 12px; background: #0a1020; border-radius: 10px; border: 1px solid; flex-shrink: 0; }
.pe-oc-tag { font-size: 8px; font-family: var(--font-hud); font-weight: 700; letter-spacing: 0.14em; border: 1px solid; padding: 2px 6px; border-radius: 3px; align-self: flex-start; display: inline-block; margin-bottom: 2px; }
.pe-oc-title { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.pe-oc-sub { font-size: 10px; color: #4a5a70; }

.pe-nav_bar { height: 52px; align-items: center; border-top: 1px solid #0a1020; margin-top: auto; flex-shrink: 0; }
.pe-nb-btn { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: default; }

.pe-push_notif { align-items: center; gap: 10px; padding: 8px 12px; background: #060c18; border-bottom: 2px solid; border-color: inherit; flex-shrink: 0; }
.pe-pn-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.pe-pn-body { flex: 1; min-width: 0; }
.pe-pn-title { font-size: 10px; font-weight: 700; font-family: var(--font-hud); letter-spacing: 0.06em; }
.pe-pn-text { font-size: 10px; color: #4a5a70; }

.pe-game_chips { align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; flex-shrink: 0; }
.pe-gc-chip { flex: 1; height: 36px; display: flex; align-items: center; justify-content: center; border: 1.5px solid; border-radius: 8px; font-size: 11px; font-family: var(--font-hud); font-weight: 700; background: #02040a; cursor: default; }

.pe-chart_bar { flex-direction: column; padding: 8px 14px; flex-shrink: 0; }
.pe-ch-bars { display: flex; align-items: flex-end; gap: 4px; height: 80px; flex: 1; }
.pe-ch-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.pe-ch-bar { width: 100%; border-radius: 3px 3px 0 0; transition: height 0.4s; min-height: 4px; }
.pe-ch-lbl { font-size: 7px; color: #334155; font-family: var(--font-hud); text-align: center; }

.pe-tx_list { flex-direction: column; flex: 1; overflow: hidden; }
.pe-tx-row { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #0a1020; flex-shrink: 0; }
.pe-tx-name { flex: 1; font-size: 11px; color: #64748b; }
.pe-tx-amt { font-size: 12px; font-weight: 700; font-family: var(--font-hud); }

.pe-goal_card { flex-direction: column; gap: 5px; padding: 10px 14px; flex-shrink: 0; border-bottom: 1px solid #0a1020; }
.pe-gl-row { display: flex; justify-content: space-between; align-items: baseline; }
.pe-gl-name { font-size: 12px; color: #94a3b8; }
.pe-gl-pct { font-size: 12px; font-weight: 700; font-family: var(--font-hud); }
.pe-gl-track { height: 4px; background: #0f1a2e; border-radius: 2px; overflow: hidden; }
.pe-gl-fill { height: 100%; border-radius: 2px; }
.pe-gl-sub { font-size: 9px; color: #334155; font-family: var(--font-hud); }

.pe-share_sheet { align-items: flex-start; justify-content: center; gap: 14px; padding: 12px 14px; flex-shrink: 0; border-top: 1px solid #0a1020; margin-top: auto; }
.pe-sh-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pe-sh-ic { width: 38px; height: 38px; border-radius: 12px; border: 1px solid; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: var(--font-hud); }
.pe-sh-lbl { font-size: 8px; color: #4a5a70; font-family: var(--font-hud); }

.pe-section_title { height: 30px; align-items: center; padding: 0 14px; font-size: 10px; font-family: var(--font-hud); font-weight: 700; letter-spacing: 0.1em; border-bottom: 1px solid #0a1020; flex-shrink: 0; }

.pe-split_summary { flex-direction: column; flex: 1; overflow: hidden; }
.pe-sp-row { display: flex; align-items: center; padding: 9px 14px; border-bottom: 1px solid #0a1020; flex-shrink: 0; }
.pe-sp-name { flex: 1; font-size: 12px; color: #64748b; }
.pe-sp-amt { font-size: 11px; color: #94a3b8; font-family: var(--font-hud); margin-right: 10px; }
.pe-sp-st { font-size: 13px; font-weight: 700; }

/* ── Semantic element styles ── */
.pe-na { flex: 1; align-items: center; justify-content: center; min-height: 48px; }

.pe-central_function { flex-direction: column; align-items: center; padding: 12px 14px; gap: 6px; flex-shrink: 0; }
.pe-cf-main { width: 100%; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: var(--font-hud); letter-spacing: 0.04em; }
.pe-cf-sub  { font-size: 9px; font-family: var(--font-hud); letter-spacing: 0.06em; text-align: center; }

.pe-balance { flex-direction: column; align-items: center; justify-content: center; padding: 14px 12px 10px; gap: 2px; flex-shrink: 0; }
.pe-bl-sub  { font-size: 9px; font-family: var(--font-hud); margin-top: 2px; }

.pe-close_contacts { flex-direction: column; flex: 1; overflow: hidden; }

.pe-offer { flex-direction: column; gap: 3px; margin: 8px 12px; padding: 10px 12px; background: #0a1020; border-radius: 10px; border: 1px solid #0f1a2e; flex-shrink: 0; }

.pe-content_feed { height: 74px; align-items: flex-start; gap: 8px; padding: 8px 10px 4px; overflow: hidden; border-bottom: 1px solid #0a1020; flex-shrink: 0; }
.pe-st-lbl  { font-size: 7px; color: #334155; font-family: var(--font-hud); white-space: nowrap; max-width: 40px; overflow: hidden; text-overflow: ellipsis; }

.pe-transaction_history { flex-direction: column; flex: 1; overflow: hidden; }

.pe-spending_analytics { flex-direction: column; padding: 8px 12px 4px; flex-shrink: 0; }

.pe-confirmation { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 160px; }
.pe-ok-amount { font-size: 11px; font-family: var(--font-hud); margin-top: 2px; }

.pe-personal_context { flex-direction: column; padding: 10px 14px; gap: 5px; flex-shrink: 0; }
.pe-ctx-hdr { font-size: 8px; font-family: var(--font-hud); font-weight: 700; letter-spacing: 0.14em; margin-bottom: 4px; }
.pe-ctx-row { font-size: 10px; color: #64748b; display: flex; gap: 6px; align-items: center; }

.pe-notification { align-items: center; gap: 10px; padding: 8px 12px; background: #060c18; border-bottom: 2px solid #0f1a2e; flex-shrink: 0; }

.pe-quick_amounts { align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; flex-shrink: 0; }

.pe-qr_scanner { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #000208; min-height: 160px; }

.pe-game_account { flex-direction: column; padding: 12px 14px; gap: 6px; flex-shrink: 0; border-bottom: 1px solid #0a1020; }
.pe-ga-game { font-size: 12px; font-weight: 700; }
.pe-ga-row  { display: flex; align-items: baseline; gap: 8px; }
.pe-ga-id   { font-size: 14px; color: #e2e8f0; font-family: var(--font-hud); font-weight: 700; }
.pe-ga-lv   { font-size: 10px; font-family: var(--font-hud); }

.pe-game_catalog { flex-direction: column; flex: 1; overflow: hidden; }

.pe-game_currency { flex-direction: column; align-items: center; justify-content: center; padding: 12px; gap: 4px; flex-shrink: 0; }

.pe-savings_goal { flex-direction: column; gap: 5px; padding: 10px 14px; flex-shrink: 0; border-bottom: 1px solid #0a1020; }

.pe-group_collection { flex-direction: column; flex: 1; overflow: hidden; }
.pe-gc-goal { font-size: 10px; font-family: var(--font-hud); padding: 8px 14px 4px; font-weight: 700; letter-spacing: 0.06em; flex-shrink: 0; }

.pe-recurring_payment { flex-direction: column; flex: 1; overflow: hidden; }
.pe-rp-row  { display: flex; align-items: center; padding: 9px 14px; border-bottom: 1px solid #0a1020; flex-shrink: 0; }
.pe-rp-name { flex: 1; font-size: 12px; color: #64748b; }
.pe-rp-amt  { font-size: 11px; font-family: var(--font-hud); font-weight: 700; margin-right: 8px; }
.pe-rp-dt   { font-size: 9px; font-family: var(--font-hud); }

.pe-referral_screen { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; }
.pe-ref-name  { font-size: 14px; font-weight: 700; font-family: var(--font-hud); letter-spacing: 0.06em; }
.pe-ref-code  { font-size: 16px; font-weight: 700; font-family: var(--font-hud); border: 1.5px solid; padding: 6px 16px; border-radius: 8px; letter-spacing: 0.12em; }
.pe-ref-bonus { font-size: 10px; font-family: var(--font-hud); }

.pe-payment_request { flex-direction: column; padding: 12px 14px; gap: 4px; flex-shrink: 0; }
.pe-pr-from   { font-size: 10px; font-family: var(--font-hud); letter-spacing: 0.08em; text-transform: uppercase; }
.pe-pr-amount { font-size: 24px; font-weight: 700; font-family: var(--font-hud); }
.pe-pr-reason { font-size: 11px; color: #4a5a70; }

/* ── E4b Replay view ─────────────────────────────────────────────────────── */
#view-replay { display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }

.rp-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #00ffff18;
  background: #04040a;
  flex-shrink: 0;
}
.rp-toolbar-title {
  font-family: var(--font-hud);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #00ffff55;
  text-transform: uppercase;
  flex-shrink: 0;
}
.rp-token-input {
  background: #080810;
  border: 1px solid #1e3a4a;
  border-radius: 4px;
  color: #a8c5d6;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 4px 8px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}
.rp-token-input:focus { border-color: #00ffff55; }
.rp-base-input {
  background: #080810;
  border: 1px solid #1e3a4a;
  border-radius: 4px;
  color: #7ba8c0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 8px;
  width: 180px;
  outline: none;
}
.rp-filter-input {
  background: #080810;
  border: 1px solid #1e3a4a;
  border-radius: 4px;
  color: #7ba8c0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 8px;
  width: 100px;
  outline: none;
}
.rp-load-btn {
  padding: 4px 12px;
  background: #00ffff12;
  border: 1px solid #00ffff44;
  border-radius: 4px;
  color: #00ffff;
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.rp-load-btn:hover { background: #00ffff22; }
.rp-load-btn:disabled { opacity: 0.4; cursor: default; }
.rp-msg {
  font-size: 11px;
  color: #5b8395;
  padding: 2px 0;
}
.rp-msg.error { color: #ff5b78; }

.rp-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Session picker panel */
.rp-picker {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid #00ffff0d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rp-picker-hdr {
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #00ffff44;
  padding: 10px 12px 6px;
  border-bottom: 1px solid #0a1520;
  flex-shrink: 0;
}
.rp-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}
.rp-picker-list::-webkit-scrollbar { width: 3px; }
.rp-picker-list::-webkit-scrollbar-thumb { background: #1e293b; }

.rp-session-card {
  padding: 10px 10px;
  border: 1px solid #0f1b24;
  border-radius: 5px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #040408;
}
.rp-session-card:hover { border-color: #00ffff33; background: #00ffff06; }
.rp-session-card.active { border-color: #00ffff66; background: #00ffff0a; }
.rp-session-id {
  font-family: var(--font-hud);
  font-size: 9px;
  color: #00ffff;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-session-meta {
  font-size: 10px;
  color: #4a5a70;
  line-height: 1.4;
}
.rp-session-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.rp-badge {
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid;
  letter-spacing: 0.3px;
}
.rp-badge.error { border-color: #ff5b7855; color: #ff5b78; background: #3a162022; }
.rp-badge.persona { border-color: #00ffff33; color: #00ffff99; }

/* Player panel */
.rp-player {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}
.rp-player-phone {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid #00ffff0d;
}
.rp-player-phone::-webkit-scrollbar { width: 3px; }
.rp-player-phone::-webkit-scrollbar-thumb { background: #1e293b; }
.rp-phone-frame-wrap {
  position: relative;
  width: 220px;
}
.rp-event-caption {
  margin-top: 8px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #4a5a70;
  text-align: center;
  line-height: 1.4;
  word-break: break-all;
}
.rp-not-modelled {
  padding: 24px 12px;
  text-align: center;
  color: #4a5a70;
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
}
/* Overlay on top of the phone screen for scroll/flow/error */
.rp-overlay {
  position: absolute;
  left: 0; right: 0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.4;
  z-index: 10;
  pointer-events: none;
  animation: rp-fadein 0.2s ease;
}
@keyframes rp-fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rp-overlay.top { top: 8px; }
.rp-overlay.bottom { bottom: 8px; }
.rp-overlay.error { background: #3a162044; border: 1px solid #ff5b78aa; color: #ff5b78; }
.rp-overlay.flow  { background: #00ffff0d; border: 1px solid #00ffff44; color: #00ffff; font-family: var(--font-hud); font-size: 9px; letter-spacing: 0.1em; }
.rp-overlay.scroll { background: #7ba8c022; border: 1px solid #7ba8c044; color: #7ba8c0; font-size: 10px; }

/* Highlight tap/selection in phone rows */
.scr-row.rp-highlight {
  background: #00ffff12 !important;
  border-left: 3px solid #00ffff !important;
  transition: background 0.3s, border-left 0.3s;
}

/* Player controls */
.rp-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  min-height: 0;
}
.rp-controls::-webkit-scrollbar { width: 3px; }
.rp-controls::-webkit-scrollbar-thumb { background: #1e293b; }
.rp-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.rp-ctrl-btn {
  padding: 5px 10px;
  background: #080810;
  border: 1px solid #1e3a4a;
  border-radius: 4px;
  color: #7ba8c0;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}
.rp-ctrl-btn:hover { border-color: #00ffff55; color: #00ffff; }
.rp-ctrl-btn:disabled { opacity: 0.3; cursor: default; }
.rp-ctrl-btn.playing { border-color: #00ffff55; color: #00ffff; }
.rp-scrubber {
  flex: 1;
  min-width: 80px;
  accent-color: #00ffff;
  cursor: pointer;
}
.rp-pos-label {
  font-family: var(--font-hud);
  font-size: 10px;
  color: #00ffff66;
  white-space: nowrap;
  letter-spacing: 0.08em;
}
.rp-event-log {
  flex: 1;
  overflow-y: auto;
  font-size: 11px;
  color: #4a5a70;
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  min-height: 0;
}
.rp-event-log::-webkit-scrollbar { width: 3px; }
.rp-event-log::-webkit-scrollbar-thumb { background: #1e293b; }
.rp-log-row {
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.1s;
}
.rp-log-row:hover { background: #00ffff08; }
.rp-log-row.active {
  background: #00ffff0d;
  border-left-color: #00ffff66;
  color: #a8c5d6;
}
.rp-log-row.ev-error { color: #ff5b78aa; }
.rp-log-row.ev-error.active { color: #ff5b78; border-left-color: #ff5b7866; }
.rp-log-seq { color: #1e3a4a; font-size: 9px; margin-right: 4px; }
.rp-empty-hint {
  padding: 32px 16px;
  text-align: center;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}
.rp-no-token {
  padding: 32px 16px;
  text-align: center;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pe-foreign_catalog { flex-direction: column; flex: 1; overflow: hidden; }
