/* Rock paper look: a copy of ave.css (the Ave site's layout and feel) with Rock's palette and type.
 * Generated from ave.css on 2026-10-21; if ave.css changes a lot, re-copy it and re-apply the swaps below.
 * Tokens: cream paper, Rock black ink, Rock orange. Display: Anton (uppercase). Body: Space Grotesk 500. */

@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-n-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/fonts/anton-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ave-paper: #F3EEE4;
  --ave-paper-2: #E8E0D1;
  --ave-sheet: #FCF9F3;
  --ave-ink: #10100F;
  --ave-ink-2: #2E2A25;
  --ave-muted: #6E665A;
  --ave-rule: #D8CFBF;
  --ave-flame: #F97D12;
  --ave-gold: #FFB25C;
  --ave-lavender: #B3A792;
  --ave-on-ink: #F3EEE4;
  --ave-error: #A8321F;
  --ave-error-bg: #F6DED6;
  --ave-warn: #8F4410;

  --ave-font: 'Space Grotesk', system-ui, sans-serif;
  --rock-display: 'Anton', sans-serif;
  --ave-radius: 10px;
  --ave-radius-sm: 6px;
  --ave-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ave-dur: 160ms;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;

  /* legacy names used by style.css, remapped so nothing falls back to Rock */
  --bg: var(--ave-paper);
  --bg2: var(--ave-sheet);
  --text: var(--ave-ink);
  --muted: var(--ave-muted);
  --accent: var(--ave-flame);
  --card: transparent;
  --card-edge: var(--ave-rule);
  --error: var(--ave-error);
  --line: var(--ave-rule);
}

html, body { overflow-x: clip; }
[hidden] { display: none !important; }

body {
  background: var(--ave-paper);
  color: var(--ave-ink);
  font-family: var(--ave-font);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--rock-display);
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--ave-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}
h1 { font-size: clamp(2.2rem, 8vw, 3rem); margin-bottom: var(--space-sm); }
h2 { font-size: 1.6rem; margin-bottom: var(--space-md); }

a { color: var(--ave-ink); text-decoration-color: var(--ave-flame); text-underline-offset: 3px; }
a:hover { color: var(--ave-ink-2); }
.muted { color: var(--ave-muted); font-size: 0.92rem; font-weight: 500; }
.error { color: var(--ave-error); font-weight: 500; }
.warn { color: var(--ave-warn); }

:focus-visible { outline: 2px solid var(--ave-flame); outline-offset: 2px; }

/* ── Top bar ───────────────────────────────────────── */
.topbar {
  gap: var(--space-md);
  padding: var(--space-md) max(1.25rem, calc((100vw - 720px) / 2));
  border-bottom: 1px solid var(--ave-rule);
  background: var(--ave-paper);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--ave-font); font-weight: 500; font-size: 1.2rem;
  letter-spacing: 0; color: var(--ave-ink); white-space: nowrap;
}
.brand-mark { height: 30px; width: auto; display: block; }
.nav { gap: var(--space-lg); margin-right: var(--space-sm); font-size: 1rem; }
.nav a {
  color: var(--ave-muted); font-weight: 500; white-space: nowrap;
  padding-block: 0.2rem; border-bottom: 2px solid transparent;
  transition: color var(--ave-dur) var(--ave-ease-out), border-color var(--ave-dur) var(--ave-ease-out);
}
.nav a:hover { color: var(--ave-ink); }
.nav a[aria-current="page"] { color: var(--ave-ink); border-bottom-color: var(--ave-flame); }
.logout button {
  background: none; border: none; padding: 0.2rem 0;
  color: var(--ave-muted); font-weight: 500; font-size: 0.95rem; white-space: nowrap;
}
.logout button:hover { color: var(--ave-ink); background: none; }

/* ── Page column + sections ────────────────────────── */
.wrap { max-width: 720px; padding: var(--space-lg) 1.25rem var(--space-xl); }

.card {
  background: transparent; border: none; border-radius: 0;
  border-top: 1px solid var(--ave-rule);
  padding: var(--space-xl) 0 var(--space-lg); margin: 0;
}
.wrap > .card:first-child, #job > .card:first-of-type { border-top: none; padding-top: var(--space-md); }

