:root {
  color-scheme: dark;
  --bg: #06111f;
  --bg-elevated: rgba(10, 24, 42, 0.78);
  --panel-border: rgba(126, 247, 255, 0.18);
  --line: rgba(126, 247, 255, 0.12);
  --text: #ebf7ff;
  --muted: #86a8c4;
  --cyan: #7ef7ff;
  --aqua: #31c6ff;
  --green: #70f0b8;
  --amber: #ffcf70;
  --danger: #ff7c90;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(35, 171, 255, 0.18), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(112, 240, 184, 0.14), transparent 24%),
    linear-gradient(180deg, #07111d 0%, #030813 100%);
  color: var(--text);
  font-family: "Space Grotesk", "PingFang SC", "Noto Sans SC", sans-serif;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

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

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 32px;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(126, 247, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 247, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-a {
  top: -5rem;
  right: -8rem;
  background: rgba(49, 198, 255, 0.55);
}

.ambient-b {
  bottom: -8rem;
  left: -8rem;
  background: rgba(112, 240, 184, 0.35);
}

.topbar,
.dashboard,
.panel {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 24px;
  max-width: 1480px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
  filter:
    drop-shadow(0 8px 20px rgba(255, 196, 24, 0.24))
    drop-shadow(0 0 20px rgba(255, 214, 58, 0.12));
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--cyan);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
}

.topbar h1,
.panel-header h3 {
  margin: 0;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
}

.topbar h1 {
  margin-top: 6px;
  font-size: clamp(2rem, 2.6vw, 3.4rem);
  line-height: 1.05;
}

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

.ghost-button,
.mini-button,
.primary-button,
.topbar-status {
  border: 1px solid var(--panel-border);
  color: var(--text);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.ghost-button,
.mini-button,
.primary-button {
  cursor: pointer;
}

.ghost-button,
.mini-button,
.topbar-status {
  background: rgba(9, 22, 39, 0.68);
  padding: 12px 16px;
  border-radius: 999px;
  min-height: 48px;
}

.ghost-button:hover,
.mini-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 247, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(126, 247, 255, 0.1), 0 12px 40px rgba(0, 0, 0, 0.28);
}

.primary-button {
  border-radius: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(32, 143, 255, 0.92), rgba(34, 242, 197, 0.78));
  color: #031019;
  font-weight: 700;
}

#parse-reference-button.is-loading,
#regenerate-clone-prompt.is-loading,
#generate-clone-video-button.is-loading {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--text);
  border-color: rgba(126, 247, 255, 0.38);
  background:
    linear-gradient(120deg, rgba(16, 44, 78, 0.98), rgba(26, 87, 146, 0.92), rgba(18, 48, 93, 0.98));
  background-size: 220% 100%;
  box-shadow:
    0 0 0 1px rgba(126, 247, 255, 0.1),
    0 14px 36px rgba(15, 55, 102, 0.34);
  animation:
    button-loading-shimmer 1.6s linear infinite,
    button-loading-breathe 2.2s ease-in-out infinite;
}

.warm-action-button {
  justify-content: center;
  border-color: rgba(255, 207, 112, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 187, 64, 0.12), rgba(255, 143, 61, 0.08)),
    rgba(9, 22, 39, 0.72);
  color: #ffe2a3;
  box-shadow: 0 0 0 1px rgba(255, 207, 112, 0.04);
}

.warm-action-button:hover,
.warm-action-button:focus-visible {
  border-color: rgba(255, 207, 112, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 199, 90, 0.24), rgba(255, 143, 61, 0.14)),
    rgba(20, 24, 32, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 207, 112, 0.12),
    0 14px 34px rgba(255, 158, 45, 0.16);
}

#parse-reference-button.warm-action-button.is-loading,
#regenerate-clone-prompt.warm-action-button.is-loading {
  color: #fff4d4;
  border-color: rgba(255, 207, 112, 0.58);
  background:
    linear-gradient(120deg, rgba(86, 46, 11, 0.98), rgba(185, 118, 32, 0.92), rgba(92, 50, 12, 0.98));
  background-size: 220% 100%;
  box-shadow:
    0 0 0 1px rgba(255, 207, 112, 0.14),
    0 14px 36px rgba(255, 154, 35, 0.24);
}

#parse-reference-button.warm-action-button.is-loading::after,
#regenerate-clone-prompt.warm-action-button.is-loading::after {
  background: linear-gradient(90deg, transparent, rgba(255, 234, 178, 0.22), transparent);
}

#parse-reference-button.is-loading::after,
#regenerate-clone-prompt.is-loading::after,
#generate-clone-video-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateX(-100%);
  animation: button-loading-scan 1.7s linear infinite;
  pointer-events: none;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.topbar-status-sync {
  width: 188px;
  min-width: 188px;
  max-width: 188px;
  justify-content: space-between;
  flex: 0 0 188px;
  overflow: hidden;
}

.topbar-status-sync span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-status-sync strong {
  display: inline-block;
  min-width: 74px;
  flex: 0 0 auto;
  text-align: right;
}

.topbar-fabric-status {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-width: 188px;
  border-color: rgba(255, 183, 77, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 170, 72, 0.08), rgba(255, 196, 24, 0.04)),
    rgba(9, 22, 39, 0.68);
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: rgba(7, 19, 33, 0.7);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.topbar-status span,
.topbar-status strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.topbar-status span {
  color: var(--muted);
}

.topbar-status strong {
  color: var(--green);
}

.topbar-fabric-status strong {
  color: #ffd36f;
}

.topbar-fabric-status small {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}

.dashboard {
  max-width: 1480px;
  margin: 0 auto;
}

.admin-dashboard {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 170px);
}

.admin-topbar {
  align-items: center;
}

.admin-topbar-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-app-shell {
  padding: 18px;
}

.workspace-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 36px);
}

.workspace-sidebar,
.workspace-header {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(11, 13, 18, 0.88);
  box-shadow: var(--shadow);
}

.workspace-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 16px;
  border-radius: 28px;
  min-height: calc(100vh - 36px);
  position: sticky;
  top: 18px;
}

.workspace-sidebar-top {
  display: grid;
  gap: 24px;
}

.sidebar-brand-lockup {
  align-items: center;
  gap: 14px;
}

.sidebar-title {
  margin: 6px 0 0;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-size: 1.18rem;
  line-height: 1.15;
}

.sidebar-user-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.08);
  background: rgba(18, 22, 31, 0.92);
}

.sidebar-section-kicker {
  color: rgba(190, 218, 240, 0.58);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.66rem;
  font-family: "JetBrains Mono", monospace;
}

.sidebar-user-chip {
  width: 100%;
  justify-content: center;
  border-radius: 18px;
  background: rgba(28, 34, 48, 0.92);
}

.sidebar-status-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.08);
  background: rgba(18, 22, 31, 0.92);
}

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

.sidebar-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(28, 34, 48, 0.78);
}

.sidebar-status-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-status-item strong {
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88rem;
  text-align: right;
}

.sidebar-nav {
  display: grid;
  gap: 14px;
}

.sidebar-nav-group {
  display: grid;
  gap: 10px;
}

.sidebar-nav-item,
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(18, 22, 31, 0.88);
  color: var(--text);
  border-radius: 15px;
  padding: 10px 12px;
  min-height: 46px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.sidebar-nav-item {
  cursor: pointer;
  text-align: left;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.is-active,
.sidebar-link:hover {
  transform: translateX(2px);
  border-color: rgba(255, 167, 79, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 134, 55, 0.14), rgba(255, 196, 24, 0.06)),
    rgba(22, 25, 35, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.sidebar-nav-item.is-active {
  border-color: rgba(255, 167, 79, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 26px rgba(255, 120, 36, 0.12);
}

.sidebar-nav-item.is-disabled {
  color: rgba(190, 218, 240, 0.48);
  border-color: rgba(190, 218, 240, 0.08);
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(71, 85, 105, 0.04)),
    rgba(16, 19, 26, 0.78);
  cursor: not-allowed;
  opacity: 1;
}

.sidebar-nav-item.is-disabled:hover {
  transform: translateX(2px);
  border-color: rgba(190, 218, 240, 0.22);
  background:
    linear-gradient(115deg, rgba(226, 241, 255, 0), rgba(226, 241, 255, 0.12), rgba(226, 241, 255, 0)),
    linear-gradient(135deg, rgba(148, 163, 184, 0.1), rgba(71, 85, 105, 0.06)),
    rgba(16, 19, 26, 0.9);
  background-size: 220% 100%, auto, auto;
  animation: disabled-nav-glow 1.5s ease-in-out infinite;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 24px rgba(148, 163, 184, 0.12);
}

.sidebar-nav-item.is-disabled .sidebar-nav-icon {
  background: linear-gradient(135deg, #6b7280, #cbd5e1);
  box-shadow: 0 0 16px rgba(203, 213, 225, 0.18);
}

.sidebar-coming-soon-label {
  display: none;
}

.sidebar-nav-item.is-disabled .sidebar-coming-soon-label {
  display: block;
  color: rgba(226, 241, 255, 0.52);
  font-size: 0.68rem;
}

@keyframes disabled-nav-glow {
  0% {
    background-position: 120% 0, 0 0, 0 0;
  }
  100% {
    background-position: -120% 0, 0 0, 0 0;
  }
}

.sidebar-nav-icon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #ff8f3d, #ffc93a);
  box-shadow: 0 0 14px rgba(255, 165, 0, 0.34);
}

.sidebar-list-trigger .sidebar-nav-icon {
  background: linear-gradient(135deg, var(--aqua), var(--cyan));
  box-shadow: 0 0 14px rgba(49, 198, 255, 0.4);
}

.sidebar-nav-copy {
  display: grid;
  gap: 0;
}

.sidebar-nav-copy strong {
  font-size: 0.94rem;
  line-height: 1.2;
}

.sidebar-nav-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.sidebar-list-trigger {
  justify-content: space-between;
}

.sidebar-nav-badge {
  flex: 0 0 auto;
  min-width: 32px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 167, 79, 0.16);
  background: rgba(10, 16, 24, 0.94);
  color: var(--amber);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-link {
  font-size: 0.95rem;
}

.workspace-sidebar-footer {
  display: grid;
  gap: 12px;
}

.sidebar-version {
  justify-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 247, 255, 0.1);
  background: rgba(10, 16, 24, 0.72);
  color: rgba(190, 218, 240, 0.68);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.sidebar-action-button {
  width: 100%;
  justify-content: center;
}

.workspace-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 18px;
  min-height: calc(100vh - 36px);
  height: calc(100vh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 28px;
}

.mobile-menu-button,
.mobile-sidebar-backdrop {
  display: none;
}

.mobile-menu-button {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(13, 33, 58, 0.92), rgba(5, 16, 29, 0.96)),
    rgba(9, 22, 39, 0.72);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 0 10px rgba(126, 247, 255, 0.28);
}

.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  left: min(84vw, 320px);
  z-index: 30;
  border: 0;
  background: rgba(3, 10, 18, 0.62);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.workspace-header-copy {
  flex: 0 0 auto;
  min-width: 0;
}

.workspace-header h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 2vw, 2.6rem);
  line-height: 1.05;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  white-space: nowrap;
}

