:root {
  --bg-deep: #0b1016;
  --bg-base: #121821;
  --bg-panel: rgba(21, 27, 35, 0.96);
  --bg-panel-soft: rgba(27, 34, 45, 0.86);
  --bg-elevated: rgba(34, 42, 55, 0.94);
  --bg-input: rgba(12, 16, 22, 0.98);
  --text-main: #e7ecf3;
  --text-muted: #b1bac5;
  --text-subtle: #7f8997;
  --line: rgba(150, 160, 172, 0.18);
  --line-strong: rgba(224, 169, 72, 0.34);
  --gold: #e0a948;
  --gold-bright: #f0bb61;
  --gold-soft: rgba(224, 169, 72, 0.12);
  --green: #89c7a6;
  --green-soft: rgba(137, 199, 166, 0.14);
  --red: #db7479;
  --red-soft: rgba(219, 116, 121, 0.14);
  --blue: #90a9d1;
  --blue-soft: rgba(144, 169, 209, 0.14);
  --shadow-lg: 0 22px 54px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.24);
  --display-font: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --body-font: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html {
  background: var(--bg-deep);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font: 15px/1.5 var(--body-font);
  background:
    radial-gradient(circle at top left, rgba(64, 75, 91, 0.14), transparent 25%),
    radial-gradient(circle at top right, rgba(224, 169, 72, 0.08), transparent 18%),
    linear-gradient(180deg, #121821 0%, #0b1016 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 72px 72px;
}

a { color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.08;
  color: var(--text-main);
  font-family: var(--display-font);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.35rem, 2vw, 1.95rem); }
h3 { font-size: 1.08rem; }

p { margin: 0; }

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

button,
summary,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
}

#app-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.portal-shell {
  position: relative;
}

.portal-backdrop {
  display: none;
}

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(22, 28, 36, 0.98), rgba(15, 20, 28, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.panel-ornate::before { content: none; }

.auth-layout {
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card,
.app-header,
.card,
.command-stage {
  padding: 24px;
}

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

.brand-lockup--svg {
  min-width: 0;
}

.brand-lockup--compact h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.4rem);
}

.brand-lockup h1 {
  display: flex;
  align-items: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  grid-template-columns: repeat(3, 8px);
  column-gap: 5px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 32% 32%, rgba(225, 175, 84, 0.34), transparent 44%),
    linear-gradient(180deg, rgba(44, 31, 20, 0.92), rgba(22, 26, 35, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 28px rgba(0,0,0,0.24);
}

.brand-mark span {
  display: block;
  width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-bright), rgba(225, 175, 84, 0.28));
}

.brand-mark span:nth-child(1) { height: 16px; }
.brand-mark span:nth-child(2) { height: 26px; }
.brand-mark span:nth-child(3) { height: 20px; }

.brand-wordmark {
  display: block;
}

.eyebrow,
.field-label,
.intro-label,
.identity-label,
.summary-hint {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-copy,
.section-copy,
.auth-subcopy,
.support-copy,
.destination-row-copy,
.provider-note,
.lock-note,
.thumbnail-note,
.meta-copy,
.summary-hint,
.empty-inline,
.empty-state-inline {
  color: var(--text-muted);
}

.hero-copy {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  max-width: 640px;
}

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

.intro-card,
.identity-card,
.stage-card,
.info-card,
.meta-card,
.metric-tile,
.destination-panel,
.provider-surface,
.studio-card,
.pairing-live-card,
.device-row,
.bulk-result {
  background: linear-gradient(180deg, rgba(34, 40, 52, 0.78), rgba(24, 28, 37, 0.88));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.intro-card {
  min-height: 132px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.auth-card {
  width: 100%;
  max-width: 428px;
  margin: auto;
  padding: 26px 24px 22px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(224, 169, 72, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(22, 28, 36, 0.98), rgba(15, 20, 28, 0.98));
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(224, 169, 72, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.auth-brand-mark .brand-logo {
  width: 22px;
  height: 22px;
}

.auth-brand-wordmark {
  height: 24px;
  max-width: 180px;
}

.auth-card-head {
  margin-bottom: 18px;
  text-align: center;
}

.auth-card-head h2 {
  margin: 8px 0 6px;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  letter-spacing: -0.03em;
}

.auth-subcopy {
  max-width: 28ch;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-methods {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 195, 144, 0.22), transparent);
}

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

.oauth-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(225, 175, 84, 0.12);
  border: 1px solid rgba(225, 175, 84, 0.24);
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 800;
}

.form-group {
  margin-bottom: 16px;
}

.auth-form .form-group {
  margin-bottom: 0;
}

.form-group label,
.field-shell > span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.87rem;
}

.form-control,
.select-shell select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 16, 23, 0.96), rgba(20, 25, 34, 0.96));
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.textarea-control {
  min-height: 112px;
  resize: vertical;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

.form-control:focus,
.select-shell select:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(225, 175, 84, 0.14);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--gold-bright), #cc963e);
  color: #16120a;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #f2ca79, #d29c45);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(225, 175, 84, 0.16), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn:disabled {
  opacity: 0.5;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  border-color: var(--line);
  box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(225, 175, 84, 0.08);
  border-color: var(--line-strong);
}

