:root {
  color-scheme: dark;
  --night: #101c2a;
  --night-deep: #0b1420;
  --ink: #f6edda;
  --ink-soft: #d8cfbd;
  --ink-muted: #ada895;
  --forest: #1a3a36;
  --forest-soft: #28534a;
  --wood: #321f1a;
  --wood-light: #5b382a;
  --brass: #c9a25b;
  --brass-bright: #eed28b;
  --amber: #d89c3d;
  --burgundy: #713a43;
  --surface: rgb(22 34 45 / 92%);
  --surface-strong: #162633;
  --line: rgb(222 188 113 / 48%);
  --line-soft: rgb(239 219 171 / 17%);
  --focus: #ffe4a0;
  --content-width: 82.5rem;
  --shadow-card: 0 0.7rem 1.6rem rgb(3 8 14 / 34%), 0 0.15rem 0.4rem rgb(3 8 14 / 25%);
  --shadow-raised: 0 1.25rem 2.4rem rgb(2 7 12 / 48%), 0 0.25rem 0.65rem rgb(2 7 12 / 32%);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  background:
    radial-gradient(58rem 36rem at 50% -14rem, rgb(109 119 103 / 24%), transparent 68%),
    radial-gradient(36rem 28rem at 102% 30%, rgb(40 83 74 / 22%), transparent 70%),
    radial-gradient(34rem 28rem at -8% 66%, rgb(113 58 67 / 15%), transparent 72%),
    linear-gradient(155deg, #172b3c 0%, var(--night) 42%, var(--night-deep) 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    linear-gradient(90deg, rgb(0 0 0 / 24%), transparent 16%, transparent 84%, rgb(0 0 0 / 26%)),
    linear-gradient(180deg, rgb(2 8 15 / 22%), transparent 27%, transparent 76%, rgb(2 7 12 / 42%));
}

body::after {
  opacity: 0.28;
  background-image: radial-gradient(rgb(245 222 170 / 18%) 0.6px, transparent 0.7px);
  background-size: 7px 7px;
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 83%, transparent);
}

button { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

h1, h2, h3, p { overflow-wrap: anywhere; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: #1c160d;
  font-weight: 800;
  background: var(--brass-bright);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-raised);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-shell {
  width: min(calc(100% - clamp(1.25rem, 4vw, 4rem)), var(--content-width));
  margin: 0 auto;
  padding: clamp(1.15rem, 3.6vw, 3.25rem) 0 clamp(2.3rem, 5vw, 4.5rem);
}

.site-header {
  position: relative;
  margin: 0 auto clamp(1.1rem, 2.5vw, 2rem);
  padding: 0.25rem 0 0.85rem;
  text-align: center;
}

.site-header::after {
  display: block;
  width: min(15.5rem, 72%);
  height: 1px;
  margin: clamp(0.65rem, 1.6vw, 0.95rem) auto 0;
  content: "";
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.header-ornament {
  display: flex;
  justify-content: center;
  gap: clamp(0.45rem, 1.3vw, 0.75rem);
  height: clamp(1.35rem, 3vw, 1.8rem);
  margin-bottom: 0.35rem;
}

.header-ornament span {
  position: relative;
  display: block;
  width: clamp(1.7rem, 4vw, 2.5rem);
  height: 100%;
  border: 1px solid rgb(230 197 120 / 72%);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  box-shadow: inset 0 0.2rem 0.5rem rgb(255 229 151 / 16%), 0 0 0.7rem rgb(207 161 80 / 10%);
}

.header-ornament span:nth-child(2) {
  width: clamp(2.1rem, 4.7vw, 3rem);
  transform: translateY(-0.3rem);
}

.eyebrow {
  margin: 0 0 0.26rem;
  color: var(--brass-bright);
  font-size: clamp(0.69rem, 1.5vw, 0.79rem);
  font-weight: 760;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2 { font-family: var(--serif); }

h1 {
  margin: 0;
  color: #fff5de;
  font-size: clamp(2.05rem, 6vw, 4.15rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
  text-shadow: 0 0.18rem 1.6rem rgb(0 0 0 / 34%);
}

h2 {
  margin: 0;
  color: #fff4dc;
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.intro {
  max-width: 32rem;
  margin: 0.55rem auto 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.3vw, 1.16rem);
}

.player-panel {
  position: relative;
  isolation: isolate;
  margin: 0 auto clamp(2.3rem, 5vw, 4rem);
  padding: clamp(1rem, 2.7vw, 1.8rem);
  overflow: hidden;
  background:
    linear-gradient(132deg, rgb(33 55 64 / 96%), rgb(17 29 41 / 98%) 56%, rgb(19 48 45 / 92%)),
    var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: clamp(0.9rem, 2.3vw, 1.35rem);
  box-shadow: var(--shadow-raised), inset 0 1px 0 rgb(255 236 190 / 12%);
}

.player-panel::before,
.player-panel::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.player-panel::before {
  inset: 0.45rem;
  border: 1px solid rgb(229 191 107 / 18%);
  border-radius: calc(clamp(0.9rem, 2.3vw, 1.35rem) - 0.3rem);
}

.player-panel::after {
  top: -9rem;
  right: -5rem;
  width: 20rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(217 167 75 / 15%), transparent 68%);
}

.player-panel__topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.player-panel__topbar .eyebrow { color: #d8b76f; }

.back-button {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  color: #20180e;
  font-size: clamp(0.85rem, 1.7vw, 0.95rem);
  font-weight: 780;
  line-height: 1.15;
  cursor: pointer;
  background: linear-gradient(180deg, #f0d68f, #c79647);
  border: 1px solid #f8df9c;
  border-radius: 0.55rem;
  box-shadow: 0 0.18rem 0.45rem rgb(0 0 0 / 24%), inset 0 1px rgb(255 249 214 / 48%);
  touch-action: manipulation;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.back-button span { font-size: 1.15em; }

.player-empty {
  display: flex;
  gap: 0.72rem;
  align-items: center;
  min-height: 3.9rem;
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  color: var(--ink-soft);
  background: rgb(4 13 22 / 22%);
  border: 1px dashed rgb(227 192 114 / 31%);
  border-radius: 0.65rem;
}

.player-empty p { margin: 0; font-size: clamp(0.92rem, 2vw, 1rem); }

.player-empty__mark {
  position: relative;
  display: grid;
  flex: 0 0 2.15rem;
  width: 2.15rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgb(232 201 126 / 57%);
  border-radius: 50%;
}

.player-empty__mark::after {
  width: 0;
  height: 0;
  margin-left: 0.15rem;
  content: "";
  border-top: 0.35rem solid transparent;
  border-bottom: 0.35rem solid transparent;
  border-left: 0.52rem solid var(--brass-bright);
}

.player-content { margin-top: clamp(0.9rem, 2.4vw, 1.3rem); }

.video-frame {
  width: min(100%, 62rem);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #060d13;
  border: 1px solid rgb(245 221 163 / 39%);
  border-radius: clamp(0.5rem, 1.2vw, 0.8rem);
  box-shadow: 0 0.65rem 1.7rem rgb(0 0 0 / 45%);
}

video {
  display: block;
  width: 100%;
  height: 100%;
  background: #060d13;
}

.error-message {
  margin: 0.85rem 0 0;
  padding: 0.8rem 0.95rem;
  color: #ffe8df;
  background: rgb(107 35 37 / 67%);
  border: 1px solid rgb(242 170 147 / 43%);
  border-radius: 0.55rem;
}

.error-message[hidden],
.player-empty[hidden],
.player-content[hidden],
.back-button[hidden],
.status-message[hidden] { display: none; }

.library { scroll-margin-top: 1rem; }

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: clamp(0.85rem, 2.2vw, 1.2rem);
}

.section-heading__note {
  margin: 0 0 0.15rem;
  color: var(--ink-muted);
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  text-align: right;
}

.status-message {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.film-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(0.85rem, 2.2vw, 1.35rem);
}

.film-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: linear-gradient(145deg, rgb(33 49 57 / 98%), rgb(22 34 43 / 98%));
  border: 1px solid var(--line-soft);
  border-radius: clamp(0.8rem, 1.8vw, 1.05rem);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgb(255 234 190 / 6%);
  touch-action: manipulation;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.film-card::after {
  position: absolute;
  inset: 0.35rem;
  pointer-events: none;
  content: "";
  border: 1px solid transparent;
  border-radius: calc(clamp(0.8rem, 1.8vw, 1.05rem) - 0.22rem);
  transition: border-color 200ms ease;
}

.film-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #122029;
  border-bottom: 1px solid rgb(239 205 127 / 31%);
}

.film-card__image::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent 56%, rgb(3 10 16 / 23%) 100%);
}

.film-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d1a22;
  transition: transform 420ms ease, filter 420ms ease;
}

.film-card__text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title action"
    "duration action";
  column-gap: 0.7rem;
  align-items: center;
  min-height: clamp(6rem, 13vw, 6.8rem);
  padding: 0.86rem 0.95rem 0.95rem;
}