.workspace-subtitle {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-status-button {
  appearance: none;
  cursor: pointer;
}

.workspace-status-button::before {
  display: none;
}

.workspace-metric-chip {
  min-width: 108px;
  justify-content: space-between;
  gap: 12px;
}

.workspace-metric-chip strong {
  color: var(--text);
}

.workspace-metric-chip.is-action {
  cursor: pointer;
}

.workspace-metric-chip.is-action strong {
  color: var(--cyan);
}

.workspace-shell {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 18px;
}

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-layout {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
}

.auth-panel {
  padding: 32px;
}

.auth-panel h1 {
  margin: 10px 0 0;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.auth-brand-lockup {
  margin-bottom: 14px;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  width: 100%;
  text-align: center;
}

.auth-brand-lockup .brand-logo {
  width: 104px;
  height: 104px;
}

.auth-brand-copy {
  width: 100%;
  text-align: center;
}

.auth-brand-copy h1,
.auth-panel h1 {
  margin-top: 0;
  text-align: center;
}

.auth-copy {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  margin-top: 24px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.auth-mode-button {
  justify-content: center;
}

.auth-mode-button.is-active {
  border-color: rgba(126, 247, 255, 0.42);
  background: rgba(14, 34, 56, 0.92);
  box-shadow: 0 0 0 1px rgba(126, 247, 255, 0.08);
}

.auth-hint {
  margin-top: 20px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(6, 18, 31, 0.68);
  border: 1px solid rgba(126, 247, 255, 0.1);
}

.auth-hint span {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.auth-hint p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-error {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-error {
  margin-top: 16px;
  color: var(--danger);
  min-height: 1.4em;
}

.auth-success {
  margin-top: 16px;
  color: var(--green);
  min-height: 1.4em;
}

.auth-footer {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.auth-policy-link {
  justify-self: end;
  color: rgba(187, 212, 228, 0.58);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease;
}

.auth-policy-link:hover,
.auth-policy-link:focus-visible {
  color: rgba(126, 247, 255, 0.92);
}

.auth-copyright {
  margin: 0;
  color: rgba(187, 212, 228, 0.52);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.policy-shell {
  min-height: 100vh;
  padding: 32px 18px;
}

.policy-layout {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  margin: 0 auto;
}

.policy-panel {
  padding: 28px 30px 34px;
}

.policy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.policy-brand-lockup {
  align-items: center;
  gap: 18px;
}

.policy-brand-lockup .brand-logo {
  width: 72px;
  height: 72px;
}

.policy-brand-copy h1 {
  margin: 0;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.policy-brand-copy p {
  margin: 8px 0 0;
  color: rgba(187, 212, 228, 0.72);
  font-size: 0.92rem;
}

.policy-back-link {
  flex-shrink: 0;
  margin-top: 6px;
}

.policy-content {
  display: grid;
  gap: 24px;
  color: rgba(227, 238, 246, 0.88);
  line-height: 1.75;
}

.policy-content section {
  display: grid;
  gap: 12px;
}

.policy-content h2 {
  margin: 0;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.96);
}

.policy-content h3 {
  margin: 0;
  font-size: 0.98rem;
  color: rgba(126, 247, 255, 0.9);
}

.policy-content p,
.policy-content ul {
  margin: 0;
}

.policy-content ul {
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.policy-content li {
  color: rgba(227, 238, 246, 0.86);
}

.policy-content a {
  color: rgba(126, 247, 255, 0.92);
}

.policy-definition-list {
  gap: 12px;
}

@media (max-width: 720px) {
  .policy-panel {
    padding: 22px 18px 26px;
  }

  .policy-header {
    flex-direction: column;
    align-items: stretch;
  }

  .policy-back-link {
    width: fit-content;
  }
}

.panel {
  background: linear-gradient(180deg, rgba(10, 24, 42, 0.86), rgba(6, 16, 29, 0.94));
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.metrics {
  --metrics-gap: 20px;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--metrics-gap);
  margin-top: 20px;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

.workflow-panel {
  margin-top: 20px;
}

.mode-switcher-panel {
  margin-top: 20px;
  padding: 24px;
}

.mode-launcher-panel {
  max-width: 1080px;
  margin: 56px auto 0;
  padding: 32px;
}

.mode-switcher-copy,
.mode-flow-copy {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
}

.mode-switcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mode-card {
  text-align: left;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(126, 247, 255, 0.16);
  background:
    radial-gradient(circle at top right, rgba(49, 198, 255, 0.14), transparent 28%),
    rgba(6, 18, 31, 0.72);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.mode-card:hover,
.mode-card.is-active {
  transform: translateY(-1px);
  border-color: rgba(126, 247, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(126, 247, 255, 0.08), 0 18px 48px rgba(0, 0, 0, 0.22);
}

.mode-card.is-active {
  background:
    radial-gradient(circle at top right, rgba(49, 198, 255, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(10, 26, 45, 0.96), rgba(6, 16, 29, 0.94));
}

.mode-card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(126, 247, 255, 0.1);
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.mode-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.metric-card {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  padding: 22px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metrics::-webkit-scrollbar {
  display: none;
}

.metric-label,
.metric-foot {
  display: block;
}

.metric-label {
  color: var(--muted);
  font-size: clamp(0.66rem, 0.95vw, 0.95rem);
  line-height: 1.4;
  white-space: nowrap;
}

.metric-value {
  display: block;
  margin-top: 12px;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-size: clamp(0.9rem, 1.75vw, 2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.metric-mini {
  font-size: clamp(0.76rem, 1.25vw, 1.1rem);
}

.metric-foot {
  margin-top: 8px;
  color: rgba(190, 218, 240, 0.74);
  font-size: clamp(0.52rem, 0.74vw, 0.8rem);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.results-panel {
  grid-column: span 12;
}

.control-panel {
  grid-column: span 7;
  align-self: stretch;
}

.admin-console-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 228px;
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 170px);
}

.admin-main-panels {
  display: grid;
  grid-template-columns: minmax(300px, 0.76fr) minmax(0, 1.24fr);
  gap: 18px;
  min-width: 0;
  min-height: calc(100vh - 170px);
  align-items: stretch;
}

.admin-main-panels > .admin-form-panel,
.admin-main-panels > .admin-users-panel-main {
  grid-column: auto;
  min-width: 0;
  align-self: stretch;
}

.admin-right-sidebar {
  min-height: calc(100vh - 170px);
  top: 24px;
  justify-content: flex-start;
  gap: 18px;
  align-self: stretch;
  width: 228px;
  padding: 16px 14px;
}

.admin-right-sidebar .workspace-sidebar-top {
  gap: 18px;
}

.admin-sidebar-status-panel {
  gap: 14px;
}

.admin-usage-panel {
  grid-column: span 12;
}

.model-config-grid .model-config-panel {
  grid-column: span 7;
}

.model-config-help {
  grid-column: span 5;
}

.sidebar-stack {
  grid-column: span 5;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-self: stretch;
  height: 100%;
}

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

.panel-header h3 {
  margin-top: 6px;
  font-size: 1.4rem;
}

.control-panel,
.projects-panel,
.pipelines-panel,
.results-panel {
  padding: 24px;
}

.admin-form-panel,
.admin-users-panel,
.admin-usage-panel,
.model-config-panel,
.model-config-help {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-form-panel,
.admin-users-panel-main,
.admin-right-sidebar {
  height: 100%;
  min-width: 0;
}

.admin-form-panel {
  overflow: auto;
}

.admin-form-panel .control-form {
  grid-template-columns: 1fr;
}

.control-panel,
.projects-panel,
.pipelines-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.results-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric-action-card {
  align-items: flex-start;
}

.metric-link-button {
  margin-top: 14px;
}

.admin-overview-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-users-panel {
  align-self: stretch;
  overflow: hidden;
}

.admin-users-panel-main {
  display: flex;
  flex-direction: column;
}

.admin-users-panel .admin-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.admin-overview-item {
  display: grid;
  gap: 4px;
  padding: 14px 14px 13px;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(6, 18, 31, 0.68);
}

.admin-overview-item span,
.admin-overview-item small {
  color: var(--muted);
}

.admin-overview-item span {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-overview-item strong {
  color: var(--text);
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-size: 1.34rem;
  line-height: 1.1;
}

.admin-overview-item small {
  line-height: 1.55;
}

.admin-overview-mini {
  font-size: 0.92rem !important;
  line-height: 1.35 !important;
  word-break: break-word;
}

.admin-overview-action .metric-link-button {
  margin-top: 8px;
  width: 100%;
  text-align: center;
}

.admin-right-sidebar .sidebar-user-panel {
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 143, 61, 0.12), rgba(255, 201, 58, 0.06)),
    rgba(18, 22, 31, 0.92);
  border-color: rgba(255, 167, 79, 0.16);
}

.admin-right-sidebar .sidebar-user-chip {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.5;
  min-height: 56px;
}

.admin-right-sidebar .sidebar-link {
  cursor: pointer;
  justify-content: flex-start;
}

.admin-sidebar-footer {
  margin-top: auto;
}

.admin-model-trigger-group,
.admin-sidebar-switch-group {
  display: grid;
  gap: 10px;
}

.admin-model-trigger-group .sidebar-nav-item,
.admin-sidebar-switch-group .sidebar-nav-item {
  width: 100%;
  justify-content: flex-start;
  padding: 16px 14px;
  border-radius: 22px;
  border-color: rgba(126, 247, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(16, 38, 58, 0.92), rgba(8, 19, 32, 0.94)),
    rgba(11, 13, 18, 0.88);
}

.admin-model-trigger-group .sidebar-nav-item:hover,
.admin-sidebar-switch-group .sidebar-nav-item:hover {
  border-color: rgba(126, 247, 255, 0.3);
}

.admin-sidebar-switch-group .sidebar-nav-item.is-active {
  border-color: rgba(126, 247, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 34px rgba(0, 0, 0, 0.22);
}

.admin-model-modal-card {
  max-width: min(780px, calc(100vw - 48px));
}

.admin-creative-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.creative-mode-form {
  display: grid;
  gap: 16px;
  min-height: 0;
}

.creative-mode-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(126, 247, 255, 0.1);
  background: rgba(5, 16, 29, 0.82);
}

.creative-mode-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--cyan);
}

.creative-mode-copy {
  display: grid;
  gap: 6px;
}

.creative-mode-copy strong {
  color: var(--text);
  line-height: 1.35;
}

.creative-mode-copy small {
  color: var(--muted);
  line-height: 1.6;
}

.creative-mode-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  padding-top: 4px;
}

.creative-mode-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-model-modal-content {
  display: grid;
  gap: 18px;
}

.admin-model-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-model-route-grid label {
  display: grid;
  gap: 10px;
}

.admin-model-route-grid span,
.admin-model-entry-header .sidebar-section-kicker {
  color: rgba(210, 229, 244, 0.8);
}

.admin-model-route-grid select {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.92);
  color: var(--text);
  padding: 12px 14px;
}

.admin-generation-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 207, 112, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 207, 112, 0.12), transparent 34%),
    rgba(5, 16, 29, 0.82);
}

.admin-generation-toggle-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-generation-toggle-copy strong {
  color: rgba(255, 246, 224, 0.94);
}

.admin-generation-toggle-copy small {
  color: rgba(190, 218, 240, 0.68);
  line-height: 1.45;
}

.admin-generation-toggle input {
  width: 46px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: var(--amber);
  cursor: pointer;
}

.admin-model-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-model-add-button {
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
}

.admin-model-entry-list {
  display: grid;
  gap: 12px;
}

.admin-model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 52px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.1);
  background: rgba(5, 16, 29, 0.82);
}

.admin-model-row input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(2, 10, 18, 0.92);
  color: var(--text);
  padding: 0 14px;
}

.admin-model-row input::placeholder {
  color: rgba(164, 190, 212, 0.52);
}

.admin-model-row-remove {
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 16px;
  font-size: 1.35rem;
  line-height: 1;
}

.admin-model-row-remove:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.admin-model-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-model-modal-actions .primary-button {
  min-width: 188px;
}

.provider-status-box {
  margin-top: 18px;
}

.model-provider-grid .model-config-panel,
.model-provider-grid .model-config-help {
  align-self: stretch;
}

.model-provider-admin-grid .provider-create-panel {
  grid-column: span 4;
}

.model-provider-admin-grid .provider-library-panel {
  grid-column: span 8;
}

.workflow-panel {
  padding: 24px;
}

.mode-flow-shell {
  min-height: 170px;
}

.mode-flow-diagram-clone {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
}

.mode-flow-diagram-benchmark {
  display: grid;
  grid-template-columns: 1.1fr 44px 1.4fr 1.2fr 44px 1.1fr 44px 1.1fr;
  gap: 14px;
  align-items: center;
}

.mode-flow-card {
  min-height: 124px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(96, 114, 245, 0.52);
  background: rgba(240, 244, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(126, 247, 255, 0.04);
}

.mode-flow-card strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.45;
}

.mode-flow-arrow {
  display: grid;
  place-items: center;
  color: #6072f5;
  font-size: 2rem;
  font-weight: 700;
}

.mode-flow-diagram-clone .mode-flow-card:nth-child(1) {
  grid-column: 1;
}

.mode-flow-diagram-clone .mode-flow-card:nth-child(3) {
  grid-column: 3;
}

.mode-flow-diagram-clone .mode-flow-card:nth-child(5) {
  grid-column: 5;
}

.mode-flow-diagram-clone .mode-flow-card:nth-child(7) {
  grid-column: 7;
}

.mode-flow-diagram-clone .mode-flow-card:nth-child(9) {
  grid-column: 9;
}

.benchmark-start {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.benchmark-arrow-a {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.benchmark-input {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.benchmark-branch {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.benchmark-branch-head {
  grid-column: 4;
  grid-row: 1;
}

.benchmark-branch-tail {
  grid-column: 4;
  grid-row: 2;
}

.benchmark-arrow-b {
  grid-column: 5;
  grid-row: 1 / span 2;
}

.benchmark-params {
  grid-column: 6;
  grid-row: 1 / span 2;
}

.benchmark-arrow-c {
  grid-column: 7;
  grid-row: 1 / span 2;
}

.benchmark-video {
  grid-column: 8;
  grid-row: 1 / span 2;
}

.list-item p,
.result-card p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.list-item,
.result-card,
.empty-state,
.result-feature {
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: rgba(6, 18, 31, 0.72);
}

.list-item strong,
.result-card strong,
.result-feature strong {
  display: block;
  margin-bottom: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-pill.ok {
  background: rgba(112, 240, 184, 0.12);
  color: var(--green);
}

.status-pill.idle {
  background: rgba(255, 207, 112, 0.12);
  color: var(--amber);
}

.status-pill.fail {
  background: rgba(255, 124, 144, 0.14);
  color: var(--danger);
}

.control-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.control-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-form label span,
.field-block span {
  color: rgba(208, 228, 241, 0.8);
  font-size: 0.92rem;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.control-form label.wide,
.field-block.wide,
.control-form button {
  grid-column: 1 / -1;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.field-action-row .mini-button {
  min-height: 52px;
  white-space: nowrap;
}

.upload-reference-video-button {
  min-width: 124px;
}

.neon-hover-field,
.neon-hover-shell {
  --glow-x: 50%;
  --glow-y: 50%;
  --glow-opacity: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 16, 28, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 28px rgba(0, 0, 0, 0.16);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease;
}

.neon-hover-field {
  padding: 12px;
}

.neon-hover-shell {
  padding: 8px;
}

.neon-hover-field.neon-hover-field-hero,
.neon-hover-shell.neon-hover-shell-hero {
  border-radius: 28px;
}

.neon-hover-field::before,
.neon-hover-field::after,
.neon-hover-shell::before,
.neon-hover-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.neon-hover-field::before,
.neon-hover-shell::before {
  inset: -38%;
  background:
    radial-gradient(
      190px circle at var(--glow-x) var(--glow-y),
      rgba(255, 103, 189, 0.34) 0,
      rgba(255, 191, 95, 0.28) 18%,
      rgba(114, 241, 255, 0.24) 36%,
      rgba(127, 135, 255, 0.18) 52%,
      transparent 72%
    );
  filter: blur(30px) saturate(140%);
  opacity: calc(var(--glow-opacity) * 0.95);
  transition: opacity 220ms ease;
  z-index: 0;
}

.neon-hover-field::after,
.neon-hover-shell::after {
  padding: 1px;
  background:
    radial-gradient(
      150px circle at var(--glow-x) var(--glow-y),
      rgba(255, 110, 198, 0.95) 0,
      rgba(255, 199, 90, 0.9) 22%,
      rgba(114, 241, 255, 0.88) 42%,
      rgba(125, 133, 255, 0.84) 60%,
      transparent 78%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: calc(0.12 + var(--glow-opacity) * 0.86);
  transition: opacity 220ms ease;
  z-index: 1;
}

.neon-hover-field > *,
.neon-hover-shell > * {
  position: relative;
  z-index: 2;
}

.neon-hover-field.is-glowing,
.neon-hover-shell.is-glowing,
.neon-hover-field:focus-within,
.neon-hover-shell:focus-within {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.22);
}

.neon-hover-field .field-hint {
  position: relative;
  z-index: 2;
}

.form-section {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: rgba(6, 18, 31, 0.66);
}

.form-section-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.form-section-header h4 {
  margin: 6px 0 0;
  font-size: 1rem;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
}

.form-section-header p {
  margin: 0;
  max-width: 360px;
  color: var(--muted);
  line-height: 1.7;
}

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

.flow-guide-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.74);
}

.flow-guide-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(126, 247, 255, 0.1);
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.flow-guide-item strong {
  display: block;
  margin-bottom: 8px;
}

.flow-guide-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.advanced-settings-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle) {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 88px;
  text-align: center;
}

.advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle) span {
  width: 100%;
  color: rgba(208, 228, 241, 0.82);
  font-size: 0.84rem;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle) input,
.advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle) select {
  min-height: 48px;
  padding-inline: 10px;
  text-align: center;
  text-align-last: center;
  white-space: nowrap;
}

.advanced-settings-panel .provider-toggle {
  display: flex;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 88px;
  text-align: center;
}

.advanced-settings-panel .provider-toggle span {
  flex: 0 0 auto;
  font-size: 0.84rem;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}

.advanced-settings-panel .provider-toggle input {
  margin: 0;
}

.advanced-settings-body .wide {
  grid-column: 1 / -1;
}

.workspace-grid {
  margin-top: 20px;
}

.clone-workspace-layout {
  grid-template-columns: minmax(300px, 0.72fr) minmax(320px, 0.82fr) minmax(520px, 1.3fr);
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - 162px);
}

.clone-workspace-layout .clone-control-panel,
.clone-workspace-layout .advanced-settings-panel,
.clone-workspace-layout .clone-results-panel {
  grid-column: auto;
  min-width: 0;
}

.clone-control-panel {
  max-width: 390px;
}

.clone-control-panel .control-form {
  grid-template-columns: 1fr;
}

.clone-control-panel .reference-analysis-grid {
  grid-template-columns: 1fr;
}

.clone-control-panel,
.advanced-settings-panel,
.clone-results-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.advanced-settings-panel {
  max-width: 420px;
}

.advanced-settings-panel .advanced-settings-body {
  padding-top: 10px;
}

.advanced-settings-panel.has-suggested-values {
  border-color: rgba(112, 240, 184, 0.28);
  box-shadow:
    0 0 0 1px rgba(112, 240, 184, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.22);
}

.clone-results-panel .results-grid {
  grid-template-columns: 1fr;
  flex: 1;
  align-content: start;
}

.image-workspace {
  margin-top: 20px;
  min-height: calc(100vh - 162px);
}

.image-studio-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  display: grid;
  gap: 22px;
  padding: 12px 0 28px;
}

.image-studio-title {
  text-align: center;
  display: grid;
  gap: 10px;
}

.image-studio-title .section-kicker {
  justify-self: center;
}

.image-studio-title h3 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.1;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
}

.image-compose-panel {
  --image-compose-height: 136px;
  --image-upload-width: 110px;
  --image-upload-height: 96px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(126, 247, 255, 0.16);
  background:
    radial-gradient(circle at top right, rgba(126, 247, 255, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(9, 22, 39, 0.92), rgba(5, 15, 27, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 70px rgba(0, 0, 0, 0.32);
}

.image-compose-input {
  display: grid;
  grid-template-columns: var(--image-upload-width) minmax(0, 1fr) auto 64px;
  gap: 14px;
  align-items: center;
  min-height: var(--image-compose-height);
}

.image-reference-picker {
  position: relative;
  align-self: center;
  width: var(--image-upload-width);
  min-width: var(--image-upload-width);
  max-width: var(--image-upload-width);
  height: var(--image-upload-height);
  min-height: var(--image-upload-height);
  max-height: var(--image-upload-height);
}

.image-prompt-shell {
  position: relative;
  width: 100%;
  height: var(--image-compose-height);
  min-height: var(--image-compose-height);
  max-height: var(--image-compose-height);
  padding: 8px;
}

.image-upload-tile {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px dashed rgba(126, 247, 255, 0.2);
  background: rgba(5, 16, 29, 0.86);
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  place-items: center;
  align-content: center;
  gap: 5px;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.image-reference-clear {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 21px;
  height: 21px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(226, 241, 255, 0.24);
  background: rgba(3, 10, 18, 0.78);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
}

.image-reference-clear:hover,
.image-reference-clear:focus-visible {
  border-color: rgba(255, 207, 112, 0.56);
  background: rgba(37, 22, 10, 0.9);
  outline: none;
}

.image-reference-clear span {
  position: relative;
  width: 9px;
  height: 9px;
  display: block;
}

.image-reference-clear span::before,
.image-reference-clear span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 9px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.image-reference-clear span::before {
  transform: rotate(45deg);
}

.image-reference-clear span::after {
  transform: rotate(-45deg);
}

.image-upload-tile.has-reference {
  border-style: solid;
  border-color: rgba(255, 207, 112, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 207, 112, 0.11), rgba(49, 198, 255, 0.06)),
    rgba(5, 16, 29, 0.9);
  color: rgba(255, 246, 224, 0.94);
}

.image-upload-icon {
  width: 20px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(190, 218, 240, 0.58);
  position: relative;
}

.image-upload-icon::after {
  content: "";
  position: absolute;
  right: -7px;
  top: -10px;
  width: 10px;
  height: 10px;
  background:
    linear-gradient(var(--amber), var(--amber)) center / 100% 2px no-repeat,
    linear-gradient(var(--amber), var(--amber)) center / 2px 100% no-repeat;
}

.image-upload-tile strong {
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.image-upload-tile small {
  min-width: 0;
  max-width: 82px;
  overflow: hidden;
  color: rgba(226, 241, 255, 0.74);
  font-size: 0.62rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-compose-input textarea {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  resize: none;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.04);
  outline: none;
  background: rgba(4, 12, 22, 0.72);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: none;
  scrollbar-gutter: stable;
}

.image-compose-input textarea::placeholder {
  color: rgba(190, 218, 240, 0.58);
}

.image-count-indicator {
  align-self: center;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88rem;
  white-space: nowrap;
}

.image-reference-strip {
  display: flex;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 247, 255, 0.26) transparent;
}

.image-reference-card {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  min-height: 136px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(10, 23, 38, 0.88), rgba(4, 12, 22, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(0, 0, 0, 0.2);
}

.image-reference-card img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  background: rgba(4, 12, 22, 0.92);
}

.image-reference-card-index {
  position: absolute;
  left: 7px;
  top: 60px;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 22, 0.82);
  border: 1px solid rgba(255, 207, 112, 0.48);
  color: #fff4d4;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.image-reference-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 23px;
  height: 23px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(226, 241, 255, 0.24);
  background: rgba(3, 10, 18, 0.78);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
}

.image-reference-card-remove:hover,
.image-reference-card-remove:focus-visible {
  border-color: rgba(255, 207, 112, 0.58);
  background: rgba(37, 22, 10, 0.92);
  outline: none;
}

.image-reference-card-remove span {
  position: relative;
  width: 10px;
  height: 10px;
  display: block;
}

.image-reference-card-remove span::before,
.image-reference-card-remove span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 10px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.image-reference-card-remove span::before {
  transform: rotate(45deg);
}

.image-reference-card-remove span::after {
  transform: rotate(-45deg);
}

.image-reference-card-meta {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.image-reference-card-meta small {
  min-width: 0;
  overflow: hidden;
  color: rgba(190, 218, 240, 0.64);
  font-size: 0.66rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-submit-button {
  align-self: center;
  width: 64px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 207, 112, 0.3);
  border-radius: 16px;
  cursor: pointer;
  color: #ffe2a3;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 12px 32px rgba(255, 155, 52, 0.12);
}

.image-submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.image-submit-button.is-loading {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff4d4;
  border-color: rgba(255, 207, 112, 0.58);
  background:
    linear-gradient(120deg, rgba(86, 46, 11, 0.98), rgba(185, 118, 32, 0.92), rgba(92, 50, 12, 0.98));
  background-size: 220% 100%;
  animation:
    button-loading-shimmer 1.6s linear infinite,
    button-loading-breathe 2.2s ease-in-out infinite;
}

.image-submit-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 234, 178, 0.22), transparent);
  transform: translateX(-100%);
  animation: button-loading-scan 1.7s linear infinite;
  pointer-events: none;
}

.image-reference-mention-menu {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
  max-height: 152px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.18);
  background: rgba(3, 10, 18, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 52px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.image-reference-mention-item {
  min-width: 0;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(8, 23, 39, 0.9);
  color: var(--text);
  display: grid;
  grid-template-columns: 36px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
}

.image-reference-mention-item:hover,
.image-reference-mention-item:focus-visible {
  border-color: rgba(255, 207, 112, 0.5);
  background: rgba(32, 27, 19, 0.94);
  outline: none;
}

.image-reference-mention-item img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.image-reference-mention-item span {
  color: #ffe2a3;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.image-reference-mention-item small {
  min-width: 0;
  overflow: hidden;
  color: rgba(190, 218, 240, 0.68);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-compose-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.image-tool-button,
.image-tool-control,
.image-count-control {
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(5, 16, 29, 0.84);
  color: var(--text);
}

.image-tool-button {
  padding: 10px 16px;
  cursor: pointer;
}

.image-tool-control {
  display: inline-grid;
  grid-template-columns: auto minmax(92px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
}

.image-tool-control span {
  color: var(--muted);
  font-size: 0.78rem;
}

.image-tool-control select {
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.image-tool-control select option {
  color: #08111f;
}

.image-count-control {
  display: inline-grid;
  grid-template-columns: auto 120px 32px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
}

.image-count-control span {
  color: var(--muted);
  font-size: 0.84rem;
}

.image-count-control strong {
  color: var(--amber);
  font-family: "JetBrains Mono", monospace;
  text-align: right;
}

.image-count-control input {
  accent-color: var(--amber);
}

.image-studio-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: var(--muted);
}

.image-guide-button {
  border: 0;
  background: transparent;
  color: rgba(255, 207, 112, 0.92);
  cursor: pointer;
  padding: 0;
}

.image-generation-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.image-generation-waiting-state {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(126, 247, 255, 0.2);
}

.image-generation-waiting-state > * {
  position: relative;
  z-index: 2;
}

.image-generation-waiting-state.is-loading {
  border-color: rgba(126, 247, 255, 0.46);
  background:
    linear-gradient(120deg, rgba(9, 27, 48, 0.98), rgba(18, 78, 130, 0.84), rgba(7, 25, 49, 0.98));
  background-size: 220% 100%;
  box-shadow:
    0 0 0 1px rgba(126, 247, 255, 0.1),
    0 18px 46px rgba(15, 78, 144, 0.3);
  animation:
    button-loading-shimmer 1.6s linear infinite,
    button-loading-breathe 2.2s ease-in-out infinite;
}

.image-generation-waiting-state.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(126, 247, 255, 0.22), transparent);
  transform: translateX(-100%);
  animation: button-loading-scan 1.7s linear infinite;
  pointer-events: none;
}

.image-results-actionbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.image-download-all-button,
.image-download-button {
  border-color: rgba(255, 207, 112, 0.24);
  color: #ffe2a3;
}

.image-result-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(6, 18, 31, 0.7);
}

.image-result-preview {
  width: 100%;
  min-height: 130px;
  border-radius: 16px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow: hidden;
  appearance: none;
}

.image-result-preview img {
  width: 100%;
  height: 100%;
  min-height: 130px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 180ms ease, filter 180ms ease;
}

.image-result-preview.has-image {
  cursor: zoom-in;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.image-result-preview.has-image:hover,
.image-result-preview.has-image:focus-visible {
  border-color: rgba(126, 247, 255, 0.45);
  box-shadow: 0 0 26px rgba(49, 198, 255, 0.22);
  outline: none;
  transform: translateY(-1px);
}

.image-result-preview.has-image:hover img,
.image-result-preview.has-image:focus-visible img {
  filter: saturate(1.08);
  transform: scale(1.015);
}

.image-result-preview span {
  color: rgba(235, 247, 255, 0.88);
  font-family: "JetBrains Mono", monospace;
}

.image-result-preview-1,
.image-result-preview-4 {
  background: linear-gradient(135deg, rgba(255, 207, 112, 0.22), rgba(49, 198, 255, 0.16));
}

.image-result-preview-2,
.image-result-preview-5 {
  background: linear-gradient(135deg, rgba(112, 240, 184, 0.18), rgba(255, 124, 144, 0.18));
}

.image-result-preview-3 {
  background: linear-gradient(135deg, rgba(126, 247, 255, 0.18), rgba(139, 132, 255, 0.18));
}

.image-result-copy {
  display: grid;
  gap: 10px;
  align-items: start;
}

.image-result-copy strong {
  margin: 0;
  line-height: 1.35;
}

.image-download-button {
  width: 100%;
  min-height: 42px;
}

.image-original-preview-modal {
  display: grid;
  gap: 16px;
}

.image-original-preview-modal img {
  width: 100%;
  max-height: min(68vh, 780px);
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.16);
  background: rgba(3, 10, 18, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.image-original-actions {
  display: flex;
  justify-content: flex-end;
}

.image-original-actions .image-download-button {
  width: auto;
  min-width: 160px;
}

.reference-analysis-panel {
  margin-top: 0;
}

.reference-analysis-actions {
  margin-top: 2px;
}

.analysis-status-button {
  width: 100%;
  padding: 14px 18px;
  appearance: none;
  color: var(--text);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  min-width: 0;
}

.analysis-status-copy {
  min-width: max-content;
  display: block;
}

.analysis-status-copy strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.2;
  white-space: nowrap;
}

.analysis-status-meta {
  min-width: 0;
  max-width: none;
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: right;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-status-button.is-pending {
  border-color: rgba(110, 177, 255, 0.24);
  background: rgba(6, 22, 40, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(214, 236, 255, 0.06),
    0 18px 40px rgba(10, 30, 58, 0.24);
}

.analysis-status-button.is-pending::before {
  background:
    radial-gradient(
      190px circle at var(--glow-x) var(--glow-y),
      rgba(74, 158, 255, 0.34) 0,
      rgba(117, 223, 255, 0.26) 28%,
      rgba(123, 136, 255, 0.18) 52%,
      transparent 78%
    );
  animation: pending-glow-pulse 2.4s ease-in-out infinite;
}

.analysis-status-button.is-pending::after {
  background:
    radial-gradient(
      150px circle at var(--glow-x) var(--glow-y),
      rgba(126, 247, 255, 0.92) 0,
      rgba(87, 151, 255, 0.84) 38%,
      rgba(139, 132, 255, 0.7) 58%,
      transparent 82%
    ),
    linear-gradient(135deg, rgba(214, 236, 255, 0.1), rgba(255, 255, 255, 0.02));
  animation: pending-border-wave 3.1s linear infinite;
}

.analysis-status-button.is-failed {
  border-color: rgba(255, 115, 115, 0.26);
  background: rgba(36, 10, 14, 0.88);
}

.analysis-status-button.is-success {
  border-color: rgba(102, 255, 184, 0.28);
  background:
    linear-gradient(135deg, rgba(8, 31, 22, 0.96), rgba(5, 24, 22, 0.9)),
    rgba(8, 16, 28, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(177, 255, 216, 0.08),
    0 18px 46px rgba(7, 34, 22, 0.28);
}

.analysis-status-button.is-success::before {
  background:
    radial-gradient(
      190px circle at var(--glow-x) var(--glow-y),
      rgba(94, 255, 173, 0.34) 0,
      rgba(77, 244, 223, 0.28) 24%,
      rgba(183, 255, 118, 0.22) 48%,
      rgba(84, 213, 162, 0.14) 62%,
      transparent 76%
    );
}

.analysis-status-button.is-success::after {
  background:
    radial-gradient(
      150px circle at var(--glow-x) var(--glow-y),
      rgba(118, 255, 183, 0.98) 0,
      rgba(70, 239, 215, 0.92) 34%,
      rgba(183, 255, 120, 0.86) 58%,
      transparent 80%
    ),
    linear-gradient(135deg, rgba(215, 255, 232, 0.14), rgba(255, 255, 255, 0.02));
}

.analysis-status-button.is-success .analysis-status-label,
.analysis-status-button.is-success .analysis-status-meta {
  color: rgba(210, 255, 229, 0.78);
}

.analysis-status-button.is-failed .analysis-status-label,
.analysis-status-button.is-failed .analysis-status-meta {
  color: rgba(255, 201, 201, 0.74);
}

.analysis-status-button.is-pending .analysis-status-label,
.analysis-status-button.is-pending .analysis-status-meta {
  color: rgba(200, 224, 255, 0.78);
}

.clone-prompt-panel textarea {
  min-height: 240px;
  resize: vertical;
}

.prompt-editor-field {
  margin-bottom: 0;
}

.prompt-editor-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.prompt-regenerate-button {
  min-width: 180px;
}

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

.reference-analysis-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.74);
}

.reference-analysis-card strong {
  display: block;
  margin-bottom: 10px;
}

.reference-analysis-card p,
.reference-analysis-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reference-analysis-card p {
  white-space: pre-line;
}

.reference-analysis-list {
  padding-left: 18px;
}

.benchmark-stage-list {
  display: grid;
  gap: 14px;
}

.benchmark-stage-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: rgba(6, 18, 31, 0.68);
}

.benchmark-stage-card strong {
  display: block;
  margin: 12px 0 8px;
}

.benchmark-stage-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.benchmark-hint-box {
  margin-top: 0;
}

.result-video-card {
  overflow: hidden;
  grid-column: 1 / -1;
  min-width: 0;
}

.generated-video-player {
  width: 100%;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.92);
}

.result-loading-state {
  padding: 24px;
  display: grid;
  gap: 20px;
  border-radius: 26px;
  border: 1px solid rgba(126, 247, 255, 0.18);
  background:
    radial-gradient(circle at top right, rgba(88, 174, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(8, 20, 34, 0.96), rgba(5, 14, 25, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 50px rgba(0, 0, 0, 0.26);
}

.result-loading-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-loading-head strong {
  margin: 0;
  font-size: 1.08rem;
}

.result-loading-core {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.result-loading-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(126, 247, 255, 0.16);
  background: radial-gradient(circle at center, rgba(20, 61, 97, 0.82), rgba(7, 18, 31, 0.4));
  box-shadow:
    inset 0 0 0 1px rgba(126, 247, 255, 0.04),
    0 0 28px rgba(49, 198, 255, 0.16);
}

.result-loading-orbit span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
}

.result-loading-orbit span:nth-child(1) {
  border-top-color: rgba(126, 247, 255, 0.95);
  animation: result-orbit-spin 1.2s linear infinite;
}

.result-loading-orbit span:nth-child(2) {
  inset: 8px;
  border-right-color: rgba(112, 240, 184, 0.82);
  animation: result-orbit-spin 1.8s linear reverse infinite;
}

.result-loading-orbit span:nth-child(3) {
  inset: 18px;
  border-bottom-color: rgba(255, 207, 112, 0.78);
  animation: result-orbit-spin 1.1s linear infinite;
}

.result-loading-copy {
  display: grid;
  gap: 6px;
}

.result-loading-copy p,
.result-loading-copy small {
  margin: 0;
}

.result-loading-copy p {
  color: var(--text);
  font-size: 1rem;
}

.result-loading-copy small {
  color: var(--muted);
  line-height: 1.6;
}

.result-loading-rail {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.result-loading-rail span {
  position: absolute;
  inset: 0 auto 0 -36%;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(126, 247, 255, 0), rgba(126, 247, 255, 0.88), rgba(112, 240, 184, 0));
  animation: result-loading-slide 1.6s ease-in-out infinite;
}

.result-loading-timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.timeline-step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(10, 17, 28, 0.74);
  min-width: 0;
  min-height: 0;
}

.timeline-step-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.02);
}

.timeline-step-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.timeline-step-copy strong,
.timeline-step-copy small {
  margin: 0;
}

.timeline-step-copy strong {
  font-size: 0.88rem;
  line-height: 1.35;
}

.timeline-step-copy small {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.76rem;
}

.timeline-step.is-active {
  border-color: rgba(126, 247, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(88, 174, 255, 0.12), transparent 42%),
    rgba(10, 20, 34, 0.9);
}

.timeline-step.is-active .timeline-step-dot {
  background: var(--cyan);
  box-shadow:
    0 0 0 4px rgba(126, 247, 255, 0.08),
    0 0 18px rgba(126, 247, 255, 0.48);
}

.timeline-step.is-done .timeline-step-dot {
  background: var(--green);
  box-shadow:
    0 0 0 4px rgba(112, 240, 184, 0.08),
    0 0 16px rgba(112, 240, 184, 0.34);
}

.result-safety-card,
.result-trace-card,
.result-consistency-card {
  padding: 18px;
}

.consistency-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.consistency-list strong {
  margin: 0;
  color: var(--text);
}

.consistency-list ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

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

.trace-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(8, 16, 27, 0.76);
  border: 1px solid rgba(126, 247, 255, 0.08);
}

.trace-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(126, 247, 255, 0.08);
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.trace-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.control-form input,
.control-form select,
.control-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.92);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.neon-hover-field input,
.neon-hover-field select,
.neon-hover-field textarea,
.neon-hover-shell input,
.neon-hover-shell select,
.neon-hover-shell textarea {
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(4, 12, 22, 0.9);
}