/* ── Forms ─────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-lg) var(--space-md);
  align-items: end;
}
.form-grid > * { grid-column: 1 / -1; }
.form-grid > label:has([name="layout"]),
.form-grid > label:has([name="preset"]),
.form-grid > label:has([name="speaker"]),
.form-grid > label:has([name="show"]),
.form-grid > label:has([name="start"]),
.form-grid > label:has([name="end"]) { grid-column: auto; }

.form-grid label { gap: 0.4rem; font-size: 1rem; font-weight: 500; color: var(--ave-ink); }
.form-grid label .muted { display: block; font-weight: 500; font-size: 0.88rem; line-height: 1.35; }
.form-grid label.check { flex-direction: row; align-items: baseline; gap: 0.6rem; font-weight: 500; }
.form-grid label.check .muted { display: inline; }

input[type=text], input[type=password], input[type=file], select, textarea {
  background: var(--ave-sheet);
  border: 1px solid var(--ave-rule);
  border-radius: var(--ave-radius-sm);
  color: var(--ave-ink);
  font-family: var(--ave-font); font-weight: 500; font-size: 1.0625rem;
  padding: 0.7rem 0.8rem;
  transition: border-color var(--ave-dur) var(--ave-ease-out);
}
input::placeholder { color: var(--ave-muted); opacity: 0.7; }
input:hover, select:hover { border-color: var(--ave-lavender); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ave-ink); outline: 2px solid var(--ave-flame); outline-offset: 1px; }
input:disabled, select:disabled { opacity: 0.5; }
input:user-invalid { border-color: var(--ave-error); }

select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2314275E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}

input[type=file] { padding: 0.45rem; font-size: 0.95rem; color: var(--ave-muted); cursor: pointer; }
input[type=file]::file-selector-button {
  background: var(--ave-paper-2); color: var(--ave-ink);
  border: none; border-radius: 999px;
  font-family: var(--ave-font); font-weight: 500; font-size: 0.95rem;
  padding: 0.5rem 1rem; margin-right: 0.8rem; cursor: pointer;
  transition: background-color var(--ave-dur) var(--ave-ease-out);
}
input[type=file]:hover::file-selector-button { background: var(--ave-rule); }

input[type=checkbox] { accent-color: var(--ave-ink); width: 1.05rem; height: 1.05rem; translate: 0 2px; }

/* ── Buttons ───────────────────────────────────────── */
button, .primary {
  background: var(--ave-ink); color: var(--ave-on-ink);
  border: 1px solid var(--ave-ink); border-radius: var(--ave-radius);
  font-family: var(--ave-font); font-weight: 500; font-size: 1.0625rem;
  padding: 0.75rem 1.4rem; white-space: nowrap;
  transition: background-color var(--ave-dur) var(--ave-ease-out), transform 90ms var(--ave-ease-out);
}
button:hover, .primary:hover { background: var(--ave-ink-2); color: var(--ave-on-ink); }
button:active, .primary:active { transform: translateY(1px); }
button:disabled, button:disabled:hover { opacity: 0.45; background: var(--ave-ink); transform: none; cursor: default; }
button[aria-busy="true"] { opacity: 0.7; cursor: progress; }

button.secondary {
  background: transparent; color: var(--ave-ink);
  border: 1px solid var(--ave-rule); justify-self: start; align-self: flex-start;
}
button.secondary:hover { background: var(--ave-paper-2); color: var(--ave-ink); }
button.secondary[aria-expanded="true"] { border-color: var(--ave-ink); }
button.secondary[aria-expanded="true"]::before {
  content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--ave-flame); margin-right: 0.55rem; translate: 0 -1px;
}

.form-grid > button[type=submit] { justify-self: start; margin-top: var(--space-sm); padding-inline: 2rem; }

