:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: rgba(24, 24, 27, 0.72);
  --panel-strong: rgba(24, 24, 27, 0.92);
  --line: rgba(255, 255, 255, 0.06);
  --line-hot: rgba(59, 130, 246, 0.42);
  --text: #ffffff;
  --muted: #71717a;
  --soft: #a1a1aa;
  --accent: #3b82f6;
  --blue: #60a5fa;
  --danger: #fb7185;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html.auth-pending .shell {
  opacity: 0;
}

body.access-locked {
  overflow: hidden;
}

body.access-locked .shell {
  filter: blur(12px) saturate(0.72);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.access-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 15, 0.34);
  backdrop-filter: blur(22px) saturate(1.25);
  animation: gateIn 420ms var(--ease) both;
}

.access-panel {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 82% 8%, rgba(59, 130, 246, 0.18), transparent 42%),
    rgba(17, 20, 27, 0.72);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 42px rgba(59, 130, 246, 0.12);
  backdrop-filter: blur(28px) saturate(1.35);
}

.access-panel > span {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.access-panel h2 {
  margin-top: 10px;
  font-size: 30px;
  letter-spacing: 0;
}

.access-panel p {
  margin-top: 10px;
  color: var(--soft);
  line-height: 1.7;
}

.access-panel form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(5, 8, 14, 0.48);
}

.auth-mode-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  transition: color 260ms var(--ease), background 260ms var(--ease), box-shadow 260ms var(--ease);
}

.auth-mode-switch button.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}

.auth-mode-switch + form {
  margin-top: 14px;
}

.access-panel input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: none;
  padding: 0 16px;
  background: rgba(5, 8, 14, 0.58);
  color: var(--text);
  text-align: center;
  transition: border-color 260ms var(--ease), box-shadow 260ms var(--ease);
}

.access-panel input:focus {
  border-color: rgba(96, 165, 250, 0.68);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.access-panel button {
  width: 100%;
  min-height: 50px;
}

.access-panel small {
  min-height: 18px;
  color: var(--danger);
  text-align: center;
}

@keyframes gateIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(59, 130, 246, 0.12), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(56, 189, 248, 0.1), transparent 26%),
    linear-gradient(180deg, #121214 0%, #0b0b0c 55%, #070708 100%);
  color: var(--text);
  font-family: Inter, Geist, Manrope, "Segoe UI", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  animation: enter 800ms var(--ease) both;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4.2vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(24px, 2.4vw, 40px);
  line-height: 1;
  letter-spacing: -0.035em;
}

h3 {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.subcopy {
  max-width: 560px;
  margin-top: 10px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
}

.top-actions,
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 12;
  flex-direction: column;
  align-items: center;
}

.icon-btn {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: #f8fafc;
  background: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.28);
  font-size: 22px;
  transition: color 420ms var(--ease), border-color 420ms var(--ease), transform 420ms var(--ease), background 420ms var(--ease);
}

.icon-btn:hover {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.icon-btn svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.view-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
  transition: background 500ms var(--ease), color 500ms var(--ease);
}

.account-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 7px 6px 14px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 14px;
  background: rgba(5, 9, 18, 0.76);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px) saturate(1.25);
}

.account-controls > span {
  max-width: 150px;
  overflow: hidden;
  color: #e5efff;
  font: 12px "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-action,
.mini-action {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 5px 10px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.035);
  transition: color 240ms var(--ease), border-color 240ms var(--ease), background 240ms var(--ease);
}

.account-action:hover,
.mini-action:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.34);
  background: rgba(59, 130, 246, 0.12);
}

.switch-btn.active {
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent);
}

.view {
  display: none;
  margin-top: 18px;
}

.view.active {
  display: block;
  animation: pageIn 300ms var(--ease) both;
}

#postprocessView {
  position: relative;
}

.card,
.modal-panel,
.post-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(59, 130, 246, 0.12), transparent 30%),
    var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.34);
}

