/*
 * frontend/assets/css/studio.css
 * Tactile Dark Studio UI — Clean zero-clutter layout with 3D bevels, recessed wells, and top specular lighting.
 */

:root,
[data-theme="indigo"] {
  --bg-canvas: #080a0f;
  --bg-card-top: #161b29;
  --bg-card: #111520;
  --bg-card-elevated: #171c2b;
  --bg-well: #0a0d14;
  --bg-hover: #21283b;
  --bg-btn-top: #1d2335;
  --bg-btn-bot: #141927;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #6366f1;

  --text-bright: #ffffff;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-top: #6366f1;
  --accent-primary: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-glow: rgba(79, 70, 229, 0.5);
  --ambient-1: rgba(99, 102, 241, 0.15);
  --ambient-2: rgba(16, 185, 129, 0.06);
}

/* THEME 2: KICK x STAKE EMERALD (Carbon & Emerald Green) */
[data-theme="emerald"] {
  --bg-canvas: #070b09;
  --bg-card-top: #111b16;
  --bg-card: #0d1511;
  --bg-card-elevated: #15221b;
  --bg-well: #080d0a;
  --bg-hover: #1c2d24;
  --bg-btn-top: #18271f;
  --bg-btn-bot: #101b15;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(16, 185, 129, 0.14);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #10b981;

  --text-bright: #ffffff;
  --text-primary: #e2f1ea;
  --text-secondary: #8da99b;
  --text-muted: #567063;

  --accent-top: #10b981;
  --accent-primary: #059669;
  --accent-hover: #047857;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --accent-glow: rgba(16, 185, 129, 0.45);
  --ambient-1: rgba(16, 185, 129, 0.16);
  --ambient-2: rgba(6, 182, 212, 0.06);
}

/* THEME 3: APPLE SPACE TITANIUM (Pure Neutral Gunmetal & macOS Blue) */
[data-theme="titanium"] {
  --bg-canvas: #0b0b0c;
  --bg-card-top: #1c1c1f;
  --bg-card: #151518;
  --bg-card-elevated: #202024;
  --bg-well: #0e0e10;
  --bg-hover: #2a2a30;
  --bg-btn-top: #26262b;
  --bg-btn-bot: #1a1a1e;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: #0a84ff;

  --text-bright: #f5f5f7;
  --text-primary: #e5e5ea;
  --text-secondary: #98989d;
  --text-muted: #636366;

  --accent-top: #2997ff;
  --accent-primary: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-glow: rgba(0, 113, 227, 0.45);
  --ambient-1: rgba(255, 255, 255, 0.06);
  --ambient-2: rgba(10, 132, 255, 0.06);
}

/* THEME 4: SONY CINEMA AMBER (Warm Carbon & Gold/Orange) */
[data-theme="amber"] {
  --bg-canvas: #0c0a09;
  --bg-card-top: #1c1917;
  --bg-card: #151311;
  --bg-card-elevated: #221e1b;
  --bg-well: #0e0c0b;
  --bg-hover: #2c2623;
  --bg-btn-top: #27221f;
  --bg-btn-bot: #1a1614;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(245, 158, 11, 0.14);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #f59e0b;

  --text-bright: #fafaf9;
  --text-primary: #e7e5e4;
  --text-secondary: #a8a29e;
  --text-muted: #78716c;

  --accent-top: #f59e0b;
  --accent-primary: #d97706;
  --accent-hover: #b45309;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --accent-glow: rgba(217, 119, 6, 0.45);
  --ambient-1: rgba(245, 158, 11, 0.13);
  --ambient-2: rgba(234, 88, 12, 0.06);
}

/* THEME 5: NORDIC OCEAN CYAN (Deep Navy & Electric Cyan) */
[data-theme="ocean"] {
  --bg-canvas: #060b11;
  --bg-card-top: #0f1c29;
  --bg-card: #0b1520;
  --bg-card-elevated: #132334;
  --bg-well: #070e16;
  --bg-hover: #1a2f45;
  --bg-btn-top: #16283b;
  --bg-btn-bot: #0e1b29;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(6, 182, 212, 0.16);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #06b6d4;

  --text-bright: #ffffff;
  --text-primary: #e0f2fe;
  --text-secondary: #7dd3fc;
  --text-muted: #475569;

  --accent-top: #06b6d4;
  --accent-primary: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: rgba(6, 182, 212, 0.16);
  --accent-glow: rgba(2, 132, 199, 0.45);
  --ambient-1: rgba(6, 182, 212, 0.15);
  --ambient-2: rgba(59, 130, 246, 0.08);
}

:root {
  --shadow-card:
    0 14px 34px -10px rgba(0, 0, 0, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);

  --shadow-well:
    inset 0 2px 5px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.05);

  --shadow-btn:
    0 3px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --radius-xl: 14px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

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

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse 70% 40% at 50% -12%, var(--ambient-1), transparent),
    radial-gradient(ellipse 50% 35% at 85% 105%, var(--ambient-2), transparent);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.2s ease;
}

.studio-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  padding: 14px 16px;
  gap: 14px;
}

/* 1. COMPACT TOP METRICS & UTILITY BAR */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.65fr;
  gap: 12px;
  flex-shrink: 0;
}