.film-card__title {
  grid-area: title;
  align-self: end;
  color: #fff2d8;
  font-size: clamp(1.03rem, 2vw, 1.24rem);
  font-weight: 760;
  line-height: 1.16;
}

.film-card__duration {
  grid-area: duration;
  align-self: start;
  margin-top: 0.33rem;
  color: var(--ink-muted);
  font-size: clamp(0.77rem, 1.65vw, 0.88rem);
  line-height: 1.2;
}

.film-card__action {
  display: inline-flex;
  grid-area: action;
  gap: 0.35rem;
  align-items: center;
  align-self: center;
  min-height: 2.75rem;
  padding: 0.45rem 0.6rem;
  color: var(--brass-bright);
  font-size: clamp(0.74rem, 1.55vw, 0.84rem);
  font-weight: 780;
  line-height: 1.1;
  white-space: nowrap;
  border: 1px solid rgb(229 190 104 / 42%);
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
}

.film-card__action::before {
  width: 0;
  height: 0;
  content: "";
  border-top: 0.26rem solid transparent;
  border-bottom: 0.26rem solid transparent;
  border-left: 0.39rem solid currentColor;
}

.film-card[aria-pressed="true"] {
  background: linear-gradient(145deg, #29453f, #1b3333 63%, #223d3c);
  border-color: rgb(235 202 125 / 84%);
  box-shadow: 0 0 0 2px rgb(218 174 88 / 24%), var(--shadow-raised), inset 0 1px 0 rgb(255 236 190 / 14%);
}

.film-card[aria-pressed="true"]::after { border-color: rgb(245 221 156 / 32%); }

.film-card[aria-pressed="true"] .film-card__action {
  color: #1e190e;
  background: linear-gradient(180deg, #f1d98e, #cc9d4f);
  border-color: #f4db98;
}

.film-card:active,
.back-button:active { transform: translateY(1px) scale(0.99); }

.film-card:focus-visible,
.back-button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  padding: 1.1rem clamp(1rem, 4vw, 2rem) 1.5rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

footer span {
  width: 2.4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
}

footer span:last-child { transform: scaleX(-1); }

@media (hover: hover) and (pointer: fine) {
  .film-card:hover {
    z-index: 1;
    border-color: rgb(229 192 110 / 69%);
    box-shadow: var(--shadow-raised), inset 0 1px 0 rgb(255 236 190 / 12%);
    transform: translateY(-0.35rem);
  }

  .film-card:hover::after { border-color: rgb(245 219 153 / 25%); }
  .film-card:hover img { filter: brightness(1.06) saturate(1.04); transform: scale(1.018); }
  .back-button:hover { filter: brightness(1.07); box-shadow: 0 0.3rem 0.75rem rgb(0 0 0 / 31%), inset 0 1px rgb(255 249 214 / 56%); transform: translateY(-1px); }
}

@media (min-width: 30rem) {
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 48rem) {
  .site-header { padding-top: 0.8rem; }
  .film-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .film-card__text { grid-template-columns: 1fr; grid-template-areas: "title" "duration" "action"; align-items: start; min-height: 9rem; }
  .film-card__action { align-self: end; justify-self: start; min-height: 2.75rem; }
}

@media (min-width: 69rem) {
  .film-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .film-card__text { min-height: 9.4rem; padding: 1rem; }
}

@media (max-width: 31rem) {
  .player-panel__topbar { align-items: flex-start; }
  .back-button { max-width: 7.2rem; padding: 0.55rem 0.58rem; font-size: 0.75rem; text-align: center; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .section-heading__note { margin: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

[hidden] { display: none !important; }

.lars-entry {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.35rem 0.55rem;
  color: rgb(216 207 189 / 56%);
  font-size: 0.7rem;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
}

.lars-entry:hover,
.lars-entry:focus-visible {
  color: var(--brass-bright);
  border-color: rgb(238 210 139 / 42%);
}

.admin-panel {
  position: relative;
  margin: 0 auto clamp(2.3rem, 5vw, 4rem);
  padding: clamp(1rem, 2.7vw, 1.8rem);
  background:
    radial-gradient(24rem 14rem at 100% 0, rgb(201 162 91 / 14%), transparent 72%),
    linear-gradient(145deg, rgb(28 61 55 / 97%), rgb(18 34 43 / 98%));
  border: 1px solid rgb(238 210 139 / 54%);
  border-radius: clamp(0.9rem, 2.3vw, 1.35rem);
  box-shadow: var(--shadow-raised), inset 0 1px 0 rgb(255 236 190 / 12%);
  scroll-margin-top: 1rem;
}

.admin-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-user {
  margin: 0.4rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.drop-zone {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  justify-content: center;
  min-height: clamp(8rem, 18vw, 11rem);
  padding: 1.2rem;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  background: rgb(4 13 22 / 34%);
  border: 1.5px dashed rgb(238 210 139 / 62%);
  border-radius: 0.85rem;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging,
.drop-zone:focus-visible {
  background: rgb(31 80 70 / 68%);
  border-color: var(--brass-bright);
  outline: none;
  transform: translateY(-1px);
}

.drop-zone[data-disabled="true"] {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.drop-zone__icon {
  display: grid;
  flex: 0 0 3.2rem;
  width: 3.2rem;
  aspect-ratio: 1;
  place-items: center;
  color: #241b0e;
  font-size: 1.75rem;
  background: linear-gradient(180deg, #f0d68f, #c79647);
  border-radius: 50%;
  box-shadow: 0 0.25rem 0.8rem rgb(0 0 0 / 28%);
}

.drop-zone strong,
.drop-zone small { display: block; }
.drop-zone strong { color: #fff2d8; font-size: 1.05rem; }
.drop-zone small { margin-top: 0.25rem; color: var(--ink-muted); }

.upload-queue { margin-top: 1rem; }
.upload-queue__heading {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.upload-queue__heading h3 { margin: 0; color: #fff2d8; font-family: var(--serif); font-size: 1.15rem; }
.upload-queue ul { display: grid; gap: 0.65rem; margin: 0; padding: 0; list-style: none; }
.upload-item {
  padding: 0.8rem;
  background: rgb(4 13 22 / 45%);
  border: 1px solid rgb(239 219 171 / 25%);
  border-radius: 0.7rem;
}
.upload-item[data-state="published"],
.upload-item[data-state="duplicate"] { background: rgb(15 74 53 / 48%); border-color: #78d6a3; }
.upload-item[data-state="failed"] { border-color: #dc776d; }
.upload-item__head,
.upload-item__detail { display: flex; gap: 0.75rem; justify-content: space-between; }
.upload-item__head { align-items: baseline; }
.upload-item__head strong { overflow: hidden; color: #fff2d8; text-overflow: ellipsis; white-space: nowrap; }
.upload-item__head span { flex: 0 0 auto; color: var(--brass-bright); font-size: 0.8rem; font-weight: 750; }
.upload-item progress {
  display: block;
  width: 100%;
  height: 0.58rem;
  margin: 0.65rem 0 0.45rem;
  overflow: hidden;
  accent-color: var(--brass);
  background: #09141d;
  border: 0;
  border-radius: 999px;
}
.upload-item progress::-webkit-progress-bar { background: #09141d; border-radius: 999px; }
.upload-item progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brass), var(--brass-bright)); border-radius: 999px; }
.upload-item progress::-moz-progress-bar { background: linear-gradient(90deg, var(--brass), var(--brass-bright)); border-radius: 999px; }
.upload-item__detail { color: var(--ink-muted); font-size: 0.75rem; }

.metadata-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  color: var(--brass-bright);
  font-size: 0.77rem;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.field > span { color: var(--ink-muted); font-weight: 500; letter-spacing: 0; }
.field--wide { grid-column: 1 / -1; }

.field input {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  color: #fff4dc;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  background: rgb(6 17 25 / 68%);
  border: 1px solid rgb(235 202 125 / 38%);
  border-radius: 0.55rem;
}

.field input:focus {
  border-color: var(--brass-bright);
  outline: 2px solid rgb(238 210 139 / 28%);
  outline-offset: 1px;
}

.job-card {
  margin-top: 1rem;
  padding: 0.95rem;
  background: rgb(4 13 22 / 45%);
  border: 1px solid rgb(239 219 171 / 25%);
  border-radius: 0.75rem;
}

.job-card__copy {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
}

.job-card__copy strong { overflow: hidden; color: #fff2d8; text-overflow: ellipsis; white-space: nowrap; }
.job-card__copy span { flex: 0 0 auto; color: var(--brass-bright); font-size: 0.82rem; font-weight: 750; }

.job-card progress {
  display: block;
  width: 100%;
  height: 0.55rem;
  margin-top: 0.75rem;
  overflow: hidden;
  accent-color: var(--brass);
  background: #09141d;
  border: 0;
  border-radius: 999px;
}

.job-card progress::-webkit-progress-bar { background: #09141d; border-radius: 999px; }
.job-card progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brass), var(--brass-bright)); border-radius: 999px; }
.job-card progress::-moz-progress-bar { background: linear-gradient(90deg, var(--brass), var(--brass-bright)); border-radius: 999px; }

.job-card__foot {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 0.55rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.job-card.is-ready {
  background: rgb(15 74 53 / 48%);
  border-color: #78d6a3;
  box-shadow: 0 0 0 1px rgb(120 214 163 / 22%);
}

.job-card.is-failed { border-color: #dc776d; }
.job-percent { display: block; margin-top: 0.45rem; color: #fff2d8; font-size: 1.55rem; }
.job-percent[hidden] { display: none; }
.job-steps { display: grid; gap: 0.28rem; margin: 0.85rem 0 0; padding: 0; list-style: none; }
.job-steps li { color: var(--ink-muted); font-size: 0.8rem; }
.job-steps li[data-state="done"] { color: #a8dbbb; }
.job-steps li[data-state="active"] { color: var(--brass-bright); font-weight: 780; }
.job-metrics { display: grid; gap: 0.2rem; margin-top: 0.75rem; color: #f5e8c9; font-size: 0.78rem; }
.job-metrics span:empty { display: none; }
.job-activity { margin: 0.7rem 0 0; color: #9be1b5; font-size: 0.78rem; font-weight: 730; }
.job-activity::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.45rem; background: #59ce83; border-radius: 50%; }
.job-activity[data-level="waiting"] { color: #f0cf79; }
.job-activity[data-level="waiting"]::before { background: #e9b63e; }
.job-activity[data-level="stalled"] { color: #ffaaa1; }
.job-activity[data-level="stalled"]::before { background: #e75d55; }
.job-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.85rem; }
.job-button { min-height: 2.35rem; padding: 0.58rem 0.85rem; color: #152016; font: inherit; font-size: 0.78rem; font-weight: 800; text-decoration: none; cursor: pointer; background: #9be1b5; border: 0; border-radius: 999px; }
.job-button--quiet { color: #fff2d8; background: transparent; border: 1px solid rgb(239 219 171 / 38%); }
.job-button--danger { color: #fff; background: #9a4038; }

progress:indeterminate {
  background: repeating-linear-gradient(110deg, #09141d 0 1rem, #2b5c62 1rem 2rem);
}

.film-shelves { display: grid; gap: clamp(1.5rem, 4vw, 2.4rem); }
.shelf-heading {
  margin: 0 0 0.75rem;
  color: var(--brass-bright);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 500;
}

.film-item { position: relative; min-width: 0; }
.film-item .film-card { height: 100%; }
.film-item:has(.edit-movie) .film-card { height: calc(100% - 2.35rem); }

.edit-movie {
  width: 100%;
  min-height: 2.35rem;
  margin-top: 0.35rem;
  color: var(--brass-bright);
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
  background: rgb(22 34 45 / 86%);
  border: 1px solid rgb(239 219 171 / 25%);
  border-radius: 0.55rem;
}

.edit-movie:hover { background: var(--forest); border-color: rgb(238 210 139 / 56%); }

.quiet-button,
.primary-button {
  min-height: 2.65rem;
  padding: 0.58rem 0.85rem;
  color: #fff2d8;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 760;
  cursor: pointer;
  border-radius: 0.55rem;
}

.quiet-button { background: rgb(5 15 23 / 42%); border: 1px solid rgb(239 219 171 / 31%); }
.primary-button { color: #21190e; background: linear-gradient(180deg, #f0d68f, #c79647); border: 1px solid #f8df9c; }
.quiet-button:hover { border-color: var(--brass-bright); }
.primary-button:hover { filter: brightness(1.07); }

.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: auto;
  background: rgb(2 8 14 / 78%);
  backdrop-filter: blur(6px);
}

.modal-open { overflow: hidden; }

.modal-card {
  position: relative;
  width: min(100%, 28rem);
  padding: clamp(1.2rem, 4vw, 2rem);
  color: var(--ink);
  background:
    radial-gradient(20rem 12rem at 100% 0, rgb(201 162 91 / 15%), transparent 72%),
    linear-gradient(145deg, #1b303b, #101c2a);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 58%);
}

.modal-card--wide { width: min(100%, 42rem); }
.modal-card h2 { padding-right: 2rem; }
.modal-copy { margin: 0.8rem 0 0; color: var(--ink-soft); }
.modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  width: 2.35rem;
  aspect-ratio: 1;
  place-items: center;
  color: var(--ink-soft);
  font-size: 1.45rem;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
}
.modal-close:hover { color: var(--brass-bright); border-color: var(--line); }

.login-form { display: grid; gap: 0.9rem; margin-top: 1.25rem; }
.remember { display: flex; gap: 0.55rem; align-items: center; color: var(--ink-soft); font-size: 0.82rem; }
.remember input { width: 1rem; height: 1rem; accent-color: var(--brass); }
.form-actions { display: flex; gap: 0.65rem; justify-content: flex-end; }
.metadata-form--edit { margin-top: 1.2rem; }

@media (max-width: 38rem) {
  .lars-entry { top: -0.25rem; right: -0.25rem; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .admin-heading .quiet-button { align-self: flex-start; }
  .drop-zone { align-items: center; flex-direction: column; }
  .upload-queue__heading,
  .upload-item__head { align-items: stretch; flex-direction: column; gap: 0.35rem; }
  .upload-item__head span { flex: auto; }
  .metadata-form { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .job-card__copy,
  .job-card__foot { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
  .form-actions { justify-content: stretch; }
  .form-actions button { flex: 1; }
}

/* Integrated filmskrivebord. Mutating controls are also gated in JavaScript
   and by a short-lived same-origin server session; these rules keep mobile
   view/play-only even during responsive transitions. */
.shelf-entrybar {
  display: flex;
  gap: 0.8rem;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 0.9rem;
}

.shelf-search { display: grid; gap: 0.3rem; width: min(100%, 25rem); color: var(--ink-muted); font-size: 0.76rem; }
.shelf-search input {
  min-height: 2.7rem;
  padding: 0.58rem 0.75rem;
  color: var(--ink);
  background: rgb(5 15 23 / 56%);
  border: 1px solid var(--line-soft);
  border-radius: 0.55rem;
}
.shelf-search input:focus { border-color: var(--brass-bright); outline: 2px solid rgb(238 210 139 / 22%); }

.shelf-toolbar {
  position: sticky;
  z-index: 12;
  top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0 0 0.9rem;
  padding: 0.65rem;
  background: rgb(13 28 39 / 95%);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}
.shelf-toolbar button { min-height: 2.45rem; }
.toolbar-finish { margin-left: auto; }
.toolbar-select { display: grid; gap: 0.12rem; color: var(--ink-muted); font-size: 0.68rem; }
.toolbar-select select {
  min-height: 2rem;
  max-width: 12rem;
  padding: 0.2rem 0.45rem;
  color: var(--ink);
  background: var(--night-deep);
  border: 1px solid var(--line-soft);
  border-radius: 0.4rem;
}
.danger-button { color: #ffd9d2; border-color: rgb(220 119 109 / 55%); }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.shelf-breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0 0 0.8rem; color: var(--ink-muted); }
.crumb { padding: 0.35rem 0.55rem; color: var(--brass-bright); cursor: pointer; background: rgb(5 15 23 / 42%); border: 1px solid var(--line-soft); border-radius: 999px; }
.crumb.is-drop-target { color: #181308; background: var(--brass-bright); box-shadow: 0 0 0 4px rgb(238 210 139 / 20%); }

.folder-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 0.2rem; padding: 0.42rem; background: linear-gradient(145deg, #6b522b, #2d493f); }
.film-card .folder-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.28rem; }
.folder-preview > span { background: rgb(7 17 24 / 44%); border: 1px solid rgb(238 210 139 / 16%); border-radius: 0.28rem; }
.folder-item .film-card { background: linear-gradient(145deg, rgb(51 70 65 / 98%), rgb(28 43 49 / 98%)); border-color: rgb(225 188 103 / 36%); }
.rename-folder { width: 100%; min-height: 2.2rem; margin-top: 0.35rem; color: var(--brass-bright); cursor: pointer; background: rgb(8 20 28 / 75%); border: 1px solid var(--line-soft); border-radius: 0.5rem; }
.folder-path { margin: 0.35rem 0 0; color: var(--ink-muted); font-size: 0.74rem; }
.empty-folder { grid-column: 1 / -1; min-height: 9rem; margin: 0; padding: 2.5rem; color: var(--ink-muted); text-align: center; border: 1px dashed var(--line-soft); border-radius: 0.8rem; }

.is-organizing .film-card { cursor: grab; user-select: none; }
.is-organizing .film-card[aria-pressed="true"] { border-color: var(--brass-bright); box-shadow: 0 0 0 3px rgb(238 210 139 / 25%), var(--shadow-raised); }
.shelf-dragging, .shelf-dragging * { user-select: none !important; }
.shelf-dragging .film-card { cursor: grabbing; }
.film-item.is-drag-source { opacity: 0.56; transform: scale(0.97); }
.film-item.is-drop-target { position: relative; }
.film-item.is-drop-target.drop-before { transform: translateX(0.35rem); transition: transform 150ms ease; }
.film-item.folder-receiving .film-card { border-color: #f7dc91; box-shadow: 0 0 0 5px rgb(238 210 139 / 22%), var(--shadow-raised); transform: scale(1.025); }
.film-item.folder-halo .film-card { border-color: #f7dc91; box-shadow: 0 0 0 6px rgb(238 210 139 / 26%), 0 1.2rem 2.7rem rgb(0 0 0 / 48%); }
.film-item.is-drag-source .film-card { box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 58%); }

.save-toast {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.72rem 0.9rem;
  color: #f7eedb;
  background: #173a33;
  border: 1px solid #79b995;
  border-radius: 0.65rem;
  box-shadow: var(--shadow-raised);
}
.save-toast button { color: var(--brass-bright); font-weight: 800; cursor: pointer; background: transparent; border: 0; text-decoration: underline; }
.trash-list { display: grid; gap: 0.6rem; margin-top: 1rem; }
.trash-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.8rem; align-items: center; padding: 0.8rem; background: rgb(5 15 23 / 48%); border: 1px solid var(--line-soft); border-radius: 0.6rem; }
.trash-item strong { color: #fff2d8; }
.trash-item span { grid-column: 1; color: var(--ink-muted); font-size: 0.76rem; }
.trash-item button { grid-column: 2; grid-row: 1 / 3; }

@media (max-width: 63.99rem), (hover: none), (pointer: coarse) {
  .desktop-organize,
  .shelf-toolbar { display: none !important; }
  .film-card { touch-action: manipulation; }
}

@media (max-width: 42rem) {
  .shelf-entrybar { align-items: stretch; flex-direction: column; }
  .shelf-search { width: 100%; }
  .trash-item { grid-template-columns: 1fr; }
  .trash-item button, .trash-item span { grid-column: 1; grid-row: auto; }
}

/* The same Filmhylle adapts to phones without exposing PC-only mutation UI. */
html {
  max-width: 100%;
  overflow-x: clip;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

video { object-fit: contain; }

.player-actions {
  display: flex;
  justify-content: flex-end;
  width: min(100%, 62rem);
  margin: 0.7rem auto 0;
}

.fullscreen-button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-width: 8.8rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  color: #20180e;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(180deg, #f0d68f, #c79647);
  border: 1px solid #f8df9c;
  border-radius: 0.55rem;
  box-shadow: 0 0.18rem 0.45rem rgb(0 0 0 / 24%);
}

.fullscreen-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

video:fullscreen,
video:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
}

@media (max-width: 63.99rem), (hover: none), (pointer: coarse) {
  .upload-panel,
  .desktop-organize,
  .shelf-toolbar,
  .edit-movie,
  .rename-folder,
  .save-toast,
  .lars-entry { display: none !important; }

  .site-shell {
    width: 100%;
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-left: max(0.75rem, env(safe-area-inset-left));
  }

  .player-panel {
    padding: 0.78rem;
    border-radius: 0.8rem;
  }

  .video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.45rem;
  }

  .film-card,
  .film-card__action,
  .crumb,
  .back-button,
  .fullscreen-button { min-height: 3rem; }

  .film-card__title {
    font-size: clamp(1.08rem, 4.4vw, 1.28rem);
    line-height: 1.22;
  }

  .film-card__action {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .shelf-search input {
    min-height: 3rem;
    font-size: 1rem;
  }
}

@media (max-width: 31rem) {
  .site-shell { padding-top: 0.85rem; }
  .site-header { margin-bottom: 0.8rem; }
  .site-header h1 { font-size: clamp(2rem, 10vw, 2.8rem); }
  .player-panel__topbar { align-items: stretch; flex-direction: column; gap: 0.7rem; }
  .back-button { width: 100%; max-width: none; font-size: 0.9rem; }
  .player-actions { justify-content: stretch; }
  .fullscreen-button { width: 100%; }
  .film-card__text { min-height: 6.6rem; padding: 0.9rem; }
  .section-heading { margin-bottom: 0.75rem; }
}

@media (orientation: landscape) and (max-height: 34rem) and (pointer: coarse) {
  .site-header { display: none; }
  .site-shell { padding-top: max(0.45rem, env(safe-area-inset-top)); }
  .has-selected-video .player-panel { margin-bottom: 1.1rem; }
  .has-selected-video .player-panel__topbar { margin-bottom: 0.4rem; }
  .has-selected-video .player-panel__topbar .eyebrow { display: none; }
  .has-selected-video .video-frame { max-height: calc(100svh - 8.5rem); }
}