/* ── Look strip (cover-flow) ───────────────────────── */
.form-grid > .style-pick { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.6rem; margin: 0 calc(-1 * 1.25rem); }
.style-pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); padding-inline: 1.25rem; flex-wrap: wrap; }
.style-pick-title { font-family: var(--rock-display); font-weight: 400; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.04em; }
.style-strip {
  --card-w: clamp(142px, 38vw, 184px);
  display: flex; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 0.4rem calc(50% - var(--card-w) / 2) 0.8rem;
}
.style-strip::-webkit-scrollbar { display: none; }
.style-strip {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  cursor: grab;
}
.style-pick-nav { display: none; gap: 0.4rem; }
.style-arrow {
  width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; font-size: 1.05rem; line-height: 1;
  background: transparent; color: var(--ave-ink); border: 1px solid var(--ave-rule);
}
.style-arrow:hover { background: var(--ave-paper-2); color: var(--ave-ink); }
.style-note { margin: 0; padding-inline: 1.25rem; min-height: 1.3em; }
@media (hover: hover) and (pointer: fine) { .style-pick-nav { display: inline-flex; } }
.style-card {
  --flow: 1;
  flex: 0 0 var(--card-w); scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem;
  background: none; border: none; padding: 0; border-radius: var(--ave-radius);
  text-align: left; white-space: normal; color: var(--ave-ink);
  transform: scale(calc(1 - min(var(--flow), 1) * 0.14));
  opacity: calc(1 - min(var(--flow), 1) * 0.35);
  transform-origin: center bottom;
  transition: transform 140ms var(--ave-ease-out), opacity 140ms var(--ave-ease-out);
}
.style-card:hover, .style-card:active { background: none; color: var(--ave-ink); }
.style-card:active { transform: scale(calc(1 - min(var(--flow), 1) * 0.14 - 0.02)); }
.style-shot {
  display: block; aspect-ratio: 9 / 16; border-radius: var(--ave-radius); overflow: hidden;
  border: 1px solid var(--ave-rule); background: var(--ave-paper-2);
  box-shadow: 0 6px 18px -8px rgba(16, 16, 15, 0.35);
  position: relative;
  transition: box-shadow var(--ave-dur) var(--ave-ease-out), border-color var(--ave-dur) var(--ave-ease-out);
}
.style-shot img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.style-card[aria-pressed="true"] .style-shot { border-color: var(--ave-flame); box-shadow: 0 0 0 3px var(--ave-flame), 0 8px 20px -8px rgba(249, 125, 18, 0.55); }
.style-card[aria-pressed="true"] .style-shot::after {
  content: ""; position: absolute; top: 0.5rem; right: 0.5rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--ave-flame) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11' viewBox='0 0 14 11'%3E%3Cpath d='M1.5 5.5l3.8 3.8L12.5 1.8' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.85rem no-repeat;
}
.style-name { font-weight: 500; font-size: 1.05rem; margin-top: 0.35rem; line-height: 1.15; }
.style-show { color: var(--ave-muted); font-size: 0.88rem; line-height: 1.2; }
@media (max-width: 600px) {
  .form-grid > .style-pick { margin: 0 -1rem; }
  .style-pick-head, .style-note { padding-inline: 1rem; }
}

/* ── Motion options ────────────────────────────────── */
.motion-box { gap: var(--space-md); }
.motion-box #motion-panel {
  background: var(--ave-sheet); border: 1px solid var(--ave-rule);
  border-radius: var(--ave-radius); padding: var(--space-md) 1.1rem; gap: 0.8rem;
}
.motion-box #motion-panel > p { margin: 0 0 0.2rem; }
.motion-badge {
  border: 1px solid var(--ave-lavender); color: var(--ave-ink);
  font-weight: 500; font-size: 0.82rem; padding: 0.15rem 0.65rem;
}

/* ── History table ─────────────────────────────────── */
table.history { font-size: 1rem; }
table.history th {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ave-muted); border-bottom: 1px solid var(--ave-ink);
  padding: 0 0.5rem 0.5rem 0;
}
table.history td { border-bottom: 1px solid var(--ave-rule); padding: 0.8rem 0.5rem 0.8rem 0; vertical-align: middle; }
table.history td:first-child a { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
table.history td:first-child a:hover { text-decoration: underline; }
table.history td:nth-child(2), table.history td:nth-child(3) { color: var(--ave-muted); font-size: 0.92rem; }
table.history td:last-child { text-align: right; }
table.history td:last-child a {
  display: inline-block; font-weight: 500; font-size: 0.92rem; text-decoration: none;
  border: 1px solid var(--ave-rule); border-radius: 999px; padding: 0.25rem 0.8rem; white-space: nowrap;
  transition: border-color var(--ave-dur) var(--ave-ease-out);
}
table.history td:last-child a:hover { border-color: var(--ave-ink); }

@media (max-width: 600px) {
  table.history thead { display: none; }
  table.history, table.history tbody { display: block; }
  table.history tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.3rem var(--space-md); align-items: center;
    padding: 0.9rem 0; border-bottom: 1px solid var(--ave-rule);
  }
  table.history td { display: block; border: none; padding: 0; }
  table.history td:nth-child(1) { grid-column: 1; grid-row: 1; }
  table.history td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
  table.history td:nth-child(2) { grid-column: 1; grid-row: 2; }
  table.history td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 0.85rem; }
  table.history td:nth-child(5) { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
}