.card,
.post-card {
  transition: transform 700ms var(--ease), border-color 700ms var(--ease), background 700ms var(--ease);
}

.card:hover,
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-hot);
}

.reveal {
  animation: rise 850ms var(--ease) both;
}

.workbench {
  min-height: 640px;
  padding: 20px;
}

.task-status {
  display: flex;
  flex-wrap: wrap;
  min-height: 108px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 20px;
  padding: 14px;
  background:
    radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.025);
}

.route-zone .task-status {
  min-height: 184px;
  padding: 22px;
}

.task-status > div:first-child {
  min-width: 0;
  flex: 1 1 calc(100% - 62px);
}

.status-text,
.section-title span,
.compact-list li span:last-child {
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.status-text {
  display: none;
}

.task-status h2 {
  margin-top: 2px;
  font-size: 20px;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.task-status p {
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.status-orb {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(96, 165, 250, 0.46), rgba(59, 130, 246, 0.08) 42%, transparent 46%),
    rgba(59, 130, 246, 0.035);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.08);
}

.status-orb::before {
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  content: "";
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(59, 130, 246, 0.92), transparent 82% 100%);
  mask: radial-gradient(circle, transparent 58%, black 60%);
  opacity: 0;
}

.status-orb::after {
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  content: "";
  background: radial-gradient(circle, rgba(147, 197, 253, 0.56), rgba(59, 130, 246, 0.06) 62%, transparent 68%);
  filter: blur(1px);
}

.task-status.running .status-orb,
.workbench.running .status-orb {
  animation: none;
  border-color: rgba(59, 130, 246, 0.28);
  background:
    radial-gradient(circle at 50% 50%, rgba(96, 165, 250, 0.88), rgba(59, 130, 246, 0.12) 46%, transparent 48%),
    rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.18);
}

.task-status.running .status-orb::before,
.workbench.running .status-orb::before {
  opacity: 0.92;
  animation: spin 1.2s linear infinite;
}

.progress-line {
  position: relative;
  flex: 1 0 100%;
  height: 3px;
  margin: 12px 0 0;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-line span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
}

.progress-line.running span {
  animation: scan 1.55s var(--ease) infinite;
}

