/* Open Sans (SIL OFL 1.1, fonts/OFL.txt), variable weight and width. */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/fonts/open-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/fonts/open-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #181a1d;
  --panel: #242629;
  --panel-hover: #2c2e31;
  --line: #3f4043;
  --line-strong: #55575b;
  --text: #d9d9d9;
  --text-strong: #fff;
  --muted: #9398a0;
  --faint: #696f78;
  --placeholder: #606469;
  --red: #ba4545;
  --red-hover: #cc5050;
  --red-bright: #ec5555;
  --red-soft: #f6aaaa;
  --red-gradient: linear-gradient(90deg, #ea4d4d, #e33333);
  --chip-red: #d32f2f;
  --chip-purple: #9d46e3;
  --chip-blue: #0b79d1;
  --chip-green: #6c9c34;
  --chip-orange: #ea5201;
  --radius: 3px;
  --font: "Open Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shell: min(100% - 2rem, 90rem);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 .9375rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p { margin-top: 0; }
a { color: var(--red-bright); }
a:hover { color: var(--red-soft); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 2px; }

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

.icon {
  width: 1.15rem; height: 1.15rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-solid { fill: currentColor; }

/* Wordmark: white V, red NOVEL with a stencil cut through the middle. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--text-strong);
  font-family: var(--font);
  font-size: 2rem;
  font-stretch: 75%;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  user-select: none;
}
a.wordmark:hover { color: var(--text-strong); }
.wordmark-v { margin-right: .05em; }
.wordmark-novel {
  background: linear-gradient(180deg, var(--red) 0 47%, transparent 47% 57%, var(--red) 57%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Buttons ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: .4rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text-strong); }
.button-primary { border-color: var(--red); background: var(--red); color: #fff; }
.button-primary:hover:not(:disabled) { border-color: var(--red-hover); background: var(--red-hover); }
.button-block { width: 100%; }
.button .icon { width: 1rem; height: 1rem; }
.icon-button { width: 2.4rem; padding: 0; }
.icon-button .icon { width: 1.25rem; height: 1.25rem; }
.button.is-small { min-height: 1.9rem; padding: .2rem .7rem; font-size: .8rem; }
.icon-button.is-small { width: 2rem; min-height: 2rem; padding: 0; }
.icon-button.is-small .icon { width: 1rem; height: 1rem; }
.link-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: .875rem;
  text-align: left;
}
.link-button:hover:not(:disabled) { color: var(--text-strong); text-decoration: underline; }

/* Chips -------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: var(--radius);
  background: var(--line);
  color: var(--text);
  padding: .05rem .4rem;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.chip-red { background: var(--chip-red); color: #fff; }
.chip-purple { background: var(--chip-purple); color: #fff; }
.chip-blue { background: var(--chip-blue); color: #fff; }
.chip-green { background: var(--chip-green); color: #fff; }
.chip-orange { background: var(--chip-orange); color: #fff; }
.chip-group { display: inline-flex; gap: .25rem; }

/* Panels, forms, notices ---------------------------------------------------- */

.panel { border-radius: var(--radius); background: var(--panel); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.panel-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid var(--line);
  padding: .8rem 1.1rem;
}
.panel-head h2 { flex: 1; margin: 0; color: var(--text-strong); font-size: 1.05rem; font-weight: 600; }
.panel-body { display: grid; gap: .9rem; padding: 1.1rem; }

.field { display: grid; gap: .4rem; }
.field-label, .section-label {
  color: var(--faint);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.input {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: .5rem .75rem;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px rgba(186, 69, 69, .22); }
.code-input { font: 700 1.5rem/1 var(--mono); letter-spacing: .45em; text-align: center; }
.check { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .9rem; }
.check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--red); }
.form-intro { margin: 0; color: var(--muted); line-height: 1.55; }
.form-intro strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.form-error { margin: 0; color: #f19c9c; font-size: .9rem; }
.form-notice { margin: 0; color: #b5d98f; font-size: .9rem; }
.form-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; }

.notice {
  margin: 0;
  border: 1px solid;
  border-radius: var(--radius);
  padding: .7rem .9rem;
  font-size: .9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.notice-error { border-color: #7a3434; background: #3a2224; color: #f3c3c3; }
.notice-success { border-color: #4d6b2c; background: #263220; color: #cfe6b5; }
.notice a { color: inherit; font-weight: 700; }

/* The red-bordered info box with an icon block on the left. */
.alert {
  display: flex;
  overflow: hidden;
  border: 2px solid var(--red-bright);
  border-radius: 6px;
  background: var(--panel);
  color: #eee;
}
.alert-icon { display: grid; flex: 0 0 3rem; place-items: center; background: var(--red-bright); color: var(--red-soft); }
.alert-icon .icon { width: 1.6rem; height: 1.6rem; color: #fff; opacity: .7; }
.alert-body { min-width: 0; padding: .75rem 1rem; line-height: 1.5; }
.alert-body h2 { margin: 0 0 .2rem; color: var(--text-strong); font-size: 1.05rem; }
.alert-body p { margin: 0; overflow-wrap: anywhere; }
.alert-body ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.alert-body li + li { margin-top: .3rem; }

.spinner {
  display: inline-block;
  width: 1.1rem; height: 1.1rem;
  flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--red-bright);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg);
}
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--red-gradient); transition: width .25s ease; }
.progress-track.indeterminate .progress-fill { display: none; }
.progress-track.indeterminate::before {
  position: absolute;
  width: 35%; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--red-bright), transparent);
  content: "";
  animation: indeterminate 1.4s ease-in-out infinite;
}
@keyframes indeterminate { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.progress-label-row { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; color: var(--text); font-size: .875rem; }

/* Top bar (catalog and status pages) ---------------------------------------- */

.topbar { position: sticky; top: 0; z-index: 20; background: var(--panel); box-shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .18); }
.topbar-inner { display: flex; align-items: stretch; gap: 2.25rem; width: var(--shell); height: 4.25rem; margin: 0 auto; }
.topbar .wordmark { align-self: center; font-size: 2.9rem; }
.tabs { display: flex; align-items: stretch; gap: 1.75rem; }
.tab {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 1.05rem;
  font-stretch: 87.5%;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  text-transform: uppercase;
}
.tab:hover { color: var(--text-strong); }
.tab.is-active { color: var(--red); }
.tab.is-active::after {
  position: absolute;
  right: -.3rem; bottom: .55rem; left: -.3rem;
  height: 4px;
  border-radius: 4px;
  background: var(--red-gradient);
  content: "";
}
.topbar-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