.control-form input:focus,
.control-form select:focus,
.control-form textarea:focus {
  border-color: rgba(126, 247, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(126, 247, 255, 0.08);
}

.list-column,
.results-grid,
.admin-list,
.provider-config-list,
.step-routing-list {
  display: grid;
  gap: 14px;
}

.projects-panel .list-column,
.pipelines-panel .list-column,
.admin-users-panel .admin-list,
.admin-usage-panel .admin-list {
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.list-item {
  padding: 18px;
}

.list-item.is-clickable {
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.list-item.is-clickable:hover,
.list-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(126, 247, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(126, 247, 255, 0.08);
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: rgba(190, 218, 240, 0.72);
}

.results-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.result-feature {
  grid-column: 1 / -1;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(49, 198, 255, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(8, 24, 41, 0.92), rgba(6, 16, 29, 0.94));
}

.result-feature-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.result-feature-copy p,
.result-feature-copy small,
.result-card p,
.result-hint,
.modal-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.result-feature-copy p {
  margin-top: 8px;
}

.result-feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.result-card {
  padding: 18px;
  cursor: pointer;
  min-width: 0;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.result-card:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 247, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(126, 247, 255, 0.08);
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.result-card-head strong {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.result-video-card .result-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.result-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.result-video-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 207, 112, 0.16);
  background: rgba(255, 207, 112, 0.06);
}

.result-preview {
  margin: 0;
  color: var(--text);
  line-height: 1.75;
}

.result-hint {
  display: inline-block;
  margin-top: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--cyan);
}

.result-card pre {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.7;
}

.empty-state {
  padding: 24px;
}

.empty-state span {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 18, 0.7);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(82vh, 900px);
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(126, 247, 255, 0.2);
  background: linear-gradient(180deg, rgba(9, 24, 42, 0.96), rgba(4, 12, 23, 0.98));
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.55);
}

