:root {
  color-scheme: dark;
  --bg: #11100e;
  --ink: #f6efe2;
  --muted: #b9ad9c;
  --line: #39342f;
  --accent: #6f6558;
  --panel: #1b1916;
  --front-bg: #14161a;
  --back-bg: #f2f0e8;
  --spine-bg: #2b2a24;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px),
    linear-gradient(#121417, #0d0e10);
  background-size: 24px 24px, auto;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 36px);
}

.topBar {
  display: flex;
  justify-content: end;
  align-items: center;
  margin-bottom: 14px;
}

.supportSlot {
  min-height: 38px;
}

.supportSlot iframe,
.supportSlot a {
  max-width: 100%;
}

.coffeeFallback {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #000;
  border-radius: 6px;
  background: #ffdd00;
  color: #000;
  font-weight: 800;
  text-decoration: none;
}

.siteLanguage {
  display: flex;
  align-items: center;
  gap: 10px;
}

.siteLanguage select {
  min-height: 38px;
  padding: 8px 34px 8px 11px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
}

.appView[hidden] {
  display: none;
}

.mediaView {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
}

.mediaBrowser {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
}

.mediaHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mediaHeader h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
}

.mediaCount {
  min-width: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.mediaSearch {
  display: grid;
  gap: 10px;
  max-width: 680px;
}

.mediaSearchStatus {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.mediaShelf {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: clamp(12px, 1.8vw, 22px);
  align-items: end;
  padding: 26px 20px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(to bottom, transparent 0 72%, rgb(0 0 0 / 0.28) 72% 100%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.035) 0 1px, transparent 1px 28px),
    rgb(18 17 15 / 0.9);
  box-shadow: inset 0 -18px 0 rgb(111 101 88 / 0.18);
}

.mediaEmpty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.mediaCard {
  display: grid;
  gap: 12px;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.mediaCard:hover,
.mediaCard.selected {
  transform: translateY(-4px);
}

.mediaCard.selected img {
  border-color: var(--ink);
}

.mediaCard img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 18px 26px rgb(0 0 0 / 0.38);
}

.mediaCard h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: clamp(0.9rem, 1.3vw, 1.08rem);
  line-height: 1.05;
}

.mediaCard p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.mediaCard span {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.mediaDetail {
  position: relative;
  display: block;
  min-height: calc(100vh - clamp(16px, 3vw, 36px) * 2);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141312;
}

.mediaDetailBackdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0.28;
  filter: saturate(0.85);
}

.mediaDetail::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(17 16 14 / 0.98) 0 34%, rgb(17 16 14 / 0.86) 58%, rgb(17 16 14 / 0.42)),
    linear-gradient(0deg, rgb(17 16 14 / 0.98), transparent 45%);
}

.mediaDetailShell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(210px, 320px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 58px);
  align-items: center;
  min-height: inherit;
  padding: clamp(22px, 4vw, 52px);
}

.mediaBackButton {
  position: absolute;
  top: clamp(16px, 2vw, 26px);
  left: clamp(16px, 2vw, 26px);
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgb(17 16 14 / 0.72);
  color: var(--ink);
}

.mediaDetail[hidden] {
  display: none;
}

.mediaDetailShell > img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 26px 46px rgb(0 0 0 / 0.45);
}

.mediaDetailBody {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.mediaDetailTop {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.mediaDetailTop h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.6rem, 8vw, 6.8rem);
  line-height: 0.95;
}

.mediaDetailActions {
  display: flex;
  align-items: start;
  gap: 10px;
}

.mediaDetailActions button,
.mediaDetailActions a {
  align-self: start;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 900;
}

.mediaDetailActions button {
  min-height: 38px;
  background: var(--ink);
  color: #17120f;
}

.coverTypeMenu {
  position: relative;
  display: grid;
}

.coverTypeDropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 4;
  display: grid;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(17 16 14 / 0.98);
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.42);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.coverTypeMenu:hover .coverTypeDropdown,
.coverTypeMenu:focus-within .coverTypeDropdown,
.mediaDetailActions:hover .coverTypeDropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mediaDetailActions .coverTypeOption {
  display: grid;
  justify-items: start;
  min-height: 0;
  padding: 10px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.mediaDetailActions .coverTypeOption:hover,
.mediaDetailActions .coverTypeOption:focus-visible {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.coverTypeOption span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.mediaDetailActions a {
  color: var(--ink);
  text-decoration: none;
}

.mediaDetailTagline,
.mediaDetailOverview,
.mediaDetailGrid p {
  margin: 0;
  color: var(--muted);
}

.mediaDetailTagline {
  color: var(--ink);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-style: italic;
  font-weight: 800;
}

.mediaDetailOverview {
  max-width: 78ch;
  font-size: clamp(0.95rem, 1.3vw, 1.12rem);
  line-height: 1.55;
}

.mediaDetailGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.mediaDetailGrid p {
  font-size: 0.88rem;
  line-height: 1.35;
}

.mediaDetailGrid strong {
  color: var(--ink);
}

.mediaDetailCredits {
  grid-column: 1 / -1;
  max-width: 78ch;
  color: var(--muted);
  line-height: 1.35;
}

.mediaDetailCredits strong {
  color: var(--ink);
  font-weight: 900;
}

.panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(27 25 22 / 0.86);
  backdrop-filter: blur(12px);
}

.eyebrow,
.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 4.25rem);
  line-height: 0.9;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.fieldHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.toggleRow {
  display: grid;
  align-content: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.92rem;
}

