:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: #101012;
  --surface-2: #151517;
  --surface-3: #1d1d20;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f1e8;
  --muted: #b8b1a4;
  --soft: #817a70;
  --gold: #d7b46a;
  --mint: #73d6bc;
  --coral: #e66f5c;
  --violet: #9a8cff;
  --blue: #69a7ff;
  --good: #67d99a;
  --warn: #f1bd5c;
  --bad: #f06f6f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --sidebar: 292px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 90% -10%, rgba(215, 180, 106, 0.16), transparent 36rem),
    radial-gradient(circle at 16% 30%, rgba(115, 214, 188, 0.12), transparent 30rem),
    linear-gradient(160deg, #050506 0%, #0a0a0c 50%, #11100e 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell {
  display: none;
}

body:not(.auth-locked) .auth-gate {
  display: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100vh;
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 26px;
  align-items: center;
  background:
    radial-gradient(circle at 24% 24%, rgba(215, 180, 106, 0.18), transparent 30rem),
    radial-gradient(circle at 74% 30%, rgba(115, 214, 188, 0.14), transparent 30rem),
    linear-gradient(145deg, #050506 0%, #0f0f11 55%, #11100d 100%);
}

.auth-stage {
  position: relative;
  min-height: min(76vh, 720px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 50% 50%, rgba(215, 180, 106, 0.2), transparent 20rem);
  box-shadow: var(--shadow);
}

.auth-stage::before,
.auth-stage::after {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.auth-stage::after {
  inset: 24%;
  transform: rotate(28deg);
  border-color: rgba(115, 214, 188, 0.22);
}

.auth-brand-mark {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 110px;
  height: 110px;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  box-shadow: 0 30px 120px rgba(215, 180, 106, 0.42);
}

.auth-orbit {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(245, 241, 232, 0.88), rgba(115, 214, 188, 0.42));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.auth-orbit-one {
  width: 160px;
  height: 210px;
  left: 18%;
  top: 18%;
  transform: rotate(-9deg);
}

.auth-orbit-two {
  width: 190px;
  height: 150px;
  right: 16%;
  top: 22%;
  background: linear-gradient(135deg, rgba(105, 167, 255, 0.78), rgba(230, 111, 92, 0.46));
  transform: rotate(8deg);
}

.auth-orbit-three {
  width: 220px;
  height: 170px;
  left: 36%;
  bottom: 12%;
  background: linear-gradient(135deg, rgba(215, 180, 106, 0.82), rgba(154, 140, 255, 0.48));
  transform: rotate(4deg);
}

.auth-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 14, 0.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 0;
  font-size: 3.1rem;
  line-height: 0.98;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.auth-remember {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-message {
  min-height: 22px;
  color: var(--warn);
  font-size: 0.9rem;
  line-height: 1.4;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  padding: 22px 18px;
  background: rgba(10, 10, 11, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #090807;
  background: linear-gradient(135deg, var(--gold), #f4e3aa 48%, var(--mint));
  border-radius: var(--radius);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--line);
}

.nav-icon,
.button-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
}

.sidebar-status {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  display: flex;
  gap: 10px;
}

.account-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  gap: 8px;
}

.account-panel span,
.account-panel strong {
  display: block;
}

.account-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
}

.account-panel strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 18px rgba(103, 217, 154, 0.7);
}

.main-content {
  width: calc(100% - var(--sidebar));
  margin-left: var(--sidebar);
  min-height: 100vh;
}

.view {
  display: none;
  min-height: 100vh;
  padding: 32px;
}

.view.is-active {
  display: block;
}

