/* Apolo Video Compressor — Binance design system adaptation
   Source: binance/DESIGN.md
   Dark canvas + yellow primary CTAs + trading green/red semantics
   Type: Inter (Nova) · IBM Plex Sans (Plex numbers)
*/

:root {
  /* Brand */
  --primary: #fcd535;
  --primary-active: #f0b90b;
  --primary-disabled: #3a3a1f;
  --on-primary: #181a20;
  --on-dark: #ffffff;

  /* Surfaces dark */
  --canvas: #0b0e11;
  --surface: #1e2329;
  --surface-2: #2b3139;
  --hairline: #2b3139;

  /* Text */
  --ink: #181a20;
  --body: #eaecef;
  --muted: #707a8a;
  --muted-strong: #929aa5;

  /* Semantics */
  --up: #0ecb81;
  --down: #f6465d;
  --info: #3b82f6;
  --info-ring: rgba(59, 130, 246, 0.45);

  /* Light footer */
  --footer-bg: #fafafa;
  --footer-ink: #181a20;

  /* Shape */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 9999px;

  /* Space (4px grid) */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "IBM Plex Sans", "Inter", sans-serif;

  --control-h: 40px;
  --nav-h: 64px;
  --max: 1280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Flat canvas — no atmospheric mesh (Binance Do's) */
.atmosphere {
  display: none;
}

/* ─── Routing visibility (display:* overrides bare [hidden]) ─── */
[hidden],
.auth-screen[hidden],
.app-shell[hidden],
.encode-overlay[hidden],
.page-loader[hidden],
.auth-form[hidden],
.auth-tab-panel[hidden] {
  display: none !important;
}

body.route-auth .view-app {
  display: none !important;
}

body.route-app .view-auth {
  display: none !important;
}

body.route-boot .view-auth,
body.route-boot .view-app {
  visibility: hidden;
}

body.is-encoding {
  overflow: hidden;
}

/* ─── Page / encode loaders ─── */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(11, 14, 17, 0.92);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-card {
  text-align: center;
  padding: 28px 32px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--hairline);
  min-width: min(280px, 90vw);
}

.page-loader-ring {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--hairline);
  border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
}

.page-loader-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
}

.page-loader-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.encode-overlay {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: grid;
  place-items: center;
  background: rgba(11, 14, 17, 0.78);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}

.encode-overlay-card {
  width: min(360px, 92vw);
  padding: 28px 24px 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--hairline);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  animation: pop-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.encode-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 36px;
  margin-bottom: 16px;
}

.encode-bars span {
  width: 6px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  animation: bar-pulse 0.9s ease-in-out infinite;
}

.encode-bars span:nth-child(1) {
  height: 40%;
  animation-delay: 0s;
}
.encode-bars span:nth-child(2) {
  height: 70%;
  animation-delay: 0.1s;
}
.encode-bars span:nth-child(3) {
  height: 100%;
  animation-delay: 0.2s;
}
.encode-bars span:nth-child(4) {
  height: 55%;
  animation-delay: 0.3s;
}
.encode-bars span:nth-child(5) {
  height: 80%;
  animation-delay: 0.4s;
}

.encode-overlay-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
}

.encode-overlay-sub {
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.encode-progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
}

.encode-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.35s ease;
}

.encode-progress-meta {
  margin: 10px 0 0;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bar-pulse {
  0%,
  100% {
    transform: scaleY(0.55);
    opacity: 0.65;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════ APP SHELL ═══════════ */
.app-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: var(--s-md) 0 var(--s-xl);
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  animation: slide-up 0.35s ease both;
}

body.route-app .app-shell {
  animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ═══════════ TOP NAV ═══════════ */
.topbar,
.top-nav-dark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  min-height: var(--nav-h);
  padding: var(--s-sm) 0;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.brand-block {
  min-width: 0;
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Shared Apolo + SSF logo pair (login, register, app) */
.brand-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-item--link {
  text-decoration: none;
  border-radius: 50%;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.brand-logo-item--link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.brand-logo-item--link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.brand-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

/* Same box size for both logos */
.brand-logos--lg .brand-logo--apolo,
.brand-logos--lg .brand-logo--ssf {
  width: 56px;
  height: 56px;
}

.brand-logos--sm .brand-logo--apolo,
.brand-logos--sm .brand-logo--ssf {
  width: 44px;
  height: 44px;
}

.brand-logo--apolo {
  border-radius: 50%;
  background: #071018;
  box-shadow: 0 0 0 1px rgba(234, 236, 239, 0.08);
}

.brand-logo--ssf {
  border-radius: 0;
  background: transparent;
}

.auth-hero-top .brand-logos {
  margin: 0 0 18px;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--on-dark);
  letter-spacing: 0;
}

.brand-text h1::first-letter {
  /* no special */
}

.tagline {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 48ch;
}

.topbar-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-xs);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-strong);
  font-family: var(--font-num);
}

.status-chip.soft {
  color: var(--up);
  border-color: rgba(14, 203, 129, 0.35);
}

.led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.led.ok {
  background: var(--up);
}

.led.err {
  background: var(--down);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn-icon:hover,
.btn-icon[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 4px 6px 4px 4px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-primary);
  background: var(--primary);
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-num);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════ GUIDE RAIL ═══════════ */
.guide-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-sm);
}

