:root {
  --bg: #07141c;
  --bg-soft: #0d2230;
  --panel: rgba(10, 23, 32, 0.8);
  --panel-strong: rgba(8, 18, 26, 0.92);
  --line: rgba(146, 184, 203, 0.16);
  --line-strong: rgba(146, 184, 203, 0.28);
  --text: #edf8ff;
  --muted: #8ea8b9;
  --accent: #2b9ed1;
  --accent-strong: #6fd4ff;
  --success: #19c37d;
  --warn: #ffb84d;
  --danger: #ff5f5f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-sans: "Trebuchet MS", "Gill Sans", sans-serif;
  --font-display: "Franklin Gothic Medium", "Trebuchet MS", sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(43, 158, 209, 0.18), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(255, 184, 77, 0.16), transparent 25%),
    linear-gradient(180deg, #081019 0%, #0a1821 40%, #07131b 100%);
}

.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr minmax(320px, 440px);
  gap: 22px;
  width: min(1100px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(8, 23, 34, 0.88), rgba(7, 17, 25, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(111, 212, 255, 0.08), transparent 38%),
    linear-gradient(320deg, rgba(255, 184, 77, 0.07), transparent 28%);
}

.auth-copy,
.auth-form {
  position: relative;
}

.auth-copy {
  padding: 18px;
}

.auth-title {
  margin: 8px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1;
}

.auth-text {
  max-width: 56ch;
  color: #c9dce8;
  line-height: 1.7;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(6, 17, 24, 0.86);
}

.auth-submit {
  width: 100%;
}

.auth-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 95, 95, 0.28);
  border-radius: 14px;
  background: rgba(255, 95, 95, 0.12);
  color: #ffd0d0;
}

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.background-glow {
  position: absolute;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.22;
}

.glow-a {
  top: -10rem;
  left: -8rem;
  background: #2aa0d9;
}

.glow-b {
  right: -8rem;
  bottom: -14rem;
  background: #f5b14a;
}

.background-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
}

.shell {
  position: relative;
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(7, 20, 28, 0.64);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(43, 158, 209, 0.96), rgba(111, 212, 255, 0.72));
  color: #032130;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

.eyebrow,
.section-kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

#brand-title,
.section-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

#brand-title {
  font-size: clamp(1.35rem, 1vw + 1rem, 2rem);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.session-stack {
  display: grid;
  gap: 8px;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.search input,
.field-control {
  width: min(280px, 70vw);
  height: 44px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 17, 24, 0.9);
  outline: none;
}

.search input:focus,
.field-control:focus,
.code-editor:focus {
  border-color: rgba(111, 212, 255, 0.66);
  box-shadow: 0 0 0 4px rgba(43, 158, 209, 0.16);
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.field-control {
  width: 100%;
}

.layout {
  display: grid;
  gap: 18px;
}

.hero-panel,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(8, 23, 34, 0.86), rgba(7, 17, 25, 0.94));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 26px;
  min-height: 250px;
}

.hero-panel::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(111, 212, 255, 0.08), transparent 38%),
    linear-gradient(320deg, rgba(255, 184, 77, 0.07), transparent 28%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.hero-grid-compact {
  grid-template-columns: 1fr;
}

.hero-title {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2vw + 1rem, 3rem);
  line-height: 1.05;
}

.hero-copy {
  margin: 0;
  max-width: 60ch;
  color: #c9dce8;
  line-height: 1.6;
}

.hero-metrics,
.summary-grid,
.spotlight-grid,
.focus-metrics {
  display: grid;
  gap: 14px;
}

.hero-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.hero-metrics-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card-wide {
  grid-column: span 1;
}

.metric-card,
.summary-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(7, 19, 28, 0.62);
}

.metric-label,
.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-value,
.summary-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.metric-sub,
.summary-sub {
  margin-top: 8px;
  color: #b2c8d5;
  font-size: 0.9rem;
}

.hero-side {
  display: grid;
  gap: 14px;
}

.radar-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(5, 15, 22, 0.74);
}

.radar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.radar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.radar-list {
  margin: 0;
  padding-left: 18px;
  color: #d7e9f4;
  line-height: 1.55;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.main-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.primary-column,
.secondary-column {
  display: grid;
  gap: 18px;
}

.secondary-column {
  position: sticky;
  top: 18px;
}

.controls-panel,
.process-panel,
.focus-panel,
.logs-panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.file-toolbar {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.button-row.compact {
  margin-top: 14px;
}

.button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--text);
  background: rgba(10, 24, 34, 0.82);
  font-family: var(--font-display);
  font-size: 0.95rem;
  white-space: normal;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #051520;
  background: linear-gradient(135deg, #39b6ec, #7edfff);
}

.button-success {
  background: rgba(25, 195, 125, 0.16);
  border-color: rgba(25, 195, 125, 0.32);
}

.button-warning {
  background: rgba(255, 184, 77, 0.16);
  border-color: rgba(255, 184, 77, 0.32);
}

.button-danger {
  background: rgba(255, 95, 95, 0.16);
  border-color: rgba(255, 95, 95, 0.32);
}

.button-ghost {
  border-color: var(--line);
}

.button.active {
  border-color: rgba(111, 212, 255, 0.42);
  background: rgba(43, 158, 209, 0.16);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 21, 29, 0.72);
  color: #d8eaf6;
  font-size: 0.86rem;
}