.visibilityToggle {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f0e0c;
  color: var(--muted);
}

.visibilityToggle[aria-pressed="true"] {
  color: var(--ink);
}

.visibilityToggle svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.searchRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search {
  position: relative;
}

input[type="search"],
input[type="text"],
textarea,
select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  background: #0f0e0c;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 92px;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  min-height: 44px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.homeButton {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  width: fit-content;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11100e;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.exportActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.exportButton {
  width: 100%;
  background: #f3eee5;
  color: #17120f;
}

.secondaryExport {
  border: 1px solid var(--line);
  background: #11100e;
  color: var(--ink);
}

.printSpec {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sectionEditor {
  display: grid;
  gap: 10px;
}

.sectionTabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11100e;
}

.sectionTab {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.sectionTab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.sectionPanel {
  display: grid;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11100e;
}

.sectionPanel[hidden] {
  display: none;
}

.posterChoices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.logoChoices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compactLogoChoices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 150px;
  overflow: auto;
}

.logoChoice {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #070706;
  color: var(--muted);
  font-size: 0.8rem;
}

.logoChoice.active {
  border-color: var(--accent);
}

.logoChoice img {
  display: block;
  max-width: 118px;
  max-height: 42px;
  object-fit: contain;
}

.posterChoice {
  display: block;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #070706;
  overflow: hidden;
}

.posterChoice.active {
  border-color: var(--accent);
}

.posterChoice img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.emptyChoices {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.86rem;
}

.backFields {
  display: grid;
  gap: 12px;
}

.fieldGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hidden {
  display: none;
}

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

.formatPicker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.formatBasePicker {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}

.formatVariantPicker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.formatOption {
  display: grid;
  place-items: center;
  aspect-ratio: 1.25;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11100e;
  color: var(--ink);
  padding: 0;
}

.formatBasePicker .formatOption {
  min-height: 58px;
}

.formatVariantPicker .formatOption {
  min-height: 48px;
  aspect-ratio: 1.45;
}

.formatBasePicker .formatOption:not(.customFormatOption) {
  background: #f3eee5;
}

.formatOption.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 28%, #11100e);
}

.formatBasePicker .formatOption.active:not(.customFormatOption) {
  background: color-mix(in srgb, var(--accent) 16%, #f3eee5);
}

.formatIcon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.formatLogo {
  display: block;
  width: 52px;
  max-width: 100%;
  max-height: 34px;
  object-fit: contain;
}

.formatBasePicker .formatLogo {
  width: 58px;
}

.formatVariantPicker .formatLogo {
  width: 46px;
  max-height: 28px;
}

.dvdIcon {
  width: 28px;
  height: 28px;
  border: 4px solid currentColor;
  border-radius: 50%;
}

.dvdIcon::after {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.blurayIcon {
  color: #7eb2ff;
}

.uhdIcon {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.customIcon {
  font-size: 1.25rem;
}

input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f0e0c;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(17 16 14 / 0.98);
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.38);
}

.results[hidden] {
  display: none;
}

.result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11100e;
  color: var(--ink);
  text-align: left;
}

.result img {
  width: 44px;
  height: 46px;
  object-fit: cover;
  border-radius: 4px;
  background: #302c27;
}

.result strong,
.result span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result span {
  color: var(--muted);
  font-size: 0.82rem;
}

.preview {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
}

.coverPreviewCanvas {
  display: block;
  width: min(100%, 960px);
  max-width: 100%;
  aspect-ratio: 273 / 183;
  height: auto;
  border: 1px solid #0a0908;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.48);
  background: #f2f0e8;
}

:root[data-cover-size="slim"] .coverPreviewCanvas {
  aspect-ratio: 266 / 183;
}

.cover {
  position: relative;
  display: grid;
  container-type: inline-size;
  --dvd-spine-width: calc(14 / 273 * 100%);
  --dvd-panel-width: calc((100% - var(--dvd-spine-width)) / 2);
  grid-template-columns: var(--dvd-panel-width) var(--dvd-spine-width) var(--dvd-panel-width);
  width: min(100%, 960px);
  aspect-ratio: 273 / 183;
  border: 1px solid #0a0908;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.48);
  background: #f2f0e8;
  color: #17120f;
  isolation: isolate;
  overflow: hidden;
}