.guide-rail.is-hidden {
  display: none;
}

.info-card,
.trust-badge {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.info-card.tip {
  border-color: rgba(252, 213, 53, 0.35);
}

.info-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  color: var(--on-primary);
  background: var(--primary);
}

.info-icon.tip-icon {
  background: var(--surface-2);
  color: var(--primary);
  border: 1px solid var(--hairline);
}

.info-card h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-dark);
  line-height: 1.3;
}

.info-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ═══════════ TABS ═══════════ */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  width: fit-content;
  max-width: 100%;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted-strong);
  border-radius: var(--r-md);
  min-height: 36px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--on-dark);
}

.tab.active {
  color: var(--on-primary);
  background: var(--primary);
  font-weight: 600;
}

.tab-count {
  font-family: var(--font-num);
  font-size: 12px;
  margin-left: 4px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: slide-up 0.28s ease both;
}

.btn,
.preset-card,
.check-row,
.info-card,
.job-card {
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.preset-card:hover,
.info-card:hover,
.job-card:hover {
  transform: translateY(-1px);
}

.btn-primary:not(:disabled):active {
  transform: scale(0.98);
}

/* ═══════════ WORKSPACE ═══════════ */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: var(--s-md);
  align-items: start;
}

.col-main,
.col-side {
  display: grid;
  gap: var(--s-md);
  min-width: 0;
}

.sticky-panel {
  position: sticky;
  top: var(--s-sm);
}

/* Cards */
.panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-sm);
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-dark);
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  font-family: var(--font-num);
}

.panel-body {
  padding: var(--s-md);
}

/* Dropzone */
.dropzone {
  position: relative;
  min-height: 160px;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.dragover {
  border-color: var(--primary);
  border-style: solid;
  background: rgba(252, 213, 53, 0.06);
}

.dropzone.has-files {
  min-height: auto;
  border-style: solid;
  background: #181a20;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.drop-idle {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px 16px;
  cursor: pointer;
  min-height: 160px;
}

.drop-visual {
  margin-bottom: 10px;
}

.drop-play {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--primary);
  font-size: 14px;
}

.drop-idle h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
}

.drop-idle p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.drop-idle .hint {
  margin-top: 10px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.file-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.file-chip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background: var(--canvas);
  border: 1px solid var(--hairline);
}

.file-chip strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
  color: var(--body);
}

.file-chip span {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--muted);
}

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

/* Presets */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.preset-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--body);
  border-radius: var(--r-lg);
  padding: 12px;
  cursor: pointer;
  font: inherit;
  min-height: 72px;
}

.preset-card:hover {
  border-color: var(--muted);
}

.preset-card.active {
  border-color: var(--primary);
  background: rgba(252, 213, 53, 0.08);
}

.preset-card .plabel {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark);
  margin-bottom: 4px;
}

.preset-card .pdesc {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* Fields */
.fields {
  display: grid;
  gap: 14px;
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.field label strong {
  color: var(--muted-strong);
  font-weight: 500;
}

.field .value {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

.help-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: help;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.help-dot:hover {
  border-color: var(--primary);
  color: var(--primary);
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  height: var(--control-h);
  appearance: none;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--body);
  padding: 0 14px;
  font-family: var(--font);
  font-size: 14px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23707a8a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

select:hover,
input:hover {
  border-color: #474d57;
}

select:focus-visible,
input:focus-visible,
.btn:focus-visible,
.tab:focus-visible,
.btn-ghost:focus-visible,
.btn-icon:focus-visible,
.preset-card:focus-visible,
.auth-tab:focus-visible,
.auth-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--info-ring);
  border-color: var(--info);
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--up), var(--primary) 55%, var(--down));
  border: none;
  padding: 0;
  height: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--on-primary);
  cursor: pointer;
}

