@font-face {
  font-family: 'Inter Tight';
  src: url('/fonts/InterTight-var.ttf') format('truetype-variations');
  font-weight: 100 900;
}

:root {
  --bg: #0a0b09;
  --panel: #141612;
  --border: #262a22;
  --text: #f2f4ef;
  --muted: #9aa093;
  --accent: #c6ff4a;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  font-family: 'Inter Tight', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  max-width: 100%;
}
main { flex: 1; width: min(880px, 92vw); margin: 0 auto; min-width: 0; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.accent { color: var(--accent); }
.error { color: #ff7a6b; min-height: 1.2em; font-size: 0.9rem; }

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem;
  gap: 0.75rem;
  min-width: 0;
}
.logo { font-weight: 800; letter-spacing: 0.05em; flex-shrink: 0; }
.logo .accent { margin-left: 0.3em; }
#nav { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; min-width: 0; position: relative; }
.nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 2.75rem; height: 2.75rem; padding: 0.45rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text); cursor: pointer;
}
.nav-burger-bar {
  display: block; width: 100%; height: 2px; border-radius: 1px; background: currentColor;
  transition: transform 0.18s, opacity 0.18s;
}
.nav-burger[aria-expanded="true"] .nav-burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] .nav-burger-bar:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .nav-burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.nav-menu {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; min-width: 0;
}
.nav-user {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  min-width: 0; max-width: 100%;
}
#nav-email {
  max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.8rem;
  white-space: nowrap;
}
.pill-local { border-color: var(--accent); color: var(--accent); }

.btn {
  font: inherit; cursor: pointer; border-radius: 8px;
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #0a0b09; font-weight: 700; border: none; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 0.2rem 0.55rem; font-size: 0.8rem; }

.hero { text-align: center; padding: 3.5rem 0 1rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; margin: 0 0 1rem; line-height: 1.05; }
.hero .sub { color: var(--muted); max-width: 34rem; margin: 0 auto 2rem; }

.style-picker { text-align: left; margin-bottom: 1rem; min-width: 0; max-width: 100%; }
.style-picker-head {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.5rem; margin-bottom: 0.5rem;
}
.style-picker-head span { margin-right: 0.15rem; }
.style-picker-head input[type='color'] {
  width: 1.9rem; height: 1.9rem; padding: 2px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
}
.preset-row { display: flex; gap: 0.6rem; flex-wrap: wrap; min-width: 0; }
.preset {
  font: inherit; cursor: pointer; text-align: center;
  background: #1c1f18; border: 1px solid var(--border); border-radius: 10px;
  padding: 0.7rem 0.9rem 0.4rem; display: flex; flex-direction: column; gap: 0.25rem;
  min-width: 8.5rem; max-width: 100%; color: var(--text);
}
.preset-preview {
  display: block; white-space: nowrap; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.preset:hover { border-color: var(--accent); }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

#style-custom, #edit-style-custom { margin-top: 0.7rem; }
.edit-style-picker { margin: 0.35rem 0 0; }
.edit-style-picker .preset {
  min-width: 4.6rem; padding: 0.3rem 0.4rem 0.2rem; gap: 0.12rem;
}
.edit-style-picker .preset-preview { font-size: 0.68rem !important; }
.edit-style-picker #edit-style-custom {
  max-height: 9rem; overflow-y: auto; margin-top: 0.45rem;
}
.edit-preview-stack {
  display: flex; flex-direction: column; min-height: 0;
}
#style-custom summary { cursor: pointer; }
.custom-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.6rem 1rem; padding: 0.8rem 0 0.2rem;
}
.custom-grid label { margin: 0; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; }
.custom-grid label.row { flex-direction: row; align-items: center; gap: 0.5rem; }
.custom-grid input[type='color'] {
  width: 100%; height: 2rem; padding: 2px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); cursor: pointer;
}
.custom-grid input[type='range'] { width: 100%; accent-color: var(--accent); }
.custom-grid input[type='checkbox'] { accent-color: var(--accent); width: auto; }
.custom-grid select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem;
}