.btn-danger {
  background: linear-gradient(180deg, #cf747b, #9f3f47);
  color: #fff5f6;
}

.btn-auth0,
.btn-google,
.btn-block {
  width: 100%;
}

.btn-compact {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.auth-toggle-row {
  margin-top: 2px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

#auth-toggle-copy {
  margin-right: 6px;
}

.auth-toggle-row a {
  color: var(--gold);
  text-decoration: none;
}

.auth-toggle-row a:hover,
.auth-toggle-row a:focus-visible {
  text-decoration: underline;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 18px 24px;
}

.portal-app {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.app-sidebar {
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  position: sticky;
  top: 0;
  border-radius: 0;
  border-width: 0 1px 0 0;
}

.sidebar-top,
.sidebar-bottom,
.sidebar-nav,
.workspace-chip-copy,
.operator-copy,
.topbar-copy,
.overview-layout,
.encoder-rail,
.rail-card,
.rail-row,
.destination-row-head,
.destination-row-actions,
.overview-copy-row {
  display: grid;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}

.sidebar-brand-mark .brand-logo {
  width: 18px;
  height: 18px;
}

.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--display-font);
}

.workspace-chip,
.operator-card,
.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.workspace-chip-dot,
.status-dot,
.operator-avatar {
  flex: 0 0 auto;
}

.workspace-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 6px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(224, 169, 72, 0.1);
}

.sidebar-nav {
  gap: 6px;
}

.nav-link,
.mobile-nav-link {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-link:hover,
.nav-link:focus-visible,
.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  color: var(--text-main);
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
  outline: none;
}

.nav-link-active,
.mobile-nav-link-active {
  color: var(--text-main);
  background: rgba(255,255,255,0.04);
  border-color: rgba(224, 169, 72, 0.28);
  box-shadow: inset 2px 0 0 var(--gold);
}

.sidebar-note {
  flex-direction: column;
  align-items: stretch;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.sidebar-note strong {
  color: var(--text-main);
  font-size: 0.82rem;
}

.operator-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}

.app-main {
  min-width: 0;
  padding: 24px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 2px 18px;
}

.topbar-kicker,
.topbar-sync {
  color: var(--text-subtle);
  font-size: 0.84rem;
}

.topbar-copy {
  gap: 6px;
}

.topbar-copy h2 {
  font-size: clamp(1.625rem, 2vw, 1.875rem);
  font-weight: 600;
}