.telemetry-cell {
  background: linear-gradient(180deg, var(--bg-card-top) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 13px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cell-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cell-meta-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-well);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.cell-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-big {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.kpi-split {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.kpi-inline-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.kpi-inline-stats > span {
  background: var(--bg-well);
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.kpi-inline-stats strong {
  color: var(--text-bright);
  font-weight: 600;
}

.runtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-well);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.runtime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.runtime-badge.active {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--green-soft);
}

.runtime-badge.active .runtime-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* 2. MAIN WORKSPACE SPLIT */
.studio-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  min-height: 0;
}

/* LEFT SIDEBAR: DIMENSIONAL CARD WITH RECESSED INPUT WELLS */
.inspector-pane {
  background: linear-gradient(180deg, var(--bg-card-top) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pane-header {
  height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pane-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.inspector-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-well);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-well);
  padding: 7px 11px;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-well), 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.secret-field {
  display: flex;
  align-items: center;
  background: var(--bg-well);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-well);
  padding-right: 5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.secret-field:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.secret-field:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-well), 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.secret-field input {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 7px 8px 7px 11px !important;
  text-overflow: ellipsis;
}

.reveal-btn {
  flex-shrink: 0;
  margin-left: 6px;
  background: linear-gradient(180deg, var(--bg-btn-top) 0%, var(--bg-btn-bot) 100%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 5px;
  transition: all 0.15s;
}

.reveal-btn:hover {
  color: var(--text-bright);
  border-color: rgba(255, 255, 255, 0.28);
}

.divider-line {
  display: none;
}

/* ELEVATED BEVELED SWITCH GROUP */
.switch-list {
  margin-top: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}

.switch-row:last-child {
  border-bottom: none;
}

.switch-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  background: var(--bg-well);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, background 0.2s ease;
}

input[type="checkbox"].hidden-check {
  display: none;
}

input[type="checkbox"].hidden-check:checked + .switch-track {
  background: linear-gradient(180deg, var(--accent-top) 0%, var(--accent-primary) 100%);
  border-color: var(--accent-top);
  box-shadow: 0 0 10px var(--accent-glow), inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

input[type="checkbox"].hidden-check:checked + .switch-track::after {
  background: #ffffff;
  transform: translateX(18px);
}

/* ACTION DOCK FOOTER */
.inspector-actions {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* TACTILE 3D BEVELED BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 33px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--bg-btn-top) 0%, var(--bg-btn-bot) 100%);
  box-shadow: var(--shadow-btn);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-bright);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-primary-cta {
  height: 40px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(180deg, var(--accent-top) 0%, var(--accent-primary) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 6px 18px -3px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.btn-primary-cta:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-top) 0%, var(--accent-hover) 100%);
  filter: brightness(1.08);
}

.btn-danger-cta {
  height: 40px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 6px 18px -3px rgba(239, 68, 68, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* RIGHT STAGE CARD */
.stage-pane {
  background: linear-gradient(180deg, var(--bg-card-top) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.stage-nav-bar {
  height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segmented-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-well);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

.seg-tab {
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.seg-tab:hover {
  color: var(--text-bright);
}

.seg-tab.active {
  background: linear-gradient(180deg, var(--bg-btn-top) 0%, var(--bg-btn-bot) 100%);
  color: var(--text-bright);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.seg-count {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #a5b4fc;
}

.ws-status {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-well);
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.stage-view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.stage-view.active {
  display: flex;
}

/* SUB-TOOLBAR */
.sub-toolbar {
  height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.toolbar-input {
  max-width: 320px;
  height: 32px;
  padding: 0 12px !important;
  font-size: 12px !important;
}

/* STRUCTURED TELEMETRY FEED */
.console-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  background: var(--bg-well);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.log-row {
  display: grid;
  grid-template-columns: 74px 84px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
}

.log-row:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}

.log-time {
  color: var(--text-muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.log-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--bg-card-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  text-transform: uppercase;
}

.log-msg {
  color: var(--text-primary);
  word-break: break-word;
}

.log-row.ok {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}
.log-row.ok .log-tag {
  background: var(--green-soft);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.log-row.ok .log-msg {
  color: #ecfdf5;
}

.log-row.err {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.22);
}
.log-row.err .log-tag {
  background: var(--red-soft);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
.log-row.err .log-msg {
  color: #fecaca;
}

.log-row.warn .log-tag {
  background: var(--amber-soft);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.log-row.phase .log-tag {
  background: var(--accent-soft);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}
.log-row.phase .log-msg {
  color: #ffffff;
  font-weight: 500;
}

/* DATA VAULT TABLE */
.vault-scroll {
  flex: 1;
  overflow: auto;
  background: var(--bg-well);
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.studio-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card-elevated);
  color: var(--text-secondary);
  text-align: left;
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  z-index: 4;
}

.studio-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}

.studio-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.07);
}

.studio-table td {
  padding: 10px 16px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-primary);
}

.cell-copy {
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
  display: inline-block;
}

.cell-copy:hover {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.tag-pill.ok {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
  background: var(--green-soft);
}

.tag-pill.warn {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
  background: var(--amber-soft);
}

.tag-pill.err {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
  background: var(--red-soft);
}

/* POOL EDITOR */
.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: var(--bg-well);
}

.code-editor {
  flex: 1;
  resize: none;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  padding: 14px !important;
  font-family: var(--font-mono) !important;
  font-size: 12.5px !important;
  line-height: 1.65 !important;
  color: var(--text-bright) !important;
}

/* LOGIN SCREEN OVERLAY */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse 60% 45% at 50% 0%, var(--ambient-1), transparent),
    radial-gradient(ellipse 50% 40% at 80% 100%, var(--ambient-2), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, var(--bg-card-top) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.login-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.login-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.login-error {
  display: none;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* NOTIFICATION BAR */
#notification-tray {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-toast {
  background: var(--bg-card-elevated);
  border: 1px solid var(--accent-primary);
  color: var(--text-bright);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* PROOF SCREENSHOT MODAL */
.proof-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.proof-modal-card {
  width: 95%;
  max-width: 1040px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeInProof 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.proof-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.proof-modal-body {
  padding: 16px;
  background: var(--bg-well);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 80vh;
}

@keyframes fadeInProof {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
