:root {
  color-scheme: light dark;
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --canvas: #f5f5f7;
  --canvas-elevated: #fbfbfd;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-subtle: rgba(255, 255, 255, 0.55);
  --surface-hover: rgba(255, 255, 255, 0.96);
  --sidebar: rgba(239, 239, 244, 0.78);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #8e8e93;
  --line: rgba(60, 60, 67, 0.14);
  --line-strong: rgba(60, 60, 67, 0.22);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: rgba(0, 113, 227, 0.11);
  --green: #248a3d;
  --green-soft: rgba(36, 138, 61, 0.11);
  --orange: #c93400;
  --orange-soft: rgba(255, 149, 0, 0.13);
  --red: #d70015;
  --red-soft: rgba(215, 0, 21, 0.1);
  --purple: #6e5dd6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.045);
  --shadow-md: 0 18px 55px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
  --radius-xs: 9px;
  --radius-sm: 13px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --sidebar-width: 250px;
  --focus: 0 0 0 4px rgba(0, 113, 227, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #101014;
    --canvas-elevated: #16161b;
    --surface: rgba(36, 36, 42, 0.76);
    --surface-solid: #202026;
    --surface-subtle: rgba(43, 43, 49, 0.58);
    --surface-hover: rgba(50, 50, 57, 0.94);
    --sidebar: rgba(25, 25, 30, 0.82);
    --text: #f5f5f7;
    --text-secondary: #aeaeb2;
    --text-tertiary: #8e8e93;
    --line: rgba(235, 235, 245, 0.12);
    --line-strong: rgba(235, 235, 245, 0.2);
    --blue: #0a84ff;
    --blue-hover: #409cff;
    --blue-soft: rgba(10, 132, 255, 0.16);
    --green: #32d74b;
    --green-soft: rgba(50, 215, 75, 0.14);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.15);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.14);
    --purple: #bf9aff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.12), 0 10px 32px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 22px 70px rgba(0, 0, 0, 0.32), 0 3px 12px rgba(0, 0, 0, 0.18);
    --focus: 0 0 0 4px rgba(10, 132, 255, 0.24);
  }
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  font: 100%/1.5 var(--font-system);
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 72% -10%, rgba(84, 150, 255, 0.09), transparent 34rem),
    var(--canvas);
  color: var(--text);
  font-family: var(--font-system);
  font-size: 0.9375rem;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { display: block; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }

