:root {
  --bg: #0d0b08; --bg-raised: #191915; --bg-sunk: #0c110e;
  --text: #e9e1cd; --text-dim: #9f998c; --accent: #c9a762;
  --accent-contrast: #17120b; --border: #2b251c; --error: #c85d36;
  --success: #7d8a5a; --info: #75a8b8; --warning: #d7a94b;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-1: 2px; --space-2: 4px; --space-3: 6px; --space-4: 8px;
  --space-5: 10px; --space-6: 12px; --space-7: 14px; --space-8: 18px;
  --space-9: 22px; --space-10: 26px; --radius: 4px;
  --shadow: 0 10px 26px rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); font: 15px/1.5 var(--sans); }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shell-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding: var(--space-8) clamp(18px,4vw,44px); border-bottom: 1px solid var(--border); background: #0a0907; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); font-size: 21px; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--accent); color: var(--accent); font-size: 22px; }
.status-cluster { display: flex; align-items: center; gap: 12px; }
.status-pill { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); }
.status-pill.active { border-color: var(--success); color: var(--text); }
.environment { padding: 7px 12px; border: 1px solid #70531b; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .18em; }
.lab { width: min(1180px, 100%); margin: 0 auto; padding: clamp(22px,4vw,46px); display: grid; gap: 22px; }
.intro { max-width: 760px; }
.intro h1 { margin: 5px 0 8px; font-size: clamp(30px,5vw,52px); line-height: 1.08; font-family: Georgia, serif; font-weight: 500; }
.intro p:last-child { margin: 0; color: var(--text-dim); font-size: 17px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); box-shadow: var(--shadow); overflow: hidden; }
.panel-header, .panel-body, .auth-panel { padding: 18px; }
.auth-panel .panel-header { padding: 0 0 18px; }
.panel-header { border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 4px 0 0; font: 500 21px/1.15 Georgia, serif; }
.auth-panel { max-width: 640px; }
.top-grid, .videos { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--text-dim); font-size: 12px; font-weight: 600; }
input, select { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--bg-sunk); }
input:hover, select:hover { border-color: #5a4c37; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.check input { width: auto; min-height: auto; accent-color: var(--accent); }
.actions, .inline-form, .footer-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.copy-field { display: flex; gap: 10px; }
.copy-field input { min-width: 0; }
.button { min-height: 40px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--bg-raised); font-weight: 600; cursor: pointer; }
.button:hover:not(:disabled) { border-color: var(--accent); background: #24231d; }
.button.primary { border-color: var(--accent); color: var(--accent-contrast); background: var(--accent); }
.button.danger { border-color: var(--error); color: #f2d9cf; background: #2a1712; }
.button:disabled, input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
.message { margin: 14px 0 0; color: var(--text-dim); }
.workspace { display: grid; gap: 18px; }
.facts { margin: 0; padding: 18px; display: grid; gap: 10px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.facts dt, .facts dd { margin: 0; }
.facts dt { color: var(--text-dim); }
#network-path.direct { color: var(--success); }
#network-path.turn { color: var(--info); }
.videos figure { margin: 0; display: grid; gap: 7px; color: var(--text-dim); }
.videos video { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: var(--radius); background: #070907; object-fit: cover; }
.media-actions { margin-top: 18px; }
details { border-top: 1px solid var(--border); padding-top: 12px; }
summary { color: var(--accent); cursor: pointer; }
details .inline-form { margin-top: 10px; }
.inline-form input { flex: 1 1 260px; }
.chat { min-height: 90px; max-height: 260px; margin: 0 0 14px; padding: 0; display: grid; align-content: start; gap: 8px; list-style: none; overflow-y: auto; }
.chat li { padding: 8px 10px; border-left: 2px solid var(--border); background: var(--bg-sunk); }
.chat strong { color: var(--accent); }
.chat time { margin-left: 8px; color: var(--text-dim); font-size: 11px; }
.footer-actions { justify-content: flex-end; }
footer { padding: 20px; border-top: 1px solid var(--border); color: var(--text-dim); text-align: center; font-size: 12px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .top-grid, .videos { grid-template-columns: 1fr; }
  .shell-header { align-items: flex-start; }
  .status-cluster { align-items: flex-end; flex-direction: column; }
  .actions .button { flex: 1 1 140px; }
  .copy-field { align-items: stretch; flex-direction: column; }
}