.crf-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--muted);
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  cursor: pointer;
  font-size: 13px;
}

.check-row:hover {
  border-color: #474d57;
}

.check-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.check-row input {
  width: auto;
  height: auto;
  margin-top: 2px;
  accent-color: var(--primary);
}

/* Buttons — Binance yellow + black text */
.actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: var(--r-md);
  min-height: 40px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.12s;
}

.btn:disabled {
  background: var(--primary-disabled) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  opacity: 1;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:not(:disabled):hover {
  background: var(--primary-active);
}

.btn-shine {
  display: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--on-dark);
  border: 1px solid var(--hairline);
}

.btn-secondary:not(:disabled):hover {
  background: var(--surface-2);
}

.btn-ghost,
.btn-label {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted-strong);
  border-radius: var(--r-md);
  min-height: 32px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-ghost:hover,
.btn-label:hover {
  color: var(--on-dark);
  border-color: var(--muted);
}

.btn-sm {
  min-height: 28px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--body);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm.ok {
  color: var(--up);
  border-color: rgba(14, 203, 129, 0.4);
}

.btn-sm.danger {
  color: var(--down);
  border-color: rgba(246, 70, 93, 0.4);
}

/* Jobs */
.job-list {
  display: grid;
  gap: 10px;
}

.job-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  align-items: start;
}

.job-card--error {
  border-color: rgba(246, 70, 93, 0.35);
  background: rgba(246, 70, 93, 0.04);
}

.job-thumb {
  width: 64px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: #000;
  border: 1px solid var(--hairline);
}

.job-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-num);
}

.job-main {
  min-width: 0;
}

.job-main h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-main .meta {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Error message: horizontal wrap, never vertical glyph column */
.job-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(246, 70, 93, 0.35);
  background: rgba(246, 70, 93, 0.1);
  color: #f7a0ab;
  max-width: 100%;
  min-width: 0;
}

.job-error-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffb3bc;
}

.job-error-msg {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #f7a0ab;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.job-error-details {
  margin-top: 8px;
}

.job-error-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-strong);
  user-select: none;
}

.job-error-details summary:hover {
  color: var(--body);
}

.job-error-log {
  margin: 8px 0 0;
  padding: 8px 10px;
  max-height: 120px;
  overflow: auto;
  border-radius: var(--r-sm);
  background: rgba(11, 14, 17, 0.65);
  border: 1px solid var(--hairline);
  font-family: var(--font-num), ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.job-status {
  display: inline-flex;
  margin-top: 4px;
  font-size: 11px;
  font-family: var(--font-num);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.job-status.done {
  color: var(--up);
}
.job-status.error {
  color: var(--down);
}
.job-status.running {
  color: var(--primary);
}

.progress-track {
  height: 3px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.2s;
}

.job-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 96px;
  max-width: 140px;
}

.meter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.meter-box {
  padding: 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  text-align: center;
}

.meter-box .label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.meter-box .size {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
}

.meter-arrow {
  color: var(--primary);
  font-family: var(--font-num);
}

.savings {
  text-align: center;
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(14, 203, 129, 0.08);
  border: 1px solid rgba(14, 203, 129, 0.25);
  margin-bottom: 8px;
}

.savings .big {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  color: var(--up);
  line-height: 1.15;
}

.savings .sub {
  font-size: 12px;
  color: var(--muted);
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}

.detail-list .k {
  color: var(--muted);
}
.detail-list .v {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  color: var(--body);
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
  opacity: 0.85;
}

.empty-orbit {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
}

/* Guide */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-md);
}

.guide-card {
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.guide-card.tip {
  border-color: rgba(252, 213, 53, 0.4);
}

.guide-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-dark);
}

.guide-card p,
.guide-card li {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.guide-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.guide-card code {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--primary);
}

.api-docs p {
  color: var(--muted);
  margin-top: 0;
  font-size: 14px;
}

.code-block {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  overflow: auto;
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--body);
  line-height: 1.5;
}