.modal-card-list {
  width: min(760px, 100%);
}

.modal-card-projects {
  width: min(980px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 24px 0;
}

.modal-header h3 {
  margin: 6px 0 0;
  font-family: "Orbitron", "Space Grotesk", sans-serif;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-meta {
  margin-top: 10px;
}

.modal-content {
  margin: 0;
  padding: 20px 24px 24px;
  max-height: calc(82vh - 110px);
  overflow: auto;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.8;
}

.modal-content.is-rich {
  white-space: normal;
  word-break: normal;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.modal-rich-content {
  display: grid;
  gap: 16px;
}

.modal-rich-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(126, 247, 255, 0.1);
  background: rgba(4, 13, 24, 0.62);
}

.modal-rich-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-rich-section p,
.modal-rich-section ul,
.modal-rich-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-rich-section ul {
  padding-left: 18px;
}

.product-reference-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.product-reference-primary,
.product-angle-gallery figure {
  margin: 0;
  display: grid;
  gap: 8px;
}

.product-reference-preview-button {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.product-reference-preview-button:focus-visible {
  outline: 2px solid rgba(126, 247, 255, 0.78);
  outline-offset: 3px;
}

.product-reference-primary img,
.product-angle-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(2, 8, 16, 0.84);
  transition: transform 180ms ease, filter 180ms ease, border-color 180ms ease;
}

.product-reference-preview-button:hover img,
.product-reference-preview-button:focus-visible img {
  border-color: rgba(126, 247, 255, 0.45);
  filter: saturate(1.08);
  transform: scale(1.01);
}

.product-reference-primary.is-empty {
  min-height: 180px;
  align-items: center;
  justify-items: center;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.1);
  background: rgba(2, 8, 16, 0.84);
  color: var(--muted);
}

.product-reference-primary figcaption,
.product-angle-gallery figcaption {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
}

.product-reference-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.product-reference-copy h4 {
  margin: 0;
  color: var(--text);
}

.product-angle-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 12px;
}