.account-menu { position: relative; }
.account-button {
  display: inline-flex;
  height: 2.4rem;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  padding: 0 .55rem 0 .3rem;
  font-size: .9rem;
  font-weight: 600;
}
.account-button:hover, .account-button[aria-expanded="true"] { border-color: var(--line-strong); background: var(--panel-hover); color: var(--text-strong); }
.account-button .icon { width: 1rem; height: 1rem; color: var(--muted); }
.account-button-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid;
  width: 1.85rem; height: 1.85rem;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar.is-large { width: 2.5rem; height: 2.5rem; font-size: 1.05rem; }
.menu-panel {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  z-index: 30;
  width: min(19rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.menu-section { display: grid; gap: .45rem; border-top: 1px solid var(--line); padding: .85rem 1rem; }
.menu-section:first-child { border-top: 0; }
.menu-who { display: flex; align-items: center; gap: .75rem; }
.menu-who > div { min-width: 0; }
.menu-name { margin: 0; overflow: hidden; color: var(--text-strong); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.menu-email { margin: 0; overflow: hidden; color: var(--muted); font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.menu-note { margin: 0; color: var(--muted); font-size: .82rem; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.menu-row-label { display: flex; align-items: center; gap: .5rem; }
.menu-row-label .icon { width: 1rem; height: 1rem; color: var(--red); }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .6rem;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--text);
  padding: .75rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
}
.menu-item:hover:not(:disabled) { background: var(--panel-hover); color: var(--text-strong); }
.menu-item .icon { width: 1.05rem; height: 1.05rem; color: var(--red); }

/* Catalog ------------------------------------------------------------------- */

.content { width: var(--shell); margin: 0 auto; padding: 1.5rem 0 3rem; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  margin-bottom: 1.1rem;
  border-radius: var(--radius);
  background: var(--panel);
  padding: .6rem .8rem;
}
.toolbar h1 { margin: 0; color: var(--text-strong); font-size: 1.05rem; font-weight: 600; }
.toolbar-stats { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.catalog-alert { margin-bottom: 1.1rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19.5rem), 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card { min-width: 0; }
.card-link {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-link:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
/* Placeholder until covers come from the ingest. */
.card-cover {
  position: relative;
  aspect-ratio: 3 / 1;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, #202225, #1b1d20);
}
.cover-icon { position: absolute; inset: 0 0 1.1rem; display: grid; place-items: center; color: #3b3d41; transition: color .15s ease; }
.cover-icon .icon { width: 2.4rem; height: 2.4rem; stroke-width: 1.6; }
.card-link:hover .cover-icon { color: var(--red); }
.card.is-failed .cover-icon { color: #5a3335; }
.cover-chips { position: absolute; right: .5rem; bottom: .45rem; left: .5rem; display: flex; align-items: flex-end; justify-content: space-between; gap: .4rem; }
.cover-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; overflow: hidden; border-radius: 0; background: rgba(0, 0, 0, .45); }
.cover-progress .progress-fill { border-radius: 0; }
.card-body { padding: .45rem .75rem .65rem; }
.card-title {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease;
}
.card-link:hover .card-title { color: var(--text-strong); }
.card-stats { display: flex; align-items: center; gap: .9rem; margin: .2rem 0 0; overflow: hidden; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.stat { display: inline-flex; min-width: 0; align-items: center; gap: .35rem; }
.stat .icon { width: 1.05rem; height: 1.05rem; color: var(--red); stroke-width: 2.3; }
.stat-text { overflow: hidden; text-overflow: ellipsis; }
.card.is-failed .card-stats { color: #e3a3a3; }
.empty-state { display: grid; justify-items: center; gap: .4rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); padding: 3.5rem 1rem; text-align: center; }
.empty-state .icon { width: 2.25rem; height: 2.25rem; color: var(--line-strong); }
.empty-state h2 { margin: .35rem 0 0; color: var(--text); font-size: 1.1rem; }
.empty-state p { margin: 0; }

/* Landing (signed out) ------------------------------------------------------- */

/* minmax(0, 1fr): the marquee rail is wider than the page and must not widen the column. */
.landing { display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
.landing-main { display: grid; align-content: center; justify-items: center; gap: 2.25rem; padding: 3rem 1rem 2.5rem; }
.banner { display: grid; justify-items: center; text-align: center; }
.banner .wordmark { margin: 0; font-size: clamp(4.5rem, 17vw, 9.5rem); }
.banner-rule { width: 6rem; height: 5px; margin: 1.15rem 0 1rem; border-radius: 5px; background: var(--red-gradient); }
.banner-subtitle { max-width: 34rem; margin: 0; color: var(--muted); font-size: clamp(1.02rem, 2.6vw, 1.25rem); line-height: 1.45; }
.auth-panel { width: min(100%, 24rem); }

.marquee { display: flex; min-width: 0; min-height: 3.1rem; border-top: 1px solid #2c2e31; background: var(--panel); }
.marquee-label {
  display: flex;
  flex: none;
  align-items: center;
  gap: .5rem;
  background: var(--red);
  color: #fff;
  padding: 0 1rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.marquee-label .icon { width: 1rem; height: 1rem; }
.marquee-viewport {
  position: relative;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
}
/* No animation until marquee.js has measured the rail and set the duration. */
.marquee-rail { display: flex; width: max-content; height: 100%; animation: marquee var(--marquee-duration) linear infinite; }
.marquee:hover .marquee-rail { animation-play-state: paused; }
.marquee-list { display: flex; margin: 0; padding: 0; list-style: none; }
.marquee-item { display: flex; align-items: center; gap: .55rem; padding: 0 1.4rem 0 0; white-space: nowrap; }
.marquee-item::before { width: .4rem; height: .4rem; margin-right: .85rem; background: var(--red); content: ""; transform: rotate(45deg); }
.marquee-title { color: var(--text); font-weight: 600; }
.marquee-age { color: var(--faint); font-size: .85rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

.boot { position: fixed; inset: 0; display: grid; place-items: center; animation: fade-in .2s ease .5s both; }
@keyframes fade-in { from { opacity: 0; } }

/* Upload dialog and other modals --------------------------------------------- */

.modal {
  width: min(100% - 2rem, 34rem);
  max-height: calc(100dvh - 2rem);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(10, 11, 13, .75); }
.modal-form { display: contents; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; border-top: 1px solid var(--line); padding: .8rem 1.1rem; }

.drop-zone {
  display: grid;
  justify-items: center;
  gap: .35rem;
  border: 2px dashed var(--line);
  border-radius: 6px;
  background: var(--bg);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.drop-zone .icon { width: 2.2rem; height: 2.2rem; margin-bottom: .2rem; color: var(--red); }
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.is-dragging { border-color: var(--red); background: #1c1e21; }
.drop-zone.is-disabled { cursor: not-allowed; opacity: .55; }
.drop-zone-title { color: var(--text-strong); font-weight: 600; }
.drop-zone-copy { color: var(--muted); font-size: .875rem; }
.file-summary { margin: 0; color: var(--text); font-size: .9rem; overflow-wrap: anywhere; }
.transfer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; margin-top: .45rem; color: var(--muted); font-size: .8rem; }

/* Status page ----------------------------------------------------------------- */

.content-narrow { width: min(100% - 2rem, 52rem); }
.loading-card { display: flex; min-height: 12rem; align-items: center; justify-content: center; gap: .75rem; color: var(--muted); }
.loading-card p { margin: 0; }
.status-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; }
.status-head h1 { margin: 0; color: var(--text-strong); font-size: clamp(1.2rem, 3.5vw, 1.5rem); line-height: 1.3; overflow-wrap: anywhere; }
.job-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.reconnecting { min-height: 1.25rem; margin: 0; color: var(--muted); font-size: .85rem; }
.status-body { display: grid; gap: 1.25rem; padding: 1.25rem; }
.current-message { margin: 0; color: var(--text); line-height: 1.5; }
.stepper { display: grid; margin: 0; padding: 0; list-style: none; }
.stage-item { position: relative; display: grid; min-height: 2.6rem; grid-template-columns: 1.5rem 1fr; gap: .75rem; color: var(--faint); }
.stage-item:not(:last-child)::before { position: absolute; top: 1.5rem; bottom: .05rem; left: .74rem; width: 2px; background: var(--line); content: ""; }
.stage-item.done:not(:last-child)::before { background: var(--chip-green); }
.stage-marker {
  z-index: 1;
  display: grid;
  width: 1.5rem; height: 1.5rem;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}
.stage-marker .spinner { width: .8rem; height: .8rem; border-width: 2px; }
.stage-item.active { color: var(--text-strong); }
.stage-item.active .stage-marker { border-color: var(--red-bright); }
.stage-item.done { color: var(--text); }
.stage-item.done .stage-marker { border-color: var(--chip-green); background: var(--chip-green); }
.stage-item.failed { color: #f3c3c3; }
.stage-item.failed .stage-marker { border-color: var(--chip-red); background: var(--chip-red); }
.stage-label { padding-top: .1rem; font-weight: 600; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.share-row p { margin: 0; color: var(--muted); font-size: .875rem; }
.details-log summary { color: var(--text); cursor: pointer; font-weight: 600; }
.log-output {
  max-height: 16rem;
  overflow: auto;
  margin: .75rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: #b9bdc4;
  padding: .8rem;
  font: .78rem/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.status-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Player ------------------------------------------------------------------------ */

.player-mode { overflow: hidden; }
.player-mode > .topbar { display: none; }
.player-mode #app { width: 100%; max-width: none; margin: 0; padding: 0; }
.player-shell { display: flex; width: 100%; height: 100dvh; flex-direction: column; }
.player-bar { display: flex; min-height: 3.6rem; flex: none; align-items: center; gap: 1rem; background: var(--panel); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); padding: .45rem 1rem; }
.player-bar .wordmark { font-size: 1.75rem; }
.player-divider { width: 1px; height: 2rem; flex: none; background: var(--line); }
.player-title { min-width: 0; flex: 1; }
.player-title h1 { margin: 0; overflow: hidden; color: var(--text-strong); font-size: 1rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.player-title p { margin: .1rem 0 0; color: var(--muted); font-size: .78rem; }
.player-actions { display: flex; flex: none; flex-wrap: wrap; gap: .45rem; }
.player-frame { width: 100%; min-height: 0; flex: 1; border: 0; background: #000; }

/* Small screens -------------------------------------------------------------------- */

@media (max-width: 40rem) {
  :root { --shell: min(100% - 1.25rem, 90rem); }
  .topbar-inner { gap: 1.1rem; height: 3.6rem; }
  .topbar .wordmark { font-size: 2.2rem; }
  .tab { font-size: .95rem; }
  .account-button-name { display: none; }
  .content { padding-top: 1rem; }
  .landing-main { gap: 1.75rem; padding-top: 2rem; }
  .marquee-label span { display: none; }
  .player-bar { flex-wrap: wrap; }
  .player-divider { display: none; }
  .player-actions { width: 100%; }
  .player-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .marquee-rail { animation: none; }
  .marquee-viewport { overflow-x: auto; }
}