.progress-line.determinate span {
  width: 0;
  background: linear-gradient(90deg, #2563eb, #93c5fd);
  transform: none;
  transition: width 650ms var(--ease);
}

.progress-line.determinate.running span {
  animation: none;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.upload-zone,
.route-zone {
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.upload-zone {
  min-height: 596px;
  display: flex;
  flex-direction: column;
}

.right-stack {
  display: flex;
  min-height: 596px;
  flex-direction: column;
  gap: 16px;
}

.route-zone {
  flex: 1;
  min-height: 454px;
}

.status-slot {
  margin-bottom: 0;
}

.post-status-slot {
  position: absolute;
  top: -118px;
  right: 136px;
  width: min(438px, 100%);
  margin: 0;
}

.route-zone .task-status,
.post-status-slot .task-status {
  width: 100%;
}

.post-status-slot .task-status {
  min-height: 96px;
}

.post-status-slot .progress-line {
  display: none;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-dot {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 50%;
  color: #dbeafe;
  background:
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.24), transparent 68%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.12);
  font-weight: 750;
  line-height: 1;
  transition: border-color 360ms var(--ease), transform 360ms var(--ease), background 360ms var(--ease);
}

.help-dot:hover {
  border-color: rgba(147, 197, 253, 0.52);
  background: rgba(59, 130, 246, 0.16);
  transform: translateY(-1px);
}

.help-dot.attention {
  animation: questionNudge 2.2s ease-in-out infinite;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 220px;
  place-content: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-align: center;
}

.drop-zone strong {
  color: var(--text);
  font-size: 20px;
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.compact-list {
  display: grid;
  gap: 8px;
  max-height: none;
  margin: 14px 0 0;
  padding: 0 12px 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  list-style: none;
}

.upload-zone .compact-list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 278px;
}

.compact-list li {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
}

.compact-list.selectable-list {
  max-height: 214px;
}

.selectable {
  align-items: center;
  cursor: pointer;
  transition: border-color 420ms var(--ease), background 420ms var(--ease), transform 420ms var(--ease);
}

.selectable:hover,
.selectable.selected {
  border-color: rgba(59, 130, 246, 0.36);
  background: rgba(59, 130, 246, 0.075);
}

.selectable:hover {
  transform: translateY(-1px);
}

.item-main {
  min-width: 0;
}

.item-main strong,
.item-main small {
  display: block;
}

.item-main strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-main small {
  margin-top: 3px;
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

.item-tags {
  display: flex;
  flex: 0 0 auto;
  max-width: 42%;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.item-tags em {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-style: normal;
  font-size: 11px;
}

.item-tags em.pending {
  border-color: rgba(56, 189, 248, 0.28);
  color: var(--blue);
}

.item-tags em.done {
  border-color: rgba(161, 161, 170, 0.2);
  color: var(--soft);
}

.item-tags em.picked {
  border-color: rgba(59, 130, 246, 0.36);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.route-option {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 86px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 14px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 500ms var(--ease), background 500ms var(--ease), transform 500ms var(--ease);
  cursor: pointer;
}

.route-option[data-route="local"] {
  min-height: 128px;
  align-items: center;
}

.route-option[data-route="api"] {
  min-height: 128px;
  align-items: center;
}

.route-option:hover,
.route-option.selected {
  border-color: rgba(59, 130, 246, 0.36);
  background: rgba(59, 130, 246, 0.07);
}

.route-option input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.route-option strong,
.post-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.route-option small,
.post-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.model-picker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
  margin: 0;
  color: var(--soft);
}

.route-option[data-route="local"] .model-picker {
  position: absolute;
  right: 22px;
  bottom: 22px;
}

.route-option[data-route="api"] .model-picker {
  position: absolute;
  right: 22px;
  bottom: 22px;
}

.model-picker > span {
  display: none;
}

.model-picker.disabled {
  opacity: 0.42;
}

select,
.setting-row input[type="number"] {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 10px;
}

.glow-btn,
.ghost-btn,
.action-btn,
.icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.2;
  text-align: center;
  transition: transform 500ms var(--ease), border-color 500ms var(--ease), background 500ms var(--ease), color 500ms var(--ease);
}

.glow-btn {
  border-color: rgba(59, 130, 246, 0.36);
  color: #06111f;
  background: linear-gradient(135deg, #3b82f6, #93c5fd);
  box-shadow: 0 0 32px rgba(59, 130, 246, 0.22);
}

.route-zone .glow-btn {
  margin-top: 18px;
}

.route-zone .danger {
  margin-top: 12px;
}

.ghost-btn:hover,
.action-btn:hover,
.icon-text:hover,
.glow-btn:hover,
.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--accent);
}

.glow-btn:hover {
  color: #020712;
}

.wide {
  width: 100%;
}

.model-options {
  display: inline-flex;
  gap: 4px;
  border: 1px solid rgba(147, 197, 253, 0.12);
  border-radius: 999px;
  padding: 5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(15, 23, 42, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.model-chip,
.api-provider-chip {
  min-width: 74px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition: background 420ms var(--ease), color 420ms var(--ease), box-shadow 420ms var(--ease), transform 420ms var(--ease);
}

.model-chip:hover,
.api-provider-chip:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.model-chip.active,
.api-provider-chip.active {
  color: #06111f;
  background: linear-gradient(135deg, #3b82f6, #93c5fd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 8px 24px rgba(59, 130, 246, 0.28);
}

.danger {
  color: var(--danger);
}

.done-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.results-card {
  margin-top: 14px;
  padding: 18px;
}

.results-card p,
.post-hero p {
  color: var(--soft);
  line-height: 1.55;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.icon-only {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.icon-only svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.post-hero {
  padding: 28px;
}

.post-hero p {
  max-width: 720px;
  margin-top: 12px;
}

.post-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-top: 0;
}

.post-pickers .picker-card {
  display: flex;
  flex-direction: column;
}

.post-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.source-actions {
  grid-template-columns: 1fr;
}

.transcript-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.return-transcribe {
  min-height: 94px;
  border-style: dashed;
  background: rgba(59, 130, 246, 0.035);
}

.youtube-status-slot {
  margin-bottom: 16px;
}

.youtube-status-slot .task-status {
  min-height: 96px;
}

.youtube-status-slot .progress-line {
  display: none;
}

.youtube-card {
  padding: 18px;
}

.youtube-note {
  margin: -4px 0 14px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

.youtube-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
}

.cookie-import {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  font-size: 13px;
}

.cookie-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.cookie-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.youtube-controls,
.youtube-results {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.playlist-row,
.youtube-actions,
.youtube-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.playlist-row .ghost-btn,
.youtube-actions .ghost-btn,
.youtube-actions .glow-btn {
  min-width: 112px;
}

.playlist-input,
.youtube-options label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--soft);
  font-size: 13px;
}

.playlist-input input,
.youtube-options input[type="number"],
#youtubeLinks {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.youtube-options label {
  flex: 1 1 150px;
}

.youtube-options .check-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
}

#youtubeLinks {
  min-height: 148px;
  margin-top: 14px;
  resize: vertical;
  line-height: 1.45;
}

.youtube-actions {
  margin-top: 14px;
}

.youtube-list {
  max-height: 508px;
  margin-top: 0;
}

.youtube-results .glow-btn {
  margin-top: 14px;
}

.youtube-item .item-main strong {
  white-space: normal;
  line-height: 1.35;
}

.picker-card {
  padding: 18px;
}

.picker-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.post-grid {
  display: none;
}

.post-card {
  grid-column: span 1;
  min-height: 126px;
  padding: 18px;
  text-align: left;
  color: var(--text);
}

.post-card.large {
  grid-column: span 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal.open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
}

.modal-panel {
  z-index: 1;
  width: min(520px, 100%);
  padding: 24px;
  animation: modalIn 650ms var(--ease) both;
}

.tutorial-panel {
  width: min(760px, calc(100vw - 36px));
  min-height: 360px;
  padding: 28px;
}

.tutorial-pages {
  position: relative;
  min-height: 190px;
  margin-top: 10px;
}

.tutorial-page {
  display: none;
  min-height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at 80% 0%, rgba(96, 165, 250, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.026);
}

.tutorial-page.active {
  display: block;
  animation: pageIn 420ms var(--ease) both;
}

.tutorial-page strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.tutorial-page p {
  margin-top: 16px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.72;
}

.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.tutorial-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutorial-nav .ghost-btn,
.tutorial-nav .glow-btn {
  min-width: 92px;
}

#youtubeHelpPageText {
  min-width: 46px;
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  text-align: center;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--soft);
}