::selection { background: rgba(10, 132, 255, 0.24); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-frame { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: max(1.25rem, env(safe-area-inset-top)) 0.9rem max(1rem, env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(34px) saturate(165%);
  -webkit-backdrop-filter: blur(34px) saturate(165%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  user-select: none;
}

.sidebar > .brand { margin: 0 0.55rem 1.75rem; }

.brand-mark {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 0.72rem;
  background: linear-gradient(145deg, #5ca8ff, #1267d7 56%, #6657d9);
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.24), inset 0 1px rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 1.05rem; font-weight: 720; letter-spacing: -0.025em; }
.brand-copy small { margin-top: 0.2rem; color: var(--text-tertiary); font-size: 0.68rem; font-weight: 550; letter-spacing: 0.025em; }

.primary-nav { display: grid; gap: 0.22rem; margin-top: 2.15rem; }

.primary-nav a,
.sidebar-action {
  display: flex;
  min-height: 2.7rem;
  align-items: center;
  gap: 0.78rem;
  padding: 0.62rem 0.78rem;
  border: 0;
  border-radius: 0.72rem;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 580;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 130ms ease-out, background-color 130ms ease-out, transform 100ms ease-out;
}

.primary-nav a svg,
.sidebar-action svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  opacity: 0.9;
}

.primary-nav a:hover,
.sidebar-action:hover { background: var(--surface-subtle); color: var(--text); }
.primary-nav a.active { background: var(--surface-solid); box-shadow: var(--shadow-sm); color: var(--text); }
.primary-nav a.active svg { color: var(--blue); opacity: 1; }
.primary-nav a:active, .sidebar-action:active { transform: scale(0.975); }
.sidebar-spacer { flex: 1; }

.runtime-card {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  margin: 1rem 0.1rem 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.runtime-card .runtime-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.62rem;
  background: var(--green-soft);
  color: var(--green);
}
.runtime-card.is-paused .runtime-icon { background: var(--red-soft); color: var(--red); }
.runtime-card svg { width: 1rem; height: 1rem; fill: currentColor; }
.runtime-card > span:last-child { display: grid; line-height: 1.2; }
.runtime-card strong { font-size: 0.76rem; font-weight: 650; }
.runtime-card small { margin-top: 0.18rem; color: var(--text-tertiary); font-size: 0.68rem; text-transform: capitalize; }
.logout-form { margin: 0; }
.sidebar-action { width: 100%; cursor: pointer; text-align: left; }

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.mobile-header, .mobile-tabbar { display: none; }

.system-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.system-banner.warning { background: color-mix(in srgb, var(--orange-soft) 86%, var(--surface)); color: var(--orange); }
.system-banner.danger { background: color-mix(in srgb, var(--red-soft) 86%, var(--surface)); color: var(--red); }
.system-banner > svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; fill: currentColor; }
.system-banner > div { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; }
.system-banner strong { font-weight: 680; }
.system-banner span { color: var(--text-secondary); }

.shell {
  width: min(100%, 92rem);
  margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 4.75rem) clamp(1.25rem, 4vw, 4.5rem) 6rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.page-head > div:first-child { max-width: 54rem; }
.page-head h1 {
  margin: 0.42rem 0 0.58rem;
  font-size: clamp(2.35rem, 4.5vw, 4.25rem);
  font-weight: 690;
  letter-spacing: -0.052em;
  line-height: 1.01;
}
.page-head p, .muted, .panel p, .empty p { margin: 0; color: var(--text-secondary); }
.eyebrow {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.eyebrow a { color: inherit; text-decoration: none; }

h2, h3 { letter-spacing: -0.025em; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.85rem 0 1rem;
}
.section-head h2 { margin: 0; font-size: 1.25rem; font-weight: 670; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.62rem; }
.button-row form { margin: 0; }

.button, button {
  position: relative;
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.58rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.74rem;
  background: var(--surface-solid);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.025);
  color: var(--text);
  cursor: pointer;
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 100ms ease-out, background-color 130ms ease-out, border-color 130ms ease-out, box-shadow 130ms ease-out, opacity 130ms ease-out;
}
.button svg, button svg { width: 1rem; height: 1rem; fill: currentColor; }
.button:hover, button:hover { background: var(--surface-hover); border-color: var(--line-strong); }
.button:active, button:active { transform: scale(0.97); }
.button.primary, button.primary { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 5px 16px rgba(0, 113, 227, 0.18); }
.button.primary:hover, button.primary:hover { border-color: var(--blue-hover); background: var(--blue-hover); }
.button.ghost, button.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--blue); }
.danger-button { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); color: var(--red); }
.danger-button:hover { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 48%, var(--line)); }
button[disabled] { cursor: not-allowed; opacity: 0.48; transform: none; }
button.is-loading::after { width: 0.8rem; height: 0.8rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; content: ""; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mode {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.56rem;
  border: 1px solid var(--line);
  border-radius: 99rem;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mode.live { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); color: var(--red); }

.flash-stack { position: fixed; z-index: 80; top: 1rem; right: 1rem; display: grid; width: min(24rem, calc(100vw - 2rem)); gap: 0.55rem; }
.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  animation: materialize 280ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}
.flash svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; margin-top: 0.1rem; fill: var(--green); }
.flash.error svg { fill: var(--red); }

