:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-elevated: #111214;
  --surface: #191a1e;
  --surface-2: #202126;
  --surface-3: #282a30;
  --stroke: #303238;
  --stroke-strong: #454851;
  --text: #f5f5f7;
  --muted: #9598a1;
  --subtle: #6d7078;
  --accent: #b8c8f4;
  --accent-ink: #10131b;
  --pass: #c8e615;
  --pass-ink: #151900;
  --review: #f0a868;
  --danger: #ff7a7a;
  --info: #83b6ff;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -15%, rgba(157, 178, 232, 0.14), transparent 28rem),
    var(--bg);
  line-height: 1.45;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

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

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #000;
  background: var(--pass);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  height: 76px;
  padding: 0 clamp(18px, 3.5vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 9, 10, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  gap: 3px;
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 7px;
  color: var(--accent-ink);
  background: var(--accent);
}

.brand-mark span {
  border-radius: 4px;
  background: currentColor;
}

.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.main-nav a,
.main-nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.main-nav a[aria-current="page"],
.main-nav button.is-active,
.main-nav a:hover,
.main-nav button:hover {
  color: var(--text);
  background: var(--surface-3);
}

#queue-count {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--pass-ink);
  background: var(--pass);
  font-size: 11px;
  text-align: center;
}

.local-status {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.session-controls {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 14px;
}

.session-logout {
  color: var(--muted);
}

.session-logout:hover {
  color: var(--text);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--review);
  box-shadow: 0 0 0 4px rgba(240, 168, 104, 0.1);
}

.local-status.is-online .status-dot {
  background: var(--pass);
  box-shadow: 0 0 0 4px rgba(200, 230, 21, 0.12);
}

.local-status.is-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 122, 122, 0.12);
}

.view {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4.5vw, 72px) clamp(18px, 3.5vw, 56px) 90px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: end;
  min-height: 360px;
  padding: clamp(28px, 4vw, 62px);
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 89% 12%, rgba(200, 230, 21, 0.17), transparent 22rem),
    linear-gradient(135deg, #15171b, #0f1012 60%);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1,
.batch-title h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(42px, 6vw, 84px);
  font-weight: 730;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 680px;
  margin: 26px 0 0;
  color: #b8bac1;
  font-size: clamp(16px, 1.4vw, 20px);
}

.hero-form {
  display: grid;
  gap: 14px;
  align-self: stretch;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.hero-form h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.6fr);
  align-items: center;
  gap: clamp(28px, 7vw, 100px);
  min-height: calc(100vh - 220px);
  padding: clamp(28px, 4vw, 62px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 84% 18%, rgba(200, 230, 21, 0.18), transparent 24rem),
    linear-gradient(135deg, #15171b, #0f1012 60%);
  box-shadow: var(--shadow);
}

.auth-copy h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 6vw, 82px);
  font-weight: 730;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.auth-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin: 26px 0 0;
  color: #b8bac1;
  font-size: clamp(16px, 1.4vw, 20px);
}

.auth-card {
  align-self: center;
}

.auth-message {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 122, 122, 0.3);
  border-radius: 10px;
  color: var(--danger);
  background: rgba(255, 122, 122, 0.08);
  font-size: 12px;
}

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

.path-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.path-input-row .button {
  min-width: 106px;
  white-space: nowrap;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(125px, 0.28fr);
  gap: 10px;
}

.field label,
.fieldset-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  color: var(--text);
  background: #0e0f11;
  transition: border-color 120ms ease, background 120ms ease;
}

.input,
.select {
  min-height: 46px;
  padding: 0 13px;
}

.textarea {
  min-height: 130px;
  padding: 12px 13px;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--stroke-strong);
}

.hint {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
}

.drive-note {
  padding: 11px 12px;
  border: 1px solid rgba(131, 182, 255, 0.2);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(131, 182, 255, 0.06);
  font-size: 11px;
}

.drive-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}

.managed-storage-note {
  padding: 12px 13px;
  border: 1px solid rgba(200, 230, 21, 0.22);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(200, 230, 21, 0.06);
  font-size: 11px;
}