.domCoverState {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background:
    radial-gradient(circle at 20% 12%, rgb(255 255 255 / 0.35), transparent 26%),
    linear-gradient(120deg, transparent 0 20%, rgb(0 0 0 / 0.11) 20.5% 21%, transparent 21.5% 52%, rgb(255 255 255 / 0.18) 53% 53.5%, transparent 54%),
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0.11) 0 1px, transparent 1px 6px);
  mix-blend-mode: multiply;
  z-index: 4;
}

.spine {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 18px 10px;
  background: var(--spine-bg);
  color: white;
  border-inline: 1px solid rgb(0 0 0 / 0.32);
}

.distributorMark {
  position: absolute;
  top: clamp(8px, 1.35vw, 16px);
  left: 50%;
  display: grid;
  place-items: center;
  width: 82%;
  max-width: 82%;
  overflow: hidden;
  color: white;
  font-size: clamp(0.48rem, 0.8vw, 0.68rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.distributorMark img {
  display: block;
  max-width: 100%;
  max-height: clamp(18px, 2.8vw, 28px);
  object-fit: contain;
}

.spineTitle {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  min-width: 0;
  font-size: clamp(0.72rem, 1.45vw, 1.2rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  max-width: 100%;
}

.spineTitle.logoTitle {
  position: absolute;
  top: 50%;
  left: 50%;
  writing-mode: horizontal-tb;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  width: min(28vw, 180px);
  height: clamp(18px, 3.8vw, 38px);
  width: min(18.8cqw, 180px);
  height: min(3.9cqw, 38px);
  display: grid;
  place-items: center;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.spineTitle.logoTitle img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(var(--spine-logo-scale-factor, 1));
  transform-origin: center;
}

.spineMark {
  position: absolute;
  bottom: 14px;
  font-weight: 900;
  font-size: 0.95rem;
}

.spineMark.logoMark {
  display: grid;
  place-items: center;
  width: 82%;
  height: clamp(18px, 2.8vw, 30px);
}

.spineMark img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

:root[data-symbol-color="white"] .formatLogo,
:root[data-symbol-color="white"] .spineMark img {
  filter: brightness(0) invert(1);
}

.formatOption[data-symbol-color="black"],
.formatOption[data-symbol-color="official"] {
  background: #f3eee5;
}

.formatOption[data-symbol-color="black"].active,
.formatOption[data-symbol-color="official"].active {
  background: color-mix(in srgb, var(--accent) 18%, #f3eee5);
}

.formatOption[data-symbol-color="white"] img {
  filter: brightness(0) invert(1);
}

.formatOption[data-symbol-color="black"] img {
  filter: brightness(0);
}

.formatOption[data-symbol-color="official"] img {
  filter: none;
}

:root[data-symbol-color="black"] .formatLogo,
:root[data-symbol-color="black"] .spineMark img {
  filter: brightness(0);
}

:root[data-symbol-color="official"] .formatLogo,
:root[data-symbol-color="official"] .spineMark img {
  filter: none;
}

:root .formatOption[data-symbol-color="white"] img {
  filter: brightness(0) invert(1);
}

:root .formatOption[data-symbol-color="black"] img {
  filter: brightness(0);
}

:root .formatOption[data-symbol-color="official"] img {
  filter: none;
}

.formatBasePicker .formatOption:not(.customFormatOption) img {
  filter: none !important;
}

.front,
.back {
  position: relative;
  padding: clamp(14px, 1.9vw, 22px);
  min-width: 0;
}

.front {
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  background: #14161a;
  background: var(--front-bg);
  color: var(--ink);
  overflow: hidden;
  padding: 0;
}

.poster {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  background-color: var(--front-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.posterFallback {
  font-size: 4rem;
  font-weight: 900;
  color: rgb(255 255 255 / 0.22);
}

.poster.hasPoster .posterFallback {
  display: none;
}

#overview {
  margin: 0;
  color: inherit;
  line-height: 1.5;
  overflow: hidden;
}

#overview {
  font-size: clamp(0.82rem, 1.15vw, 1rem);
}

.overviewBlock {
  min-height: 0;
  overflow: hidden;
}

.companyLines {
  display: grid;
  gap: 4px;
}

.companyLines p {
  margin: 0;
  color: #17120f;
  font-size: clamp(0.62rem, 0.95vw, 0.84rem);
  font-weight: 500;
  line-height: 1.25;
}

.back.denseText .companyLines p,
.back.denseText .metaGrid,
.back.denseText .credits {
  font-size: clamp(0.55rem, 0.78vw, 0.72rem);
  line-height: 1.22;
}

.back.tightText .companyLines p,
.back.tightText .metaGrid,
.back.tightText .credits {
  font-size: clamp(0.5rem, 0.68vw, 0.64rem);
  line-height: 1.16;
}

.back.ultraText .companyLines p,
.back.ultraText .metaGrid,
.back.ultraText .credits {
  font-size: clamp(0.46rem, 0.6vw, 0.58rem);
  line-height: 1.12;
}

.companyLines strong {
  font-weight: 900;
}

#overview.longText {
  font-size: clamp(0.68rem, 0.95vw, 0.86rem);
  line-height: 1.38;
}

#overview.veryLongText {
  font-size: clamp(0.58rem, 0.82vw, 0.76rem);
  line-height: 1.3;
}

.back.denseText #overview {
  font-size: clamp(0.56rem, 0.78vw, 0.74rem);
  line-height: 1.24;
}

.back.tightText #overview {
  font-size: clamp(0.5rem, 0.68vw, 0.66rem);
  line-height: 1.18;
}