.pill.neutral {
  color: var(--muted);
}

.pill.success {
  color: #90f4c8;
  border-color: rgba(25, 195, 125, 0.28);
}

.pill.warning {
  color: #ffd28e;
  border-color: rgba(255, 184, 77, 0.28);
}

.pill.danger {
  color: #ffaaaa;
  border-color: rgba(255, 95, 95, 0.28);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.process-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(7, 17, 25, 0.86);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.process-card:hover,
.process-card.selected {
  border-color: rgba(111, 212, 255, 0.34);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.process-top,
.focus-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.process-name,
.focus-name {
  margin: 0;
  font-family: var(--font-display);
}

.process-meta,
.focus-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stats-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #d4e7f1;
  font-size: 0.93rem;
}

.bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #27b3eb, #86e5ff);
}

.process-actions,
.focus-actions,
.logs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.focus-panel {
  min-height: 290px;
}

.files-panel {
  min-height: 360px;
  padding: 18px;
}

.workbench-panel {
  min-height: 680px;
  padding: 22px;
}

.focus-empty,
.logs-empty,
.process-empty {
  padding: 24px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.focus-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.focus-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(6, 17, 24, 0.78);
}

.focus-tile-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.focus-tile-value {
  font-family: var(--font-display);
  font-size: 1.06rem;
}

.focus-path {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(4, 12, 18, 0.88);
  color: #cfe0ea;
  font-family: var(--font-mono);
  font-size: 0.87rem;
  word-break: break-all;
}

.logs-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.logs-console {
  min-height: 320px;
  max-height: 480px;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(4, 11, 17, 0.96);
  color: #d8edf8;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.logs-console.dimmed {
  color: var(--muted);
}

.logs-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line);
}

.fade-in {
  animation: fade-in 220ms ease;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 16, 24, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 30;
}

.toast.hidden {
  display: none;
}

.status-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.tiny {
  font-size: 0.8rem;
  color: var(--muted);
}

.restricted-note {
  width: 100%;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(6, 17, 24, 0.55);
}

.browser-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.browser-sidebar,
.editor-main {
  display: grid;
  gap: 12px;
}

.browser-sidebar {
  align-content: start;
}

.browser-path {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(6, 17, 24, 0.78);
  color: #d8edf8;
}

.browser-path strong,
.editor-target {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  word-break: break-word;
}

.browser-path-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.browser-list {
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.browser-empty,
.editor-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: rgba(6, 17, 24, 0.5);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.entry-button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(7, 17, 25, 0.86);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.entry-button:hover,
.entry-button.active {
  transform: translateY(-1px);
  border-color: rgba(111, 212, 255, 0.34);
  background: rgba(10, 26, 36, 0.92);
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 44px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.entry-icon.directory {
  background: rgba(111, 212, 255, 0.16);
  color: #9be6ff;
}

.entry-icon.file {
  background: rgba(255, 184, 77, 0.16);
  color: #ffd28e;
}

.entry-copy {
  display: grid;
  gap: 4px;
}

.entry-copy strong {
  font-size: 0.95rem;
}

.entry-copy small {
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.editor-main {
  align-content: start;
}

.code-editor {
  min-height: 520px;
  width: 100%;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(4, 11, 17, 0.96);
  color: #d8edf8;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  outline: none;
}

.editor-empty {
  min-height: 520px;
}

.code-editor:disabled,
.field-control:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .auth-card,
  .hero-grid,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .secondary-column {
    position: static;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 100%);
    padding-top: 12px;
  }

  .auth-shell {
    padding: 14px;
  }

  .auth-card {
    padding: 18px;
  }

  .topbar {
    padding: 14px;
  }

  .topbar,
  .topbar-tools,
  .topbar-brand {
    flex-direction: column;
    align-items: stretch;
  }

  .search input {
    width: 100%;
  }

  .hero-panel,
  .controls-panel,
  .process-panel,
  .focus-panel,
  .logs-panel,
  .files-panel,
  .workbench-panel {
    padding: 16px;
  }

  .hero-metrics,
  .summary-grid,
  .focus-metrics,
  .browser-layout {
    grid-template-columns: 1fr;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .search input,
  .field-control {
    width: 100%;
  }

  .logs-head,
  .editor-head,
  .focus-top,
  .process-top {
    flex-direction: column;
    align-items: stretch;
  }

  .file-toolbar {
    justify-items: stretch;
  }

  .file-toolbar .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .file-toolbar .button-row > .pill {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .file-toolbar .button,
  .logs-head .button {
    width: 100%;
    min-height: 44px;
    height: auto;
    padding: 10px 12px;
  }

  .browser-list {
    max-height: none;
    overflow: visible;
  }

  .browser-path strong,
  .editor-target,
  .focus-path,
  .logs-meta,
  .process-meta,
  .focus-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .code-editor,
  .editor-empty {
    min-height: 340px;
  }
}