.setting-row input[type="number"] {
  width: 88px;
}

.save-hint {
  min-height: 22px;
  margin: -4px 0 8px;
  color: var(--accent);
  font-size: 13px;
}

.mobile-access {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 16px;
  padding: 14px;
  background: rgba(59, 130, 246, 0.055);
}

.mobile-access strong,
.mobile-access span {
  display: block;
}

.mobile-access strong {
  font-size: 14px;
}

.mobile-access span {
  margin-top: 5px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}

.mobile-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-url-row code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #bfdbfe;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-url-row .ghost-btn {
  min-height: 34px;
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 48px));
  border: 1px solid rgba(147, 197, 253, 0.16);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.2), transparent 66%),
    rgba(9, 14, 24, 0.34);
  backdrop-filter: blur(34px) saturate(1.34);
  -webkit-backdrop-filter: blur(34px) saturate(1.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 42px rgba(59, 130, 246, 0.16),
    0 18px 60px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.process-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 40;
  width: min(440px, calc(100vw - 48px));
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 24px;
  padding: 22px 26px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.22), transparent 62%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.012)),
    rgba(9, 14, 24, 0.28);
  backdrop-filter: blur(46px) saturate(1.42);
  -webkit-backdrop-filter: blur(46px) saturate(1.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(255, 255, 255, 0.018),
    0 0 44px rgba(59, 130, 246, 0.22),
    0 34px 120px rgba(0, 0, 0, 0.68);
  opacity: 0;
  text-align: center;
  transform: translate(-50%, -45%) scale(0.96);
  pointer-events: auto;
  transition: opacity 560ms var(--ease), transform 560ms var(--ease), border-color 560ms var(--ease), filter 560ms var(--ease);
}