.product-lock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.product-lock-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(8, 16, 27, 0.7);
  border: 1px solid rgba(126, 247, 255, 0.08);
}

.modal-list-content {
  padding: 20px 24px 24px;
  max-height: calc(82vh - 110px);
  overflow: auto;
  align-content: start;
}

.modal-list-content .empty-state {
  padding: 0;
}

.project-list-modal-content {
  gap: 10px;
}

.project-list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(140px, 0.9fr) minmax(92px, 0.55fr) minmax(168px, 0.9fr);
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}

.project-row-title,
.project-row-product,
.project-row-channel,
.project-row-time {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-row-title {
  font-size: 0.94rem;
}

.project-row-product,
.project-row-channel,
.project-row-time {
  color: var(--muted);
  font-size: 0.82rem;
}

.project-row-time {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
}

.admin-user-row,
.usage-record-row {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: rgba(6, 18, 31, 0.72);
}

.admin-user-row {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.05fr);
  align-items: stretch;
}

.usage-record-row {
  grid-template-columns: minmax(160px, 0.55fr) minmax(0, 1.4fr) minmax(160px, 0.55fr);
  align-items: start;
}

.admin-user-meta strong,
.usage-record-main strong {
  display: block;
  margin-bottom: 8px;
}

.admin-user-meta,
.usage-record-main,
.usage-record-side {
  min-width: 0;
}