.managed-storage-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.team-picker {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.team-picker-empty {
  display: grid;
  gap: 5px;
  border-style: dashed;
}

.team-picker-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.team-picker-header .hint {
  margin-top: 4px;
}

.team-picker-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.team-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: #101114;
  cursor: pointer;
}

.team-option:has(input:checked) {
  border-color: rgba(201, 245, 0, 0.48);
  background: rgba(201, 245, 0, 0.07);
}

.team-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.team-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--pass);
}

.team-option span {
  display: grid;
  min-width: 0;
}

.team-option strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-option small {
  color: var(--subtle);
  font-size: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 720;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.45;
}

.button-primary {
  color: var(--accent-ink);
  background: var(--accent);
}

.button-pass {
  color: var(--pass-ink);
  background: var(--pass);
}

.button-secondary {
  border-color: var(--stroke);
  color: var(--text);
  background: var(--surface-2);
}

.button-ghost {
  border-color: var(--stroke);
  color: var(--muted);
  background: transparent;
}

.button-danger {
  border-color: rgba(255, 122, 122, 0.3);
  color: var(--danger);
  background: rgba(255, 122, 122, 0.08);
}

.button-block {
  width: 100%;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 58px 0 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: -0.045em;
}

.section-heading p {
  max-width: 600px;
  margin: 7px 0 0;
  color: var(--muted);
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 680;
}

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

.batch-card {
  position: relative;
  display: grid;
  min-height: 230px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.batch-card::after {
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 178, 232, 0.16), transparent 68%);
  content: "";
}

.batch-card:hover {
  border-color: var(--stroke-strong);
  background: var(--surface-2);
}

.batch-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-card h3 {
  align-self: end;
  margin: 38px 0 8px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

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

.batch-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 26px;
}

.batch-card-stats span {
  color: var(--muted);
  font-size: 12px;
}

.batch-card-stats strong {
  color: var(--text);
  font-size: 16px;
}

.status-pill,
.stage-pill,
.pose-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill::before,
.asset-status::before,
.job-state::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

[data-status="approved"],
[data-status="done"],
[data-status="pass"] { color: var(--pass); }
[data-status="approved"]::before,
[data-status="done"]::before,
[data-status="pass"]::before { background: var(--pass); }
[data-status="needs_review"],
[data-status="review"],
[data-status="running"] { color: var(--review); }
[data-status="needs_review"]::before,
[data-status="review"]::before,
[data-status="running"]::before { background: var(--review); }
[data-status="failed"],
[data-status="error"],
[data-status="needs_mapping"] { color: var(--danger); }
[data-status="failed"]::before,
[data-status="error"]::before,
[data-status="needs_mapping"]::before { background: var(--danger); }
[data-status="queued"] { color: var(--info); }
[data-status="queued"]::before { background: var(--info); }

.empty-state {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 34px;
  border: 1px dashed var(--stroke-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 17px;
}

.integration-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
}

.integration-card {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
}

.integration-card h3 {
  margin: 0;
  font-size: 20px;
}

.integration-card > p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.privacy-card {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 260px;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(157, 178, 232, 0.22), transparent 50%),
    var(--surface);
}

.privacy-card::before {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 74px;
  height: 92px;
  border: 4px solid var(--accent);
  border-radius: 18px;
  opacity: 0.5;
  content: "";
}

.privacy-card::after {
  position: absolute;
  top: 5px;
  right: 48px;
  width: 42px;
  height: 54px;
  border: 4px solid var(--accent);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  opacity: 0.5;
  content: "";
}

.scoreplay-result {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.scoreplay-result.is-visible {
  display: grid;
}

.scoreplay-result div {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-3);
}

.scoreplay-result strong,
.scoreplay-result span {
  display: block;
}

.scoreplay-result span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

/* Batch workspace */
.batch-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
}

.back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.back-link:hover { color: var(--text); }

.batch-title h1 {
  font-size: clamp(36px, 5vw, 68px);
}