.job-lang-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.job-lang-row label:not(:first-child) { margin-left: 0.8rem; }
.job-lang-row select, .lang-select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.5rem;
}

.job-options-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem 0.75rem; margin-top: 0.85rem;
}
@media (max-width: 780px) { .job-options-grid { grid-template-columns: 1fr; } }

.hero-upload-stack {
  display: flex; flex-direction: column; gap: 0.85rem;
  text-align: left; min-width: 0;
}
.hero-upload-primary { min-width: 0; }
.hero-upload-primary .dropzone { text-align: center; }

.upload-panels { min-width: 0; }
.upload-panel {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); margin-bottom: 0.45rem;
}
.upload-panel:last-child { margin-bottom: 0; }
.upload-panel summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.65rem 0.75rem;
  font-size: 0.88rem; font-weight: 600; cursor: pointer; user-select: none;
}
.upload-panel-summary-main {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.1em;
  overflow: hidden;
}
.upload-panel-picked {
  font-weight: 400; color: var(--muted); font-size: 0.78em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 1; min-width: 0;
}
.upload-panel[open] .upload-panel-picked { display: none; }
@media (min-width: 720px) { .upload-panel-picked { display: none !important; } }
.upload-panel summary::-webkit-details-marker { display: none; }
.upload-panel summary::after {
  content: '›'; font-size: 1.15rem; line-height: 1; color: var(--muted);
  transform: rotate(90deg); transition: transform 0.15s, color 0.15s; flex-shrink: 0;
}
.upload-panel[open] summary::after { transform: rotate(-90deg); color: var(--accent); }
.upload-panel-body { padding: 0 0.75rem 0.75rem; }
.upload-options-row { margin-top: 0; gap: 0.45rem; }

@media (min-width: 720px) {
  .hero-upload-stack { gap: 1rem; }
  .hero-upload-primary { order: 2; }
  .upload-panels { order: 1; }
  .upload-panel {
    border: none; background: transparent; margin-bottom: 0;
  }
  .upload-panel summary { display: none; }
  .upload-panel-body { padding: 0; }
  .upload-panel-label { display: inline; }
  .upload-options-row { margin-top: 0.85rem; }
  .upload-options-row .upload-panel.job-opt-col {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 0.6rem 0.7rem;
  }
}

.job-opt-col {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 0.7rem;
}
.job-opt-col-title {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin-bottom: 0.4rem; font-weight: 600;
}
.job-opt-hint {
  font-size: 0.72rem; color: var(--muted); margin: 0.4rem 0 0; line-height: 1.35;
}
.toggle-group { display: flex; gap: 0.35rem; }
.toggle-group .toggle-btn { flex: 1; min-width: 0; }
.toggle-btn, .toggle-chip {
  font: inherit; font-size: 0.8rem; padding: 0.38rem 0.5rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.toggle-btn:hover:not(:disabled), .toggle-chip:hover { border-color: var(--accent); }
.toggle-btn.active, .toggle-chip.active {
  border-color: var(--accent);
  background: rgba(198, 255, 74, 0.1);
  box-shadow: 0 0 0 1px var(--accent);
}
.toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.toggle-stack { display: flex; flex-direction: column; gap: 0.32rem; }
.toggle-chip { text-align: left; width: 100%; }
.toggle-chip.hidden { display: none; }
.lang-select { background: transparent; cursor: pointer; }

.dropzone {
  border: 2px dashed var(--border); border-radius: 16px;
  padding: 2.5rem 1rem; cursor: pointer; background: var(--panel);
  transition: border-color 0.15s, border-style 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); }