.back.ultraText #overview {
  font-size: clamp(0.46rem, 0.62vw, 0.6rem);
  line-height: 1.13;
}

.back {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto auto;
  gap: clamp(7px, 1vw, 13px);
  overflow: hidden;
  background:
    linear-gradient(color-mix(in srgb, var(--back-bg) 92%, transparent), color-mix(in srgb, var(--back-bg) 92%, transparent)),
    repeating-linear-gradient(90deg, transparent 0 32px, rgb(0 0 0 / 0.06) 32px 33px);
}

.back.denseText {
  gap: clamp(5px, 0.75vw, 9px);
}

.back.tightText,
.back.ultraText {
  gap: clamp(4px, 0.6vw, 7px);
}

.backSection {
  display: grid;
  gap: 6px;
  padding-block: 2px;
}

.synopsisSection {
  min-height: 0;
  overflow: hidden;
}

.backMovieLogo {
  display: none;
  place-items: center;
  min-height: clamp(30px, 4.5vw, 54px);
  margin-bottom: 4px;
}

.backMovieLogo.hasLogo {
  display: grid;
}

.backMovieLogo img {
  display: block;
  max-width: min(64%, 300px);
  max-height: clamp(28px, 4vw, 50px);
  object-fit: contain;
}

.tagline {
  margin: 0;
  overflow: hidden;
  color: #17120f;
  font-size: clamp(0.74rem, 1vw, 0.95rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.metaGrid,
.credits {
  margin: 0;
  color: #17120f;
  font-size: clamp(0.62rem, 0.95vw, 0.84rem);
  font-weight: 500;
  line-height: 1.35;
}

.credits strong {
  font-weight: 900;
}

.creditsSection {
  overflow: hidden;
}

.credits {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.back.denseText .credits {
  -webkit-line-clamp: 4;
}

.back.tightText .credits,
.back.ultraText .credits {
  -webkit-line-clamp: 5;
}

.metaGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 12px;
}

.back.tightText .metaGrid,
.back.ultraText .metaGrid {
  gap: 2px 10px;
}

.metaGrid p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metaGrid strong {
  font-weight: 900;
}

.codeArea {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.qrCode {
  width: 58px;
  height: 58px;
  padding: 4px;
  background: #fff;
  object-fit: contain;
}

.qrCode:not([src]),
.qrCode[src=""] {
  visibility: hidden;
}

.barcode {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  width: 132px;
  height: 54px;
  padding: 8px 10px 14px;
  background: #fff;
  position: relative;
}

.barcode span {
  width: 2px;
  background: #111;
}

.barcode span.thin {
  width: 1px;
}

.barcode span.wide {
  width: 4px;
}

.barcode::after {
  content: attr(data-code);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  color: #111;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  text-align: center;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .mediaShelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mediaDetail {
    min-height: auto;
  }

  .mediaDetailShell {
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: start;
    padding-top: 72px;
  }

  .panel {
    position: static;
  }

  .preview {
    min-height: auto;
  }

  .cover {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
    min-height: 0;
  }

  .spine {
    min-height: 62px;
  }

  .spineTitle {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .back {
    min-height: 280px;
  }

  .spineTitle {
    font-size: 1.4rem;
  }
}

@media (max-width: 520px) {
  .mediaHeader {
    align-items: start;
    flex-direction: column;
  }

  .mediaShelf {
    grid-template-columns: 1fr;
  }

  .mediaDetailShell,
  .mediaDetailGrid {
    grid-template-columns: 1fr;
  }

  .searchRow,
  .controls,
  .sectionEditor,
  .metaGrid {
    grid-template-columns: 1fr;
  }

  .front,
  .back,
  .panel {
    padding: 16px;
  }
}