.home-view {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.hero-canvas {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 84vh;
  min-height: 640px;
  opacity: 0.95;
}

.topbar {
  position: relative;
  z-index: 2;
  min-height: 72px;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-copy {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-copy strong {
  color: var(--text);
}

.mobile-menu {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.mobile-menu span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.hero {
  position: relative;
  z-index: 2;
  min-height: calc(78vh - 72px);
  padding: 80px 32px 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: 5.3rem;
  line-height: 0.94;
  font-weight: 850;
}

.hero-subtitle {
  max-width: 820px;
  margin: 26px auto 0;
  color: #e4ded2;
  font-size: 1.25rem;
  line-height: 1.55;
}

.hero-actions,
.header-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  justify-content: center;
  margin-top: 34px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button {
  color: #080704;
  border-color: transparent;
  background: linear-gradient(135deg, #f2d58a, var(--gold) 46%, var(--mint));
  font-weight: 800;
}

.secondary-button {
  background: rgba(115, 214, 188, 0.12);
  color: #dffbf3;
  border-color: rgba(115, 214, 188, 0.36);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

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

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.wide {
  width: 100%;
}

.section-band {
  position: relative;
  z-index: 3;
  padding: 44px 32px 54px;
  background: linear-gradient(180deg, rgba(5, 5, 6, 0.2), var(--bg) 16%);
}

.section-heading {
  max-width: 1080px;
  margin: 0 auto 22px;
}

.section-heading h2,
.page-header h1,
.panel-heading h2 {
  margin: 0;
}

.section-heading h2 {
  max-width: 760px;
  font-size: 2rem;
  line-height: 1.15;
}

.usecase-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.usecase-card,
.quick-action,
.gallery-card,
.preset-card,
.compare-card,
.project-card,
.connection-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
}

.usecase-card {
  min-height: 130px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.usecase-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.usecase-card strong {
  font-size: 1.04rem;
  line-height: 1.25;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.page-header h1 {
  font-size: 2.7rem;
  line-height: 1;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.quick-action {
  min-height: 110px;
  padding: 16px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.quick-action span {
  display: block;
  margin-bottom: 20px;
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
}

.quick-action strong {
  font-size: 1.03rem;
  line-height: 1.25;
}

.split-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.85fr);
  gap: 22px;
}

.workspace-panel,
.creator-form,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.workspace-panel {
  padding: 18px;
}

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

.panel-heading h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.gallery-card {
  min-width: 0;
  overflow: hidden;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #191919;
}

.thumb canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.thumb.video-thumb::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}

.card-body {
  padding: 13px;
}

.card-title {
  margin: 0 0 8px;
  font-weight: 780;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.badge,
.provider-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.76rem;
  font-weight: 750;
}

.badge.completed {
  color: #d9ffe8;
  border-color: rgba(103, 217, 154, 0.32);
  background: rgba(103, 217, 154, 0.1);
}

.badge.processing,
.badge.generating {
  color: #fff0d0;
  border-color: rgba(241, 189, 92, 0.34);
  background: rgba(241, 189, 92, 0.1);
}

.badge.failed {
  color: #ffe2e2;
  border-color: rgba(240, 111, 111, 0.34);
  background: rgba(240, 111, 111, 0.1);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.recommendation-card {
  padding: 18px;
  border: 1px solid rgba(215, 180, 106, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(215, 180, 106, 0.12), rgba(115, 214, 188, 0.07));
}

.recommendation-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.mini-metrics div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.mini-metrics strong,
.mini-metrics span {
  display: block;
}

.mini-metrics strong {
  font-size: 1.55rem;
}

.mini-metrics span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.creator-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.creator-form,
.result-panel {
  padding: 18px;
}

.creator-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.provider-fieldset legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

textarea,
select,
input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  outline: none;
}

textarea {
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

select,
input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"] {
  padding: 0 12px;
}

textarea:focus,
select:focus,
input[type="url"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: rgba(215, 180, 106, 0.65);
  box-shadow: 0 0 0 3px rgba(215, 180, 106, 0.12);
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle span {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle input:checked + span {
  border-color: rgba(115, 214, 188, 0.42);
  background: rgba(115, 214, 188, 0.16);
}

.toggle input:checked + span::after {
  transform: translateX(20px);
  background: var(--mint);
}

.recommendation-inline {
  color: var(--muted);
  font-size: 0.86rem;
}

.provider-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.provider-option {
  position: relative;
}

.provider-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.provider-card {
  min-height: 178px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

.provider-card strong {
  font-size: 1rem;
}

.provider-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.provider-option input:checked + .provider-card {
  border-color: rgba(215, 180, 106, 0.68);
  background: rgba(215, 180, 106, 0.09);
}

.provider-type {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #0b0905;
  background: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.upload-field {
  min-height: 96px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 6px;
  align-content: center;
  cursor: pointer;
}

.upload-field input {
  display: none;
}

.upload-title {
  color: var(--text);
  font-weight: 800;
}

.upload-copy {
  color: var(--muted);
  font-size: 0.84rem;
}

.result-panel {
  position: sticky;
  top: 22px;
}

.result-preview {
  position: relative;
  min-height: 510px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0a0b;
}

.result-preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.preview-player {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #050506;
}

.empty-state {
  position: absolute;
  inset: auto 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.result-preview.has-result .empty-state {
  display: none;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.video-frame-lines {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  pointer-events: none;
}

.video-frame-lines::before,
.video-frame-lines::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.video-frame-lines::before {
  top: 33%;
}

.video-frame-lines::after {
  bottom: 33%;
}

.progress-shell {
  height: 9px;
  margin: 14px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--mint), var(--coral));
  transition: width 240ms ease;
}

.segmented-control {
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  display: inline-flex;
  gap: 4px;
}

.segmented-control button {
  min-width: 96px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented-control button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
}

.preset-grid,
.comparison-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.preset-card,
.compare-card,
.project-card {
  padding: 16px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.preset-card h3,
.compare-card h3,
.project-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.preset-card p,
.compare-card p,
.project-card p,
.settings-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.security-warning {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(241, 189, 92, 0.36);
  border-radius: var(--radius);
  background: rgba(241, 189, 92, 0.08);
  display: grid;
  gap: 5px;
}

.security-warning strong,
.server-vault strong,
.security-warning span,
.server-vault span {
  display: block;
}

.security-warning span,
.server-vault span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.server-vault {
  margin: 14px 0;
  display: grid;
  gap: 8px;
}

.server-vault div {
  min-height: 54px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.server-vault strong {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.server-vault span {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

.preset-card p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.result-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.detail-preview {
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0a0b;
}

.detail-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.detail-info {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 14px;
}

.detail-info dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.detail-info dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-info dd {
  margin: 4px 0 0;
  line-height: 1.45;
}

.connection-list {
  display: grid;
  gap: 10px;
}

.connection-row {
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.connection-row strong,
.connection-row span {
  display: block;
}

.connection-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  min-width: 260px;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(20, 20, 22, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1280px) {
  .quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-grid,
  .history-grid,
  .preset-grid,
  .comparison-grid,
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 980px) {
  :root {
    --sidebar: 0px;
  }

  .auth-gate {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .auth-stage {
    min-height: 280px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-block;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
  }

  .view {
    padding: 22px;
  }

  .home-view {
    padding: 0;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .split-layout,
  .settings-layout,
  .creator-layout,
  .result-detail {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .auth-gate {
    padding: 16px;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-panel h1 {
    font-size: 2.45rem;
  }

  .auth-orbit-one {
    left: 8%;
  }

  .auth-orbit-two {
    right: 6%;
  }

  .auth-orbit-three {
    left: 28%;
  }

  .topbar {
    padding: 16px;
  }

  .topbar-copy {
    display: none;
  }

  .hero {
    align-items: flex-start;
    text-align: left;
    padding: 62px 18px 92px;
  }

  .hero h1 {
    font-size: 3.15rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .section-band {
    padding: 34px 18px 42px;
  }

  .view {
    padding: 18px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header h1 {
    font-size: 2.2rem;
  }

  .quick-actions,
  .gallery-grid,
  .history-grid,
  .preset-grid,
  .comparison-grid,
  .projects-grid,
  .usecase-grid,
  .filter-bar,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .result-preview,
  .detail-preview {
    min-height: 430px;
  }

  .sidebar {
    width: 86vw;
  }
}