.process-toast::before {
  position: absolute;
  inset: -44px;
  z-index: -1;
  border-radius: 32px;
  content: "";
  background:
    radial-gradient(circle, rgba(96, 165, 250, 0.2), transparent 58%),
    radial-gradient(circle at 28% 50%, rgba(255, 255, 255, 0.08), transparent 42%);
  filter: blur(34px);
}

.process-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  filter: blur(0);
}

.process-toast[data-tone="success"] {
  border-color: rgba(147, 197, 253, 0.2);
}

.process-toast[data-tone="error"] {
  border-color: rgba(251, 113, 133, 0.42);
  color: #fecdd3;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(280%); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.82; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes questionNudge {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-2px); }
  55% { transform: translateY(1px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mobile-only,
.mobile-results-view,
.upload-status {
  display: none;
}

.upload-status {
  margin-top: 12px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(37, 99, 235, 0.08);
}

.upload-status[hidden] {
  display: none !important;
}

.upload-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-status-head strong {
  font-size: 14px;
}

.upload-status-head span,
.upload-status small {
  color: var(--soft);
  font-size: 12px;
}

.upload-progress {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #93c5fd);
  transition: width 240ms var(--ease);
}

.upload-status small {
  display: block;
  margin-top: 8px;
}

.mobile-result-shell {
  padding: 18px;
}

.mobile-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mobile-result-heading > div {
  min-width: 0;
  flex: 1;
}

.mobile-result-heading span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-result-heading h2 {
  margin: 5px 0 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.ghost-btn.compact {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.mobile-transcript-empty,
.mobile-transcript-text {
  min-height: 280px;
  margin: 16px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 16px;
  background: rgba(5, 9, 18, 0.46);
}

.mobile-transcript-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.mobile-transcript-empty[hidden],
.mobile-transcript-text[hidden],
.mobile-transcript-actions[hidden] {
  display: none;
}

.mobile-transcript-text {
  max-height: 52vh;
  overflow: auto;
  color: var(--soft);
  font: inherit;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mobile-transcript-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.mobile-transcript-actions .glow-btn {
  display: grid;
  place-items: center;
  color: #07111e;
  text-decoration: none;
}

.mobile-history-panel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mobile-history-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.mobile-history-list li {
  border: 1px solid rgba(91, 158, 255, 0.24);
  border-radius: 14px;
  background: rgba(91, 158, 255, 0.06);
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}

.mobile-history-list li.selected {
  border-color: rgba(91, 158, 255, 0.65);
  background: rgba(91, 158, 255, 0.13);
}

.mobile-history-list button {
  width: 100%;
  border: 0;
  padding: 14px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.mobile-history-list strong,
.mobile-history-list small {
  display: block;
}

.mobile-history-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-history-list small {
  margin-top: 4px;
  color: var(--muted);
}

.mobile-history-list .empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

html.mobile-mode #showYoutube,
html.mobile-mode #showPostprocess,
html.mobile-mode #youtubeView,
html.mobile-mode #postprocessView,
html.mobile-mode .route-option[data-route="local"],
html.mobile-mode .results-card,
html.mobile-mode #openOutputsBtn,
html.mobile-mode #doneActions,
html.mobile-mode #settingsBtn,
html.mobile-mode #youtubeHelpModal {
  display: none !important;
}

html.mobile-mode .mobile-only {
  display: inline-flex;
}

.admin-view.active {
  display: block;
  animation: pageIn 360ms var(--ease) both;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 26px 28px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 12%, rgba(59, 130, 246, 0.14), transparent 38%),
    rgba(19, 22, 29, 0.68);
  backdrop-filter: blur(20px) saturate(1.2);
}

.admin-heading > div > span,
.admin-metric > span {
  color: var(--blue);
  font: 11px "SFMono-Regular", Consolas, monospace;
}

.admin-heading h2 {
  margin-top: 8px;
  font-size: 32px;
  letter-spacing: 0;
}

.admin-heading p,
.admin-panel .section-title p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(260px, 1.35fr);
  gap: 12px;
  margin-top: 14px;
}

.admin-metric {
  min-height: 118px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(18, 20, 26, 0.7);
}

.admin-metric strong {
  display: block;
  margin-top: 12px;
  font-size: 26px;
  letter-spacing: 0;
}

.admin-metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(520px, 1.35fr);
  gap: 14px;
  margin-top: 14px;
}

.admin-panel {
  min-width: 0;
  padding: 22px;
}

.invite-form {
  display: grid;
  grid-template-columns: 1fr 118px 108px;
  gap: 10px;
  margin-top: 18px;
}

.invite-form label,
.quota-field {
  display: grid;
  gap: 6px;
}

.invite-form label > span,
.quota-field > span {
  color: var(--muted);
  font-size: 11px;
}

.invite-form input,
.quota-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  outline: none;
  padding: 0 11px;
  color: #fff;
  background: rgba(5, 9, 18, 0.58);
}

.invite-form .glow-btn {
  grid-column: 1 / -1;
  min-height: 42px;
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  margin-top: 18px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-row.disabled {
  opacity: 0.48;
}

.admin-row > div,
.user-identity {
  min-width: 0;
}

.admin-row strong,
.admin-row small {
  display: block;
}

.admin-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 128px 62px 54px;
}

.active-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--soft);
  font-size: 12px;
}