.alert {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert.show {
  display: block;
}

.alert.error {
  background: rgba(246, 70, 93, 0.1);
  border: 1px solid rgba(246, 70, 93, 0.35);
  color: #f7a0ab;
}

.alert.info {
  background: rgba(252, 213, 53, 0.08);
  border: 1px solid rgba(252, 213, 53, 0.3);
  color: #f5e6a3;
}

.alert.ok {
  background: rgba(14, 203, 129, 0.1);
  border: 1px solid rgba(14, 203, 129, 0.3);
  color: #7ee0b5;
}

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 2100;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--body);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  transform: translate(-50%, -100%) translateY(-4px) scale(0.96);
  opacity: 0;
  transition:
    opacity 0.16s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.tooltip.show {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-10px) scale(1);
}

.tooltip.tooltip-below {
  transform: translate(-50%, 8px) scale(0.96);
}

.tooltip.tooltip-below.show {
  transform: translate(-50%, 12px) scale(1);
}

.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: var(--surface-2);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  transform: translateX(-50%) rotate(45deg);
}

.tooltip.tooltip-below::after {
  bottom: auto;
  top: -5px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid var(--hairline);
  border-top: 1px solid var(--hairline);
}

/* ═══════════ FOOTER — dark Binance system (matches app) ═══════════ */
.foot,
.footer-light,
.site-footer {
  margin: var(--s-xl) 0 0;
  width: 100%;
  background: var(--surface);
  color: var(--body);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  color-scheme: dark;
}

.footer-inner {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  padding: 24px 16px;
}

.footer-brand {
  font-weight: 600;
  color: var(--on-dark);
}

.foot .dot {
  opacity: 0.4;
}

.site-footer-inner {
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.site-footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(0, 2.2fr);
  gap: 32px 40px;
  padding-bottom: 24px;
}

.site-footer-brand {
  min-width: 0;
}

.site-footer-logos {
  margin: 0 0 14px;
}

.site-footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
}

.site-footer-brand-link:hover .site-footer-product {
  color: var(--primary);
}

.site-footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-footer-product {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--on-dark);
  line-height: 1.25;
  transition: color 0.15s ease;
}

.site-footer-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.site-footer-tag {
  margin: 0 0 14px;
  max-width: 36ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted-strong);
}

.site-footer-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted-strong);
  white-space: nowrap;
}

.site-footer-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.site-footer-badge[data-tone="ok"] {
  background: rgba(14, 203, 129, 0.08);
  border-color: rgba(14, 203, 129, 0.28);
  color: #7ee0b5;
}

.site-footer-badge[data-tone="ok"] .site-footer-badge-dot {
  background: var(--up);
  box-shadow: 0 0 0 2px rgba(14, 203, 129, 0.2);
}

.site-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  min-width: 0;
}

.site-footer-col h3 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  transition: color 0.12s ease;
}

.site-footer-col a:hover {
  color: var(--primary);
}

.site-footer-col a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-footer-ext {
  font-size: 11px;
  opacity: 0.45;
  font-weight: 400;
}

.site-footer-col a:hover .site-footer-ext {
  opacity: 0.85;
}

.site-footer-muted {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 18ch;
}

.site-footer-muted-sm {
  font-size: 12px !important;
  color: var(--muted) !important;
  font-weight: 400 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 20ch;
}

.site-footer-form {
  margin: 0;
  display: inline;
}

.site-footer-linkbtn {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  cursor: pointer;
  text-align: left;
  transition: color 0.12s ease;
}

.site-footer-linkbtn:hover {
  color: var(--down);
}

.site-footer-linkbtn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-footer-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  color: var(--muted-strong);
  font-size: 12px;
}

.site-footer-credit p {
  margin: 0;
}

.site-footer-credit a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.site-footer-credit a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-credit-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--muted);
}

.site-footer-bottom-left,
.site-footer-bottom-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.site-footer-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  opacity: 0.6;
}

.site-footer-stack {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.foot:not(.site-footer),
.footer-light:not(.site-footer) {
  padding: 24px 16px;
}

/* SSF watermark */
.ssf-watermark {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  display: inline-flex;
  padding: 6px 8px;
  border-radius: var(--r-md);
  background: rgba(11, 14, 17, 0.85);
  border: 1px solid var(--hairline);
  opacity: 0.7;
  text-decoration: none;
}

.ssf-watermark:hover {
  opacity: 1;
}

.ssf-watermark img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 36px;
  object-fit: contain;
}