@keyframes materialize {
  from { opacity: 0; transform: translateY(-0.55rem) scale(0.98); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  overflow: hidden;
}
.auth-shell::before, .auth-shell::after {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.2), transparent 68%);
  content: "";
  filter: blur(8px);
  pointer-events: none;
}
.auth-shell::before { top: -12rem; right: -8rem; }
.auth-shell::after { bottom: -15rem; left: -10rem; background: radial-gradient(circle, rgba(110, 93, 214, 0.15), transparent 68%); }
.auth-brand { position: absolute; top: max(1.5rem, env(safe-area-inset-top)); left: 1.7rem; }
.auth-content { position: relative; z-index: 1; width: min(100%, 28rem); }

.empty {
  display: grid;
  min-height: 17rem;
  place-content: center;
  justify-items: center;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  text-align: center;
}
.empty strong { font-size: 1.35rem; font-weight: 670; letter-spacing: -0.025em; }
.empty p { max-width: 34rem; margin: 0.45rem 0 1.35rem; }

.block { display: block; }
.space-top { margin-top: 1.25rem !important; }
.connected { color: var(--green) !important; }
.bad { color: var(--orange); }
.dimmed { opacity: 0.55; }

@media (max-width: 980px) {
  :root { --sidebar-width: 5.25rem; }
  .sidebar { align-items: center; padding-inline: 0.65rem; }
  .sidebar > .brand { margin: 0 0 1.7rem; }
  .brand-copy, .primary-nav a span, .sidebar-action span, .runtime-card > span:last-child { display: none; }
  .primary-nav { width: 100%; margin-top: 0; }
  .primary-nav a, .sidebar-action { justify-content: center; padding-inline: 0; }
  .primary-nav a svg, .sidebar-action svg { width: 1.28rem; height: 1.28rem; }
  .runtime-card { justify-content: center; padding: 0.56rem; }
}