.admin-user-meta p,
.usage-record-main p,
.usage-record-side p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
}

.admin-user-side {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.admin-user-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.admin-user-controls select,
.admin-user-select {
  width: 100%;
  min-width: 180px;
  flex: 1 1 180px;
  border-radius: 14px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.92);
  color: var(--text);
  padding: 10px 12px;
}

.admin-user-controls .secondary-button {
  flex: 1 1 110px;
  width: auto;
  min-width: 110px;
}

.admin-user-info {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.08);
  background: rgba(4, 13, 24, 0.52);
}

.admin-user-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.secondary-button {
  border: 1px solid rgba(126, 247, 255, 0.16);
  background: rgba(9, 22, 39, 0.72);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-button:hover {
  border-color: rgba(126, 247, 255, 0.45);
}

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

.routing-step-card,
.provider-config-card {
  border-radius: 22px;
  border: 1px solid rgba(126, 247, 255, 0.14);
  background: rgba(6, 18, 31, 0.72);
}

.routing-step-card {
  padding: 18px;
}

.routing-step-head,
.provider-config-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.routing-step-head strong,
.provider-config-name {
  display: block;
  margin-bottom: 8px;
}

.routing-step-head p,
.provider-config-meta,
.provider-config-order {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.routing-step-fields,
.provider-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.routing-step-fields label,
.provider-config-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.routing-step-fields span,
.provider-config-grid span {
  color: rgba(208, 228, 241, 0.8);
  font-size: 0.88rem;
}

.provider-config-card {
  padding: 20px;
}

.provider-config-grid .wide {
  grid-column: 1 / -1;
}

.provider-config-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.provider-save-button {
  min-height: 48px;
}

.provider-config-grid input,
.provider-config-grid select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.92);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.provider-config-grid input:focus,
.provider-config-grid select:focus {
  border-color: rgba(126, 247, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(126, 247, 255, 0.08);
}

.provider-toggle {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(126, 247, 255, 0.12);
  background: rgba(4, 13, 24, 0.92);
}

.provider-toggle input {
  width: auto !important;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
}

.provider-config-status {
  margin-top: 16px;
}

.provider-config-card.is-readonly {
  border-color: rgba(255, 207, 112, 0.14);
}

.provider-config-card.is-readonly .provider-config-name::after {
  content: " · SYSTEM";
  color: var(--amber);
  font-size: 0.78rem;
  font-family: "JetBrains Mono", monospace;
}

@keyframes button-loading-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes button-loading-breathe {
  0%,
  100% {
    transform: translateY(0);
    box-shadow:
      0 0 0 1px rgba(126, 247, 255, 0.1),
      0 14px 36px rgba(15, 55, 102, 0.26);
  }
  50% {
    transform: translateY(-1px);
    box-shadow:
      0 0 0 1px rgba(126, 247, 255, 0.18),
      0 20px 42px rgba(15, 78, 144, 0.32);
  }
}

@keyframes button-loading-scan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes pending-glow-pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 0.92;
  }
}