.dropzone.dropzone--staged {
  border-style: solid; border-color: var(--accent); cursor: default;
}
.dropzone.dropzone--staged:hover { border-color: var(--accent); }
.drop-staged {
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
  padding: 0.25rem 0;
}
.upload-actions {
  display: flex; gap: 0.6rem; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.drop-selected { text-align: center; line-height: 1.45; }
.drop-selected strong {
  display: block; margin-top: 0.2rem; color: var(--text); font-weight: 600;
  font-size: 1.05rem; word-break: break-word;
}
.drop-icon { color: var(--accent); font-size: 1.6rem; margin-bottom: 0.4rem; }
.progressbar {
  height: 10px; background: var(--border); border-radius: 999px; overflow: hidden;
  max-width: 24rem; margin: 0.5rem auto;
}
#progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.job-status { display: flex; align-items: center; gap: 0.5rem; }
.job-status .muted { white-space: nowrap; }
.drop-status { justify-content: center; margin: 0.35rem 0; }
.spinner {
  width: 1rem; height: 1rem; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.steps { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; padding: 2rem 0 3rem; }
.step {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.9rem 1.1rem; font-size: 0.9rem; display: flex; align-items: center; gap: 0.6rem;
}
.step-n {
  background: var(--accent); color: #0a0b09; font-weight: 800;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem;
}

h2 { margin: 2.5rem 0 1rem; }
.job-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}
.job-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.55rem;
  min-width: 0;
}
.job-card-name {
  font-weight: 700; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-card-status { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.job-card-status .badge { white-space: nowrap; }
.job-card-actions {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto;
}
.job-card-actions .btn { min-width: 2.3rem; text-align: center; }
.job-card-actions .ghost { margin-left: auto; }
#preview-dialog {
  width: auto; max-width: min(92vw, 60rem); padding: 0.8rem;
}
.preview-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 0.6rem;
}
.preview-head .name {
  font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#preview-body video {
  max-width: 100%; max-height: 80vh; border-radius: 10px; background: #000; display: block;
  margin: 0 auto;
}
.job .name { font-weight: 700; }
.job .grow { flex: 1; }
.badge {
  border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.78rem; font-weight: 700;
  background: var(--border);
}
.badge.done { background: var(--accent); color: #0a0b09; }
.badge.processing { background: #3d5afe; color: #fff; }
.badge.failed { background: #ff7a6b; color: #0a0b09; }
.badge.expired { background: var(--border); color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 2rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }
.admin-overview { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.8rem 1.2rem;
}
.stat b { display: block; font-size: 1.4rem; color: var(--accent); }

footer { text-align: center; padding: 2rem; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem; width: min(24rem, 90vw);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  flex: 1; font: inherit; padding: 0.5rem; cursor: pointer;
  background: transparent; border: none; border-bottom: 2px solid var(--border); color: var(--muted);
}
.tab.active { color: var(--text); border-color: var(--accent); }
form label { display: block; margin-bottom: 0.8rem; font-size: 0.9rem; color: var(--muted); }
form input {
  width: 100%; margin-top: 0.3rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.7rem;
}
form input:focus { outline: none; border-color: var(--accent); }
form .btn { width: 100%; margin-top: 0.4rem; }

/* footer + legal */
.footer-links { display: inline-flex; gap: 1.2rem; margin-left: 1.5rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.legal { padding: 2rem 0 3rem; line-height: 1.6; }
.legal h1 { margin-bottom: 2rem; }
.legal h3 { margin: 1.8rem 0 0.5rem; }
.legal p { color: var(--muted); margin: 0 0 0.8rem; max-width: 62ch; }

/* admin: Aufruf-Chart */
.views-chart { max-width: 40rem; }
.views-chart svg {
  width: 100%; height: 9rem; display: block;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
}
.views-chart .bar { fill: var(--accent); }
.views-chart .bar.empty { fill: var(--border); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 0.3rem; }

.render-mode-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.6rem; }
.render-mode-label { width: 100%; margin-bottom: 0.15rem; }
.render-mode-opt { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.render-mode-opt input { accent-color: var(--accent); }
.job-review-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; cursor: pointer; }
.job-review-row input { accent-color: var(--accent); }

/* transcript editor */
#edit-dialog { width: min(46rem, 92vw); }
@media (min-width: 720px) {
  #edit-dialog { width: min(58rem, 94vw); }
  .edit-workspace {
    display: grid;
    grid-template-columns: minmax(12rem, 42%) 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
  }
  .edit-media-col { min-width: 0; }
  .edit-transcript-col {
    display: flex; flex-direction: column; min-width: 0;
    overflow: hidden;
  }
  .edit-transcript-col #edit-hint {
    flex-shrink: 0; margin-bottom: 0.35rem;
  }
  .edit-transcript-col .edit-words {
    flex: 1; min-height: 0; max-height: none;
    overflow-y: auto;
  }
}
.edit-workspace:not(.hidden) { display: block; }
@media (min-width: 720px) {
  .edit-workspace:not(.hidden) { display: grid; }
}
.edit-words {
  line-height: 2.1;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.8rem 1rem; user-select: none;
}
@media (max-width: 719px) {
  .edit-words { max-height: 45vh; overflow-y: auto; }
}
.eword { cursor: pointer; padding: 0.05rem 0.18rem; border-radius: 4px; transition: background 0.12s, box-shadow 0.12s; }
.eword:hover { background: var(--border); }
.eword.playing {
  background: rgba(198, 255, 74, 0.28); box-shadow: 0 0 0 1px rgba(198, 255, 74, 0.55);
  color: var(--text);
}
.eword.playing.struck { color: #ffb8ae; opacity: 0.9; }
.eword.struck { text-decoration: line-through; color: #ff7a6b; opacity: 0.65; }
.eword.edited { color: var(--accent); }
.edit-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.9rem; gap: 1rem;
}
.edit-preview-wrap {
  position: relative; margin: 0.6rem 0 0.35rem; border-radius: 10px;
  overflow: hidden; background: #000; aspect-ratio: 9 / 16; max-height: 40vh;
  cursor: pointer;
}
.edit-preview-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.edit-preview-caption {
  position: absolute; left: 0; right: 0; bottom: 14%; text-align: center;
  pointer-events: none; padding: 0 0.8rem;
}
.edit-preview-caption .caption-sub {
  display: block; margin-top: 0.55em; opacity: 1; line-height: 1.2;
}
.edit-preview-controls { margin-bottom: 0.5rem; }
.edit-transport {
  display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.45rem;
}
.edit-time-display { margin-left: auto; font-variant-numeric: tabular-nums; }
.edit-timeline { user-select: none; touch-action: none; }
.edit-timeline-track {
  position: relative; height: 2rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden; cursor: pointer;
}
.edit-timeline-kept, .edit-timeline-pauses {
  position: absolute; inset: 0; pointer-events: none;
}
.edit-timeline-kept .tl-segment {
  position: absolute; top: 0; bottom: 0; background: rgba(198, 255, 74, 0.22);
  border-left: 1px solid rgba(198, 255, 74, 0.35);
  border-right: 1px solid rgba(198, 255, 74, 0.35);
}
.edit-timeline-pauses { pointer-events: auto; }
.tl-pause {
  position: absolute; top: 0; bottom: 0; min-width: 4px; padding: 0; border: none; cursor: pointer;
  border-radius: 2px; opacity: 0.85;
}
.tl-pause.cut { background: rgba(255, 122, 107, 0.75); }
.tl-pause.kept { background: rgba(120, 180, 255, 0.55); }
.tl-pause:hover { opacity: 1; filter: brightness(1.15); }
.edit-timeline-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--accent); pointer-events: none; z-index: 2;
  box-shadow: 0 0 4px rgba(198, 255, 74, 0.6);
}
.edit-timeline-hint { margin: 0.35rem 0 0; line-height: 1.4; }
.edit-simulate-row { display: flex; align-items: center; gap: 0.45rem; margin: 0.4rem 0; cursor: pointer; }
.edit-simulate-row input { accent-color: var(--accent); }
.pause-chip {
  font-family: ui-monospace, monospace; font-size: 0.72rem; cursor: pointer;
  color: var(--muted); background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.05rem 0.35rem; user-select: none;
  transition: background 0.12s, border-color 0.12s;
}
.pause-chip.playing {
  background: rgba(198, 255, 74, 0.28); border-color: var(--accent); color: var(--text); opacity: 1;
}
.pause-chip.struck { text-decoration: line-through; opacity: 0.55; }
.pause-chip:hover { border-color: var(--accent); }
#edit-render:disabled { opacity: 0.45; cursor: not-allowed; }

body.dialog-open { overflow: hidden; overscroll-behavior: none; }

@media (max-width: 719px) {
  .site-header {
    flex-wrap: nowrap;
    align-items: center;
    padding: max(0.65rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) 0.65rem max(0.85rem, env(safe-area-inset-left));
  }
  #nav {
    width: auto;
    margin-left: auto;
    flex-wrap: nowrap;
  }
  .nav-burger { display: inline-flex; flex-shrink: 0; }
  .nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: min(16rem, calc(100vw - 1.7rem));
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.55rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    z-index: 40;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  }
  .nav-menu--open { display: flex; }
  .nav-user {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .nav-menu-email {
    max-width: none;
    padding: 0.2rem 0.45rem;
    font-size: 0.82rem;
    line-height: 1.35;
    word-break: break-word;
  }
  #nav-menu .lang-select,
  #nav-menu .btn,
  #nav-menu #nav-admin {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
  }
  #nav-menu #nav-admin { display: flex; box-sizing: border-box; }
  #nav-menu #nav-admin.hidden { display: none !important; }
  #nav-credits { align-self: flex-start; }

  main { width: 100%; max-width: 100%; padding: 0 0.85rem; box-sizing: border-box; }
  .hero { padding: 1.5rem 0 0.75rem; }
  .hero h1 { font-size: clamp(1.75rem, 8.5vw, 2.4rem); }
  .hero .sub { font-size: 0.92rem; margin-bottom: 0.85rem; }

  .upload-panel-label { display: none; }
  .upload-panel .job-opt-col-title { display: none; }
  .upload-options-row {
    display: flex; flex-direction: column;
  }
  .upload-options-row .upload-panel.job-opt-col {
    background: transparent; padding: 0;
  }

  .style-picker-head { gap: 0.4rem; }
  .preset-row { gap: 0.4rem; }
  .preset {
    min-width: 0;
    flex: 1 1 calc(50% - 0.22rem);
    max-width: calc(50% - 0.22rem);
    padding: 0.55rem 0.35rem 0.35rem;
  }
  .preset-preview { white-space: normal; font-size: 0.68rem !important; line-height: 1.2; }

  .custom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.55rem;
    padding-top: 0.55rem;
  }
  .custom-grid label.row { grid-column: 1 / -1; }

  .job-lang-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin-top: 0.55rem;
  }
  .job-lang-row label:not(:first-child) { margin-left: 0; margin-top: 0.35rem; }
  .job-lang-row select { width: 100%; max-width: 100%; }

  footer { padding: 1.5rem 0.85rem max(1.5rem, env(safe-area-inset-bottom)); }
  .footer-links {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0.75rem 1rem; margin-left: 0;
  }

  .dropzone { padding: 1.75rem 0.85rem; }

  #edit-dialog:not([open]) {
    display: none !important;
  }

  #edit-dialog[open],
  #edit-dialog[open].edit-dialog--mobile {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
  }
  #edit-dialog::backdrop { background: var(--bg); }

  #edit-dialog .preview-head {
    flex-shrink: 0;
    margin: 0;
    padding: max(0.65rem, env(safe-area-inset-top)) 0.85rem 0.65rem;
    border-bottom: 1px solid var(--border);
  }
  #edit-dialog .preview-head .name { font-size: 0.92rem; }

  #edit-dialog .tabs {
    flex-shrink: 0;
    flex-wrap: wrap;
    overflow-x: hidden;
    gap: 0.35rem;
    margin: 0;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border);
  }
  #edit-dialog .tabs::-webkit-scrollbar { display: none; }
  #edit-dialog .tab {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.84rem;
  }

  #edit-dialog .edit-workspace:not(.hidden) {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.55rem 0.85rem 0;
  }

  #edit-dialog .edit-media-col {
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
  }

  #edit-dialog .edit-transcript-col {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 0.45rem;
  }

  #edit-dialog .edit-transcript-col #edit-hint {
    flex-shrink: 0;
    margin-bottom: 0.35rem;
    line-height: 1.35;
  }

  #edit-dialog #edit-preview-status,
  #edit-dialog #edit-vad-hint {
    flex-shrink: 0;
    margin: 0;
    padding: 0.35rem 0.85rem;
  }

  #edit-dialog .edit-foot {
    flex-shrink: 0;
    margin: 0;
    padding: 0.65rem 0.85rem max(0.75rem, env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--border);
    gap: 0.65rem;
  }
  #edit-dialog .edit-foot .btn.primary {
    flex-shrink: 0;
    min-height: 2.75rem;
    padding: 0.55rem 1.1rem;
  }

  .edit-preview-wrap {
    max-height: min(28vh, 11.5rem);
    margin-top: 0;
    cursor: default;
  }
  .edit-preview-caption { bottom: 10%; padding: 0 0.5rem; font-size: 0.85em; }

  .edit-preview-controls { margin-bottom: 0.25rem; }
  .edit-transport { gap: 0.4rem; margin-bottom: 0.4rem; }
  .edit-transport .btn.tiny {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.88rem;
  }
  .edit-time-display { font-size: 0.82rem; }

  .edit-timeline-track { height: 2.5rem; border-radius: 8px; }
  .edit-timeline-playhead { width: 3px; margin-left: -1.5px; }
  .tl-pause { min-width: 12px; border-radius: 3px; }

  .edit-timeline-hint { display: none; }
  .edit-simulate-row { min-height: 2.25rem; padding: 0.1rem 0; margin: 0.25rem 0 0; }

  .edit-words {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.65rem 0.75rem;
    line-height: 2.15;
  }
  .eword { padding: 0.12rem 0.28rem; }
  .pause-chip { font-size: 0.78rem; padding: 0.15rem 0.45rem; }

  .edit-style-picker { margin-top: 0.35rem; }
  .edit-style-picker .preset-row { flex-wrap: wrap; }
  .edit-style-picker .preset { min-width: calc(33% - 0.35rem); flex: 1 1 calc(33% - 0.35rem); min-height: 2.35rem; }

  .upload-actions .btn { min-height: 2.75rem; }
  .job-grid { grid-template-columns: 1fr; }
  .job-card-actions .ghost { margin-left: 0; }
}

/* premium */
#nav-premium { color: var(--accent); border-color: var(--accent); }
#premium-dialog { width: min(26rem, 92vw); }
.premium-perks { margin: 0.4rem 0 0.8rem 1.2rem; padding: 0; line-height: 1.8; }

/* landing content */
.features, .faq { padding: 1rem 0 1.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.2rem; }
.feature h3 { margin: 0 0 0.5rem; font-size: 1.02rem; }
.feature p { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.faq details { border-bottom: 1px solid var(--border); padding: 0.7rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 0.6rem 0 0.2rem; line-height: 1.6; max-width: 65ch; }
.logo { text-decoration: none; color: var(--text); }

.time-chip {
  font-family: ui-monospace, monospace; font-size: 0.72rem;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.05rem 0.3rem; user-select: none;
}