/* ── Status badges ─────────────────────────────────── */
.badge {
  display: inline-block; border-radius: 999px; padding: 0.2rem 0.65rem;
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.05em; white-space: nowrap;
}
.badge-new { background: var(--ave-paper-2); color: var(--ave-muted); }
.badge-queued { background: transparent; color: var(--ave-ink); box-shadow: inset 0 0 0 1px var(--ave-lavender); }
.badge-rendering, .badge-running, .badge-uploading { background: var(--ave-gold); color: var(--ave-ink); }
.badge-done { background: var(--ave-ink); color: var(--ave-on-ink); }
.badge-failed { background: var(--ave-error-bg); color: var(--ave-error); }

/* ── Job page ──────────────────────────────────────── */
.back { color: var(--ave-muted); font-weight: 500; font-size: 0.95rem; text-decoration: none; margin-bottom: var(--space-md); }
.back:hover { color: var(--ave-ink); }
#job > h1 + .muted { margin-top: 0; }

.preview-img, video {
  max-width: 320px; border-radius: var(--ave-radius);
  border: 1px solid var(--ave-rule); background: var(--ave-paper-2);
}
.preview-img { display: block; margin-bottom: var(--space-md); }
video { margin: var(--space-md) 0; }
#render-done .primary { margin-top: var(--space-sm); }

#caption-editor {
  background: var(--ave-sheet); border: 1px solid var(--ave-rule); border-radius: var(--ave-radius);
  padding: var(--space-md) 1.1rem; margin-bottom: var(--space-md);
  max-height: 26rem; overflow-y: auto;
}
.caption-line { gap: 0.15rem 0.3rem; margin-bottom: 0.35rem; padding-bottom: 0.35rem; border-bottom: 1px dashed var(--ave-paper-2); }
.caption-line:last-child { border-bottom: none; margin-bottom: 0; }
.caption-line .word {
  width: calc(var(--len, 6) * 0.82ch + 1.1rem); min-width: 2.5ch; max-width: 100%;
  background: transparent; color: var(--ave-ink);
  font-family: var(--ave-font); font-weight: 500; font-size: 1.0625rem;
  border: 1px solid transparent; border-bottom: 1px dotted var(--ave-lavender);
  border-radius: 4px; padding: 0.15rem 0.3rem;
  transition: background-color var(--ave-dur) var(--ave-ease-out), border-color var(--ave-dur) var(--ave-ease-out);
}
.caption-line .word:hover { background: var(--ave-paper); }
.caption-line .word:focus-visible { background: var(--ave-paper); border-color: var(--ave-ink); outline: 2px solid var(--ave-flame); outline-offset: 1px; }
#captions-saved { margin-left: 0.75rem; }

.bar { background: var(--ave-paper-2); height: 8px; border-radius: 999px; margin: var(--space-md) 0 0.4rem; }
.bar-fill { background: linear-gradient(90deg, var(--ave-flame), var(--ave-gold)); border-radius: 999px; }
#render-state { font-weight: 500; letter-spacing: 0.05em; color: var(--ave-muted); }

/* ── Tools ─────────────────────────────────────────── */
.inline-opts { gap: var(--space-md); }
.tool-row { background: var(--ave-sheet); border-color: var(--ave-rule); border-radius: var(--ave-radius); padding: 0.85rem 1rem; }
.tool-row .name { font-weight: 500; }
.tool-row .del { background: none; border: none; color: var(--ave-muted); font-weight: 500; }
.tool-row .del:hover { color: var(--ave-error); background: none; }
.form-msg { font-size: 0.92rem; }