@media (max-width: 700px) {
  body { background: var(--canvas); }
  .app-frame { padding-bottom: calc(4.75rem + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    min-height: 3.9rem;
    align-items: center;
    justify-content: space-between;
    padding: max(0.55rem, env(safe-area-inset-top)) 1rem 0.55rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--canvas) 78%, transparent);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
  }
  .compact-brand { gap: 0.55rem; }
  .compact-brand .brand-mark { width: 2rem; height: 2rem; border-radius: 0.62rem; font-size: 0.9rem; }
  .mobile-tabbar {
    position: fixed;
    z-index: 50;
    right: 0.6rem;
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    left: 0.6rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.38rem;
    border: 1px solid var(--line-strong);
    border-radius: 1.28rem;
    background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
  }
  .mobile-tabbar a {
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 0.12rem;
    padding: 0.34rem 0.1rem 0.3rem;
    border-radius: 0.95rem;
    color: var(--text-tertiary);
    font-size: 0.58rem;
    font-weight: 620;
    text-decoration: none;
    transition: background-color 130ms ease, color 130ms ease, transform 100ms ease;
  }
  .mobile-tabbar a svg { width: 1.18rem; height: 1.18rem; fill: currentColor; }
  .mobile-tabbar a.active { background: var(--blue-soft); color: var(--blue); }
  .mobile-tabbar a:active { transform: scale(0.94); }
  .system-banner { top: 3.9rem; padding-inline: 1rem; }
  .shell { padding: 2rem 1rem 3rem; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 1.2rem; margin-bottom: 1.8rem; }
  .page-head h1 { font-size: clamp(2.25rem, 12vw, 3.35rem); }
  .page-head > .button-row { width: 100%; }
  .page-head > .button-row > *, .page-head > .button-row form, .page-head > .button-row form button { flex: 1; }
  .section-head { margin-top: 2.2rem; }
  .flash-stack { top: 4.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .flash { filter: none !important; transform: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar, .system-banner, .mobile-header, .mobile-tabbar, .flash { background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: currentColor; --line-strong: currentColor; }
  .sidebar, .mobile-tabbar, .panel, .table-wrap, .form-card { border-color: var(--text-secondary); }
}

/* NeuralFlow-inspired editorial shell */
:root {
  color-scheme: light;
  --canvas: #f6f6f3;
  --canvas-elevated: #fbfbf9;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-subtle: #efefeb;
  --surface-hover: #f4f4f0;
  --sidebar: #f6f6f3;
  --text: #0a0a0a;
  --text-secondary: #5e5d58;
  --text-tertiary: #898781;
  --line: rgba(10, 10, 10, 0.13);
  --line-strong: rgba(10, 10, 10, 0.28);
  --blue: #0a0a0a;
  --blue-hover: #2a2926;
  --blue-soft: #e8e8e3;
  --green: #287449;
  --green-soft: #e1eee6;
  --orange: #a85d20;
  --orange-soft: #f6e9dc;
  --red: #b92929;
  --red-soft: #f6e3e1;
  --purple: #6754d9;
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 24px 80px rgba(0, 0, 0, 0.1);
  --radius-xs: 12px;
  --radius-sm: 18px;
  --radius-md: 26px;
  --radius-lg: 34px;
  --focus: 0 0 0 4px rgba(10, 10, 10, 0.14);
}

body {
  background:
    linear-gradient(rgba(10, 10, 10, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 10, 0.018) 1px, transparent 1px),
    var(--canvas);
  background-size: 56px 56px;
  font-weight: 450;
}

.app-frame, .workspace { min-height: 100vh; }
.workspace { margin-left: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  padding: max(0.8rem, env(safe-area-inset-top)) clamp(1.1rem, 2.5vw, 2rem) 0.8rem;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-inner {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) auto minmax(14rem, 0.8fr);
  width: min(100%, 96rem);
  min-height: 4.2rem;
  align-items: center;
  gap: 1rem;
  margin: 0 auto;
  padding: 0.55rem 0.65rem 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  background: rgba(255, 255, 255, 0.88);
}
.brand { gap: 0.68rem; }
.brand-mark {
  position: relative;
  display: block;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}
.brand-mark i { position: absolute; left: 0; display: block; height: 0.66rem; border-radius: 0.15rem; background: currentColor; transform: skewX(-13deg); }
.brand-mark i:first-child { top: 0.33rem; width: 2.05rem; }
.brand-mark i:last-child { top: 1.28rem; width: 1.3rem; }
.brand-copy strong { font-size: 0.98rem; font-weight: 660; }
.brand-copy small { margin-top: 0.1rem; font-size: 0.61rem; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  white-space: nowrap;
}
.primary-nav a {
  min-height: 2.45rem;
  gap: 0;
  padding: 0.58rem 0.74rem;
  border-radius: 99rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 560;
}
.primary-nav a + a::before { position: absolute; left: -0.08rem; color: var(--text-tertiary); content: "/"; opacity: 0.5; }
.primary-nav a { position: relative; }
.primary-nav a:hover { background: var(--surface-subtle); }
.primary-nav a.active { background: var(--text); box-shadow: none; color: #fff; }
.primary-nav a.active + a::before, .primary-nav a + a.active::before { opacity: 0; }

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.runtime-card {
  gap: 0.5rem;
  margin: 0;
  padding: 0.42rem 0.68rem 0.42rem 0.48rem;
  border-radius: 99rem;
  background: transparent;
}
.runtime-card .runtime-icon { width: 1.65rem; height: 1.65rem; border-radius: 50%; }
.runtime-card svg { width: 0.78rem; height: 0.78rem; }
.runtime-card strong { font-size: 0.66rem; }
.runtime-card small { font-size: 0.58rem; letter-spacing: 0.03em; text-transform: uppercase; }
.sidebar-action {
  width: auto;
  min-height: 2.75rem;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.62rem 0.9rem;
  border: 1px solid var(--text);
  border-radius: 99rem;
  background: var(--text);
  color: #fff;
  font-size: 0.74rem;
}
.sidebar-action:hover { background: #2a2926; color: #fff; }
.sidebar-action svg { width: 0.9rem; height: 0.9rem; }

.system-banner { top: 6.2rem; width: min(calc(100% - 2rem), 94rem); margin: 0.35rem auto 0; border: 1px solid var(--line); border-radius: 99rem; }
.shell { width: min(100%, 96rem); padding: clamp(3rem, 5vw, 5.5rem) clamp(1.25rem, 3vw, 3rem) 7rem; }

.page-head { align-items: center; margin-bottom: clamp(2.6rem, 5vw, 4.5rem); }
.page-head > div:first-child { max-width: 62rem; }
.page-head h1 {
  max-width: 61rem;
  margin: 0.62rem 0 0.8rem;
  font-size: clamp(3rem, 5.8vw, 5.8rem);
  font-weight: 570;
  letter-spacing: -0.07em;
  line-height: 0.96;
}
.page-head p { max-width: 45rem; font-size: clamp(0.95rem, 1.3vw, 1.08rem); }
.eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-secondary); font-size: 0.68rem; font-weight: 610; letter-spacing: 0.06em; }
.eyebrow::before, .eyebrow::after { color: var(--text-tertiary); content: "/"; }
.eyebrow .status::before { display: none; }

.section-head { margin-top: 4.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: clamp(1.55rem, 2.5vw, 2.35rem); font-weight: 570; letter-spacing: -0.045em; }

.button, button {
  min-height: 3rem;
  padding: 0.72rem 1.2rem;
  border-color: var(--text);
  border-radius: 99rem;
  background: transparent;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 590;
}
.button:hover, button:hover { background: var(--surface-subtle); border-color: var(--text); }
.button.primary, button.primary { border-color: var(--text); background: var(--text); box-shadow: none; color: #fff; }
.button.primary:hover, button.primary:hover { border-color: #2a2926; background: #2a2926; }
.button.ghost, button.ghost { color: var(--text); text-decoration: underline; text-underline-offset: 0.2rem; }
.danger-button { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); background: rgba(255, 255, 255, 0.08); }
.mode { border-color: var(--line-strong); background: transparent; }

.flash { border-radius: 1.2rem; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.auth-shell { background: #32312e; }
.auth-shell::before, .auth-shell::after { background: radial-gradient(circle, rgba(255,255,255,.1), transparent 68%); filter: none; }
.auth-shell::after { background: radial-gradient(circle, rgba(255,255,255,.06), transparent 68%); }
.auth-brand { color: #fff; }
.auth-brand .brand-copy small { color: rgba(255,255,255,.6); }

@media (max-width: 1160px) {
  .topbar-inner { grid-template-columns: minmax(8rem, 0.65fr) auto minmax(8rem, 0.65fr); }
  .runtime-card { display: none; }
  .primary-nav a { padding-inline: 0.58rem; }
}

@media (max-width: 860px) and (min-width: 701px) {
  .brand-copy, .sidebar-action span { display: none; }
  .topbar-inner { grid-template-columns: auto 1fr auto; }
  .primary-nav { justify-content: center; }
  .primary-nav a { padding-inline: 0.5rem; font-size: 0.7rem; }
  .sidebar-action { width: 2.75rem; padding: 0; }
}

@media (max-width: 700px) {
  .topbar { display: none; }
  .workspace { margin-left: 0; }
  .mobile-header { background: rgba(246,246,243,.92); }
  .compact-brand .brand-mark { width: 1.85rem; height: 1.85rem; border-radius: 0; }
  .compact-brand .brand-mark i:first-child { top: .28rem; width: 1.75rem; }
  .compact-brand .brand-mark i:last-child { top: 1.08rem; width: 1.08rem; }
  .mobile-tabbar { border-color: var(--line-strong); border-radius: 99rem; background: rgba(255,255,255,.9); }
  .mobile-tabbar a { border-radius: 99rem; }
  .mobile-tabbar a.active { background: var(--text); color: #fff; }
  .system-banner { top: 4.15rem; width: calc(100% - 1rem); border-radius: 1rem; }
  .shell { padding-top: 2.7rem; }
  .page-head { gap: 1.5rem; }
  .page-head h1 { font-size: clamp(2.65rem, 13vw, 4.1rem); }
  .page-head > .button-row > *, .page-head > .button-row form, .page-head > .button-row form button { flex: 1 1 100%; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .mobile-header, .mobile-tabbar { background: var(--canvas); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