.batch-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.batch-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.destination-card,
.setup-callout,
.workflow-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.destination-card strong {
  display: block;
  max-width: 900px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-card p:last-child,
.setup-callout p,
.workflow-guide p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.setup-callout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(380px, 1fr);
  border-color: rgba(240, 168, 104, 0.38);
  background:
    linear-gradient(120deg, rgba(240, 168, 104, 0.08), transparent 60%),
    var(--surface);
}

.setup-callout h2,
.workflow-guide h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.setup-output-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.setup-callout > .hint {
  grid-column: 1 / -1;
}

.workflow-guide {
  margin-top: 14px;
  background: rgba(184, 200, 244, 0.055);
}

.workflow-guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 38px 0 18px;
}

.metric {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-tabs {
  display: flex;
  gap: 5px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--bg-elevated);
}

.workspace-tabs button {
  flex: 1 0 auto;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.workspace-tabs button.is-active {
  color: var(--text);
  background: var(--surface-3);
}

.toolbar {
  position: sticky;
  z-index: 20;
  top: 86px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(3, minmax(130px, 0.3fr)) auto;
  gap: 8px;
  margin: 16px 0 28px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(17, 18, 20, 0.93);
  backdrop-filter: blur(14px);
}

.toolbar .input,
.toolbar .select {
  min-height: 40px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--muted);
  background: #0e0f11;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.toggle input,
.checkbox-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--pass);
}

.asset-group {
  margin-top: 34px;
}

.group-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.group-header h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.group-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.group-header > span {
  color: var(--muted);
  font-size: 12px;
}

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

.asset-card {
  min-width: 0;
}

.asset-open {
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  color: inherit;
  background: var(--surface);
  text-align: left;
  transition: border-color 120ms ease, transform 120ms ease;
}

.asset-open:hover {
  border-color: var(--stroke-strong);
  transform: translateY(-2px);
}

.asset-image-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
    #111216;
}

.asset-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-image.is-broken {
  opacity: 0;
}

.asset-select {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  background: rgba(8, 9, 10, 0.7);
  backdrop-filter: blur(8px);
}

.asset-card.is-selected .asset-select {
  border-color: var(--pass);
  color: var(--pass-ink);
  background: var(--pass);
}

.asset-card.is-selected .asset-select::after {
  font-size: 13px;
  font-weight: 900;
  content: "✓";
}

.asset-shot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.asset-copy {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.asset-name {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-status,
.job-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* Inspector */
.inspector,
.tray {
  position: fixed;
  z-index: 100;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.inspector.is-open,
.tray.is-open {
  visibility: visible;
  pointer-events: auto;
}

.inspector-backdrop,
.tray-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.64);
  opacity: 0;
  transition: opacity 180ms ease;
}

.inspector.is-open .inspector-backdrop,
.tray.is-open .tray-backdrop {
  opacity: 1;
}

.inspector-panel,
.tray-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  height: 100%;
  border-left: 1px solid var(--stroke);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 200ms ease;
}

.inspector.is-open .inspector-panel,
.tray.is-open .tray-panel {
  transform: translateX(0);
}

.inspector-header,
.tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--stroke);
}

.inspector-header h2,
.tray-header h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 22px;
}

.icon-button:hover { color: var(--text); }

.inspector-content,
.queue-list {
  overflow-y: auto;
  padding: 20px 24px 40px;
}

.inspector-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #0b0c0e;
}

.inspector-preview img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.inspector-block {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface);
}

.inspector-block h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.inspector-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.inspector-block-header h3 { margin: 0; }

.ai-manual-block {
  border-color: rgba(184, 200, 244, 0.24);
  background:
    linear-gradient(145deg, rgba(184, 200, 244, 0.07), transparent 55%),
    var(--surface);
}

.ai-status {
  max-width: 210px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 9px;
  font-weight: 700;
  text-align: right;
}

.ai-status.is-ready { color: var(--info); }
.ai-status.is-complete { color: var(--pass); }

.manual-steps {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding-left: 22px;
  color: #c4c6cc;
  font-size: 12px;
}

.prompt-heading {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
}

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

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.choice-button {
  min-height: 54px;
  padding: 7px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 680;
}