/* ═══════════ AUTH (Binance dark + yellow) ═══════════ */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--canvas);
  overflow: auto;
  animation: fade-in 0.25s ease;
}

.auth-shell {
  width: min(960px, 100%);
  max-height: min(92vh, 740px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
}

.auth-form[hidden],
.auth-tab-panel[hidden] {
  display: none !important;
}

.auth-tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.auth-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px 20px;
  background: var(--canvas);
  border-right: 1px solid var(--hairline);
  min-height: 0;
  overflow: auto;
}

.auth-credit-mark--ssf {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.auth-product-name {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.auth-hero-title {
  margin: 8px 0 0;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
  color: var(--on-dark);
}

.auth-hero-title em {
  font-style: normal;
  color: var(--primary);
}

.auth-hero-copy {
  margin: 12px 0 0;
  max-width: 36ch;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.5;
}

.auth-features {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.auth-features-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.auth-feature-list li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  align-items: start;
}

.auth-feature-dot {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.auth-feature-list strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark);
}

.auth-feature-list span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.auth-scope {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
}

.auth-scope span {
  flex: 1;
  border-radius: 1px 1px 0 0;
  background: var(--hairline);
  height: 40%;
}

.auth-scope span:nth-child(2) {
  height: 70%;
  background: var(--primary);
  opacity: 0.7;
}
.auth-scope span:nth-child(4) {
  height: 100%;
  background: var(--primary);
}

.auth-hero-foot {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-hero-foot-stack {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-credit {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.auth-credit--hero {
  justify-content: flex-start;
  text-align: left;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  color: var(--muted-strong);
}

.auth-credit-mark {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.9;
}

.auth-credit-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.auth-credit-link:hover {
  color: var(--primary-active);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-credit-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-form-foot .auth-credit {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  min-width: 0;
  min-height: 0;
  max-height: min(92vh, 740px);
  overflow: hidden;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: var(--canvas);
  border: 1px solid var(--hairline);
}

.auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted-strong);
  border-radius: var(--r-md);
  min-height: 36px;
  padding: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--on-primary);
  background: var(--primary);
  font-weight: 600;
}

.auth-panel-head {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.auth-panel-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--on-dark);
  line-height: 1.3;
}

.auth-panel-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.auth-form--login .auth-form-body,
.auth-form--register .auth-form-body {
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.auth-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-strong);
}

.auth-hint {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-num);
}

.auth-input {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font);
  font-size: 14px;
}

.auth-input::placeholder {
  color: #5e6673;
}

.auth-input:hover {
  border-color: #474d57;
}

.auth-input:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 2px var(--info-ring);
}

