:root {
  color-scheme: light;
  --background: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --sidebar: #10182a;
  --sidebar-soft: #1b2740;
  --text: #162033;
  --muted: #6b7588;
  --border: #dfe5ef;
  --primary: #2b67f6;
  --primary-dark: #1f54d7;
  --primary-soft: #eaf0ff;
  --success: #178658;
  --success-soft: #e5f7ee;
  --warning: #a4630a;
  --warning-soft: #fff4d8;
  --danger: #c43d4b;
  --danger-soft: #ffebed;
  --shadow: 0 16px 40px rgb(20 31 53 / 8%);
  --radius: 16px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
}

button,
input,
select {
  font: inherit;
}

button,
label,
select,
input[type="file"],
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid rgb(43 103 246 / 28%);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  color: #dbe5f9;
  background:
    radial-gradient(circle at 20% 0%, rgb(55 95 173 / 25%), transparent 34%),
    var(--sidebar);
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  font-weight: 750;
  background: linear-gradient(135deg, #6292ff, #2858e8);
  box-shadow: 0 8px 24px rgb(33 82 210 / 34%);
}

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

.brand strong {
  color: #fff;
  font-size: 14px;
}

.brand small {
  margin-top: 2px;
  color: #7f91b3;
  font-size: 11px;
}

.side-nav {
  display: grid;
  gap: 7px;
  margin-top: 42px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 11px;
  color: #a7b5ce;
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  color: #fff;
  background: rgb(255 255 255 / 5%);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, #294d99, #223b71);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  font-size: 15px;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 12px;
  background: rgb(255 255 255 / 4%);
}

.sidebar-foot strong,
.sidebar-foot small {
  display: block;
}

.sidebar-foot strong {
  color: #dce6fa;
  font-size: 12px;
}

.sidebar-foot small {
  margin-top: 2px;
  color: #7f91b3;
  font-size: 10px;
}

.account-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  color: #a7b5ce;
  background: rgb(255 255 255 / 7%);
  font-weight: 800;
}

.mode-dot,
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #50d493;
  box-shadow: 0 0 0 5px rgb(80 212 147 / 12%);
}

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

.mobile-header,
.mobile-nav {
  display: none;
}

main {
  width: min(1220px, calc(100% - 56px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.view {
  display: none;
}

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

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

.page-head h1,
.page-head p,
.section-head h2,
.section-head p,
.dialog-head h2 {
  margin: 0;
}

.page-head h1 {
  margin-top: 3px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.035em;
}

.page-head > div > p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.health-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.health-status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgb(196 61 75 / 12%);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(350px, .82fr);
  gap: 18px;
  align-items: stretch;
}

.upload-panel,
.options-panel,
.queue-panel,
.settings-grid .panel,
.watermark-layout .panel {
  padding: 20px;
}

.panel-title-row,
.section-head,
.switch-row,
.job-row,
.watermark-card,
.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title-row {
  margin-bottom: 16px;
}

.panel-title-row > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.soft-label,
.recommended,
.local-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.soft-label {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 288px;
  padding: 28px;
  border: 2px dashed #cbd5e5;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgb(234 240 255 / 68%), transparent 55%),
    var(--surface-soft);
  text-align: center;
  transition: 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: #aabff6;
}

.upload-symbol {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 17px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #5f8dff, #2d62ec);
  box-shadow: 0 12px 28px rgb(43 103 246 / 28%);
  font-size: 26px;
}

.drop-zone strong {
  font-size: 16px;
}

.drop-zone > span:nth-of-type(2) {
  max-width: 430px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.choose-file {
  margin-top: 18px;
  padding: 8px 13px;
  border: 1px solid #ccd6e7;
  border-radius: 9px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.batch-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  margin-top: 14px;
}

.batch-upload-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.batch-upload-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.batch-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
}

.batch-upload-copy {
  min-width: 0;
}

.batch-upload-copy strong,
.batch-upload-copy small {
  display: block;
}

.batch-upload-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.batch-upload-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

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

.batch-upload-progress {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ebf2;
}

.batch-upload-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #356ff9, #2359df);
  transition: width 180ms ease;
}

.batch-upload-row.is-failed {
  border-color: #f3c7cb;
  background: var(--danger-soft);
}

.batch-upload-row.is-completed {
  border-color: #cce8d9;
  background: var(--success-soft);
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--primary);
  background: none;
  font-size: 11px;
}

fieldset {
  padding: 0;
  border: 0;
  margin: 0;
}

legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mode-options {
  display: grid;
  gap: 8px;
}

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: 150ms ease;
}

.choice-card:has(input:checked) {
  border-color: #8cabfb;
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgb(43 103 246 / 12%);
}

.choice-card input {
  accent-color: var(--primary);
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card strong {
  font-size: 13px;
}

.choice-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.recommended {
  padding: 4px 7px;
  color: var(--primary);
  background: #fff;
}

.watermark-option {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  font-size: 13px;
}

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd3df;
  transition: 150ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgb(20 31 53 / 22%);
  transition: 150ms ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field select,
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"],
.field input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.primary-action,
.secondary-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 750;
}

.primary-action {
  width: 100%;
  margin-top: 16px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #356ff9, #2359df);
  box-shadow: 0 9px 20px rgb(43 103 246 / 22%);
}

.primary-action:hover {
  background: linear-gradient(135deg, #2e66ee, #194cca);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}

.form-hint {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.form-hint.is-error {
  color: var(--danger);
}

.form-hint.is-success {
  color: var(--success);
}

.queue-panel {
  margin-top: 18px;
}

.section-head h2 {
  font-size: 16px;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.section-head.compact {
  align-items: flex-start;
  margin-bottom: 16px;
}

.queue-list {
  margin-top: 14px;
}

.job-row {
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.job-row:first-child {
  border-top: 0;
}

.job-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.video-thumb {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  aspect-ratio: 16 / 10;
  border-radius: 9px;
  color: #7d8daa;
  background: linear-gradient(145deg, #e2e9f5, #f3f6fb);
  font-size: 13px;
}

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

.job-copy strong,
.job-copy small {
  display: block;
}

.job-copy strong {
  overflow: hidden;
  max-width: 420px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.job-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.job-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 255px;
}

.status-badge {
  padding: 6px 9px;
  color: var(--muted);
  background: var(--surface-soft);
}

.status-badge.completed {
  color: var(--success);
  background: var(--success-soft);
}

.status-badge.processing {
  color: var(--primary);
  background: var(--primary-soft);
}

.status-badge.failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-badge.queued {
  color: var(--warning);
  background: var(--warning-soft);
}

.progress-track {
  width: 100px;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ebf2;
}

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

.job-actions {
  display: flex;
  gap: 6px;
}

.small-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.small-button.primary {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.empty-state {
  padding: 36px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

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

.video-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.video-card-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  color: #8490a4;
  background:
    radial-gradient(circle at 30% 20%, rgb(77 118 224 / 18%), transparent 30%),
    #e9eef7;
  font-size: 28px;
}

.video-card-body {
  padding: 15px;
}

.video-card-body h3 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.video-card-body > p {
  margin: 6px 0 13px;
  color: var(--muted);
  font-size: 10px;
}

.watermark-layout,
.settings-grid {
  display: grid;
  gap: 18px;
}

.watermark-layout {
  grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr);
  align-items: start;
}

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

.watermark-effect-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 4px 0 16px;
  border: 1px solid #d9e2f2;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgb(47 99 222 / 13%), transparent 45%),
    repeating-linear-gradient(
      45deg,
      #eef3fb 0,
      #eef3fb 12px,
      #f8faff 12px,
      #f8faff 24px
    );
}

.watermark-effect-preview::after {
  position: absolute;
  inset: 50% auto auto 50%;
  color: #91a0b8;
  content: "16:9 视频画面";
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.watermark-preview-badge {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  min-width: 48px;
  padding: 5px 7px;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #ef4770, #3f6fe5);
  box-shadow: 0 3px 10px rgb(33 52 94 / 25%);
  font-size: clamp(7px, 1vw, 11px);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watermark-production-guide {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid #dbe6fb;
  border-radius: 10px;
  color: #5f6f89;
  background: #f5f8ff;
  font-size: 12px;
  line-height: 1.55;
}

.watermark-production-guide strong {
  color: #263653;
}

.watermark-production-guide.compact {
  margin: 0;
  font-size: 11px;
}

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

.watermark-recycle { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 18px; min-width: 0; }
.watermark-recycle h3 { margin: 20px 0 10px; font-size: 14px; }
.recycle-card { display: grid; gap: 8px; margin: 10px 0; padding: 12px; border: 1px solid var(--border); border-radius: 11px; min-width: 0; overflow-wrap: anywhere; }
.recycle-card strong { font-size: 13px; }
.recycle-card small { color: var(--muted); }
.recycle-card button { justify-self: start; min-height: 44px; }
.watermark-control-stack, .watermark-layout > .panel { min-width: 0; }
.watermark-layout select { max-width: 100%; min-width: 0; }

.watermark-card {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.watermark-card img {
  width: 70px;
  height: 44px;
  object-fit: contain;
  border-radius: 7px;
  background:
    linear-gradient(45deg, #e8edf5 25%, transparent 25%),
    linear-gradient(-45deg, #e8edf5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8edf5 75%),
    linear-gradient(-45deg, transparent 75%, #e8edf5 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.watermark-placeholder {
  display: grid;
  width: 70px;
  height: 44px;
  place-items: center;
  border-radius: 7px;
  background: #e8edf5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.watermark-info {
  flex: 1;
  min-width: 0;
}

.watermark-info strong,
.watermark-info small {
  display: block;
}

.watermark-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.watermark-info small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

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

.settings-grid-single {
  grid-template-columns: minmax(0, 640px);
}

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

.compact-ranges {
  margin-top: 10px;
}

.field-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field.is-disabled {
  opacity: 0.48;
}

.field.is-disabled input {
  cursor: not-allowed;
}

.settings-submit {
  grid-column: 1 / -1;
  justify-self: end;
  width: auto;
  min-width: 200px;
  margin-top: 0;
}

.settings-message {
  grid-column: 1 / -1;
  margin: -8px 0 0;
  text-align: right;
}

dialog {
  width: min(820px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 30px 100px rgb(17 25 42 / 35%);
}

dialog::backdrop {
  background: rgb(12 20 35 / 64%);
  backdrop-filter: blur(4px);
}

.dialog-head,
.dialog-actions {
  padding: 17px 20px;
}

.dialog-head {
  border-bottom: 1px solid var(--border);
}

.dialog-head h2 {
  margin-top: 4px;
  font-size: 17px;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 22px;
}

#preview-player {
  display: block;
  width: 100%;
  max-height: 62vh;
  background: #000;
}

#watermark-inspector { padding: 16px 20px; font-size: 13px; overflow-wrap: anywhere; }
#watermark-inspector h3 { margin: 0 0 12px; }
#watermark-inspector p { margin: 10px 0; line-height: 1.6; }
.watermark-inspector-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.watermark-inspector-controls label { display: flex; flex: 1 1 130px; flex-direction: column; gap: 6px; min-width: 0; }
.watermark-inspector-controls select, .watermark-inspector-controls input { min-width: 0; width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.watermark-inspector-controls[hidden] { display: none; }
.watermark-inspector-controls + .watermark-inspector-controls { margin-top: 12px; }
.watermark-inspector-note { color: var(--muted); }
#watermark-inspector svg { display: block; width: 100%; max-height: 210px; }
.inspector-frame { fill: #17202e; }
.inspector-content { fill: #e0e6ed; }
.inspector-mark { fill: #3d7cf0; stroke: #173f88; stroke-width: 1; }
.watermark-inspector-warnings { padding: 10px 12px 10px 28px; color: #783e05; background: #fff1db; border-radius: 8px; line-height: 1.7; }

.dialog-actions {
  border-top: 1px solid var(--border);
}

.dialog-actions code {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.toast {
  padding: 12px 14px;
  border: 1px solid #c6d4f5;
  border-radius: 11px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 16px 40px rgb(20 31 53 / 18%);
  font-size: 12px;
}

.toast.error {
  border-color: #efbec4;
  color: #8f2734;
  background: #fff6f7;
}

.auth-shell {
  min-height: 100vh;
  padding: 42px 20px;
  background:
    radial-gradient(circle at 15% 10%, rgb(43 103 246 / 26%), transparent 34%),
    radial-gradient(circle at 90% 90%, rgb(80 212 147 / 14%), transparent 30%),
    var(--sidebar);
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(340px, 1fr);
  width: min(900px, 100%);
  min-height: 540px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 34px 100px rgb(0 0 0 / 32%);
}

.auth-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 38px 30px;
  color: #fff;
  background:
    linear-gradient(160deg, rgb(43 103 246 / 35%), transparent 48%),
    var(--sidebar-soft);
}

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

.auth-brand small {
  margin-top: 5px;
  color: #9dafcf;
  font-size: 11px;
}

.auth-form {
  align-self: center;
  width: min(390px, calc(100% - 48px));
  margin: 36px auto;
}

.auth-form h1 {
  margin: 6px 0 0;
  font-size: 28px;
}

.auth-form > div > p:last-child {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.staff-layout {
  display: grid;
  grid-template-columns: minmax(290px, .68fr) minmax(0, 1.32fr);
  gap: 18px;
}

.staff-create-form,
.staff-list-panel {
  padding: 20px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.staff-table-wrap {
  overflow-x: auto;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
}

.staff-table th,
.staff-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.staff-table th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
}

.staff-table td {
  font-size: 12px;
}

.staff-table td strong,
.staff-table td small {
  display: block;
}

.staff-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.staff-note {
  color: var(--warning) !important;
}

.compact-select {
  min-width: 120px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 11px;
}

.staff-actions,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button.danger,
.danger-button {
  border-color: #efbec4;
  color: var(--danger);
  background: var(--danger-soft);
}

.danger-button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #efbec4;
  border-radius: 10px;
  font-weight: 750;
}

.dialog-form {
  padding: 4px 20px 20px;
}

.account-actions {
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

#account-dialog,
#staff-reset-dialog {
  width: min(520px, calc(100% - 28px));
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .workspace-grid,
  .watermark-layout,
  .staff-layout {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 220px;
  }

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

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    color: #fff;
    background: var(--sidebar);
  }

  .mobile-brand {
    gap: 9px;
    font-size: 13px;
    font-weight: 750;
  }

  .mobile-header .brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 9px;
  }

  .local-pill {
    padding: 5px 8px;
    color: #b8c8e7;
    background: rgb(255 255 255 / 8%);
  }

  .mobile-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(12px);
  }

  .mobile-nav button {
    padding: 9px 4px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
  }

  .mobile-nav button.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 750;
  }

  main {
    width: calc(100% - 28px);
    padding: 24px 0 48px;
  }

  .page-head {
    display: block;
  }

  .health-status {
    margin-top: 15px;
  }

  .workspace-grid,
  .settings-grid,
  .video-library {
    grid-template-columns: 1fr;
  }

  .batch-upload-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .batch-upload-actions {
    justify-content: space-between;
  }

  .upload-panel,
  .options-panel,
  .queue-panel,
  .settings-grid .panel,
  .watermark-layout .panel,
  .staff-layout .panel {
    padding: 15px;
  }

  .drop-zone {
    min-height: 210px;
    padding: 22px 14px;
  }

  .job-row {
    align-items: flex-start;
  }

  .job-state {
    display: grid;
    justify-items: end;
    min-width: 105px;
  }

  .progress-track {
    width: 86px;
  }

  .job-copy strong {
    max-width: 155px;
  }

  .job-copy small {
    max-width: 170px;
  }

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

  .range-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .settings-submit {
    width: 100%;
  }

  .settings-message {
    text-align: left;
  }

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

  .auth-shell {
    padding: 18px 12px;
  }

  .auth-card {
    display: block;
    min-height: 0;
  }

  .auth-brand {
    padding: 22px;
  }

  .auth-form {
    width: calc(100% - 36px);
    margin: 28px auto;
  }
}

@media (max-width: 390px) {
  main {
    width: calc(100% - 20px);
  }

  .page-head h1 {
    font-size: 25px;
  }

  .choice-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .choice-card .recommended {
    display: none;
  }

  .job-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .job-state {
    grid-template-columns: auto 1fr;
    justify-items: start;
    width: 100%;
  }

  .job-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .job-copy strong {
    max-width: 220px;
  }
}

/* Product identity remains visible on desktop and mobile without upload confirmations. */
.product-zone-bar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px;margin-bottom:24px;background:#fff;border:1px solid #d9e2eb;border-radius:14px}
.product-zone-buttons{display:flex;flex-wrap:wrap;gap:6px}.product-zone-buttons button{padding:10px 14px;border:1px solid #dce2eb;border-radius:9px;background:#f6f8fc;color:#303c53;cursor:pointer;font:inherit}
.product-zone-buttons button[aria-pressed="true"]{background:#563ca5;color:white;border-color:#563ca5}.product-zone-buttons .zone-history{font-size:12px}
#product-zone-hint{font-size:12px;color:#5e687b}body[data-product-zone="adult"] .product-zone-buttons button[aria-pressed="true"]{background:#9d355f;border-color:#9d355f}
@media(max-width:600px){.product-zone-bar{padding:12px;gap:9px}.product-zone-buttons{width:100%}.product-zone-buttons button{flex:1;padding:9px 8px;font-size:13px}}