.topbar-subtitle {
  color: var(--text-muted);
  max-width: 58ch;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-nav {
  display: none;
  margin-bottom: 18px;
  padding: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.overview-layout {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}

.overview-main-card,
.encoder-rail {
  min-width: 0;
}

.overview-copy-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.overview-summary {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.header-meta,
.header-actions,
.hero-actions,
.panel-actions,
.panel-actions-wrap,
.provider-action-row,
.button-row,
.pairing-inline-form,
.destination-board-side,
.device-row-title,
.subscription-overview,
.summary-top,
.readiness-head,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-meta {
  gap: 16px;
  justify-content: flex-end;
  min-width: 0;
}

.header-actions {
  flex-shrink: 0;
}

.header-actions,
.hero-actions,
.panel-actions-wrap,
.provider-action-row,
.button-row,
.destination-board-side,
.modal-actions {
  flex-wrap: wrap;
}

.identity-card {
  min-width: 0;
  padding: 10px 12px;
}

.identity-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  overflow-wrap: anywhere;
}

.identity-row + .identity-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 195, 144, 0.12);
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.alert-danger {
  color: #f5c7c9;
  background: rgba(219, 116, 121, 0.12);
  border-color: rgba(219, 116, 121, 0.28);
}

.alert-success {
  color: #bee8cf;
  background: rgba(137, 199, 166, 0.12);
  border-color: rgba(137, 199, 166, 0.28);
}

.command-stage {
  margin-bottom: 24px;
  overflow: hidden;
  padding: 18px 20px;
}

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

.section-head--hero {
  margin-bottom: 12px;
}

.section-head-tight {
  margin-bottom: 14px;
}

.subscription-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}
.subscription-hero h3 { font-size: 1.4rem; margin-bottom: 8px; }
.billing-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.subscription-price-panel { display: grid; gap: 5px; text-align: right; }
.subscription-price-kicker, .subscription-price-note { color: var(--text-muted); font-size: 0.86rem; }
.subscription-price { color: var(--gold); font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.2; letter-spacing: -0.04em; }
#subscription-panel .metric-strip-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#subscription-panel .metric-tile { background: none; border: 0; border-radius: 0; padding: 12px 0; }
.billing-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 22px 0; border-block: 1px solid rgba(255,255,255,0.08); }
.billing-card { min-width: 0; }
.billing-card h3 { font-size: 1rem; margin: 5px 0 10px; }
.billing-card p { font-size: 0.9rem; line-height: 1.55; }
.billing-mini-note { margin-top: 10px; color: var(--text-muted); }
.billing-detail-list { display: grid; gap: 12px; }
.billing-detail-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; font-size: 0.88rem; line-height: 1.5; }
.billing-detail-row > span { color: var(--text-muted); }
.billing-detail-row > strong { font-weight: 500; }
.billing-return-notice > div:first-child { display: grid; gap: 5px; }
.billing-return-notice .panel-actions { margin-top: 12px; }
@media (max-width: 720px) {
  .subscription-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .subscription-price-panel { text-align: left; }
  .billing-card-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .billing-detail-row { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  #subscription-panel .metric-strip-3 { gap: 16px; grid-template-columns: minmax(0, 1fr); }
  #subscription-panel .metric-tile { display: flex; flex-direction: row; justify-content: space-between; gap: 16px; align-items: center; padding: 0; }
}

.command-copy {
  max-width: 70ch;
  margin-bottom: 18px;
}

.command-stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stage-card {
  position: relative;
  padding: 14px 14px 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  background: linear-gradient(180deg, rgba(29, 36, 47, 0.82), rgba(22, 27, 35, 0.96));
}

.stage-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.stage-dot-success { color: var(--green); }
.stage-dot-warning { color: var(--gold); }
.stage-dot-danger { color: var(--red); }
.stage-dot-muted { color: var(--text-subtle); }

.stage-card h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.stage-label {
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stage-card p:last-child {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.stage-card-success { box-shadow: inset 0 0 0 1px rgba(137, 199, 166, 0.18); }
.stage-card-warning { box-shadow: inset 0 0 0 1px rgba(225, 175, 84, 0.18); }
.stage-card-danger { box-shadow: inset 0 0 0 1px rgba(219, 116, 121, 0.18); }
.stage-card-muted { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }

.status-chip,
.meter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.2;
  white-space: normal;
}

.status-chip::before,
.meter-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.status-chip-success,
.meter-pill-success { color: var(--green); background: var(--green-soft); border-color: rgba(137, 199, 166, 0.24); }
.status-chip-warning,
.meter-pill-warning { color: var(--gold); background: var(--gold-soft); border-color: rgba(225, 175, 84, 0.24); }
.status-chip-danger,
.meter-pill-danger { color: var(--red); background: var(--red-soft); border-color: rgba(219, 116, 121, 0.24); }
.status-chip-muted,
.meter-pill-muted { color: var(--text-subtle); background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.07); }

.app-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.app-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.82fr);
  gap: 24px;
}

.secondary-stack,
.panel-stack,
.device-list-shell,
.youtube-layout,
.studio-stack,
.dense-form,
.pairing-shell,
.bulk-results,
.metric-strip,
.provider-target-list,
.provider-surface-grid,
.meta-grid,
.bulk-target-list,
.destination-board,
.broadcast-list {
  display: grid;
  gap: 16px;
}

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

.channels-panel-shell {
  container-type: inline-size;
}

@container (max-width: 920px) {
  .provider-surface-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 640px) {
  .provider-surface-grid {
    grid-template-columns: 1fr;
  }
}