.auth-form-foot {
  flex-shrink: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-submit {
  width: 100%;
  min-height: 40px;
}

.auth-alert {
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  background: rgba(246, 70, 93, 0.1);
  border: 1px solid rgba(246, 70, 93, 0.35);
  color: #f7a0ab;
}

.auth-alert.ok {
  background: rgba(14, 203, 129, 0.1);
  border-color: rgba(14, 203, 129, 0.3);
  color: #7ee0b5;
}

.auth-foot {
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* ─── Advanced auth: ambient, float labels, motion ─── */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.45;
  animation: auth-orb-drift 14s ease-in-out infinite alternate;
}

.auth-bg-orb--a {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  top: -8%;
  left: -6%;
  background: radial-gradient(circle, rgba(252, 213, 53, 0.22), transparent 70%);
}

.auth-bg-orb--b {
  width: min(42vw, 380px);
  height: min(42vw, 380px);
  right: -4%;
  bottom: 5%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
  animation-delay: -4s;
  animation-duration: 18s;
}

.auth-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(234, 236, 239, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 236, 239, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.7;
}

.auth-screen > .auth-shell {
  position: relative;
  z-index: 1;
}

.auth-shell--enter {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  animation: auth-shell-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
  box-shadow:
    0 0 0 1px rgba(252, 213, 53, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.auth-shell--enter.is-ready {
  /* class hook for JS */
}

.auth-panel--glass {
  background: linear-gradient(165deg, rgba(30, 35, 41, 0.98), rgba(24, 28, 34, 0.96));
  backdrop-filter: blur(12px);
}

.auth-tabs {
  position: relative;
}

.auth-tab {
  position: relative;
  z-index: 1;
  text-decoration: none;
  text-align: center;
  transition: color 0.18s ease, transform 0.15s ease;
}

.auth-tab:hover:not(.active) {
  color: var(--body);
}

.auth-tab.active {
  color: var(--on-primary);
  background: transparent;
  font-weight: 600;
}

.auth-tab-ink {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: var(--r-md);
  background: var(--primary);
  box-shadow: 0 2px 12px rgba(252, 213, 53, 0.28);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tab-ink--right {
  transform: translateX(100%);
}

.auth-reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: auth-reveal-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

.auth-feature-item {
  opacity: 0;
  transform: translateX(-8px);
  animation: auth-reveal-up 0.45s ease forwards;
  animation-delay: var(--d, 0.3s);
}

.auth-feature-list li:hover .auth-feature-dot {
  box-shadow: 0 0 0 4px rgba(252, 213, 53, 0.18);
  transform: scale(1.15);
}

.auth-feature-dot {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Floating labels + icons */
.auth-form--enhanced .auth-field {
  gap: 6px;
}

.auth-field--float .auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field--float .auth-input-icon {
  position: absolute;
  left: 12px;
  z-index: 2;
  display: flex;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-field--float .auth-input {
  height: 48px;
  padding: 18px 44px 6px 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  color: var(--body);
  font-size: 14px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.auth-field--float .auth-input-wrap:not(:has(.auth-input-icon)) .auth-input {
  padding-left: 14px;
  padding-right: 14px;
}

.auth-field--float .auth-label {
  position: absolute;
  left: 40px;
  top: 50%;
  z-index: 2;
  margin: 0;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  pointer-events: none;
  transition:
    transform 0.16s ease,
    font-size 0.16s ease,
    color 0.16s ease,
    top 0.16s ease;
}

.auth-field--float .auth-input-wrap:not(:has(.auth-input-icon)) .auth-label {
  left: 14px;
}

.auth-field--float .auth-input:focus ~ .auth-label,
.auth-field--float .auth-input:not(:placeholder-shown) ~ .auth-label,
.auth-field--float .auth-input.is-filled ~ .auth-label,
.auth-field--float .auth-input-wrap:focus-within .auth-label {
  top: 10px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--primary);
}

.auth-field--float .auth-input {
  outline: none;
  border-color: var(--hairline);
}

.auth-field--float .auth-input:focus {
  border-color: rgba(252, 213, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(252, 213, 53, 0.12);
  background: #12161c;
}

.auth-field--float .auth-input-wrap:focus-within .auth-input-icon {
  color: var(--primary);
}

.auth-field--float .auth-input-wrap:has(.auth-pass-toggle) .auth-input {
  padding-right: 44px;
}

.auth-input-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(120deg, transparent, rgba(252, 213, 53, 0.15), transparent);
  transition: opacity 0.25s ease;
}

.auth-field--float .auth-input:focus ~ .auth-input-glow {
  opacity: 1;
  animation: auth-shine 1.2s ease;
}

.auth-pass-toggle {
  position: absolute;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-pass-toggle:hover {
  color: var(--primary);
  background: rgba(252, 213, 53, 0.08);
}

.auth-pass-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.auth-field-hint {
  margin: 0;
  padding-left: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* Password strength */
.auth-strength {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.auth-strength-track {
  height: 4px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
}

.auth-strength-bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--down);
  transition: width 0.25s ease, background 0.25s ease;
}

.auth-strength[data-tone="weak"] .auth-strength-bar {
  background: var(--down);
}
.auth-strength[data-tone="mid"] .auth-strength-bar {
  background: var(--primary);
}
.auth-strength[data-tone="good"] .auth-strength-bar,
.auth-strength[data-tone="strong"] .auth-strength-bar {
  background: var(--up);
}

.auth-strength-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-strong);
  font-family: var(--font-num);
}

.auth-strength[data-tone="weak"] .auth-strength-label {
  color: #f7a0ab;
}
.auth-strength[data-tone="mid"] .auth-strength-label {
  color: var(--primary);
}
.auth-strength[data-tone="good"] .auth-strength-label,
.auth-strength[data-tone="strong"] .auth-strength-label {
  color: #7ee0b5;
}

/* Submit loading */
.auth-submit {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:not(:disabled):hover {
  box-shadow: 0 6px 20px rgba(252, 213, 53, 0.28);
  transform: translateY(-1px);
}

.auth-submit:not(:disabled):active {
  transform: translateY(0) scale(0.98);
}

.auth-submit.is-loading {
  pointer-events: none;
  filter: saturate(0.85);
}

.auth-submit.is-loading .auth-submit-label {
  opacity: 0;
}

.auth-submit-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(24, 26, 32, 0.25);
  border-top-color: var(--on-primary);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.auth-submit.is-loading .auth-submit-spinner {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

.auth-alert--shake {
  animation: auth-shake 0.45s ease;
}

@keyframes auth-shell-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-reveal-up {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-orb-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(24px, 18px) scale(1.08);
  }
}

@keyframes auth-shine {
  from {
    opacity: 0;
    transform: translateX(-40%);
  }
  40% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(40%);
  }
}

@keyframes auth-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* ═══════════ TOASTS (app) ═══════════ */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 0 12px;
  align-items: start;
  padding: 12px 12px 12px 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  color: var(--body);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.is-leaving {
  animation: toast-out 0.28s ease forwards;
}

.toast-accent {
  width: 4px;
  align-self: stretch;
  border-radius: 4px 0 0 4px;
  background: var(--primary);
}

.toast--ok .toast-accent {
  background: var(--up);
}
.toast--error .toast-accent {
  background: var(--down);
}
.toast--info .toast-accent {
  background: var(--info);
}
.toast--warn .toast-accent {
  background: var(--primary);
}

.toast-body {
  min-width: 0;
  padding-top: 2px;
}

.toast-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-dark);
}

.toast-msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted-strong);
  word-break: break-word;
}

.toast-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.toast-close:hover {
  background: var(--surface-2);
  color: var(--on-dark);
}

.toast-progress {
  grid-column: 1 / -1;
  height: 2px;
  margin: 8px 12px 0 4px;
  border-radius: 1px;
  background: var(--hairline);
  overflow: hidden;
}

.toast-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--primary);
  transform-origin: left center;
  animation: toast-progress linear forwards;
}