.admin-badge {
  display: inline-flex;
  margin-left: 8px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--blue);
  font-size: 9px;
  vertical-align: middle;
}

.admin-empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.mini-action:disabled,
.quota-field input:disabled,
.active-field input:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

html.mobile-mode .upload-status:not([hidden]) {
  display: block;
}

html.mobile-mode .view-switch {
  display: flex;
}

html.mobile-mode .mobile-results-view.active {
  display: block;
  animation: pageIn 300ms var(--ease) both;
}

@media (max-width: 980px) {
  .shell {
    width: min(100vw - 24px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workbench-grid,
  .post-pickers,
  .post-grid,
  .youtube-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-status-slot {
    position: static;
    width: 100%;
    margin-bottom: 16px;
  }

  .post-card,
  .post-card.large {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 32px), 430px);
    padding: 16px 0 24px;
  }

  .topbar {
    position: relative;
    min-height: 0;
  }

  .topbar > div:first-child {
    padding-right: 96px;
  }

  .account-controls {
    max-width: 168px;
  }

  .admin-heading {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .admin-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .admin-metric {
    min-height: 104px;
    padding: 16px;
  }

  .balance-metric {
    grid-column: 1 / -1;
  }

  .invite-form {
    grid-template-columns: 1fr 1fr;
  }

  .invite-form label:first-child {
    grid-column: 1 / -1;
  }

  .user-row {
    grid-template-columns: 1fr 88px;
  }

  .quota-field {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: 32px;
    letter-spacing: 0;
    line-height: 1.04;
  }

  h2,
  h3 {
    letter-spacing: 0;
  }

  .subcopy {
    margin-top: 8px;
    font-size: 13px;
  }

  .view-switch {
    display: flex;
    width: 100%;
  }

  .switch-btn {
    min-width: 0;
    flex: 1;
  }

  .transcript-actions {
    grid-template-columns: 1fr;
  }

  .done-actions,
  .result-actions {
    display: grid;
    width: 100%;
  }

  .top-actions {
    position: absolute;
    top: 0;
    right: 0;
    flex-direction: row;
    gap: 6px;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .icon-btn svg {
    width: 23px;
    height: 23px;
  }

  .workbench {
    min-height: 0;
    padding: 12px;
  }

  .card,
  .post-card,
  .modal-panel {
    border-radius: 20px;
  }

  .workbench-grid {
    gap: 12px;
  }

  .upload-zone,
  .route-zone {
    min-height: 0;
    border-radius: 18px;
    padding: 14px;
  }

  .upload-zone,
  .right-stack {
    min-height: 0;
  }

  .right-stack {
    gap: 12px;
  }

  .drop-zone {
    min-height: 156px;
    border-radius: 16px;
  }

  .drop-zone strong {
    font-size: 18px;
  }

  .upload-zone .compact-list {
    max-height: 230px;
  }

  .compact-list {
    padding-right: 5px;
  }

  .compact-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .item-main,
  .item-tags {
    width: 100%;
  }

  .item-tags {
    max-width: 100%;
    justify-content: flex-start;
  }

  .route-zone .task-status {
    min-height: 126px;
    padding: 16px;
  }

  .route-option,
  .route-option[data-route="api"],
  .route-option[data-route="local"] {
    min-height: 0;
    align-items: flex-start;
    border-radius: 16px;
    padding: 14px;
  }

  .route-option > span {
    min-width: 0;
    width: 100%;
  }

  .route-option[data-route="api"] .model-picker,
  .route-option[data-route="local"] .model-picker {
    position: static;
    margin-top: 14px;
    justify-content: flex-start;
  }

  .model-options {
    width: 100%;
  }

  .model-chip,
  .api-provider-chip {
    min-width: 0;
    flex: 1;
  }

  .results-card,
  .post-hero,
  .picker-card,
  .youtube-card {
    padding: 14px;
  }

  .modal {
    padding: 14px;
  }

  .modal-panel,
  .tutorial-panel {
    width: min(100%, 430px);
    min-height: 0;
    padding: 18px;
  }

  .tutorial-page {
    padding: 16px;
  }

  .tutorial-page strong {
    font-size: 20px;
    letter-spacing: 0;
  }

  .tutorial-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mobile-url-row {
    align-items: stretch;
    flex-direction: column;
  }

  .mobile-url-row .ghost-btn {
    width: 100%;
  }

  .process-toast {
    width: min(calc(100vw - 40px), 390px);
    border-radius: 20px;
    padding: 18px;
  }

  .task-status {
    align-items: flex-start;
  }

  html.mobile-mode .topbar > div:first-child {
    padding-right: 0;
  }

  html.mobile-mode .top-actions {
    position: static;
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
  }

  html.mobile-mode .workbench {
    margin-top: 18px;
  }

  html.mobile-mode .workbench-grid {
    display: flex;
    flex-direction: column;
  }

  html.mobile-mode .upload-zone,
  html.mobile-mode .route-zone,
  html.mobile-mode .mobile-result-shell {
    padding: 14px;
  }

  html.mobile-mode .route-option[data-route="api"] {
    grid-template-columns: auto minmax(0, 1fr);
  }

  html.mobile-mode .mobile-transcript-actions {
    grid-template-columns: 1fr;
  }
}
