:root {
  color-scheme: dark;
  --ink: #eef5f1;
  --muted: #8d9d97;
  --muted-2: #60716a;
  --green: #86efac;
  --green-deep: #0d2d22;
  --blue: #8ad5ff;
  --line: rgba(190, 226, 211, 0.13);
  --panel: rgba(13, 21, 18, 0.9);
  --page: #070b0a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(rgba(255,255,255,.018) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px), var(--page);
  background-size: 42px 42px;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { color: inherit; }

.page-glow { position: fixed; z-index: -1; width: 38rem; height: 38rem; border-radius: 50%; filter: blur(130px); opacity: .12; pointer-events: none; }
.glow-one { top: -20rem; right: -10rem; background: #42e58b; }
.glow-two { bottom: -24rem; left: -18rem; background: #347c69; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: #07120d;
  background: var(--green);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -.05em;
  box-shadow: 0 0 34px rgba(134,239,172,.17);
}

.overline { margin: 0 0 8px; color: var(--green); font: 700 11px/1.3 "SFMono-Regular",Consolas,monospace; letter-spacing: .15em; text-transform: uppercase; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.login-card {
  width: min(100%, 650px);
  padding: clamp(34px, 7vw, 70px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg,rgba(19,31,26,.96),rgba(9,15,13,.96));
  box-shadow: 0 36px 110px rgba(0,0,0,.46);
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 64px; }
.login-brand strong { font-size: 17px; letter-spacing: -.02em; }
.login-card h1 { max-width: 500px; margin: 0; font-size: clamp(42px,7vw,68px); line-height: .99; letter-spacing: -.06em; font-weight: 680; }
.login-copy { margin: 22px 0 38px; color: #aab8b3; font-size: 17px; line-height: 1.6; }
.login-card form > label { display: block; margin: 0 0 9px 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.login-row input { min-width: 0; padding: 15px 16px; color: var(--ink); background: #0a1210; border: 1px solid var(--line); border-radius: 11px; outline: none; font-family: "SFMono-Regular",Consolas,monospace; }
.login-row input:focus { border-color: rgba(134,239,172,.55); box-shadow: 0 0 0 4px rgba(134,239,172,.08); }
.login-row button { padding: 15px 20px; color: #08110d; background: var(--green); border: 0; border-radius: 11px; font-weight: 750; cursor: pointer; }
.login-row button:hover { background: #a6f5c1; }
.login-row button span { margin-left: 8px; }
.form-error { min-height: 22px; margin: 9px 2px 0; color: #ff9e9e; font-size: 13px; }
.login-note { display: flex; align-items: center; gap: 9px; margin: 26px 0 0; color: var(--muted-2); font-size: 12px; }
.login-note span, .status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(134,239,172,.45); }

.topbar, .app-shell { width: min(1460px, calc(100% - 48px)); margin-inline: auto; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand > span:last-child, .brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.user-menu { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.user-menu strong { color: var(--green); font-family: Consolas,monospace; }
.user-menu button { padding: 9px 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.user-menu button:hover { border-color: rgba(134,239,172,.35); }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 52px 0 30px; }
.page-heading h2 { margin: 0; font-size: clamp(36px,5vw,58px); line-height: 1; letter-spacing: -.055em; }
.capture-summary { color: var(--muted); font: 12px/1.5 "SFMono-Regular",Consolas,monospace; }

.workspace { display: grid; grid-template-columns: minmax(270px,330px) minmax(0,1fr); min-height: 680px; margin-bottom: 48px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 28px 90px rgba(0,0,0,.34); overflow: hidden; }
.session-panel { padding: 25px 21px; border-right: 1px solid var(--line); background: rgba(6,11,9,.52); }
.panel-heading,.viewer-header,.viewer-footer,.list-divider { display: flex; align-items: center; justify-content: space-between; }
.panel-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.count-badge { display: grid; place-items: center; min-width: 31px; height: 31px; padding: 0 8px; color: var(--green); background: rgba(134,239,172,.08); border: 1px solid rgba(134,239,172,.16); border-radius: 9px; font: 12px Consolas,monospace; }
.filters { display: grid; gap: 11px; margin: 25px 0 22px; }
.filters label span { display: block; margin: 0 0 7px 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
select { width: 100%; padding: 11px 34px 11px 12px; color: #d9e3df; background: #0c1512; border: 1px solid var(--line); border-radius: 9px; outline: none; cursor: pointer; }
select:focus { border-color: rgba(134,239,172,.48); box-shadow: 0 0 0 3px rgba(134,239,172,.07); }
.list-divider { padding: 17px 2px 12px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.text-button { padding: 3px; color: var(--green); background: none; border: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
.session-list { display: grid; gap: 7px; }
.session-card { position: relative; width: 100%; padding: 14px 13px 14px 50px; text-align: left; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 11px; cursor: pointer; transition: 150ms ease; }
.session-card:hover { background: rgba(255,255,255,.028); border-color: var(--line); }
.session-card.active { background: rgba(134,239,172,.07); border-color: rgba(134,239,172,.22); }
.session-terminal { position: absolute; left: 12px; top: 14px; color: var(--green); font: 700 10px/1.5 Consolas,monospace; }
.session-card strong { display: block; font-size: 13px; }
.session-meta { display: block; margin-top: 7px; color: var(--muted); font: 10px/1.4 Consolas,monospace; }

.viewer-panel { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; background: #0b1210; }
.viewer-header { min-height: 70px; padding: 0 22px; gap: 18px; border-bottom: 1px solid var(--line); }
.window-dots { display: flex; gap: 6px; }
.window-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #35433e; }
.window-dots i:nth-child(2) { background: #53665f; }
.window-dots i:nth-child(3) { background: var(--green); box-shadow: 0 0 8px rgba(134,239,172,.42); }
.active-session { flex: 1; min-width: 0; color: #cbd7d2; font: 12px "SFMono-Regular",Consolas,monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-session b { color: var(--green); font-weight: 700; }
.sequence-status { color: var(--muted); font: 10px "SFMono-Regular",Consolas,monospace; white-space: nowrap; }
.terminal-frame-wrap { position: relative; min-height: 540px; }
#terminal-frame { display: block; width: 100%; height: 100%; min-height: 540px; border: 0; background: #07100d; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state span { color: var(--green); font-size: 34px; }
.empty-state h3 { margin: 12px 0 5px; color: var(--ink); font-size: 20px; }
.empty-state p { margin: 0; font-size: 13px; }
.viewer-footer { min-height: 52px; padding: 0 22px; color: var(--muted-2); border-top: 1px solid var(--line); font: 9px "SFMono-Regular",Consolas,monospace; letter-spacing: .04em; text-transform: uppercase; }
.viewer-footer > div { display: flex; align-items: center; }
.viewer-footer .status-dot { margin-right: 8px; }

@media (max-width: 880px) {
  .topbar,.app-shell { width: min(100% - 28px,760px); }
  .page-heading { padding-top: 42px; }
  .workspace { grid-template-columns: 1fr; }
  .session-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(3,1fr); }
  .session-list { grid-template-columns: repeat(3,minmax(210px,1fr)); overflow-x: auto; padding-bottom: 5px; }
}

@media (max-width: 620px) {
  .login-view { padding: 16px; }
  .login-card { padding: 30px 22px; border-radius: 20px; }
  .login-brand { margin-bottom: 48px; }
  .login-card h1 { font-size: 42px; }
  .login-row { grid-template-columns: 1fr; }
  .topbar { min-height: 74px; }
  .brand small,.user-menu > span { display: none; }
  .page-heading { align-items: start; flex-direction: column; padding: 38px 0 25px; }
  .filters { grid-template-columns: 1fr; }
  .workspace { border-radius: 15px; }
  .viewer-header { padding: 0 14px; gap: 10px; }
  .sequence-status { display: none; }
  .viewer-footer { padding: 0 14px; }
  .viewer-footer > div:last-child { display: none; }
  #terminal-frame,.terminal-frame-wrap { min-height: 500px; }
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; } }