/* ── Login ─────────────────────────────────────────── */
body:has(.login-card) .topbar { display: none; }
.login-card { max-width: 340px; margin: clamp(2.5rem, 10vh, 6rem) auto; text-align: center; }
.login-mark { width: 180px; height: auto; display: block; margin: 0 auto var(--space-lg); }
.login-card h1 { font-size: 2rem; }
.login-card form { gap: var(--space-sm); margin-top: var(--space-lg); }
.login-card button { width: 100%; }

/* ── Small screens ─────────────────────────────────── */
@media (max-width: 600px) {
  .wrap { padding: var(--space-md) 1rem var(--space-xl); }
  .card { padding: var(--space-lg) 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .form-grid > label { grid-column: 1 / -1 !important; }
  .form-grid > button[type=submit] { justify-self: stretch; }
  .nav { gap: var(--space-md); }
}
@media (max-width: 420px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
  button:active, .primary:active { transform: none; }
}

/* ── Cover ─────────────────────────────────────────── */
.cover-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.cover-shot {
  aspect-ratio: 9 / 16; border-radius: var(--ave-radius); overflow: hidden;
  border: 1px solid var(--ave-rule); background: var(--ave-paper-2);
  display: grid; place-items: center; text-align: center;
}
.cover-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-form { display: flex; flex-direction: column; gap: var(--space-md); }
.cover-form label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 500; }
.cover-form label.check { flex-direction: row; align-items: baseline; gap: 0.6rem; font-weight: 500; }
.cover-form label .muted { font-weight: 500; }
.cover-actions { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.cover-form .muted { margin: 0; }
@media (max-width: 520px) { .cover-row { grid-template-columns: minmax(0, 1fr); } .cover-shot { max-width: 200px; } }

/* ── Done actions (shared with the Rock page's markup) ── */
.done-actions { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; margin-top: var(--space-sm); }
.ghost-link { color: var(--ave-ink); font-weight: 500; font-size: 0.95rem; text-decoration-color: var(--ave-flame); text-underline-offset: 3px; }

/* ── Headline writer ───────────────────────────────── */
.headline-writer { display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
.headline-options { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; }
.headline-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; width: 100%;
  background: var(--ave-sheet); color: var(--ave-ink); border: 1px solid var(--ave-rule);
  border-radius: var(--ave-radius); padding: 0.8rem 1rem; text-align: left; white-space: normal;
}
.headline-option:hover { background: var(--ave-paper-2); color: var(--ave-ink); border-color: var(--ave-lavender); }
.headline-option[aria-pressed="true"] { border-color: var(--ave-flame); box-shadow: 0 0 0 2px var(--ave-flame); }
.headline-text { font-weight: 500; font-size: 1.3rem; line-height: 1.15; }
.headline-text mark { background: none; color: var(--ave-flame); }
.headline-from { font-weight: 500; font-size: 0.85rem; color: var(--ave-muted); line-height: 1.3; }

/* ── Hosts ─────────────────────────────────────────── */
.form-grid > .host-pick { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.6rem; }
.host-pick .style-pick-head { padding-inline: 0; }
.host-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.host-chip {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.3rem 1rem 0.3rem 0.3rem;
  background: var(--ave-sheet); color: var(--ave-ink); border: 1px solid var(--ave-rule); border-radius: 999px;
  font-weight: 500; font-size: 1rem; white-space: nowrap;
}
.host-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; background: var(--ave-paper-2); }
.host-chip:hover { background: var(--ave-paper-2); color: var(--ave-ink); border-color: var(--ave-lavender); }
.host-chip[aria-pressed="true"] { border-color: var(--ave-flame); box-shadow: 0 0 0 2px var(--ave-flame); }
.host-add { font-weight: 500; font-size: 0.95rem; text-decoration: none; padding: 0.55rem 0.9rem; border: 1px dashed var(--ave-lavender); border-radius: 999px; color: var(--ave-ink); }
.host-add:hover { background: var(--ave-paper-2); }
.host-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.host-row { display: flex; align-items: center; gap: var(--space-md); padding: 0.8rem 0; border-bottom: 1px solid var(--ave-rule); }
.host-row:last-child { border-bottom: none; }
.host-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--ave-paper-2); flex: none; }
.host-info { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.host-row form { margin: 0; }


/* ── Rock only: clip gallery (thumbnail cards with Save) ─────────── */
.gallery-wrap { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--ave-rule); }
.section-head { display: flex; align-items: baseline; gap: var(--space-sm); margin-bottom: var(--space-md); }
.section-head h2 { margin: 0; }
.count { color: var(--ave-muted); font-size: 0.92rem; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg) var(--space-md); }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.clip { display: flex; flex-direction: column; gap: var(--space-sm); min-width: 0; }
.poster {
  position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--ave-radius); overflow: hidden;
  background: var(--ave-paper-2); border: 1px solid var(--ave-rule);
  box-shadow: 0 6px 18px -8px rgba(16, 16, 15, 0.35);
}
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ave-ease-out); }
.poster:hover img { transform: scale(1.03); }
.poster-fallback { position: absolute; inset: 0; display: grid; place-items: center; font: 400 3rem var(--rock-display); color: var(--ave-rule); text-transform: uppercase; }
.poster .badge { position: absolute; top: var(--space-sm); left: var(--space-sm); z-index: 2; }
.clip[data-state="done"] .poster .badge { display: none; }
.poster-bar { position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0.6rem; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.5); overflow: hidden; z-index: 2; display: none; }
.poster-bar > span { display: block; height: 100%; background: var(--ave-flame); transition: width 400ms var(--ave-ease-out); }
.clip[data-state="queued"] .poster-bar, .clip[data-state="rendering"] .poster-bar { display: block; }
.clip-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.clip-name { color: var(--ave-ink); text-decoration: none; font-weight: 500; font-size: 1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-name:hover { text-decoration: underline; text-decoration-color: var(--ave-flame); }
.clip-sub { color: var(--ave-muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-actions { display: flex; gap: 0.4rem; }
.clip-actions .save-btn { flex: 1; padding: 0.55rem 0.8rem; font-size: 0.95rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; flex: 0 0 2.6rem; border-radius: var(--ave-radius-sm);
  border: 1px solid var(--ave-rule); color: var(--ave-ink); text-decoration: none; background: var(--ave-sheet);
}
.icon-btn:hover { border-color: var(--ave-flame); }
.done-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); }

/* ── Dark mode: follows the phone unless the top-bar toggle picked one (html[data-theme]) ── */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --ave-paper: #0C0C0B;
  --ave-paper-2: #1E1B17;
  --ave-sheet: #151413;
  --ave-ink: #F0EAD8;
  --ave-ink-2: #FFFFFF;
  --ave-muted: #9C968A;
  --ave-rule: #2E2B27;
  --ave-lavender: #5E574D;
  --ave-on-ink: #10100F;
  --ave-error: #FF7A6B;
  --ave-error-bg: #3A1C18;
  --ave-warn: #FFB25C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ave-paper: #0C0C0B;
    --ave-paper-2: #1E1B17;
    --ave-sheet: #151413;
    --ave-ink: #F0EAD8;
    --ave-ink-2: #FFFFFF;
    --ave-muted: #9C968A;
    --ave-rule: #2E2B27;
    --ave-lavender: #5E574D;
    --ave-on-ink: #10100F;
    --ave-error: #FF7A6B;
    --ave-error-bg: #3A1C18;
    --ave-warn: #FFB25C;
  }
}

/* Logo: ink version on paper, light version on dark */
.brand-mark-dark { display: none; }
:root[data-theme="dark"] .brand-mark-light { display: none; }
:root[data-theme="dark"] .brand-mark-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-mark-light { display: none; }
  :root:not([data-theme="light"]) .brand-mark-dark { display: block; }
}

.mode-toggle {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid var(--ave-rule); background: transparent; color: var(--ave-ink);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.mode-toggle:hover { border-color: var(--ave-flame); }

/* Top bar on phones: logo + 3 links + toggle + log out must fit in 320–414px */
@media (max-width: 480px) {
  .topbar { gap: 0.6rem; padding-inline: 0.9rem; }
  .brand-mark { height: 24px; }
  .nav { gap: 0.8rem; margin-right: 0; font-size: 0.92rem; }
  .mode-toggle { width: 1.9rem; height: 1.9rem; font-size: 0.85rem; }
  .logout button { font-size: 0.85rem; }
}
@media (max-width: 360px) {
  .topbar { gap: 0.45rem; padding-inline: 0.7rem; }
  .nav { gap: 0.6rem; font-size: 0.88rem; }
}