.youtube-layout {
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  align-items: start;
}

.info-grid {
  display: grid;
  gap: 14px;
}

.info-grid-encoder,
.field-grid-2,
.meta-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid,
.field-grid-3 {
  display: grid;
  gap: 14px;
}

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

.field-grid-tight {
  align-items: end;
}

.field-shell {
  display: block;
}

.info-card,
.meta-card,
.provider-surface,
.studio-card,
.destination-panel,
.metric-tile,
.pairing-live-card,
.device-row,
.bulk-result {
  padding: 16px;
}

.info-card {
  display: grid;
  gap: 10px;
}

.info-card-strong,
.key-card-fresh {
  background:
    radial-gradient(circle at top right, rgba(225, 175, 84, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(40, 32, 18, 0.26), rgba(24, 28, 37, 0.92));
}

.rail-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.rail-row-between {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.mono-value,
.secret-value,
.pairing-code {
  font-family: var(--mono-font);
}

.mono-value {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(9, 12, 18, 0.52);
  overflow-wrap: anywhere;
}

.key-card {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(225, 175, 84, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(31, 36, 47, 0.96), rgba(18, 22, 30, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.rail-card-tip,
.key-card-fresh {
  background:
    radial-gradient(circle at top right, rgba(224, 169, 72, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(28, 35, 45, 0.98), rgba(18, 23, 31, 0.98));
}

.secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  margin-bottom: 16px;
}

.secret-value {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.58);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.meta-grid {
  margin-top: 8px;
}

.portal-details {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}

.portal-details summary {
  list-style: none;
  padding: 11px 13px;
  color: var(--text-main);
  font-weight: 600;
}

.portal-details summary::-webkit-details-marker {
  display: none;
}

.portal-details-body {
  padding: 0 13px 13px;
}

.portal-details-inline {
  background: transparent;
  border-color: rgba(255,255,255,0.08);
}

.meta-card span {
  display: block;
  color: var(--text-subtle);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.select-shell {
  display: block;
}

.inline-status,
.lock-note,
.provider-note,
.thumbnail-note,
.empty-inline,
.empty-state-inline {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.inline-status-pending {
  color: var(--gold);
  background: rgba(225, 175, 84, 0.1);
  border-color: rgba(225, 175, 84, 0.24);
}

.inline-status-success {
  color: var(--green);
  background: rgba(137, 199, 166, 0.1);
  border-color: rgba(137, 199, 166, 0.24);
}

.inline-status-danger {
  color: #f1c4c7;
  background: rgba(219, 116, 121, 0.1);
  border-color: rgba(219, 116, 121, 0.24);
}

.destination-toggle-row,
.broadcast-row,
.bulk-target-row,
.destination-board-row {
  display: grid;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
}

.broadcast-row,
.destination-board-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px 16px;
}

.destination-toggle-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 14px 16px;
}

.destination-row-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.destination-toggle-row .delivery-pill-set {
  justify-content: flex-start;
}

.destination-toggle-row-selected,
.broadcast-row-selected,
.destination-panel-selected,
.device-row-active,
.youtube-tab-active {
  border-color: rgba(225, 175, 84, 0.36);
  box-shadow: inset 0 0 0 1px rgba(225, 175, 84, 0.16);
}

.destination-toggle-main,
.broadcast-row-main,
.destination-board-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

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

.destination-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.destination-row-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.destination-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.provider-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
}

.provider-badge-youtube { color: #ffb7b7; }
.provider-badge-facebook { color: #c8d8ff; }
.provider-badge-twitch { color: #dec2ff; }

.provider-copy-compact {
  max-width: 34ch;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.toggle-switch-ui {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.toggle-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d7dde6;
  transition: transform 0.18s ease;
}

.toggle-switch input:checked + .toggle-switch-ui {
  background: rgba(224, 169, 72, 0.22);
  border-color: rgba(224, 169, 72, 0.42);
}

.toggle-switch input:checked + .toggle-switch-ui::after {
  transform: translateX(18px);
  background: var(--gold-bright);
}

.toggle-switch input:focus-visible + .toggle-switch-ui {
  outline: 2px solid rgba(224, 169, 72, 0.34);
  outline-offset: 2px;
}

.destination-toggle-main input,
.broadcast-row-main input,
.checkbox-line input,
.bulk-target-row input {
  accent-color: var(--gold);
  margin-top: 2px;
}

.destination-row-extra,
.destination-broadcast,
.thumbnail-note {
  color: var(--text-subtle);
  font-size: 0.84rem;
}

.delivery-pill-set {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.delivery-pill-set-wrap {
  justify-content: flex-start;
  margin-top: 12px;
}

.delivery-pill-set-compact {
  width: 100%;
  margin-top: 2px;
}

.provider-surface {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

.provider-surface .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: 0;
}

.provider-surface .section-head-tight > div:first-child {
  min-width: 0;
}

.provider-surface .section-copy {
  margin: 0;
}

.compact-board {
  gap: 12px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line span,
.destination-name,
.destination-toggle-main strong,
.broadcast-row strong,
.bulk-target-row strong,
.device-row strong {
  word-break: break-word;
}

.destination-toggle-main strong,
.destination-panel h3,
.provider-surface h3 {
  max-width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

.destination-row-copy,
.destination-row-extra,
.destination-broadcast {
  overflow-wrap: break-word;
}

.destination-toggle-main strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.destination-panel {
  display: grid;
  gap: 12px;
}

.youtube-target-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.youtube-tab {
  appearance: none;
  min-width: 0;
  flex: 1 1 220px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--text-main);
  background: rgba(255,255,255,0.025);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.youtube-tab small {
  color: var(--text-muted);
}

.youtube-tab:hover,
.youtube-tab:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(225, 175, 84, 0.05);
  outline: none;
}

.studio-card {
  display: grid;
  gap: 14px;
}

.broadcast-list,
.bulk-target-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.bulk-target-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  padding: 12px 14px;
}

.bulk-target-row small {
  display: block;
  margin-top: 4px;
  color: var(--text-subtle);
}

.bulk-results {
  gap: 10px;
}

.bulk-result {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.bulk-result span {
  color: var(--text-muted);
}

.bulk-result-success { border-color: rgba(137, 199, 166, 0.26); }
.bulk-result-warning { border-color: rgba(225, 175, 84, 0.26); }
.bulk-result-danger { border-color: rgba(219, 116, 121, 0.26); }
.bulk-result-muted { border-color: rgba(255,255,255,0.08); }

.subordinate-shell {
  overflow: hidden;
}

.subordinate-shell summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.subordinate-shell summary::-webkit-details-marker {
  display: none;
}

.subordinate-shell[open] summary {
  border-bottom: 1px solid rgba(226, 195, 144, 0.12);
}

.subordinate-body {
  padding: 20px;
}

.pairing-shell {
  gap: 18px;
}

.pairing-inline-form {
  flex-wrap: wrap;
}

.pairing-inline-form .form-control {
  min-width: min(320px, 100%);
  flex: 1 1 260px;
}

.pairing-live-card {
  justify-content: space-between;
}

.pairing-code {
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: 0.16em;
  color: var(--gold);
}

.pairing-timer {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.device-list-shell {
  gap: 12px;
}

.device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.device-row .panel-actions {
  justify-content: flex-end;
}

.subscription-overview {
  justify-content: space-between;
}

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

.metric-tile span {
  display: block;
  color: var(--text-subtle);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.metric-tile strong {
  font-size: 1.45rem;
  font-family: var(--display-font);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 8, 12, 0.78);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(28, 34, 45, 0.98), rgba(16, 20, 28, 0.98));
  box-shadow: var(--shadow-lg);
}

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

.modal-stack {
  display: grid;
  gap: 18px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  font-size: 1.5rem;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: rgba(225, 175, 84, 0.08);
  border-color: var(--line-strong);
  outline: none;
}

.portal-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
}

.portal-loading div { display: grid; gap: 3px; }
.portal-loading small { color: var(--text-muted); }

.loading-mark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: portal-spin 0.8s linear infinite;
}

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

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

/* Control-room surfaces: one destination list, one encoder rail. */
.portal-app .panel {
  background: #131a23;
  box-shadow: none;
  backdrop-filter: none;
}
.portal-app .app-sidebar { background: #10161e; }
.portal-app .card { padding: 20px; border-radius: 10px; }
.portal-app h2 { font-size: 20px; letter-spacing: -.025em; }
.portal-app .topbar-copy h2 { font-size: 26px; }
.portal-app h3 { font-size: 15px; }
.portal-app .section-head { margin-bottom: 14px; }
.portal-app .eyebrow { font-size: 12px; margin-bottom: 6px; }
.portal-app .btn { min-height: 38px; border-radius: 6px; font-size: 13px; padding: 8px 12px; }
.portal-app .form-control, .portal-app select { border-radius: 6px; }
.portal-app .status-chip, .portal-app .meter-pill { width: auto; font-size: 12px; padding: 4px 8px; }
.sidebar-note { display: none; }
.workspace-chip, .operator-card { border: 0; padding: 10px 6px; background: transparent; }
.workspace-chip-copy, .operator-copy { min-width: 0; gap: 3px; }
.operator-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.operator-copy span, .workspace-chip-copy span { color: var(--text-subtle); font-size: 13px; }
.command-stage { margin-bottom: 20px; padding: 14px 18px; border-radius: 10px; }
.command-stage .section-head { align-items: center; margin-bottom: 12px; }
.command-stage h2 { font-size: 14px; color: var(--text-muted); }
.command-stage-grid { gap: 0; }
.stage-card { padding: 4px 14px; border: 0; border-radius: 0; box-shadow: none; background: transparent; gap: 4px; }
.stage-card + .stage-card { border-left: 1px solid var(--line); }
.stage-card:first-child { padding-left: 0; }
.stage-card .stage-label { font-size: 12px; }
.stage-card p { font-size: 13px; }
.overview-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.overview-copy-row { gap: 10px; }
.overview-summary { font-size: 13px; }
.destination-list { gap: 0; }
.destination-list .destination-toggle-row { padding: 18px 0; border: 0; border-top: 1px solid var(--line); background: transparent; box-shadow: none; border-radius: 0; }
.destination-row-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.destination-title-row { align-items: center; flex-wrap: wrap; gap: 8px; }
.destination-toggle-copy, .destination-toggle-main { min-width: 0; }
.destination-toggle-copy strong { font-size: 15px; overflow-wrap: anywhere; }
.destination-row-copy { font-size: 13px; }
.destination-toggle-copy > .destination-approval-copy { display: none; }
.destination-row-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.delivery-pill-set { gap: 6px; justify-content: flex-start; }
.delivery-pill-set-compact { margin: 6px 0 0; }
.portal-details { border-radius: 6px; }
.connections-details { border-width: 1px 0 0; border-radius: 0; background: transparent; }
.connections-details > summary { padding: 14px 0; }
.provider-surface-grid { grid-template-columns: 1fr; gap: 0; }
.connections-details .provider-surface { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; gap: 10px; }
.connections-details .section-head { margin: 0; flex-wrap: wrap; gap: 8px; }
.connections-details .section-copy { margin: 4px 0 0; font-size: 13px; }
.connections-details .provider-note, .connections-details .inline-status { grid-column: 1 / -1; }
.provider-surface-wide { padding: 0; border: 0; background: transparent; }
.provider-surface-wide > .section-head { display: none; }
.provider-surface-wide .destination-board:empty { display: none; }
.encoder-rail > .section-head { margin: 0; }
.encoder-rail .panel-stack { gap: 0; }
.encoder-rail .rail-card, .encoder-rail .key-card { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; gap: 8px; }
.encoder-rail .rail-card-tip { border-bottom: 0; padding-bottom: 0; }
.encoder-rail .rail-row-between { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.encoder-rail .section-copy, .encoder-rail .meta-copy { font-size: 13px; }
.encoder-rail .rail-card-device .section-copy, .encoder-rail .rail-card .meta-copy { display: none; }
.encoder-rail .mono-value, .encoder-rail .secret-value { padding: 10px; font-size: 12px; font-weight: 400; border-radius: 6px; }
.encoder-rail .secret-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.encoder-rail .key-card > .section-head h3 { display: none; }
.encoder-rail .key-card > .section-head { align-items: center; gap: 6px; margin: 0; }
.encoder-rail .panel-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.encoder-rail .field-label { font-size: 12px; }
.encoder-rail .key-card > .section-copy { display: none; }
.encoder-rail .key-card-fresh > .section-copy { display: block; }
.youtube-studio-panel .studio-card, .device-row, .subscription-card { border-radius: 8px; box-shadow: none; }

@media (max-width: 1100px) {
  .portal-app {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .mobile-nav {
    display: grid;
  }

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

  .app-main { padding: 20px; }
  .app-primary-grid,
  .app-secondary-grid,
  .youtube-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .metric-strip,
  .info-grid-encoder,
  .field-grid-3,
  .field-grid-2,
  .meta-grid-2 {
    grid-template-columns: 1fr;
  }

  .app-header,
  .header-meta,
  .subscription-overview,
  .device-row,
  .secret-row,
  .destination-toggle-row,
  .broadcast-row,
  .destination-board-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: row;
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .app-header,
  .header-meta,
  .pairing-live-card,
  .section-head,
  .panel-actions,
  .hero-actions {
    align-items: stretch;
  }

  .panel-actions,
  .hero-actions,
  .pairing-inline-form,
  .device-row-title,
  .panel-actions-wrap,
  .provider-action-row,
  .subscription-overview,
  .destination-board-side,
  .modal-actions {
    flex-direction: column;
  }

  .header-meta {
    justify-content: space-between;
    align-items: center;
  }

  .header-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .identity-card {
    flex: 1;
    min-width: 0;
  }

  .provider-surface .section-head,
  .destination-panel .section-head,
  .destination-toggle-row,
  .destination-row-head {
    align-items: stretch;
  }

  .provider-surface .status-chip,
  .destination-panel .status-chip {
    justify-self: start;
  }

  .delivery-pill-set {
    justify-content: flex-start;
  }

  .delivery-pill-set-compact {
    margin-top: 6px;
  }

  .destination-row-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .device-row .panel-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  #app-container { padding: 0; }
  .app-main { padding: 16px 12px; }
  .overview-layout { grid-template-columns: minmax(0, 1fr); }
  .portal-app .card { padding: 16px; }
  .portal-app .topbar-copy h2 { font-size: 22px; }
  .topbar-kicker, .topbar-sync { display: none; }
  .topbar-subtitle { margin-top: 6px; font-size: 13px; }
  .command-stage { padding: 14px; }
  .command-stage-grid { gap: 12px 0; }
  .stage-card:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stage-card p:last-child:not(.stage-label) { font-size: 12px; }
  .portal-app .mobile-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 4px; }
  .mobile-nav-link { font-size: 12px; padding: 8px 4px; }
  .destination-title-row { flex-direction: row; }
  .destination-row-actions { align-items: center; }
  .portal-app .panel-actions { gap: 8px; }

  .auth-card,
  .card,
  .command-stage,
  .subordinate-body {
    padding: 20px;
  }

  .auth-layout {
    min-height: 100dvh;
    padding: 16px;
    align-items: center;
  }

  .auth-card {
    max-width: 100%;
    padding: 22px 18px 18px;
    border-radius: 20px;
  }

  .auth-card-head {
    margin-bottom: 16px;
  }

  .auth-brand {
    margin-bottom: 18px;
  }

  .auth-brand-wordmark {
    height: 22px;
    max-width: 156px;
  }

  .portal-backdrop {
    inset: 10px 0 auto;
    height: 200px;
    border-radius: 24px;
  }

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

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

  .mobile-nav-link {
    min-height: 40px;
    justify-content: center;
  }

  .overview-copy-row {
    grid-template-columns: 1fr;
  }

  .provider-surface {
    padding: 15px;
  }

  .device-row-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .destination-toggle-row {
    padding: 13px 14px;
  }

  .youtube-tab {
    flex-basis: 100%;
  }
}

@media (max-width: 480px) {
  #app-container { padding: 0; }

  .auth-card,
  .card,
  .command-stage {
    padding: 18px;
    border-radius: 18px;
  }

  .auth-layout {
    padding: 12px;
  }

  .auth-card {
    padding: 20px 16px 16px;
  }

  .auth-brand {
    gap: 10px;
  }

  .auth-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .auth-brand-mark .brand-logo {
    width: 20px;
    height: 20px;
  }

  .auth-brand-wordmark {
    height: 20px;
    max-width: 144px;
  }

  h1 { font-size: 1.85rem; }

  .identity-row {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .topbar-copy h2 {
    font-size: 1.6rem;
  }

  .topbar-subtitle,
  .topbar-sync,
  .overview-summary,
  .section-copy,
  .destination-row-copy,
  .destination-row-extra {
    font-size: 0.87rem;
  }

  .delivery-pill-set {
    justify-content: flex-start;
  }

  .bulk-result {
    flex-direction: column;
  }
}

@media (max-height: 760px) and (min-width: 641px) {
  .auth-layout {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .auth-card {
    padding-top: 20px;
    padding-bottom: 18px;
  }

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

  .auth-card-head {
    margin-bottom: 14px;
  }

  .auth-form {
    gap: 12px;
  }
}

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