.choice-button.is-active {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
}

.crop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.crop-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 50px;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.crop-field input[type="range"] {
  min-width: 0;
  accent-color: var(--accent);
}

.crop-value {
  padding: 4px 5px;
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-3);
  text-align: center;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.button-row .button { flex: 1; }

.prompt-box {
  margin: 0;
  padding: 13px;
  overflow: auto;
  border-radius: 10px;
  color: #c4c6cc;
  background: #0c0d0f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.approval-bar {
  position: sticky;
  bottom: -40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px -24px -40px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--stroke);
  background: rgba(17, 18, 20, 0.94);
  backdrop-filter: blur(16px);
}

/* Queue */
.tray-panel {
  width: min(460px, 100%);
}

.queue-list {
  display: grid;
  align-content: start;
  gap: 24px;
}

.queue-section {
  display: grid;
  gap: 9px;
}

.queue-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 3px;
}

.queue-section-header h3,
.queue-section-header p {
  margin: 0;
}

.queue-section-header h3 {
  font-size: 13px;
}

.queue-section-header p,
.queue-section-header > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.job-card {
  padding: 15px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: var(--surface);
}

.job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-title {
  font-size: 13px;
  font-weight: 700;
}

.job-time,
.job-message {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pass);
  transition: width 200ms ease;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 180ms ease both;
}

.toast.is-error { border-color: rgba(255, 122, 122, 0.6); }
.toast.is-success { border-color: rgba(200, 230, 21, 0.5); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.skeleton {
  min-height: 220px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (max-width: 1180px) {
  .asset-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(120px, 0.35fr)); }
  .toolbar .toggle { grid-column: auto; }
  .toolbar select[data-filter="status"] { display: none; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: 68px;
    background: rgba(8, 9, 10, 0.97);
    backdrop-filter: none;
  }
  .main-nav {
    position: fixed;
    z-index: 60;
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: stretch;
    box-shadow: var(--shadow);
  }
  .main-nav a,
  .main-nav button { flex: 1; justify-content: center; }
  .local-status span:last-child { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .auth-view { grid-template-columns: 1fr; min-height: auto; }
  .integration-grid { grid-template-columns: 1fr; }
  .batch-header { grid-template-columns: 1fr; }
  .batch-actions { justify-content: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-callout { grid-template-columns: 1fr; }
  .setup-output-actions { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .view { padding-right: 14px; padding-left: 14px; }
  .hero { padding: 24px 18px; border-radius: 21px; }
  .hero h1 { font-size: clamp(38px, 13vw, 62px); }
  .auth-view { padding: 24px 18px; border-radius: 21px; }
  .auth-copy h1 { font-size: clamp(38px, 13vw, 62px); }
  .field-row { grid-template-columns: 1fr; }
  .path-input-row { grid-template-columns: 1fr; }
  .path-input-row .button { width: 100%; }
  .team-grid { grid-template-columns: 1fr; }
  .team-picker-header { align-items: stretch; flex-direction: column; }
  .batch-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .batch-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .batch-actions .button { padding: 0 10px; }
  .destination-card,
  .workflow-guide { align-items: stretch; flex-direction: column; }
  .destination-card .button,
  .workflow-guide-actions,
  .workflow-guide-actions .button { width: 100%; }
  .toolbar {
    top: 77px;
    grid-template-columns: 1fr 1fr;
  }
  .toolbar [data-filter="search"] { grid-column: 1 / -1; }
  .toolbar select[data-filter="stage"] { display: none; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .asset-copy { padding: 9px; }
  .asset-name { font-size: 11px; }
  .asset-meta { display: none; }
  .scoreplay-result { grid-template-columns: 1fr; }
  .inspector-panel { width: 100%; }
  .crop-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .topbar { padding: 0 15px; }
  .brand { font-size: 16px; }
  .session-controls { gap: 8px; }
  .hero-form { padding: 16px; }
  .metrics { gap: 7px; }
  .metric { min-height: 100px; padding: 14px; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar [data-filter="search"] { grid-column: auto; }
  .batch-actions { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
}

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