@keyframes pending-border-wave {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.02);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes result-orbit-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes result-loading-slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(380%);
  }
}

@media (max-width: 1180px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .workspace-main {
    height: auto;
    min-height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .result-loading-timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .clone-workspace-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .image-compose-panel {
    --image-compose-height: 128px;
    --image-upload-width: 106px;
    --image-upload-height: 92px;
  }

  .image-count-indicator,
  .image-submit-button {
    justify-self: end;
  }

  .clone-workspace-layout .clone-control-panel,
  .clone-workspace-layout .advanced-settings-panel,
  .clone-workspace-layout .clone-results-panel {
    max-width: none;
    height: auto;
    overflow: visible;
  }

  .admin-console-layout {
    grid-template-columns: 1fr;
  }

  .admin-main-panels {
    grid-template-columns: minmax(280px, 0.84fr) minmax(0, 1.16fr);
    min-height: auto;
  }

  .workspace-sidebar {
    position: relative;
    top: 0;
    min-height: auto;
  }

  .admin-right-sidebar {
    grid-column: 1 / -1;
    position: relative;
    top: 0;
    min-height: auto;
    height: auto;
    width: 100%;
  }

  .admin-model-route-grid {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-header-actions {
    justify-content: stretch;
  }

  .control-panel,
  .sidebar-stack {
    grid-column: span 12;
  }

  .admin-usage-panel,
  .model-config-grid .model-config-panel,
  .model-config-help,
  .model-provider-admin-grid .provider-create-panel,
  .model-provider-admin-grid .provider-library-panel {
    grid-column: span 12;
  }

  .sidebar-stack {
    height: auto;
    grid-template-rows: none;
  }

  .projects-panel .list-column,
  .pipelines-panel .list-column,
  .admin-users-panel .admin-list,
  .admin-usage-panel .admin-list {
    overflow: visible;
    padding-right: 0;
  }

  .metrics {
    --metrics-gap: 14px;
  }

  .metric-card {
    padding: 18px;
  }

  .metric-label {
    font-size: 0.72rem;
  }

  .metric-value {
    margin-top: 10px;
    font-size: clamp(0.84rem, 1.45vw, 1.18rem);
  }

  .metric-mini {
    font-size: clamp(0.72rem, 1.08vw, 0.9rem);
  }

  .metric-foot {
    margin-top: 6px;
    font-size: 0.56rem;
  }

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

  .mode-switcher-grid,
  .flow-guide-grid,
  .advanced-settings-body,
  .reference-analysis-grid,
  .product-reference-layout,
  .step-routing-list,
  .provider-config-grid {
    grid-template-columns: 1fr;
  }

  .analysis-status-button {
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
  }

  .analysis-status-meta {
    max-width: none;
    text-align: right;
  }

  .mode-flow-diagram-clone,
  .mode-flow-diagram-benchmark {
    grid-template-columns: 1fr;
  }

  .benchmark-start,
  .benchmark-arrow-a,
  .benchmark-input,
  .benchmark-branch-head,
  .benchmark-branch-tail,
  .benchmark-arrow-b,
  .benchmark-params,
  .benchmark-arrow-c,
  .benchmark-video {
    grid-column: auto;
    grid-row: auto;
  }

  .benchmark-branch {
    grid-template-columns: 44px minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  .app-shell {
    padding: 18px;
  }

  body.sidebar-drawer-open {
    overflow: hidden;
  }

  .result-loading-timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .clone-workspace-layout {
    grid-template-columns: 1fr;
  }

  .admin-console-layout {
    grid-template-columns: 1fr;
  }

  .admin-main-panels {
    grid-template-columns: 1fr;
  }

  .admin-model-row {
    grid-template-columns: 1fr;
  }

  .admin-model-row-remove {
    width: 100%;
  }

  .workspace-app-shell {
    padding: 14px;
  }

  .workspace-layout {
    gap: 14px;
    min-height: calc(100vh - 28px);
  }

  .workspace-sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 320px);
    height: 100dvh;
    min-height: 0;
    padding: 18px 16px;
    overflow-y: auto;
    border-radius: 0 24px 24px 0;
    background: rgba(6, 10, 18, 0.98);
    transform: translateX(calc(-100% - 18px));
    transition:
      transform 240ms ease,
      box-shadow 240ms ease;
  }

  body.sidebar-drawer-open .workspace-sidebar {
    transform: translateX(0);
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.52);
  }

  .mobile-sidebar-backdrop:not([hidden]) {
    display: block;
  }

  .workspace-sidebar,
  .workspace-header {
    border-radius: 24px;
  }

  .workspace-sidebar {
    border-radius: 0 24px 24px 0;
  }

  .workspace-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .workspace-header-actions {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    display: grid;
    grid-template-columns: repeat(5, 32px);
    grid-auto-flow: column;
    align-items: center;
    justify-items: center;
    align-content: center;
    justify-content: end;
    gap: 6px;
    width: 184px;
    flex-wrap: nowrap;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions a,
  .topbar-actions button,
  .topbar-status,
  .topbar-user {
    flex: 1 1 180px;
    text-align: center;
  }

  .workspace-header-actions .workspace-status-button,
  .workspace-header-actions .workspace-status-button.topbar-status-sync {
    display: inline-grid;
    place-items: center;
    width: 32px;
    min-width: 0;
    max-width: 32px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 32px;
    padding: 0;
    border-radius: 11px;
    font-size: 0;
    line-height: 1;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    align-self: center;
    justify-self: center;
  }

  .workspace-header-actions .workspace-status-button span,
  .workspace-header-actions .workspace-status-button strong {
    display: none;
  }

  .workspace-header-actions .workspace-status-button::before {
    content: "";
    display: block;
    width: 15px;
    height: 15px;
    background: var(--text);
    mask: var(--mobile-status-icon) center / contain no-repeat;
    -webkit-mask: var(--mobile-status-icon) center / contain no-repeat;
  }

  .workspace-header-actions .workspace-status-button[data-status-detail="providers"] {
    --mobile-status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h7v7H4V4Zm9 0h7v7h-7V4ZM4 13h7v7H4v-7Zm9 0h7v7h-7v-7Z'/%3E%3C/svg%3E");
  }

  .workspace-header-actions .workspace-status-button[data-status-detail="latest"] {
    --mobile-status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm1 5h-2v5l4 3 1.2-1.6-3.2-2.4V8Z' clip-rule='evenodd'/%3E%3C/svg%3E");
  }

  .workspace-header-actions .workspace-status-button[data-status-detail="user"] {
    --mobile-status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8a7 7 0 0 1 14 0v1H5v-1Z'/%3E%3C/svg%3E");
  }

  .workspace-header-actions .workspace-status-button[data-status-detail="sync"] {
    --mobile-status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7.4 7H14a4 4 0 0 1 3.6 2.25l1.8-.88A6 6 0 0 0 14 5H7.4l2.3-2.3L8.3 1.3 3.6 6l4.7 4.7 1.4-1.4L7.4 7Zm9.2 10H10a4 4 0 0 1-3.6-2.25l-1.8.88A6 6 0 0 0 10 19h6.6l-2.3 2.3 1.4 1.4 4.7-4.7-4.7-4.7-1.4 1.4 2.3 2.3Z'/%3E%3C/svg%3E");
  }

  .workspace-header-actions .workspace-status-button[data-status-detail="refresh"] {
    --mobile-status-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.65 6.35A7.95 7.95 0 0 0 12 4a8 8 0 1 0 7.45 5.06l-1.9.62A6 6 0 1 1 12 6c1.65 0 3.14.67 4.22 1.76L13 11h8V3l-3.35 3.35Z'/%3E%3C/svg%3E");
  }

  .workspace-header-actions #refresh-dashboard::before {
    background: var(--amber);
  }

  .workspace-header-copy .section-kicker,
  .workspace-header h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-nav-item,
  .sidebar-link {
    padding: 12px;
  }

  .field-label-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-action-row {
    grid-template-columns: 1fr;
  }

  .image-count-control {
    width: 100%;
    grid-template-columns: 1fr auto;
  }

  .image-count-control strong {
    text-align: left;
  }

  .image-workspace {
    margin-top: 0;
    min-height: auto;
  }

  .image-studio-shell {
    gap: 16px;
    padding: 4px 0 20px;
  }

  .image-studio-title {
    text-align: center;
    gap: 6px;
  }

  .image-studio-title .section-kicker {
    justify-self: center;
  }

  .image-compose-panel {
    --image-compose-height: 132px;
    --image-upload-width: 104px;
    --image-upload-height: 90px;
    padding: 14px;
    border-radius: 22px;
  }

  .image-compose-input {
    grid-template-columns: var(--image-upload-width) minmax(0, 1fr) 64px;
    gap: 12px;
  }

  .image-reference-picker {
    grid-column: 1;
    grid-row: 1;
    width: var(--image-upload-width);
    min-width: var(--image-upload-width);
    max-width: var(--image-upload-width);
    height: var(--image-upload-height);
    min-height: var(--image-upload-height);
    max-height: var(--image-upload-height);
  }

  .image-prompt-shell {
    grid-column: 1 / -1;
    grid-row: 2;
    height: var(--image-compose-height);
    min-height: var(--image-compose-height);
    max-height: var(--image-compose-height);
  }

  .image-count-indicator {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
  }

  .image-reference-strip {
    gap: 8px;
    padding-bottom: 6px;
  }

  .image-reference-card {
    flex-basis: 104px;
    width: 104px;
    min-height: 128px;
  }

  .image-reference-card img {
    height: 82px;
  }

  .image-reference-card-index {
    top: 54px;
  }

  .image-submit-button {
    grid-column: 3;
    grid-row: 1;
    width: 64px;
    justify-self: end;
  }

  .image-compose-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-reference-mention-menu {
    left: 12px;
    right: 12px;
    grid-template-columns: 1fr;
  }

  .image-tool-button,
  .image-tool-control,
  .image-count-control {
    width: 100%;
    min-width: 0;
  }

  .image-tool-control {
    grid-template-columns: minmax(68px, auto) minmax(0, 1fr);
  }

  .image-tool-control select {
    width: 100%;
  }

  .image-count-control {
    grid-column: 1 / -1;
  }

  .image-count-control input {
    width: 100%;
  }

  .image-studio-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .image-guide-button {
    text-align: left;
  }

  .image-generation-results {
    grid-template-columns: 1fr;
  }

  .neon-hover-field,
  .neon-hover-shell {
    border-radius: 22px;
  }

  .metric-card {
    padding: 12px;
    border-radius: 20px;
  }

  .metric-label {
    font-size: 0.62rem;
  }

  .metric-value {
    margin-top: 8px;
    font-size: clamp(0.68rem, 1.9vw, 0.9rem);
  }

  .metric-mini {
    font-size: clamp(0.64rem, 1.7vw, 0.82rem);
  }

  .metric-foot {
    margin-top: 5px;
    font-size: 0.5rem;
    line-height: 1.3;
  }

  .workflow-track,
  .control-form,
  .results-grid,
  .result-feature-header,
  .admin-user-row,
  .usage-record-row,
  .flow-guide-grid,
  .advanced-settings-body,
  .routing-step-fields,
  .provider-config-grid {
    grid-template-columns: 1fr;
  }

  .result-feature-header,
  .panel-header,
  .modal-header,
  .form-section-header,
  .routing-step-head,
  .provider-config-header {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-flow-arrow {
    transform: rotate(90deg);
  }

  .results-header-actions,
  .result-feature-actions,
  .provider-config-actions {
    justify-content: stretch;
  }

  .project-list-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-row-time {
    text-align: left;
  }

  .results-header-actions button,
  .result-feature-actions button,
  .modal-close {
    width: 100%;
  }

  .admin-user-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .creative-mode-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-shell {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 12px;
  }

  .auth-shell {
    align-items: flex-start;
  }

  .auth-panel {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .auth-brand-lockup {
    gap: 12px;
  }

  .auth-brand-lockup .brand-logo {
    width: 82px;
    height: 82px;
  }

  .auth-mode-switch {
    gap: 8px;
  }

  .auth-mode-button {
    min-height: 44px;
    padding: 10px 12px;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .topbar h1 {
    font-size: 1.72rem;
  }

  .topbar-actions {
    gap: 8px;
  }

  .workspace-app-shell {
    padding: 10px;
  }

  .workspace-layout {
    gap: 10px;
    min-height: calc(100vh - 20px);
  }

  .workspace-sidebar {
    padding: 14px;
    border-radius: 0 20px 20px 0;
  }

  .workspace-sidebar-top {
    gap: 16px;
  }

  .sidebar-brand-lockup .brand-logo {
    width: 42px;
    height: 42px;
  }

  .sidebar-brand-lockup {
    align-items: center;
    min-height: 54px;
  }

  .sidebar-brand-lockup > div {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 42px;
  }

  .sidebar-brand-lockup .eyebrow {
    line-height: 1;
  }

  .sidebar-title {
    margin: 0;
    font-size: 1rem;
  }

  .sidebar-nav {
    gap: 10px;
  }

  .sidebar-nav-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sidebar-nav .sidebar-nav-group:first-child {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar .sidebar-section-kicker {
    grid-column: 1 / -1;
    margin: 0;
  }

  .sidebar-nav-item,
  .sidebar-link {
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px;
    border-radius: 13px;
    gap: 8px;
  }

  .sidebar-list-trigger {
    grid-column: auto;
  }

  .sidebar-nav-copy {
    min-width: 0;
  }

  .sidebar-nav-copy strong {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .sidebar-nav-badge {
    min-width: 28px;
    min-height: 28px;
    padding: 5px 7px;
    border-radius: 10px;
  }

  .workspace-sidebar-footer {
    margin-top: 0;
    gap: 10px;
  }

  .sidebar-version {
    padding: 5px 9px;
    font-size: 0.68rem;
  }

  .sidebar-action-button {
    min-height: 44px;
  }

  .workspace-header {
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
  }

  .workspace-header h2 {
    font-size: 1.55rem;
  }

  .workspace-header-actions {
    display: grid;
    grid-template-columns: repeat(5, 28px);
    grid-auto-flow: column;
    align-items: center;
    justify-items: center;
    align-content: center;
    justify-content: end;
    gap: 5px;
    width: 160px;
  }

  .workspace-header-actions .workspace-status-button,
  .workspace-header-actions .workspace-status-button.topbar-status-sync {
    width: 28px;
    min-width: 0;
    max-width: 28px;
    height: 28px;
    min-height: 28px;
    flex: 0 0 28px;
    padding: 0;
    border-radius: 10px;
    box-sizing: border-box;
    align-self: center;
    justify-self: center;
  }

  .topbar-status-sync,
  .topbar-fabric-status {
    min-width: 0;
    max-width: none;
    width: auto;
    flex: none;
  }

  .topbar-user {
    justify-content: center;
    white-space: normal;
  }

  .workspace-header-actions .workspace-status-button::before {
    width: 14px;
    height: 14px;
  }

  .panel,
  .image-compose-panel {
    border-radius: 20px;
  }

  .control-panel,
  .projects-panel,
  .pipelines-panel,
  .results-panel,
  .admin-form-panel,
  .admin-users-panel,
  .admin-usage-panel,
  .model-config-panel,
  .model-config-help {
    padding: 16px;
  }

  .content-grid,
  .metrics {
    gap: 12px;
  }

  .metric-card {
    min-width: 148px;
  }

  .image-studio-title h3 {
    font-size: 1.7rem;
  }

  .image-compose-panel {
    --image-compose-height: 148px;
    --image-upload-width: 96px;
    --image-upload-height: 84px;
  }

  .image-upload-tile {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 8px 7px;
  }

  .image-reference-clear {
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
  }

  .image-upload-tile small {
    max-width: 74px;
  }

  .image-prompt-shell {
    height: var(--image-compose-height);
    min-height: var(--image-compose-height);
    max-height: var(--image-compose-height);
  }

  .image-compose-input textarea {
    font-size: 1rem;
  }

  .image-compose-toolbar {
    grid-template-columns: 1fr;
  }

  .image-tool-control {
    grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  }

  .image-studio-meta {
    font-size: 0.88rem;
  }

  .admin-console-layout,
  .admin-main-panels {
    gap: 12px;
  }

  .admin-right-sidebar {
    width: 100%;
    padding: 14px;
  }

  .admin-model-modal-card {
    max-width: calc(100vw - 20px);
  }

  .modal-shell {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }

  .modal-header {
    padding: 18px 18px 0;
  }

  .modal-content,
  .modal-list-content {
    padding: 16px 18px 18px;
    max-height: calc(100dvh - 118px);
  }

  .image-original-actions .image-download-button {
    width: 100%;
  }

  .admin-model-route-grid,
  .admin-model-row {
    grid-template-columns: 1fr;
  }

  .admin-model-row-remove {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .advanced-settings-panel .advanced-settings-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle),
  .advanced-settings-panel .provider-toggle {
    min-height: 84px;
    padding: 10px;
  }

  .advanced-settings-panel .advanced-settings-body .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  .advanced-settings-panel .advanced-settings-body {
    gap: 10px;
  }

  .advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle) input,
  .advanced-settings-panel .advanced-settings-body > label:not(.wide):not(.provider-toggle) select {
    padding-inline: 8px;
  }
}