.toast--ok .toast-progress > span {
  background: var(--up);
}
.toast--error .toast-progress > span {
  background: var(--down);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px) scale(0.96);
  }
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Legacy reveal class */
.reveal {
  opacity: 1;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }

  .guide-rail {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

@media (max-width: 800px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-height: none;
    max-width: 440px;
  }

  .auth-hero {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    max-height: none;
  }

  .auth-scope {
    display: none;
  }

  .auth-panel {
    max-height: none;
    overflow: visible;
  }

  .auth-form-body {
    overflow: visible;
  }

  .auth-hero-top .brand-logos {
    margin-bottom: 14px;
  }

  .brand-logos--lg .brand-logo--apolo,
  .brand-logos--lg .brand-logo--ssf {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 768px) {
  .app-shell {
    width: calc(100% - 24px);
    gap: 12px;
    padding-top: 12px;
  }

  .topbar {
    min-height: auto;
    align-items: flex-start;
  }

  .brand-block {
    width: 100%;
  }

  .brand-logos--sm .brand-logo--apolo,
  .brand-logos--sm .brand-logo--ssf {
    width: 40px;
    height: 40px;
  }

  .topbar-aside {
    width: 100%;
    justify-content: flex-start;
  }

  .user-meta {
    display: none;
  }

  .guide-rail {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .field-row,
  .checks,
  .actions {
    grid-template-columns: 1fr;
  }

  .job-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .job-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .foot,
  .footer-light {
    margin-top: 24px;
    padding: 20px 12px;
  }

  .site-footer {
    margin-top: 24px;
    border-radius: var(--r-lg);
  }

  .site-footer-inner {
    padding: 22px 16px 0;
  }

  .site-footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 20px;
  }

  .site-footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
  }

  .site-footer-tag {
    max-width: none;
  }

  .site-footer-credit {
    flex-wrap: wrap;
  }

  .site-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0 16px;
  }
}

@media (max-width: 520px) {
  .site-footer-cols {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer-product {
    font-size: 14px;
  }

  .site-footer-bottom-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-footer-bottom-left .site-footer-sep {
    display: none;
  }
}

@media (max-width: 420px) {
  .auth-field-row {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    padding: 12px;
  }

  .brand-text h1 {
    font-size: 18px;
  }
}

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

  .page-loader-ring,
  .encode-bars span {
    animation: none !important;
  }

  .auth-shell--enter,
  .auth-reveal,
  .auth-feature-item,
  .toast {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .auth-bg-orb {
    animation: none !important;
  }
}
