:root {
  --bg: #111017;
  --accent: #d7a86e;
  --paper: rgba(255, 249, 240, 0.92);
  --paper-strong: #fff9f0;
  --paper-soft: rgba(255, 249, 240, 0.68);
  --ink: #241d1e;
  --muted: rgba(36, 29, 30, 0.58);
  --line: rgba(36, 29, 30, 0.14);
  --white-line: rgba(255, 249, 240, 0.18);
  --white-soft: rgba(255, 249, 240, 0.10);
  --glass-dark: rgba(12, 9, 16, 0.48);
  --glass-darker: rgba(12, 9, 16, 0.72);
  --shadow: 0 34px 120px rgba(10, 7, 12, 0.42);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

/* Click shield fix: author CSS can override the native hidden attribute.
   Keep hidden auth/modals truly gone so they cannot block buttons. */
[hidden],
.auth-screen[hidden],
.modal-backdrop.hidden {
  display: none !important;
  pointer-events: none !important;
}

html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--paper);
  background: var(--bg);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 194, 115, 0.20), transparent 32%),
    radial-gradient(circle at 82% 72%, rgba(158, 108, 255, 0.18), transparent 38%),
    linear-gradient(90deg, rgba(8, 6, 11, 0.76), rgba(8, 6, 11, 0.46), rgba(8, 6, 11, 0.74)),
    linear-gradient(135deg, #211826, #181521 45%, #2b211b);
}
.background::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.page { position: relative; z-index: 1; min-height: 100vh; padding: 24px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.topbar { position: sticky; top: 18px; z-index: 20; margin-bottom: 30px; }
.topbar-inner {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 10px; border: 1px solid var(--white-line); border-radius: 999px;
  background: rgba(17, 13, 22, 0.58); backdrop-filter: blur(20px); box-shadow: var(--shadow);
}
.brand, .room-nav a, .top-actions button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid transparent; color: var(--paper);
}
.brand { gap: 10px; padding: 0 14px 0 10px; }
.brand-mark { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #fff2cf, #f2a86f 50%, #9b6cff); box-shadow: 0 0 30px rgba(255, 205, 147, .35); }
.room-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.room-nav a { padding: 0 14px; color: var(--paper-soft); }
.room-nav a.active, .room-nav a:hover { color: var(--ink); background: var(--paper); }
.top-actions { display: flex; gap: 8px; }
.top-actions button { padding: 0 14px; background: var(--white-soft); color: var(--paper); border-color: var(--white-line); }
.top-actions button:hover { background: var(--paper); color: var(--ink); }

.main { min-height: 70vh; }
.room-view { animation: pageIn .34s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.intro { max-width: 760px; margin: 56px 0 30px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--paper-soft); margin-bottom: 12px; }
h1 { font-size: clamp(2.5rem, 7vw, 5.9rem); line-height: .92; letter-spacing: -0.07em; margin: 0 0 18px; }
h2 { margin: 0; font-size: 1.1rem; }
h3 { margin: 0; }
p { line-height: 1.65; }
.subtitle { color: var(--paper-soft); max-width: 680px; font-size: 1.05rem; }
.action-row, .button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn, button, .file-label {
  border: 0; border-radius: 999px; background: var(--paper); color: var(--ink); padding: 11px 16px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
}
.btn.secondary, button.secondary { background: var(--white-soft); color: var(--paper); border: 1px solid var(--white-line); box-shadow: none; }
.btn.danger, button.danger { background: #4c151a; color: #fff5f0; }
.btn.small, button.small { padding: 8px 12px; font-size: .86rem; }

.grid, .split-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .62fr); gap: 18px; align-items: start; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.panel, .dark-panel, .media-player, .auth-card {
  border-radius: var(--radius-xl); box-shadow: var(--shadow); overflow: hidden;
}
.panel { background: var(--paper); color: var(--ink); border: 1px solid rgba(255,255,255,.35); }
.dark-panel, .media-player { background: var(--glass-darker); border: 1px solid var(--white-line); color: var(--paper); backdrop-filter: blur(20px); }
.panel, .dark-panel { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head span, .muted { color: var(--muted); font-size: .92rem; }
.dark-panel .panel-head span, .dark-panel .muted { color: var(--paper-soft); }
.status-pill, .pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 10px; font-size: .78rem; font-weight: 800;
  background: rgba(36,29,30,.08); color: var(--ink); white-space: nowrap;
}
.dark-panel .pill, .dark-panel .status-pill { background: var(--white-soft); color: var(--paper); }

.stack { display: grid; gap: 14px; }
.quick-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field, label { display: grid; gap: 7px; font-weight: 700; color: inherit; }
.field.wide, .wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px; background: rgba(255,255,255,.58); color: var(--ink); outline: none;
}
.dark-panel input, .dark-panel select, .dark-panel textarea, .auth-card input {
  color: var(--paper); background: rgba(255,255,255,.08); border-color: var(--white-line);
}
textarea { min-height: 96px; resize: vertical; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 16px; color: var(--muted); }
.dark-panel .form-actions { color: var(--paper-soft); }
.status-line { min-height: 24px; color: var(--paper-soft); }

.countdown-display { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.count-card { border-radius: 22px; background: rgba(36,29,30,.07); padding: 22px; text-align: center; }
.count-card strong { display: block; font-size: clamp(2rem, 5vw, 4.8rem); letter-spacing: -0.08em; }
.count-card span { color: var(--muted); font-weight: 800; }
.countdown-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }

.local-list { display: grid; gap: 10px; }
.list-item, .event-item, .file-item, .secret-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px; border-radius: 18px;
  background: rgba(255,255,255,.08); border: 1px solid var(--white-line);
}
.panel .list-item, .panel .event-item, .panel .file-item { background: rgba(36,29,30,.06); border-color: var(--line); }
.item-main { min-width: 0; }
.item-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main span { display: block; color: var(--paper-soft); font-size: .88rem; margin-top: 4px; }
.panel .item-main span { color: var(--muted); }

.media-player { padding: 14px; }
video, audio { width: 100%; display: block; border-radius: 22px; background: #050407; }
video { aspect-ratio: 16 / 9; object-fit: contain; }
.sync-row, .ready-grid, .link-pill-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ready-item, .link-pill-row span {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 999px; background: var(--white-soft); border: 1px solid var(--white-line);
}
.image-wall { columns: 260px; column-gap: 16px; }
.image-card { break-inside: avoid; margin: 0 0 16px; border-radius: 24px; overflow: hidden; background: var(--glass-darker); border: 1px solid var(--white-line); }
.image-card img { width: 100%; display: block; }
.image-card div { padding: 12px; }

.auth-screen {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(5,4,8,.72); backdrop-filter: blur(18px);
}
.auth-card { width: min(460px, 100%); padding: 28px; background: rgba(17, 13, 22, 0.86); border: 1px solid var(--white-line); }
body.is-locked .page { filter: blur(6px); pointer-events: none; user-select: none; }

.route-curtain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .24s ease; background: rgba(8,6,11,.62); backdrop-filter: blur(20px); display: grid; place-items: center; }
.route-curtain.show { opacity: 1; }
.route-loader { width: 180px; height: 4px; border-radius: 999px; overflow: hidden; background: var(--white-soft); }
.route-loader span { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--paper); animation: load 1s ease infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.empty { padding: 22px; border-radius: 22px; border: 1px dashed var(--white-line); color: var(--paper-soft); text-align: center; }
.panel .empty { border-color: var(--line); color: var(--muted); }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .page { padding: 14px; }
  .topbar { position: static; }
  .topbar-inner { border-radius: 26px; align-items: stretch; flex-direction: column; }
  .brand { justify-content: flex-start; }
  .room-nav { justify-content: flex-start; }
  .grid, .split-board { grid-template-columns: 1fr; }
  .countdown-display { grid-template-columns: repeat(2, 1fr); }
  .form-actions { align-items: stretch; flex-direction: column; }
}

/* Respect the hidden attribute. Without this, .stack/display:grid overrides hidden and both auth forms show. */
[hidden] {
  display: none !important;
}

.profile-chip {
  min-height: 40px; display: inline-flex; align-items: center; gap: 9px; border-radius: 999px;
  padding: 5px 12px 5px 6px; background: var(--white-soft); border: 1px solid var(--white-line); color: var(--paper); font-weight: 800;
}
.profile-chip:hover { background: var(--paper); color: var(--ink); }
.top-avatar, .profile-avatar {
  display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--accent), rgba(255,255,255,.72));
  color: var(--ink); font-weight: 900; background-size: cover; background-position: center;
}
.top-avatar { width: 30px; height: 30px; font-size: .8rem; }
.profile-avatar.big { width: 92px; height: 92px; font-size: 2rem; box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.profile-preview { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.compact-intro { margin-top: 36px; }

.calendar-shell { padding: 22px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 8px; color: var(--paper-soft); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.weekday-row span { padding: 0 10px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day-cell {
  min-height: 132px; border-radius: 20px; border: 1px solid var(--white-line); background: rgba(255,255,255,.075); color: var(--paper);
  padding: 10px; display: flex; flex-direction: column; align-items: stretch; text-align: left; box-shadow: none; overflow: hidden; cursor: pointer;
}
.day-cell:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.day-cell.muted-month { opacity: .45; }
.day-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.day-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.day-number { font-weight: 900; color: var(--paper); }
.day-add { width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; background: var(--white-soft); border: 1px solid var(--white-line); color: var(--paper); box-shadow: none; font-size: 1rem; line-height: 1; }
.day-add:hover { background: var(--paper); color: var(--ink); }
.day-events { display: grid; gap: 5px; min-width: 0; }
.calendar-event {
  width: 100%; border-radius: 11px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.18); color: var(--paper);
  padding: 6px 7px; box-shadow: none; display: grid; gap: 1px; text-align: left; position: relative; overflow: hidden;
}
.calendar-event::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--event-color); }
.calendar-event span { color: var(--paper-soft); font-size: .68rem; padding-left: 4px; }
.calendar-event strong { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.more-events { color: var(--paper-soft); font-size: .75rem; padding-left: 6px; }
.agenda-lower, .calltime-lower { margin-top: 18px; }
.agenda-help p { margin-bottom: 0; }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 22px; background: rgba(5,4,8,.66); backdrop-filter: blur(18px); }
.modal-card { width: min(680px, 100%); max-height: min(780px, 92vh); overflow: auto; border-radius: var(--radius-xl); padding: 24px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.modal-card textarea { min-height: 130px; }

.call-hero { padding: 28px; margin-bottom: 18px; }
.mega-time { font-size: clamp(2.8rem, 9vw, 7rem); letter-spacing: -0.08em; line-height: .95; font-weight: 900; margin: 18px 0; }
.live-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid var(--white-line); color: var(--paper-soft); }
.live-line strong { color: var(--paper); font-size: 1.4rem; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { border-radius: 22px; padding: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); min-width: 0; }
.stat-card span { display: block; color: var(--muted); font-weight: 900; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; font-size: clamp(1.15rem, 2.4vw, 1.8rem); letter-spacing: -0.04em; margin-top: 8px; overflow-wrap: anywhere; }
.stat-card small { display: block; color: var(--muted); margin-top: 6px; }
.bar-chart { display: grid; gap: 8px; max-height: 420px; overflow: auto; padding-right: 4px; }
.bar-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: .82rem; color: inherit; }
.bar-row > span { color: inherit; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row > div { height: 10px; border-radius: 999px; background: rgba(36,29,30,.10); overflow: hidden; }
.dark-panel .bar-row > div { background: var(--white-soft); }
.bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--accent); opacity: .86; }
.bar-row strong { font-size: .78rem; text-align: right; white-space: nowrap; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .weekday-row { display: none; }
  .month-grid { grid-template-columns: 1fr; }
  .day-cell { min-height: 108px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 72px minmax(0, 1fr) 60px; }
  .top-actions { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-form-grid { grid-template-columns: 1fr; }
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--paper-soft);
  font-size: .94rem;
}
.link-button {
  padding: 0;
  min-height: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.link-button:hover {
  color: var(--accent);
  background: transparent;
}

/* Library visual shelf */
.library-room { max-width: 1060px; margin: 0 auto; }
.library-intro {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none;
}
.library-count {
  min-width: 118px; border-radius: 26px; padding: 18px 20px; background: rgba(255,255,255,.075); border: 1px solid var(--white-line);
  text-align: center; box-shadow: var(--shadow);
}
.library-count strong { display: block; font-size: 2.2rem; line-height: .9; letter-spacing: -.07em; }
.library-count span { display: block; color: var(--paper-soft); font-weight: 800; margin-top: 6px; }
.library-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr); gap: 16px; margin-bottom: 28px; }
.library-tool { border-radius: 28px; }
.library-wall-wrap { margin-top: 8px; padding-bottom: 50px; }
.library-wall-head { padding: 0 4px; }
.library-masonry { columns: 3 240px; column-gap: 18px; }
.library-masonry .empty { break-inside: avoid; }
.shelf-card {
  position: relative; break-inside: avoid; margin: 0 0 18px; overflow: hidden; border-radius: 22px; background: #0b0d0c;
  min-height: 160px; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 24px 90px rgba(0,0,0,.36);
  transform: translateZ(0);
}
.shelf-card:hover .shelf-visual img { transform: scale(1.035); }
.shelf-card:hover .shelf-title { opacity: 1; transform: translateY(0); }
.shelf-visual { min-height: 100%; }
.shelf-visual img { width: 100%; min-height: 175px; display: block; object-fit: cover; transition: transform .4s ease; }
.shelf-placeholder {
  min-height: 260px; display: grid; place-items: center; padding: 26px; color: rgba(255,255,255,.82); text-transform: uppercase; letter-spacing: .18em; font-size: .74rem; font-weight: 900;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.22), transparent 28%),
    radial-gradient(circle at 82% 80%, rgba(87, 130, 90,.38), transparent 34%),
    linear-gradient(135deg, #172416, #36502e 48%, #10150f);
}
.seed-1 { min-height: 190px; background: linear-gradient(135deg, #0f2118, #2f523d 58%, #09100c); }
.seed-2 { min-height: 330px; background: linear-gradient(135deg, #14211f, #415b52 52%, #13100f); }
.seed-3 { min-height: 230px; background: linear-gradient(135deg, #17210f, #536734 52%, #0f1208); }
.seed-4 { min-height: 380px; background: linear-gradient(135deg, #1f1712, #6c3d24 48%, #0b0807); }
.file-tile { min-height: 300px; background: linear-gradient(135deg, #1a1a20, #51483d 54%, #0d0d12); }
.shelf-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.18), transparent 32%, rgba(0,0,0,.72));
}
.shelf-topline {
  position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  opacity: 0; transition: opacity .2s ease;
}
.shelf-card:hover .shelf-topline { opacity: 1; }
.shelf-topline span {
  max-width: calc(100% - 42px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; padding: 7px 10px;
  background: rgba(0,0,0,.38); backdrop-filter: blur(14px); color: rgba(255,255,255,.86); font-size: .72rem; font-weight: 800;
}
.shelf-delete, .shelf-open {
  width: 30px; height: 30px; min-height: 30px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,.90); color: #171414; border: 0; box-shadow: 0 10px 28px rgba(0,0,0,.22); font-weight: 900;
}
.shelf-delete { background: rgba(60, 14, 19, .86); color: #fff; }
.shelf-caption {
  position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.shelf-person { min-width: 0; display: inline-flex; align-items: center; gap: 8px; color: white; font-weight: 900; font-size: .82rem; text-shadow: 0 2px 20px rgba(0,0,0,.75); }
.shelf-person span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-avatar { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background-size: cover; background-position: center; border: 1px solid rgba(255,255,255,.45); }
.shelf-avatar-fallback { display: inline-grid; place-items: center; background: var(--paper); color: var(--ink); font-size: .72rem; }
.shelf-title {
  position: absolute; left: 12px; right: 12px; bottom: 54px; padding: 12px; border-radius: 16px; color: white;
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.10); backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease;
}
.shelf-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-title span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; color: rgba(255,255,255,.72); font-size: .8rem; line-height: 1.35; }

/* Cleaner call-time dashboard */
.clean-call-hero { margin-bottom: 14px; }
.call-compact-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 14px; border-top: 1px solid var(--white-line);
}
.call-compact-row div { min-width: 0; border-radius: 18px; background: var(--white-soft); padding: 12px 14px; }
.call-compact-row span { display: block; color: var(--paper-soft); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.call-compact-row strong { display: block; margin-top: 4px; color: var(--paper); font-size: 1.14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.mini-metric {
  min-width: 0; border-radius: 20px; padding: 14px 15px; background: rgba(255,255,255,.075); border: 1px solid var(--white-line); color: var(--paper);
}
.mini-metric span { display: block; color: var(--paper-soft); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.mini-metric strong { display: block; margin-top: 6px; font-size: 1.15rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
.mini-metric small { display: block; margin-top: 4px; color: var(--paper-soft); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-details { margin-top: 12px; padding: 0; }
.call-details summary {
  list-style: none; padding: 18px 22px; cursor: pointer; font-weight: 900; display: flex; align-items: center; justify-content: space-between;
}
.call-details summary::-webkit-details-marker { display: none; }
.call-details summary::after { content: "+"; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--white-soft); border: 1px solid var(--white-line); }
.panel.call-details summary::after { background: rgba(36,29,30,.06); border-color: var(--line); }
.call-details[open] summary::after { content: "–"; }
.call-details .local-list, .call-details .chart-stack { padding: 0 22px 22px; }
.chart-stack { display: grid; gap: 18px; }
.compact-session { padding: 12px; }
.calm-bars { max-height: 280px; }

@media (max-width: 860px) {
  .library-intro { align-items: stretch; flex-direction: column; }
  .library-count { align-self: flex-start; }
  .library-tools { grid-template-columns: 1fr; }
  .call-compact-row, .call-overview { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .library-masonry { columns: 1; }
  .call-compact-row, .call-overview { grid-template-columns: 1fr; }
}

/* Library wall mode */
.library-room.wall-mode {
  width: min(calc(100vw - 48px), 1380px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
  padding-bottom: 88px;
}
.library-wall-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 34px 0 18px;
  padding: 0 4px;
}
.library-wall-hero h1 {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  margin-bottom: 0;
}
.library-wall-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.library-count.compact {
  min-width: 92px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255,255,255,.07);
}
.library-count.compact strong { font-size: 1.65rem; }
.library-count.compact span { font-size: .78rem; }
.library-plus {
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 22px 70px rgba(0,0,0,.35), 0 0 50px rgba(215,168,110,.22);
}
.library-wall-wrap.full-wall {
  margin-top: 0;
  min-height: 62vh;
}
.full-wall .library-masonry {
  columns: 4 250px;
  column-gap: 20px;
}
.full-wall .empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: rgba(255,255,255,.045);
  border: 1px dashed rgba(255,249,240,.24);
  color: var(--paper-soft);
}
.wall-mode .shelf-card {
  margin-bottom: 20px;
  border-radius: 24px;
  cursor: pointer;
  background: #050705;
}
.wall-mode .shelf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 32px 110px rgba(0,0,0,.48);
}
.wall-mode .shelf-visual img {
  min-height: 0;
  height: 270px;
}
.wall-mode .card-size-1 .shelf-visual img,
.wall-mode .card-size-1 .shelf-placeholder { height: 170px; min-height: 170px; }
.wall-mode .card-size-2 .shelf-visual img,
.wall-mode .card-size-2 .shelf-placeholder { height: 360px; min-height: 360px; }
.wall-mode .card-size-3 .shelf-visual img,
.wall-mode .card-size-3 .shelf-placeholder { height: 260px; min-height: 260px; }
.wall-mode .card-size-4 .shelf-visual img,
.wall-mode .card-size-4 .shelf-placeholder { height: 430px; min-height: 430px; }
.wall-mode .card-size-5 .shelf-visual img,
.wall-mode .card-size-5 .shelf-placeholder { height: 310px; min-height: 310px; }
.wall-mode .shelf-title {
  opacity: 0;
  bottom: 56px;
}
.wall-mode .shelf-caption {
  bottom: 14px;
}
.wall-mode .shelf-person {
  font-size: .78rem;
  max-width: calc(100% - 42px);
}
.wall-mode .shelf-open {
  opacity: .96;
}
.library-modal {
  z-index: 80;
}
.library-modal-card.modal-card {
  width: min(620px, 100%);
  background: rgba(15, 12, 19, .94);
  color: var(--paper);
  border: 1px solid var(--white-line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.library-modal-card .eyebrow {
  margin-bottom: 8px;
}
.modal-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.icon-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.25rem;
}
.library-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--white-line);
  margin-bottom: 18px;
}
.library-tabs button {
  flex: 1;
  box-shadow: none;
  background: transparent;
  color: var(--paper-soft);
}
.library-tabs button.active {
  background: var(--paper);
  color: var(--ink);
}
.library-add-panel textarea,
.library-modal-card textarea {
  min-height: 110px;
}
.library-settings-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.library-settings-meta span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--white-line);
  color: var(--paper-soft);
  font-size: .82rem;
  font-weight: 800;
}
.split-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
}
.split-actions span {
  align-self: center;
  text-align: center;
}
.library-modal-card input,
.library-modal-card textarea {
  color: var(--paper);
  background: rgba(255,255,255,.08);
  border-color: var(--white-line);
}
.library-modal-card input[type="file"] {
  padding: 10px;
}

@media (max-width: 980px) {
  .full-wall .library-masonry { columns: 3 220px; }
}
@media (max-width: 700px) {
  .library-room.wall-mode { width: min(calc(100vw - 28px), 1380px); }
  .library-wall-hero { align-items: flex-start; }
  .library-wall-actions { align-items: flex-end; flex-direction: column-reverse; }
  .full-wall .library-masonry { columns: 2 160px; column-gap: 12px; }
  .wall-mode .shelf-card { margin-bottom: 12px; border-radius: 18px; }
  .wall-mode .card-size-1 .shelf-visual img,
  .wall-mode .card-size-1 .shelf-placeholder { height: 140px; min-height: 140px; }
  .wall-mode .card-size-2 .shelf-visual img,
  .wall-mode .card-size-2 .shelf-placeholder { height: 260px; min-height: 260px; }
  .wall-mode .card-size-3 .shelf-visual img,
  .wall-mode .card-size-3 .shelf-placeholder { height: 210px; min-height: 210px; }
  .wall-mode .card-size-4 .shelf-visual img,
  .wall-mode .card-size-4 .shelf-placeholder { height: 300px; min-height: 300px; }
  .wall-mode .card-size-5 .shelf-visual img,
  .wall-mode .card-size-5 .shelf-placeholder { height: 230px; min-height: 230px; }
  .library-plus { width: 52px; height: 52px; min-height: 52px; }
  .split-actions { grid-template-columns: 1fr; }
  .split-actions span { text-align: left; }
}

/* Library: full visual wall */
.library-room.wall-gallery-mode {
  width: min(calc(100vw - 36px), 1440px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
  min-height: calc(100vh - 150px);
  padding-bottom: 96px;
}
.library-room.wall-gallery-mode .library-wall-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 14px;
  padding: 0 4px;
  color: var(--paper-soft);
}
.library-room.wall-gallery-mode .library-wall-strip .eyebrow {
  margin-bottom: 4px;
  opacity: .82;
}
.library-room.wall-gallery-mode .library-wall-strip strong {
  color: var(--paper);
  font-size: 1.15rem;
  letter-spacing: -.04em;
}
.library-room.wall-gallery-mode .library-wall-wrap.full-wall {
  margin: 0;
  min-height: 74vh;
}
.library-room.wall-gallery-mode .library-masonry {
  columns: 5 230px;
  column-gap: 18px;
  min-height: 74vh;
}
.library-room.wall-gallery-mode .shelf-card {
  width: 100%;
  display: block;
  break-inside: avoid;
  margin: 0 0 18px;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  background: #060706;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 22px 90px rgba(0,0,0,.42);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.library-room.wall-gallery-mode .shelf-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 34px 120px rgba(0,0,0,.56);
}
.library-room.wall-gallery-mode .shelf-visual,
.library-room.wall-gallery-mode .shelf-visual img,
.library-room.wall-gallery-mode .shelf-placeholder {
  width: 100%;
}
.library-room.wall-gallery-mode .shelf-visual img {
  display: block;
  object-fit: cover;
  min-height: 0;
  background: #050505;
}
.library-room.wall-gallery-mode .fit-contain .shelf-visual img {
  object-fit: contain;
  padding: 10px;
}
.library-room.wall-gallery-mode .card-size-1 .shelf-visual img,
.library-room.wall-gallery-mode .card-size-1 .shelf-placeholder,
.library-room.wall-gallery-mode .wall-size-small .shelf-visual img,
.library-room.wall-gallery-mode .wall-size-small .shelf-placeholder,
.library-room.wall-gallery-mode .shelf-card.wall-size-small { height: 178px; min-height: 178px; }
.library-room.wall-gallery-mode .card-size-2 .shelf-visual img,
.library-room.wall-gallery-mode .card-size-2 .shelf-placeholder,
.library-room.wall-gallery-mode .wall-size-tall .shelf-visual img,
.library-room.wall-gallery-mode .wall-size-tall .shelf-placeholder,
.library-room.wall-gallery-mode .shelf-card.wall-size-tall { height: 410px; min-height: 410px; }
.library-room.wall-gallery-mode .card-size-3 .shelf-visual img,
.library-room.wall-gallery-mode .card-size-3 .shelf-placeholder,
.library-room.wall-gallery-mode .wall-size-medium .shelf-visual img,
.library-room.wall-gallery-mode .wall-size-medium .shelf-placeholder,
.library-room.wall-gallery-mode .shelf-card.wall-size-medium { height: 270px; min-height: 270px; }
.library-room.wall-gallery-mode .card-size-4 .shelf-visual img,
.library-room.wall-gallery-mode .card-size-4 .shelf-placeholder,
.library-room.wall-gallery-mode .wall-size-feature .shelf-visual img,
.library-room.wall-gallery-mode .wall-size-feature .shelf-placeholder,
.library-room.wall-gallery-mode .shelf-card.wall-size-feature { height: 510px; min-height: 510px; }
.library-room.wall-gallery-mode .card-size-5 .shelf-visual img,
.library-room.wall-gallery-mode .card-size-5 .shelf-placeholder { height: 320px; min-height: 320px; }
.library-room.wall-gallery-mode .shelf-title {
  bottom: 56px;
  opacity: 0;
}
.library-room.wall-gallery-mode .shelf-card:hover .shelf-title {
  opacity: 1;
  transform: translateY(0);
}
.library-room.wall-gallery-mode .shelf-caption {
  bottom: 13px;
}
.library-room.wall-gallery-mode .shelf-person {
  max-width: calc(100% - 42px);
  font-size: .78rem;
}
.library-room.wall-gallery-mode .shelf-open {
  opacity: .96;
}
.library-room.wall-gallery-mode .wall-add-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 22px;
  border: 1px dashed rgba(255,249,240,.28);
  color: var(--paper);
  background:
    radial-gradient(circle at 32% 20%, rgba(215,168,110,.22), transparent 34%),
    radial-gradient(circle at 84% 88%, rgba(155,108,255,.18), transparent 42%),
    rgba(255,255,255,.045);
  box-shadow: none;
  font-weight: 900;
}
.library-room.wall-gallery-mode .wall-add-card:hover {
  background:
    radial-gradient(circle at 32% 20%, rgba(215,168,110,.32), transparent 34%),
    radial-gradient(circle at 84% 88%, rgba(155,108,255,.24), transparent 42%),
    rgba(255,255,255,.075);
}
.library-room.wall-gallery-mode .wall-add-plus {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 22px 70px rgba(0,0,0,.34);
}
.library-room.wall-gallery-mode .wall-ghost {
  pointer-events: none;
  opacity: .36;
  background:
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02)),
    radial-gradient(circle at 30% 20%, rgba(215,168,110,.16), transparent 34%),
    radial-gradient(circle at 82% 75%, rgba(120,86,180,.18), transparent 44%);
  border: 1px dashed rgba(255,249,240,.18);
  box-shadow: none;
}
.library-room.wall-gallery-mode .ghost-2,
.library-room.wall-gallery-mode .ghost-5,
.library-room.wall-gallery-mode .ghost-8 { opacity: .22; }
.library-fab {
  position: fixed;
  z-index: 65;
  right: max(24px, calc((100vw - 1440px) / 2 + 24px));
  bottom: 28px;
  width: 66px;
  height: 66px;
  min-height: 66px;
  padding: 0;
  border-radius: 50%;
  font-size: 2.35rem;
  line-height: 1;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.44);
  box-shadow: 0 28px 90px rgba(0,0,0,.50), 0 0 70px rgba(215,168,110,.22);
}
.library-fab:hover {
  transform: translateY(-2px) scale(1.03);
}
@media (max-width: 1100px) {
  .library-room.wall-gallery-mode .library-masonry { columns: 4 210px; }
}
@media (max-width: 820px) {
  .library-room.wall-gallery-mode { width: min(calc(100vw - 24px), 1440px); }
  .library-room.wall-gallery-mode .library-masonry { columns: 3 180px; column-gap: 12px; }
  .library-room.wall-gallery-mode .shelf-card { margin-bottom: 12px; border-radius: 18px; }
  .library-fab { right: 18px; bottom: 18px; width: 58px; height: 58px; min-height: 58px; }
}
@media (max-width: 560px) {
  .library-room.wall-gallery-mode .library-masonry { columns: 2 150px; }
  .library-room.wall-gallery-mode .card-size-1 .shelf-visual img,
  .library-room.wall-gallery-mode .card-size-1 .shelf-placeholder,
  .library-room.wall-gallery-mode .wall-size-small .shelf-visual img,
  .library-room.wall-gallery-mode .wall-size-small .shelf-placeholder,
  .library-room.wall-gallery-mode .shelf-card.wall-size-small { height: 142px; min-height: 142px; }
  .library-room.wall-gallery-mode .card-size-2 .shelf-visual img,
  .library-room.wall-gallery-mode .card-size-2 .shelf-placeholder,
  .library-room.wall-gallery-mode .wall-size-tall .shelf-visual img,
  .library-room.wall-gallery-mode .wall-size-tall .shelf-placeholder,
  .library-room.wall-gallery-mode .shelf-card.wall-size-tall { height: 280px; min-height: 280px; }
  .library-room.wall-gallery-mode .card-size-3 .shelf-visual img,
  .library-room.wall-gallery-mode .card-size-3 .shelf-placeholder,
  .library-room.wall-gallery-mode .wall-size-medium .shelf-visual img,
  .library-room.wall-gallery-mode .wall-size-medium .shelf-placeholder,
  .library-room.wall-gallery-mode .shelf-card.wall-size-medium { height: 210px; min-height: 210px; }
  .library-room.wall-gallery-mode .card-size-4 .shelf-visual img,
  .library-room.wall-gallery-mode .card-size-4 .shelf-placeholder,
  .library-room.wall-gallery-mode .wall-size-feature .shelf-visual img,
  .library-room.wall-gallery-mode .wall-size-feature .shelf-placeholder,
  .library-room.wall-gallery-mode .shelf-card.wall-size-feature { height: 330px; min-height: 330px; }
  .library-room.wall-gallery-mode .card-size-5 .shelf-visual img,
  .library-room.wall-gallery-mode .card-size-5 .shelf-placeholder { height: 240px; min-height: 240px; }
}

/* Library wall v3: anchor the wall to the room instead of letting it drift right. */
.library-room.wall-gallery-mode {
  width: 100%;
  max-width: none;
  margin: 0;
  margin-left: 0;
  transform: none;
  min-height: calc(100vh - 136px);
  padding-bottom: 96px;
}
.library-room.wall-gallery-mode .library-wall-strip {
  width: 100%;
  margin: 4px 0 14px;
  padding: 0 2px;
}
.library-room.wall-gallery-mode .library-wall-strip .eyebrow {
  margin-bottom: 1px;
}
.library-room.wall-gallery-mode .library-wall-strip strong {
  font-size: 1rem;
}
.library-room.wall-gallery-mode .library-wall-wrap.full-wall {
  width: 100%;
  margin: 0;
  min-height: calc(100vh - 190px);
}
.library-room.wall-gallery-mode .library-masonry {
  columns: initial;
  column-gap: initial;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  grid-auto-rows: 10px;
  grid-auto-flow: dense;
  gap: 18px;
  width: 100%;
  min-height: calc(100vh - 190px);
  align-items: stretch;
}
.library-room.wall-gallery-mode .shelf-card {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  grid-row: span 28;
}
.library-room.wall-gallery-mode .shelf-card.card-size-1,
.library-room.wall-gallery-mode .shelf-card.wall-size-small {
  grid-row: span 18;
}
.library-room.wall-gallery-mode .shelf-card.card-size-2,
.library-room.wall-gallery-mode .shelf-card.wall-size-tall {
  grid-row: span 42;
}
.library-room.wall-gallery-mode .shelf-card.card-size-3,
.library-room.wall-gallery-mode .shelf-card.wall-size-medium {
  grid-row: span 28;
}
.library-room.wall-gallery-mode .shelf-card.card-size-4,
.library-room.wall-gallery-mode .shelf-card.wall-size-feature {
  grid-row: span 52;
}
.library-room.wall-gallery-mode .shelf-card.card-size-5 {
  grid-row: span 34;
}
.library-room.wall-gallery-mode .shelf-visual,
.library-room.wall-gallery-mode .shelf-visual img,
.library-room.wall-gallery-mode .shelf-placeholder {
  height: 100% !important;
  min-height: 0 !important;
}
.library-room.wall-gallery-mode .shelf-visual img {
  object-fit: cover;
}
.library-room.wall-gallery-mode .fit-contain .shelf-visual img {
  object-fit: contain;
  padding: 10px;
}
.library-room.wall-gallery-mode .wall-add-card {
  min-height: 0 !important;
}
.library-room.wall-gallery-mode .wall-ghost {
  min-height: 0 !important;
}

@media (min-width: 1300px) {
  .library-room.wall-gallery-mode {
    width: min(calc(100vw - 48px), 1440px);
    margin-left: calc(50% - min(calc(100vw - 48px), 1440px) / 2);
  }
  .library-room.wall-gallery-mode .library-masonry {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}
@media (max-width: 820px) {
  .library-room.wall-gallery-mode {
    width: 100%;
    margin-left: 0;
  }
  .library-room.wall-gallery-mode .library-masonry {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    grid-auto-rows: 8px;
    gap: 12px;
  }
  .library-room.wall-gallery-mode .shelf-card.card-size-1,
  .library-room.wall-gallery-mode .shelf-card.wall-size-small { grid-row: span 17; }
  .library-room.wall-gallery-mode .shelf-card.card-size-2,
  .library-room.wall-gallery-mode .shelf-card.wall-size-tall { grid-row: span 34; }
  .library-room.wall-gallery-mode .shelf-card.card-size-3,
  .library-room.wall-gallery-mode .shelf-card.wall-size-medium { grid-row: span 25; }
  .library-room.wall-gallery-mode .shelf-card.card-size-4,
  .library-room.wall-gallery-mode .shelf-card.wall-size-feature { grid-row: span 40; }
  .library-room.wall-gallery-mode .shelf-card.card-size-5 { grid-row: span 29; }
}

/* Library upload preview */
.library-file-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.11);
}
.library-preview-visual {
  height: 104px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 10%, rgba(215,168,110,.25), transparent 36%),
    rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  display: grid;
  place-items: center;
}
.library-preview-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.library-preview-file {
  color: var(--paper);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.library-preview-meta {
  min-width: 0;
}
.library-preview-meta strong,
.library-preview-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-preview-meta strong {
  color: var(--paper);
  font-size: 1rem;
  margin-bottom: 5px;
}
.library-preview-meta span {
  color: var(--paper-soft);
  font-weight: 700;
  font-size: .88rem;
}
@media (max-width: 560px) {
  .library-file-preview { grid-template-columns: 1fr; }
  .library-preview-visual { height: 150px; }
}

/* Per-user personalization */
html[data-radius="sharp"] { --radius-xl: 18px; --radius-lg: 12px; --radius-md: 9px; }
html[data-radius="soft"] { --radius-xl: 32px; --radius-lg: 22px; --radius-md: 16px; }
html[data-radius="round"] { --radius-xl: 44px; --radius-lg: 30px; --radius-md: 22px; }

html[data-theme="midnight"] {
  --bg: #070812;
  --paper: rgba(236, 240, 255, 0.92);
  --paper-strong: #f3f5ff;
  --paper-soft: rgba(236, 240, 255, 0.68);
  --ink: #11131f;
  --muted: rgba(17, 19, 31, 0.58);
  --line: rgba(17, 19, 31, 0.16);
  --white-line: rgba(236, 240, 255, 0.16);
  --white-soft: rgba(236, 240, 255, 0.09);
  --glass-dark: rgba(6, 8, 18, 0.50);
  --glass-darker: rgba(6, 8, 18, 0.76);
}
html[data-theme="forest"] {
  --bg: #07110c;
  --paper: rgba(241, 248, 232, 0.92);
  --paper-strong: #f7ffe9;
  --paper-soft: rgba(241, 248, 232, 0.68);
  --ink: #142016;
  --muted: rgba(20, 32, 22, 0.58);
  --line: rgba(20, 32, 22, 0.16);
  --white-line: rgba(241, 248, 232, 0.16);
  --white-soft: rgba(241, 248, 232, 0.09);
  --glass-dark: rgba(5, 13, 8, 0.50);
  --glass-darker: rgba(5, 13, 8, 0.76);
}
html[data-theme="ocean"] {
  --bg: #061018;
  --paper: rgba(230, 247, 255, 0.92);
  --paper-strong: #f0fbff;
  --paper-soft: rgba(230, 247, 255, 0.68);
  --ink: #091b28;
  --muted: rgba(9, 27, 40, 0.58);
  --line: rgba(9, 27, 40, 0.15);
  --white-line: rgba(230, 247, 255, 0.16);
  --white-soft: rgba(230, 247, 255, 0.09);
  --glass-dark: rgba(4, 12, 20, 0.50);
  --glass-darker: rgba(4, 12, 20, 0.76);
}
html[data-theme="rose"] {
  --bg: #170c13;
  --paper: rgba(255, 242, 247, 0.92);
  --paper-strong: #fff5f8;
  --paper-soft: rgba(255, 242, 247, 0.68);
  --ink: #26131b;
  --muted: rgba(38, 19, 27, 0.58);
  --line: rgba(38, 19, 27, 0.15);
  --white-line: rgba(255, 242, 247, 0.16);
  --white-soft: rgba(255, 242, 247, 0.09);
  --glass-dark: rgba(20, 8, 14, 0.50);
  --glass-darker: rgba(20, 8, 14, 0.76);
}
html[data-theme="ember"] {
  --bg: #150907;
  --paper: rgba(255, 244, 230, 0.92);
  --paper-strong: #fff7ed;
  --paper-soft: rgba(255, 244, 230, 0.68);
  --ink: #26120c;
  --muted: rgba(38, 18, 12, 0.58);
  --line: rgba(38, 18, 12, 0.15);
  --white-line: rgba(255, 244, 230, 0.16);
  --white-soft: rgba(255, 244, 230, 0.09);
  --glass-dark: rgba(18, 7, 5, 0.50);
  --glass-darker: rgba(18, 7, 5, 0.76);
}

.background::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--wallpaper-url, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: saturate(0.9) contrast(0.94);
  transition: opacity .28s ease;
}
html[data-background="custom"] .background::before {
  opacity: calc(1 - var(--wallpaper-dim, .68));
}
html[data-background="aurora"] .background {
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 32%),
    radial-gradient(circle at 82% 72%, rgba(158, 108, 255, 0.18), transparent 38%),
    linear-gradient(90deg, rgba(8, 6, 11, 0.76), rgba(8, 6, 11, 0.46), rgba(8, 6, 11, 0.74)),
    linear-gradient(135deg, #211826, #181521 45%, #2b211b);
}
html[data-background="stars"] .background {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.20) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 68%, rgba(255,255,255,.16) 0 1px, transparent 2px),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.13) 0 1px, transparent 2px),
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 30%),
    linear-gradient(135deg, #070812, #11131f 50%, #09070f);
  background-size: 220px 220px, 310px 310px, 180px 180px, auto, auto;
}
html[data-background="window"] .background {
  background:
    linear-gradient(110deg, rgba(255,255,255,.06) 0 1px, transparent 1px 74px),
    radial-gradient(circle at 14% 18%, rgba(170, 205, 255,.18), transparent 28%),
    radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 40%),
    linear-gradient(135deg, #0a1018, #1b1820 48%, #101015);
}
html[data-background="moss"] .background {
  background:
    radial-gradient(circle at 18% 16%, rgba(193, 232, 151,.18), transparent 32%),
    radial-gradient(circle at 82% 70%, rgba(77, 124, 75,.30), transparent 42%),
    linear-gradient(135deg, #07110c, #152315 45%, #090d08);
}
html[data-background="blush"] .background {
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 174, 195,.24), transparent 34%),
    radial-gradient(circle at 86% 72%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 44%),
    linear-gradient(135deg, #170c13, #271723 46%, #11090f);
}
html[data-background="void"] .background {
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 38%),
    linear-gradient(135deg, #050507, #09090e 50%, #050507);
}
html[data-background="custom"] .background {
  background:
    linear-gradient(90deg, rgba(5, 5, 8, var(--wallpaper-dim, .68)), rgba(5, 5, 8, calc(var(--wallpaper-dim, .68) - .14)), rgba(5, 5, 8, var(--wallpaper-dim, .68))),
    linear-gradient(135deg, #111017, #181521 45%, #111017);
}

html[data-surface="glass"] .panel {
  background: rgba(255,255,255,.16);
  color: var(--paper);
  border-color: var(--white-line);
  backdrop-filter: blur(24px);
}
html[data-surface="glass"] .panel .muted,
html[data-surface="glass"] .panel .panel-head span,
html[data-surface="glass"] .panel .countdown-meta,
html[data-surface="glass"] .panel .count-card span,
html[data-surface="glass"] .panel .form-actions { color: var(--paper-soft); }
html[data-surface="glass"] .panel input,
html[data-surface="glass"] .panel select,
html[data-surface="glass"] .panel textarea {
  color: var(--paper);
  background: rgba(255,255,255,.08);
  border-color: var(--white-line);
}
html[data-surface="glass"] .panel .status-pill,
html[data-surface="glass"] .panel .pill,
html[data-surface="glass"] .panel .count-card {
  background: var(--white-soft);
  color: var(--paper);
}
html[data-surface="dim"] .panel,
html[data-surface="dim"] .dark-panel,
html[data-surface="dim"] .media-player {
  background: rgba(8, 7, 11, .80);
  color: var(--paper);
  border-color: var(--white-line);
}
html[data-surface="dim"] .panel input,
html[data-surface="dim"] .panel select,
html[data-surface="dim"] .panel textarea {
  color: var(--paper);
  background: rgba(255,255,255,.08);
  border-color: var(--white-line);
}
html[data-surface="dim"] .panel .muted,
html[data-surface="dim"] .panel .panel-head span,
html[data-surface="dim"] .panel .form-actions { color: var(--paper-soft); }

html[data-density="compact"] .panel,
html[data-density="compact"] .dark-panel { padding: 16px; }
html[data-density="compact"] .intro { margin: 34px 0 20px; }
html[data-density="compact"] .quick-form-grid { gap: 10px; }
html[data-density="compact"] input,
html[data-density="compact"] select,
html[data-density="compact"] textarea { padding: 9px 11px; border-radius: 12px; }
html[data-density="roomy"] .panel,
html[data-density="roomy"] .dark-panel { padding: 30px; }
html[data-density="roomy"] .intro { margin: 76px 0 42px; }
html[data-density="roomy"] .quick-form-grid { gap: 18px; }
html[data-density="roomy"] input,
html[data-density="roomy"] select,
html[data-density="roomy"] textarea { padding: 15px 16px; }

html[data-nav="minimal"] .topbar-inner {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
html[data-nav="minimal"] .room-nav a,
html[data-nav="minimal"] .profile-chip,
html[data-nav="minimal"] .top-actions button {
  background: transparent;
  border-color: transparent;
}
html[data-nav="minimal"] .room-nav a.active,
html[data-nav="minimal"] .room-nav a:hover {
  background: var(--white-soft);
  color: var(--paper);
}
html[data-nav="rail"] .topbar-inner {
  border-radius: var(--radius-xl);
  align-items: stretch;
}
html[data-nav="rail"] .room-nav a,
html[data-nav="rail"] .brand,
html[data-nav="rail"] .profile-chip,
html[data-nav="rail"] .top-actions button {
  border-radius: var(--radius-lg);
}

html[data-motion="calm"] *,
html[data-motion="calm"] *::before,
html[data-motion="calm"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

.preferences-panel { margin-top: 18px; }
.preferences-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.room-label-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(36,29,30,.045);
}
.room-label-editor summary {
  cursor: pointer;
  font-weight: 900;
  color: inherit;
  margin-bottom: 12px;
}
.theme-preview-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 18% 14%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 38%),
    rgba(36,29,30,.055);
  border: 1px solid var(--line);
}
.theme-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--paper));
  box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 34%, transparent);
}
.theme-strip {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--paper-soft));
}
.theme-card-preview {
  height: 58px;
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: 0 14px 42px rgba(0,0,0,.14);
}
html[data-surface="glass"] .room-label-editor,
html[data-surface="dim"] .room-label-editor,
html[data-surface="glass"] .theme-preview-row,
html[data-surface="dim"] .theme-preview-row {
  border-color: var(--white-line);
  background: var(--white-soft);
}
html[data-surface="glass"] .theme-card-preview,
html[data-surface="dim"] .theme-card-preview {
  background: rgba(255,255,255,.18);
}

@media (max-width: 860px) {
  .preferences-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .preferences-grid { grid-template-columns: 1fr; }
  .theme-preview-row { grid-template-columns: 44px 1fr; }
  .theme-card-preview { display: none; }
}

/* v1.2 layout fixes + new rooms */
.library-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: auto;
  padding: 24px;
}
.library-modal-card.modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: min(700px, 86vh);
  margin: auto;
  transform: none;
}
.library-room.wall-gallery-mode .library-masonry .wall-add-card {
  break-inside: avoid;
}

.stats-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr);
  gap: 18px;
  margin-bottom: 18px;
}
.stats-call-panel { margin-bottom: 0; }
.storage-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.storage-meter {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid var(--white-line);
}
.storage-meter i {
  display: block;
  height: 100%;
  width: 2%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,.78));
  box-shadow: 0 0 28px rgba(255,255,255,.18);
}
.storage-big { font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.06em; }
.roomy-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.soft-stat { min-height: 128px; }
.stats-lower { align-items: start; }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .65fr);
  gap: 18px;
  align-items: start;
}
.map-stage { padding: 20px; }
.map-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 14px; }
.map-toolbar h2 { margin: 0; }
.map-canvas {
  position: relative;
  min-height: min(68vh, 720px);
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid var(--white-line);
  background:
    radial-gradient(circle at 20% 25%, rgba(215,168,110,.24), transparent 26%),
    radial-gradient(circle at 78% 70%, rgba(146,114,255,.18), transparent 34%),
    linear-gradient(140deg, rgba(15,16,34,.96), rgba(10,12,24,.92));
  cursor: crosshair;
  box-shadow: inset 0 0 80px rgba(0,0,0,.28);
}
.map-canvas.dream-mode {
  filter: saturate(1.22) contrast(1.05);
}
.world-shapes {
  position: absolute;
  inset: 5% 4%;
  width: 92%;
  height: 90%;
  opacity: .34;
  filter: drop-shadow(0 20px 70px rgba(0,0,0,.5));
}
.world-shapes path {
  fill: rgba(255,249,240,.16);
  stroke: rgba(255,249,240,.18);
  stroke-width: 2;
}
.map-grid-glow {
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.trip-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.trip-lines line {
  stroke-width: .55;
  stroke-linecap: round;
  stroke-dasharray: 1.4 1.1;
  filter: drop-shadow(0 0 7px currentColor);
  opacity: .9;
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: transparent;
  text-shadow: 0 2px 18px rgba(0,0,0,.8);
}
.map-pin span {
  width: 20px;
  height: 20px;
  border-radius: 999px 999px 999px 4px;
  transform: rotate(-45deg);
  background: var(--accent);
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 0 0 8px rgba(215,168,110,.16), 0 16px 40px rgba(0,0,0,.45);
}
.map-pin strong {
  max-width: 150px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(5,4,8,.55);
  border: 1px solid rgba(255,255,255,.16);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(12px);
}
.map-pin.status-done span { background: #91d190; }
.map-pin.status-booked span { background: #8bb8ff; }
.map-pin.status-planned span { background: #f0c36f; }
.map-pin:hover { z-index: 6; transform: translate(-50%, -100%) scale(1.04); }
.map-hint { margin: 12px 4px 0; }
.map-sidebar { display: grid; gap: 18px; }
.map-side-card, .trip-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(36,29,30,.06);
}
.map-side-card { cursor: pointer; }
.map-side-card:hover { transform: translateY(-1px); background: rgba(36,29,30,.09); }
.map-side-card strong, .trip-card strong { display: block; }
.map-side-card span, .trip-card span { display: block; color: var(--muted); font-size: .84rem; margin-top: 4px; }
.dark-panel .trip-card { border-color: var(--white-line); background: rgba(255,255,255,.07); }
.dark-panel .trip-card span { color: var(--paper-soft); }
.pin-image-strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  overflow: hidden;
  margin-bottom: 2px;
}
.pin-image-strip img {
  width: 64px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.18);
}
.pin-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--white-line);
  background: var(--white-soft);
  color: var(--paper);
  font-size: .84rem;
}
.trip-list { display: grid; gap: 10px; margin-top: 14px; }
.trip-card { grid-template-columns: 12px minmax(0, 1fr) auto; }
.trip-color { width: 12px; height: 100%; min-height: 46px; border-radius: 999px; }
.trip-card p { margin: 7px 0 0; color: var(--paper-soft); font-size: .85rem; }
.map-modal .modal-card { width: min(760px, calc(100vw - 32px)); max-height: min(720px, 88vh); }
.pin-existing-images { margin-top: 12px; }

.casino-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .52fr);
  gap: 18px;
  align-items: start;
}
.casino-table, .casino-create, .casino-rules { margin-bottom: 18px; }
.casino-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.casino-balance-card {
  padding: 22px;
  border-radius: 26px;
  border: 1px solid var(--white-line);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.14), transparent 38%),
    rgba(255,255,255,.07);
}
.casino-balance-card.me { outline: 2px solid var(--accent); outline-offset: -2px; }
.casino-balance-card span { display: block; color: var(--paper-soft); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.casino-balance-card strong { display: block; margin-top: 10px; font-size: clamp(1.9rem, 4vw, 3.4rem); letter-spacing: -.08em; }
.casino-balance-card small { color: var(--paper-soft); }
.casino-bets-panel { margin-top: 18px; }
.casino-bets { display: grid; gap: 12px; }
.casino-bet-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .36fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--white-line);
  background: rgba(255,255,255,.07);
}
.casino-bet-card.status-settled { opacity: .82; }
.casino-bet-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.casino-bet-title strong { font-size: 1.15rem; }
.casino-bet-title span { color: var(--accent); font-weight: 900; }
.casino-bet-card p { margin: 8px 0; color: var(--paper-soft); }
.casino-bet-card small { color: var(--paper-soft); }
.casino-result {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 16px;
  background: rgba(255,255,255,.10);
  border: 1px solid var(--white-line);
}
.casino-result.pending { color: var(--paper-soft); }
.casino-resolve { display: grid; gap: 10px; }

@media (max-width: 980px) {
  .stats-top-grid, .map-layout, .casino-layout { grid-template-columns: 1fr; }
  .roomy-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-canvas { min-height: 520px; }
}
@media (max-width: 620px) {
  .roomy-stats, .casino-balances, .casino-bet-card { grid-template-columns: 1fr; }
  .map-toolbar { flex-direction: column; align-items: stretch; }
  .map-pin strong { display: none; }
  .map-canvas { min-height: 430px; }
}

/* v1.2.1: real map room + cleaner casino */
.map-real-room {
  width: min(100vw - 48px, 1560px);
  margin: 0 auto;
}
.map-real-room .intro { display: none; }
.map-shell {
  position: relative;
  min-height: calc(100vh - 144px);
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid var(--white-line);
  box-shadow: var(--shadow);
  background: #081329;
}
.real-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 640px;
  background: #091322;
}
.real-map .leaflet-container,
.leaflet-container {
  font-family: inherit;
}
.real-map .leaflet-tile-pane {
  filter: saturate(.82) brightness(.72) contrast(1.05) hue-rotate(178deg);
}
.real-map .leaflet-control-attribution {
  background: rgba(5, 7, 12, .48);
  color: rgba(255,249,240,.7);
  border-radius: 999px 0 0 0;
  backdrop-filter: blur(14px);
}
.real-map .leaflet-control-attribution a { color: rgba(255,249,240,.86); }
.real-map .leaflet-control-zoom {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.real-map .leaflet-control-zoom a {
  width: 42px;
  height: 42px;
  line-height: 40px;
  background: rgba(13, 18, 32, .78);
  color: var(--paper);
  border: 0;
  backdrop-filter: blur(16px);
}
.real-map .leaflet-control-zoom a:hover { background: var(--paper); color: var(--ink); }
.floating-map-control {
  position: absolute;
  z-index: 650;
  backdrop-filter: blur(20px);
}
.map-searchbar {
  top: 18px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 26px;
  background: rgba(8, 11, 20, .62);
  box-shadow: 0 24px 90px rgba(0,0,0,.34);
}
.map-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.map-searchbar input {
  height: 44px;
  border-radius: 999px;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color: var(--paper);
}
.map-searchbar input::placeholder { color: rgba(255,249,240,.56); }
.map-searchbar button {
  min-height: 44px;
  box-shadow: none;
}
.map-square-button {
  width: 44px;
  padding: 0;
}
.map-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 64px;
  width: min(720px, calc(100vw - 126px));
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.17);
  background: rgba(10, 12, 22, .92);
  box-shadow: 0 24px 90px rgba(0,0,0,.42);
}
.map-search-result {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  border-radius: 16px;
  background: transparent;
  color: var(--paper);
  box-shadow: none;
  padding: 10px 12px;
}
.map-search-result:hover { background: rgba(255,255,255,.10); }
.map-search-result span,
.map-search-empty {
  color: var(--paper-soft);
  font-size: .86rem;
  line-height: 1.35;
}
.map-search-empty { padding: 14px; }
.map-drawer {
  position: absolute;
  z-index: 620;
  left: 18px;
  top: 88px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 30px;
  background: rgba(8, 9, 18, .72);
  color: var(--paper);
  backdrop-filter: blur(24px);
  box-shadow: 0 30px 110px rgba(0,0,0,.42);
  transition: transform .24s ease, opacity .24s ease;
}
.map-drawer.collapsed {
  transform: translateX(calc(-100% - 28px));
  opacity: 0;
  pointer-events: none;
}
.map-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.map-drawer-head h1 {
  font-size: 2rem;
  line-height: 1;
  margin: 0 0 3px;
}
.map-drawer-head span { color: var(--paper-soft); font-weight: 800; }
.map-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.map-tabs button {
  min-height: 36px;
  padding: 0 10px;
  box-shadow: none;
  background: transparent;
  color: var(--paper-soft);
}
.map-tabs button.active {
  background: var(--paper);
  color: var(--ink);
}
.map-tab-panel {
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}
.map-panel-actions { margin-bottom: 12px; }
.map-panel-actions button { width: 100%; }
.map-pin-list, .trip-list { display: grid; gap: 10px; }
.map-side-card.real-map-card,
.trip-card.real-trip-card {
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: var(--paper);
}
.map-side-card.real-map-card:hover,
.trip-card.real-trip-card:hover { background: rgba(255,255,255,.12); }
.map-side-card.real-map-card span,
.trip-card.real-trip-card span { color: var(--paper-soft); }
.map-card-actions,
.trip-card-actions,
.casino-resolve-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.trip-card.real-trip-card {
  grid-template-columns: 10px minmax(0, 1fr);
}
.trip-card.real-trip-card .trip-card-actions { grid-column: 1 / -1; }
.compact-trip-form {
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  margin-bottom: 12px;
}
.compact-trip-form textarea { min-height: 74px; }
.two-tight { grid-template-columns: minmax(0, 1fr) 68px; }
.map-zoom-hint {
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--paper-soft);
  background: rgba(8, 11, 20, .62);
  box-shadow: 0 18px 70px rgba(0,0,0,.28);
}
.leaf-pin-wrap { background: transparent; border: 0; }
.leaf-pin {
  width: 30px;
  height: 42px;
  position: relative;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.45));
}
.leaf-pin span {
  position: absolute;
  left: 4px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px 999px 999px 5px;
  transform: rotate(-45deg);
  background: var(--accent);
  border: 3px solid rgba(255,249,240,.96);
  box-shadow: 0 0 0 8px rgba(215,168,110,.18);
}
.leaf-pin span::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.26);
}
.leaf-pin.status-planned span { background: #f0c36f; box-shadow: 0 0 0 8px rgba(240,195,111,.2); }
.leaf-pin.status-booked span { background: #79adff; box-shadow: 0 0 0 8px rgba(121,173,255,.2); }
.leaf-pin.status-done span { background: #8ad88d; box-shadow: 0 0 0 8px rgba(138,216,141,.2); }
.leaflet-tooltip {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(8, 11, 20, .78);
  color: var(--paper);
  border-radius: 999px;
  box-shadow: 0 18px 60px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
  font-weight: 800;
}
.map-error-panel {
  position: absolute;
  inset: 20px;
  z-index: 2;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 28px;
  background: rgba(0,0,0,.42);
}

.casino-clean-room {
  width: min(100%, 1120px);
  margin: 0 auto;
}
.casino-clean-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 48px 0 14px;
}
.casino-clean-hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  margin-bottom: 8px;
}
.casino-clean-hero .subtitle { margin: 0; }
.casino-clean-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.casino-mini-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--white-line);
  background: rgba(255,255,255,.08);
  color: var(--paper);
  box-shadow: 0 18px 70px rgba(0,0,0,.18);
}
.casino-mini-balance.me { outline: 2px solid var(--accent); outline-offset: -2px; }
.casino-mini-balance span { color: var(--paper-soft); font-weight: 900; }
.casino-mini-balance strong { font-size: 1.35rem; letter-spacing: -.04em; }
.casino-compose { margin: 0 0 14px; }
.casino-compose-form {
  display: grid;
  grid-template-columns: minmax(160px, .65fr) minmax(120px, .35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}
.casino-compose-form textarea { min-height: 46px; }
.casino-compose-form .form-actions { grid-column: 1 / -1; }
.casino-board { padding: 18px; }
.casino-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.casino-board-head h2 { font-size: 1.4rem; }
.casino-board-head span { color: var(--paper-soft); }
.casino-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.casino-filters button {
  min-height: 36px;
  padding: 0 12px;
  font-size: .86rem;
  background: rgba(255,255,255,.08);
  color: var(--paper-soft);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,.12);
}
.casino-filters button.active {
  background: var(--paper);
  color: var(--ink);
}
.casino-clean-bets { display: grid; gap: 10px; }
.casino-clean-bet {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.07);
}
.casino-clean-bet.status-settled { opacity: .78; }
.casino-clean-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.casino-clean-top strong { display: block; font-size: 1.08rem; }
.casino-clean-top span { display: block; color: var(--paper-soft); margin-top: 3px; font-size: .9rem; }
.casino-clean-amount {
  text-align: right;
  display: grid;
  gap: 3px;
  min-width: 128px;
}
.casino-clean-amount b { color: var(--accent); font-size: 1.05rem; }
.casino-clean-amount small { color: var(--paper-soft); }
.casino-clean-bet p {
  margin: 0;
  color: var(--paper-soft);
  line-height: 1.45;
}
.casino-bet-details {
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 8px;
}
.casino-bet-details summary {
  cursor: pointer;
  color: var(--paper-soft);
  font-weight: 800;
}
.casino-resolve-buttons { margin: 10px 0 8px; }
.casino-resolve-buttons button { box-shadow: none; }

@media (max-width: 980px) {
  .map-real-room { width: min(100vw - 24px, 1560px); }
  .map-shell { min-height: calc(100vh - 130px); }
  .map-searchbar { grid-template-columns: auto minmax(0, 1fr); }
  .map-searchbar > #addMapPin,
  .map-searchbar > #fitPins { display: none; }
  .map-drawer { width: min(340px, calc(100vw - 28px)); left: 14px; top: 92px; bottom: 14px; }
  .casino-clean-hero,
  .casino-board-head { align-items: stretch; flex-direction: column; }
  .casino-compose-form { grid-template-columns: 1fr 1fr; }
  .casino-compose-form .wide { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .map-searchbar { left: 10px; right: 10px; top: 10px; border-radius: 22px; }
  .map-search-form { grid-template-columns: 1fr; }
  .map-searchbar input { height: 42px; }
  .map-search-results { left: 10px; width: calc(100vw - 44px); }
  .map-drawer { left: 10px; right: 10px; top: 128px; width: auto; }
  .map-zoom-hint { display: none; }
  .casino-clean-balances,
  .casino-compose-form { grid-template-columns: 1fr; }
  .casino-clean-top { flex-direction: column; }
  .casino-clean-amount { text-align: left; }
}


/* v1.2.2: full-map layout polish + uniform map styling */
body.route-map {
  overflow: hidden;
}
body.route-map .page {
  height: 100dvh;
  min-height: 720px;
  padding: 18px 20px 20px;
}
body.route-map .wrap {
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}
body.route-map .topbar {
  position: relative;
  top: auto;
  z-index: 760;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}
body.route-map .main {
  min-height: 0;
  flex: 1 1 auto;
}
body.route-map .background {
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 194, 115, 0.18), transparent 30%),
    radial-gradient(circle at 86% 80%, rgba(126, 99, 255, 0.16), transparent 36%),
    linear-gradient(135deg, #17121c, #0c1019 46%, #211917);
}
body.route-map .background::after {
  opacity: .1;
}
.map-real-room {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
}
.map-shell {
  height: 100%;
  min-height: 0;
  border-radius: 32px;
  background: #0d1620;
  border-color: rgba(255, 249, 240, .13);
  box-shadow: 0 32px 110px rgba(0,0,0,.48);
}
.real-map {
  height: 100%;
  min-height: 0;
  background: #0d1620;
}
.real-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #0d1620;
}
.real-map .leaflet-tile-pane {
  filter: none;
}
.real-map[data-map-style="night"] .leaflet-tile-pane {
  filter: saturate(.92) brightness(.95) contrast(1.04);
}
.real-map[data-map-style="atlas"] .leaflet-tile-pane {
  filter: saturate(.92) brightness(.86) contrast(1.02);
}
.real-map[data-map-style="clean"] .leaflet-tile-pane {
  filter: saturate(.78) brightness(.76) contrast(1.03);
}
.real-map[data-map-style="osm"] .leaflet-tile-pane {
  filter: saturate(.78) brightness(.78) contrast(1.02);
}
.map-searchbar {
  top: 20px;
  left: 22px;
  right: auto;
  width: min(1120px, calc(100% - 44px));
  grid-template-columns: 44px minmax(280px, 1fr) 116px auto auto;
  padding: 9px;
  border-radius: 24px;
  background: rgba(15, 16, 25, .78);
  border-color: rgba(255, 249, 240, .16);
  box-shadow: 0 22px 80px rgba(0,0,0,.36);
}
.map-searchbar input,
.map-style-select {
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 249, 240, .16);
  background: rgba(255,255,255,.10);
  color: var(--paper);
}
.map-style-select {
  padding: 0 12px;
  outline: none;
  font-weight: 800;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,249,240,.78) 50%), linear-gradient(135deg, rgba(255,249,240,.78) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.map-style-select option {
  color: #16131a;
  background: #fff9f0;
}
.map-searchbar button {
  min-height: 44px;
  white-space: nowrap;
}
.map-square-button {
  min-width: 44px;
  width: 44px;
  padding: 0;
}
.map-search-results {
  top: calc(100% + 10px);
  left: 62px;
  width: min(760px, calc(100vw - 160px));
  background: rgba(14, 15, 24, .94);
  border-color: rgba(255, 249, 240, .16);
}
.map-drawer {
  left: 22px;
  top: 96px;
  bottom: 22px;
  width: min(380px, calc(100vw - 44px));
  padding: 17px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(30, 31, 43, .88), rgba(10, 12, 22, .88));
  border-color: rgba(255, 249, 240, .15);
  box-shadow: 0 30px 100px rgba(0,0,0,.44);
}
.map-drawer-head h1 {
  font-size: 2.05rem;
  letter-spacing: -.055em;
}
.map-drawer .eyebrow {
  margin-bottom: 8px;
}
.map-drawer.collapsed {
  transform: translateX(calc(-100% - 34px));
}
.map-tabs {
  background: rgba(255,255,255,.07);
  border-color: rgba(255, 249, 240, .13);
}
.map-tab-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,249,240,.32) transparent;
}
.map-side-card.real-map-card,
.trip-card.real-trip-card,
.compact-trip-form {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,249,240,.12);
}
.map-side-card.real-map-card:hover,
.trip-card.real-trip-card:hover {
  background: rgba(255,255,255,.11);
}
.map-zoom-hint {
  display: none;
}
.real-map .leaflet-control-zoom {
  margin-right: 22px;
  margin-bottom: 22px;
  border-color: rgba(255,249,240,.16);
}
.real-map .leaflet-control-zoom a {
  background: rgba(15, 16, 25, .80);
}
.real-map .leaflet-control-attribution {
  font-size: .68rem;
  background: rgba(10, 12, 18, .58);
}
.leaf-pin {
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.5));
}
.leaf-pin span {
  border-color: rgba(255,249,240,.96);
}

@media (max-width: 1120px) {
  body.route-map .page { padding: 14px; }
  body.route-map .topbar { margin-bottom: 14px; }
  .map-shell { border-radius: 26px; }
  .map-searchbar {
    left: 14px;
    width: calc(100% - 28px);
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .map-style-select,
  .map-searchbar > #fitPins {
    display: none;
  }
  .map-drawer {
    left: 14px;
    top: 94px;
    bottom: 14px;
    width: min(360px, calc(100vw - 28px));
  }
  .map-search-results {
    left: 58px;
    width: calc(100vw - 100px);
  }
}
@media (max-width: 720px) {
  body.route-map {
    overflow: auto;
  }
  body.route-map .page {
    min-height: 100dvh;
    height: auto;
  }
  body.route-map .wrap {
    height: auto;
  }
  .map-shell {
    min-height: 760px;
  }
  .map-searchbar {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    grid-template-columns: 44px 1fr;
    gap: 8px;
  }
  .map-search-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .map-search-form button,
  .map-searchbar > #addMapPin {
    display: none;
  }
  .map-drawer {
    top: 74px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }
  .map-search-results {
    left: 10px;
    width: calc(100vw - 42px);
  }
}


/* v1.2.3: true fullscreen map with nav hovering over it */
body.route-map {
  overflow: hidden;
  background: #070b12;
}
body.route-map .background {
  display: none;
}
body.route-map .page {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  z-index: 1;
}
body.route-map .wrap {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  display: block;
}
body.route-map .topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: min(1160px, calc(100vw - 32px));
  margin: 0;
  pointer-events: auto;
}
body.route-map .topbar-inner {
  background: rgba(13, 11, 18, .74);
  border-color: rgba(255, 249, 240, .18);
  box-shadow: 0 18px 70px rgba(0,0,0,.42);
  backdrop-filter: blur(22px) saturate(1.25);
}
body.route-map .main {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
}
body.route-map .room-view {
  animation: none;
}
body.route-map .map-real-room {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  margin: 0;
}
body.route-map .map-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #09111b;
}
body.route-map .real-map {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
}
body.route-map .real-map .leaflet-container {
  width: 100%;
  height: 100%;
}
body.route-map .map-searchbar {
  top: 94px;
  left: 20px;
  right: auto;
  width: min(980px, calc(100vw - 40px));
  grid-template-columns: 44px minmax(320px, 1fr) 112px 112px 66px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(15, 16, 25, .82);
  border: 1px solid rgba(255, 249, 240, .18);
  box-shadow: 0 20px 80px rgba(0,0,0,.38);
  backdrop-filter: blur(24px) saturate(1.25);
}
body.route-map .map-search-results {
  top: calc(100% + 10px);
  left: 60px;
  width: min(720px, calc(100vw - 100px));
}
body.route-map .map-drawer {
  top: 166px;
  left: 20px;
  bottom: 22px;
  width: min(370px, calc(100vw - 40px));
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(27, 29, 40, .86), rgba(8, 10, 18, .88));
  box-shadow: 0 26px 90px rgba(0,0,0,.44);
  backdrop-filter: blur(24px) saturate(1.18);
}
body.route-map .map-drawer.collapsed {
  transform: translateX(calc(-100% - 32px));
}
body.route-map .real-map .leaflet-control-zoom {
  margin-right: 22px;
  margin-bottom: 22px;
}
body.route-map .real-map .leaflet-control-attribution {
  margin-right: 8px;
  margin-bottom: 0;
}
body.route-map .real-map[data-map-style="clean"] .leaflet-tile-pane,
body.route-map .real-map[data-map-style="osm"] .leaflet-tile-pane {
  filter: none;
}
body.route-map .real-map[data-map-style="atlas"] .leaflet-tile-pane {
  filter: saturate(.96) brightness(.98) contrast(1.02);
}
body.route-map .real-map[data-map-style="night"] .leaflet-tile-pane {
  filter: saturate(.95) brightness(.96) contrast(1.04);
}

@media (max-width: 1120px) {
  body.route-map .topbar {
    top: 10px;
    width: calc(100vw - 20px);
  }
  body.route-map .map-searchbar {
    top: 86px;
    left: 12px;
    width: calc(100vw - 24px);
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  body.route-map .map-style-select,
  body.route-map .map-searchbar > #fitPins {
    display: none;
  }
  body.route-map .map-drawer {
    top: 154px;
    left: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
  }
  body.route-map .map-search-results {
    left: 56px;
    width: calc(100vw - 90px);
  }
}
@media (max-width: 720px) {
  body.route-map .page,
  body.route-map .main,
  body.route-map .map-real-room,
  body.route-map .map-shell {
    height: 100dvh;
  }
  body.route-map .topbar {
    top: 8px;
  }
  body.route-map .topbar-inner {
    overflow-x: auto;
    justify-content: flex-start;
  }
  body.route-map .map-searchbar {
    top: 78px;
    left: 8px;
    width: calc(100vw - 16px);
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
  }
  body.route-map .map-search-form {
    grid-template-columns: minmax(0, 1fr);
  }
  body.route-map .map-search-form button,
  body.route-map .map-searchbar > #addMapPin {
    display: none;
  }
  body.route-map .map-drawer {
    top: 140px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
  body.route-map .map-search-results {
    left: 8px;
    width: calc(100vw - 16px);
  }
}


/* v1.2.4: map page only — nav and map controls share one desktop row */
@media (min-width: 1761px) {
  body.route-map .topbar {
    top: 16px;
    left: 18px;
    right: auto;
    transform: none;
    width: 920px;
    max-width: calc(100vw - 36px);
  }
  body.route-map .topbar-inner {
    gap: 10px;
    padding: 8px;
    min-height: 64px;
    overflow: hidden;
  }
  body.route-map .brand {
    flex: 0 0 auto;
    padding: 0 10px 0 8px;
  }
  body.route-map .room-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: center;
  }
  body.route-map .room-nav a {
    min-height: 40px;
    padding: 0 11px;
    white-space: nowrap;
  }
  body.route-map .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }
  body.route-map .profile-chip {
    min-height: 40px;
    gap: 7px;
    padding: 5px 10px 5px 6px;
    white-space: nowrap;
  }
  body.route-map .top-actions button {
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
  }
  body.route-map .map-searchbar {
    top: 16px;
    left: 956px;
    right: 18px;
    width: auto;
    max-width: none;
    grid-template-columns: 44px minmax(280px, 1fr) 112px 108px 64px;
  }
  body.route-map .map-drawer {
    top: 96px;
  }
}

/* v1.2.5: map top row fit, dark pin modal, safer upload controls */
@media (min-width: 900px) {
  body.route-map {
    --map-edge: 14px;
    --map-topbar-w: clamp(500px, 53vw, 900px);
  }
  body.route-map .topbar {
    top: var(--map-edge);
    left: var(--map-edge);
    right: auto;
    transform: none;
    width: var(--map-topbar-w);
    max-width: none;
  }
  body.route-map .topbar-inner {
    min-height: 58px;
    padding: 7px;
    gap: 6px;
    overflow: hidden;
  }
  body.route-map .brand {
    flex: 0 0 auto;
    padding: 0 8px;
  }
  body.route-map .room-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.route-map .room-nav::-webkit-scrollbar { display: none; }
  body.route-map .room-nav a {
    min-height: 38px;
    padding: 0 9px;
    white-space: nowrap;
  }
  body.route-map .top-actions {
    flex: 0 0 auto;
    gap: 5px;
  }
  body.route-map .profile-chip {
    min-height: 38px;
    max-width: 148px;
    padding: 4px 9px 4px 5px;
    gap: 6px;
    overflow: hidden;
  }
  body.route-map .profile-chip strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.route-map .top-actions button {
    min-height: 38px;
    padding: 0 10px;
    white-space: nowrap;
  }
  body.route-map .map-searchbar {
    top: var(--map-edge);
    left: calc(var(--map-edge) + var(--map-topbar-w) + 10px);
    right: var(--map-edge);
    width: auto;
    max-width: none;
    min-width: 0;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 7px;
    border-radius: 24px;
  }
  body.route-map .map-search-form {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  body.route-map .map-search-form input { min-width: 0; }
  body.route-map .map-search-results {
    left: 58px;
    width: min(620px, calc(100vw - var(--map-edge) - var(--map-edge) - var(--map-topbar-w) - 86px));
  }
  body.route-map .map-drawer {
    top: 88px;
  }
}

@media (min-width: 900px) and (max-width: 1500px) {
  body.route-map .map-style-select,
  body.route-map .map-searchbar > #fitPins {
    display: none;
  }
  body.route-map .map-searchbar {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }
  body.route-map .map-searchbar > #addMapPin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
  }
}

@media (min-width: 900px) and (max-width: 1250px) {
  body.route-map { --map-topbar-w: clamp(470px, 52vw, 650px); }
  body.route-map .brand strong,
  body.route-map .profile-chip strong {
    display: none;
  }
  body.route-map .brand { padding: 0 6px; }
  body.route-map .room-nav {
    justify-content: flex-start;
  }
  body.route-map .room-nav a {
    min-height: 36px;
    padding: 0 7px;
    font-size: .9rem;
  }
  body.route-map .top-actions button {
    padding: 0 9px;
  }
  body.route-map .map-search-form {
    grid-template-columns: minmax(0, 1fr);
  }
  body.route-map .map-search-form button {
    display: none;
  }
  body.route-map .map-searchbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }
}

@media (max-width: 899px) {
  body.route-map .map-searchbar {
    top: 86px;
  }
  body.route-map .map-drawer {
    top: 148px;
  }
}

body.route-map .map-modal,
.map-modal {
  z-index: 2600;
  align-content: center;
  place-items: center;
  padding: 18px;
  background: rgba(3, 5, 10, .72);
  backdrop-filter: blur(22px) saturate(1.08);
}
body.route-map .map-modal .map-modal-card,
.map-modal .map-modal-card {
  width: min(860px, calc(100vw - 30px));
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(25, 27, 38, .96), rgba(8, 10, 18, .97));
  color: var(--paper);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 34px 120px rgba(0,0,0,.62);
  backdrop-filter: blur(26px) saturate(1.18);
}
.map-modal .modal-topline {
  position: sticky;
  top: -1px;
  z-index: 2;
  margin: -24px -24px 18px;
  padding: 24px 24px 14px;
  background: linear-gradient(180deg, rgba(19, 20, 30, .98), rgba(19, 20, 30, .86));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.map-modal .map-modal-card input,
.map-modal .map-modal-card select,
.map-modal .map-modal-card textarea {
  color: var(--paper);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}
.map-modal .map-modal-card input::placeholder,
.map-modal .map-modal-card textarea::placeholder {
  color: rgba(255,249,240,.46);
}
.map-modal .map-modal-card select option {
  color: #201b1e;
  background: #fff9f0;
}

.map-coordinate-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.map-coordinate-fields input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.map-click-hint {
  grid-column: 1 / -1;
  margin: -2px 0 2px;
  color: rgba(255,249,240,.62);
  font-size: .88rem;
  font-weight: 700;
}
@media (max-width: 720px) {
  .map-coordinate-fields { grid-template-columns: 1fr; }
}

.map-modal .map-modal-card .form-actions {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  margin: 18px -24px -24px;
  padding: 14px 24px 22px;
  background: linear-gradient(0deg, rgba(8,10,18,.98), rgba(8,10,18,.82));
  border-top: 1px solid rgba(255,255,255,.1);
}

.file-picker-field {
  cursor: pointer;
}
.visually-hidden-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.file-picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
}
.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.file-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper-soft);
  font-weight: 800;
}
.file-picker-field:focus-within .file-picker-row,
.file-picker-field:hover .file-picker-row {
  border-color: rgba(255,249,240,.34);
  background: rgba(255,255,255,.11);
}
.library-modal-card .file-picker-row,
.map-modal-card .file-picker-row {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}

@media (max-width: 720px) {
  .map-modal .modal-topline,
  .map-modal .map-modal-card .form-actions {
    margin-left: -18px;
    margin-right: -18px;
  }
  .file-picker-row {
    grid-template-columns: 1fr;
  }
}

/* v1.2.6: map controls, upload controls, request-flow casino cleanup */
body.route-map .map-searchbar > #fitPins {
  display: none !important;
}
body.route-map .map-searchbar {
  align-items: center;
}
body.route-map .map-search-form {
  min-width: 0;
}
body.route-map .map-search-form input {
  min-width: 0;
}
body.route-map .map-style-select {
  min-width: 88px;
}

@media (min-width: 760px) {
  body.route-map {
    --map-edge: 10px;
    --map-topbar-w: clamp(430px, 46vw, 760px);
  }
  body.route-map .topbar {
    top: var(--map-edge);
    left: var(--map-edge);
    right: auto;
    transform: none;
    width: var(--map-topbar-w);
    max-width: none;
  }
  body.route-map .topbar-inner {
    min-height: 54px;
    padding: 6px;
    gap: 5px;
    overflow: hidden;
  }
  body.route-map .brand {
    flex: 0 0 auto;
    padding: 0 7px;
  }
  body.route-map .room-nav {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  body.route-map .room-nav::-webkit-scrollbar { display: none; }
  body.route-map .room-nav a {
    min-height: 36px;
    padding: 0 8px;
    white-space: nowrap;
    font-size: .9rem;
  }
  body.route-map .top-actions {
    flex: 0 0 auto;
    gap: 5px;
  }
  body.route-map .profile-chip {
    min-height: 36px;
    max-width: 132px;
    padding: 4px 8px 4px 5px;
    overflow: hidden;
  }
  body.route-map .profile-chip strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.route-map .top-actions button {
    min-height: 36px;
    padding: 0 9px;
  }
  body.route-map .map-searchbar {
    top: var(--map-edge);
    left: calc(var(--map-edge) + var(--map-topbar-w) + 8px);
    right: var(--map-edge);
    width: auto;
    max-width: none;
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    gap: 7px;
    padding: 6px;
    border-radius: 22px;
  }
  body.route-map .map-search-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }
  body.route-map .map-searchbar button,
  body.route-map .map-style-select {
    min-height: 40px;
  }
  body.route-map .map-drawer {
    top: 78px;
  }
}

@media (min-width: 760px) and (max-width: 1380px) {
  body.route-map { --map-topbar-w: clamp(430px, 49vw, 640px); }
  body.route-map .brand strong,
  body.route-map .profile-chip strong {
    display: none;
  }
  body.route-map .map-style-select {
    display: none;
  }
  body.route-map .map-searchbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }
}

@media (min-width: 760px) and (max-width: 1120px) {
  body.route-map .map-search-form button {
    display: none;
  }
  body.route-map .map-searchbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }
  body.route-map .room-nav a {
    padding: 0 6px;
    font-size: .84rem;
  }
  body.route-map .top-actions button {
    padding: 0 8px;
  }
}

@media (max-width: 759px) {
  body.route-map .map-searchbar {
    top: 78px;
    left: 8px;
    right: 8px;
    width: auto;
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }
  body.route-map .map-style-select,
  body.route-map .map-search-form button {
    display: none;
  }
  body.route-map .map-drawer {
    top: 138px;
  }
}

.file-picker-field {
  position: relative;
}
.file-picker-row {
  cursor: pointer;
  user-select: none;
}
.file-picker-button {
  pointer-events: none;
}
.file-picker-name {
  pointer-events: none;
}

.casino-clean-bet.status-requested {
  border-color: rgba(215, 168, 110, .36);
  background: linear-gradient(135deg, rgba(215,168,110,.14), rgba(255,255,255,.06));
}
.casino-clean-bet.status-declined {
  opacity: .62;
}
.casino-request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* v1.2.7: reliable native upload controls and clearer map forms */
.native-upload-field {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 0;
}
.native-upload-field .native-file-input {
  width: 100%;
  min-height: 52px;
  padding: 9px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: var(--paper);
  cursor: pointer;
  outline: none;
}
.panel .native-upload-field .native-file-input {
  background: rgba(36,29,30,.06);
  border-color: rgba(36,29,30,.14);
  color: var(--ink);
}
.native-upload-field .native-file-input::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}
.panel .native-upload-field .native-file-input::file-selector-button {
  background: var(--ink);
  color: var(--paper);
}
.native-upload-field .upload-help {
  display: block;
  color: var(--paper-soft);
  font-size: .86rem;
  font-weight: 700;
}
.panel .native-upload-field .upload-help {
  color: var(--muted);
}
.native-upload-field.is-dragging .native-file-input,
.native-upload-field:focus-within .native-file-input {
  border-color: rgba(255,249,240,.42);
  box-shadow: 0 0 0 4px rgba(215,168,110,.14);
}
body.route-map .map-modal .native-upload-field .native-file-input {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
  color: var(--paper);
}
body.route-map .map-modal .native-upload-field .upload-help {
  color: rgba(255,249,240,.62);
}

/* Hide old fit button in case an older browser cached part of the page. */
#fitPins { display: none !important; }

/* v1.2.9: make validation visible instead of looking like dead buttons */
.field-needs-attention,
input.field-needs-attention,
select.field-needs-attention,
textarea.field-needs-attention {
  border-color: rgba(220, 60, 60, .9) !important;
  box-shadow: 0 0 0 4px rgba(220, 60, 60, .18) !important;
}
button:active, .btn:active { transform: translateY(1px); }
.auth-screen.hidden,
.modal-backdrop.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* v1.2.11: hard fix clickable file pickers, casino details, and top-anchored modals */
.casino-bet-details summary {
  display: block;
  min-height: 42px;
  padding: 10px 0;
  user-select: none;
  -webkit-user-select: none;
}
.casino-bet-details summary:hover {
  color: var(--paper);
}

.clickable-upload-field {
  cursor: pointer;
}
.clickable-upload-field .visually-hidden-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.clickable-upload-field .file-picker-row {
  width: 100%;
  min-height: 56px;
  cursor: pointer;
}
.clickable-upload-field .file-picker-button,
.clickable-upload-field .file-picker-name {
  pointer-events: none;
}
.native-upload-field.is-dragging .file-picker-row,
.clickable-upload-field:hover .file-picker-row,
.clickable-upload-field:focus-within .file-picker-row {
  border-color: rgba(255,249,240,.42);
  box-shadow: 0 0 0 4px rgba(215,168,110,.14);
}
.panel .clickable-upload-field .file-picker-row {
  background: rgba(36,29,30,.06);
  border-color: rgba(36,29,30,.14);
}
.panel .clickable-upload-field:hover .file-picker-row,
.panel .clickable-upload-field:focus-within .file-picker-row {
  border-color: rgba(36,29,30,.28);
}

.library-modal {
  z-index: 3200 !important;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  place-items: initial;
  align-content: initial;
  overflow-y: auto;
  padding: 20px;
  overscroll-behavior: contain;
}
.library-modal:not(.hidden) {
  display: flex !important;
}
.library-modal-card.modal-card {
  margin: 0 auto;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.library-modal-card .modal-topline {
  position: sticky;
  top: -1px;
  z-index: 5;
  margin: -24px -24px 16px;
  padding: 24px 24px 14px;
  background: linear-gradient(180deg, rgba(15,12,19,.98), rgba(15,12,19,.88));
  backdrop-filter: blur(20px);
}
@media (max-height: 760px) {
  .library-modal { padding-top: 12px; padding-bottom: 12px; }
  .library-modal-card.modal-card { max-height: calc(100dvh - 24px); }
}

/* v1.2.12 local cinema sync */
.cinema-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  align-items: start;
}
.cinema-side-stack {
  display: grid;
  gap: 16px;
}
.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .28);
}
.video-shell video {
  display: block;
  width: 100%;
  min-height: 320px;
  background: #050407;
  border-radius: inherit;
}
.play-gate {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(8, 7, 12, .82);
  color: var(--paper);
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .24);
  backdrop-filter: blur(14px);
}
.play-gate[hidden] { display: none !important; }
.cinema-ready-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.ready-summary,
.ready-card {
  border: 1px solid var(--white-line);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  display: grid;
  gap: 3px;
}
.ready-summary {
  grid-column: 1 / -1;
}
.ready-summary span,
.ready-card span {
  color: var(--muted);
  font-size: .92rem;
}
.ready-card.is-ready {
  border-color: rgba(215, 168, 110, .55);
  background: rgba(215, 168, 110, .12);
}
.ready-card.is-waiting {
  opacity: .82;
}
@media (max-width: 980px) {
  .cinema-grid { grid-template-columns: 1fr; }
  .video-shell video { min-height: 220px; }
}

/* v1.2.13 cinema progress + cleaner tabbed layout */
.cinema-clean-room {
  width: min(100vw - 48px, 1560px);
}
.cinema-clean-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}
.cinema-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 18px;
  align-items: start;
}
.cinema-player.dark-panel {
  padding: 18px;
  overflow: hidden;
}
.cinema-drawer {
  position: sticky;
  top: 88px;
  max-height: calc(100dvh - 116px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 16px;
}
.cinema-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.cinema-drawer-head h2 {
  margin: 2px 0 0;
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
}
.cinema-drawer-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}
.cinema-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  margin-bottom: 14px;
  border: 1px solid var(--white-line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}
.cinema-tabs button {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.cinema-tabs button.active {
  color: var(--ink);
  background: var(--paper);
}
.cinema-tab-panel {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.cinema-tab-panel.hidden { display: none !important; }
.cinema-panel-form {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--white-line);
  border-radius: 24px;
  padding: 14px;
}
.cinema-panel-form .panel-head,
.cinema-tab-panel > .panel-head {
  margin-bottom: 12px;
}
.cinema-panel-form h3,
.cinema-tab-panel h3 {
  margin: 0;
  font-size: 1.02rem;
}
.cinema-panel-form .panel-head span,
.cinema-tab-panel > .panel-head span {
  display: block;
  color: var(--muted);
  font-size: .88rem;
  margin-top: 3px;
}
.cinema-movie-list {
  display: grid;
  gap: 10px;
}
.cinema-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.cinema-stored-actions {
  justify-content: end;
  flex-wrap: wrap;
}
.storage-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--white-line);
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-weight: 800;
}
.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .28);
}
.video-shell video {
  display: block;
  width: 100%;
  min-height: clamp(300px, 48vw, 640px);
  max-height: calc(100dvh - 350px);
  background: #050407;
  border-radius: inherit;
}
.play-gate {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(8, 7, 12, .82);
  color: var(--paper);
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .24);
  backdrop-filter: blur(14px);
}
.play-gate[hidden] { display: none !important; }
.cinema-load-box {
  margin-top: 14px;
  border: 1px solid var(--white-line);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255,255,255,.055);
}
.cinema-load-head,
.ready-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cinema-load-head strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
#loadPercent {
  color: var(--gold);
  font-weight: 950;
  font-size: 1.12rem;
}
.cinema-progress-bar {
  height: 9px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.10);
  margin-top: 9px;
}
.cinema-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(215,168,110,.72), rgba(255,249,240,.92));
  transition: width .18s ease;
}
.cinema-load-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
}
.cinema-load-meta span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cinema-sync-row {
  margin-top: 12px;
  flex-wrap: wrap;
}
.cinema-ready-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.ready-summary,
.ready-card {
  border: 1px solid var(--white-line);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  display: grid;
  gap: 5px;
}
.ready-summary { grid-column: 1 / -1; }
.ready-summary span,
.ready-card span,
.ready-card small,
.ready-card em {
  color: var(--muted);
  font-size: .86rem;
}
.ready-card em {
  font-style: normal;
  overflow-wrap: anywhere;
}
.ready-card small {
  font-weight: 750;
}
.ready-card.is-ready {
  border-color: rgba(215, 168, 110, .55);
  background: rgba(215, 168, 110, .12);
}
.ready-card.is-waiting { opacity: .92; }
@media (max-width: 1180px) {
  .cinema-layout { grid-template-columns: 1fr; }
  .cinema-drawer {
    position: static;
    max-height: none;
  }
  .cinema-tab-panel { max-height: none; overflow-y: visible; }
  .video-shell video { max-height: none; min-height: 240px; }
}
@media (max-width: 680px) {
  .cinema-clean-room { width: min(100vw - 24px, 1560px); }
  .cinema-player.dark-panel,
  .cinema-drawer { padding: 12px; }
  .cinema-file-item { grid-template-columns: 1fr; }
  .cinema-stored-actions { justify-content: stretch; }
  .cinema-stored-actions button { flex: 1 1 120px; }
  .cinema-load-meta { flex-direction: column; gap: 4px; }
}

/* v1.2.14: cinema as full viewport player with slide-in side panels */
body.route-cinema {
  overflow: hidden;
}
body.route-cinema .page {
  min-height: 100dvh;
  padding: 14px;
}
body.route-cinema .wrap,
body.route-cinema .main,
body.route-cinema .room-view,
body.route-cinema .cinema-stage-room,
body.route-cinema .cinema-overlay-layout {
  width: 100%;
  height: 100%;
  min-height: calc(100dvh - 28px);
}
body.route-cinema .wrap {
  max-width: none;
}
body.route-cinema .main {
  padding: 0;
  margin: 0;
}
body.route-cinema .background {
  filter: saturate(1.04) brightness(.86);
}
body.route-cinema .background::after {
  background: radial-gradient(circle at 30% 20%, rgba(215,168,110,.22), transparent 34%), linear-gradient(90deg, rgba(8,6,11,.78), rgba(8,6,11,.52));
}
body.route-cinema .cinema-clean-hero {
  display: none !important;
}
body.route-cinema .cinema-stage-room {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
  background: rgba(7,6,10,.74);
}
body.route-cinema .cinema-overlay-layout {
  position: relative;
  display: block;
  gap: 0;
}
body.route-cinema .cinema-player.dark-panel {
  position: absolute;
  inset: 0;
  padding: 0;
  border-radius: inherit;
  overflow: hidden;
  border: 0;
  background: rgba(0,0,0,.42);
}
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: inherit;
  background: #050407;
}
body.route-cinema .cinema-player .video-shell video {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  border-radius: inherit;
  background: #050407;
}
body.route-cinema .cinema-now-strip {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 5;
  max-width: min(760px, calc(100vw - 180px));
  padding: 11px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,7,12,.68);
  color: rgba(255,249,240,.86);
  font-weight: 850;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  overflow-wrap: anywhere;
}
body.route-cinema .play-gate {
  left: 50%;
  right: auto;
  bottom: 82px;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 52px));
  text-align: center;
  z-index: 9;
}
body.route-cinema .cinema-panel-toggle {
  position: absolute;
  top: 50%;
  z-index: 730;
  transform: translateY(-50%);
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  color: var(--paper);
  background: rgba(13,10,18,.74);
  box-shadow: 0 18px 56px rgba(0,0,0,.34);
  backdrop-filter: blur(18px);
}
body.route-cinema .cinema-panel-toggle:hover,
body.route-cinema .cinema-panel-toggle.active {
  background: var(--paper);
  color: var(--ink);
}
body.route-cinema .cinema-panel-toggle-left { left: 16px; }
body.route-cinema .cinema-panel-toggle-right { right: 16px; }
body.route-cinema .cinema-slide-panel {
  position: absolute;
  top: 88px;
  bottom: 18px;
  z-index: 740;
  width: min(430px, calc(100vw - 58px));
  padding: 16px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(14,11,18,.84);
  box-shadow: 0 24px 90px rgba(0,0,0,.46);
  backdrop-filter: blur(24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  transition: transform .28s ease, opacity .22s ease;
  opacity: .98;
}
body.route-cinema .cinema-setup-panel {
  right: 18px;
  grid-template-rows: auto auto minmax(0, 1fr);
  transform: translateX(calc(100% + 34px));
}
body.route-cinema .cinema-controls-panel {
  left: 18px;
  transform: translateX(calc(-100% - 34px));
}
body.route-cinema .cinema-slide-panel.open {
  transform: translateX(0);
}
body.route-cinema .cinema-panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
body.route-cinema .cinema-any-panel-open .cinema-panel-backdrop {
  opacity: 1;
  pointer-events: auto;
}
body.route-cinema .cinema-slide-head {
  margin-bottom: 0;
  align-items: flex-start;
}
body.route-cinema .cinema-close-panel {
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
}
body.route-cinema .cinema-tabs {
  margin-bottom: 0;
}
body.route-cinema .cinema-tab-panel,
body.route-cinema .cinema-controls-panel > .cinema-ready-grid,
body.route-cinema .cinema-setup-panel > .cinema-tab-panel {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}
body.route-cinema .cinema-controls-panel .cinema-load-box {
  margin-top: 0;
}
body.route-cinema .cinema-controls-panel .cinema-sync-row {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.route-cinema .cinema-controls-panel .ready-item {
  width: 100%;
  justify-content: flex-start;
}
body.route-cinema .cinema-ready-grid {
  margin-top: 0;
  grid-template-columns: 1fr;
  align-content: start;
  overflow-y: auto;
}
body.route-cinema .cinema-movie-list {
  padding-bottom: 8px;
}
body.route-cinema .cinema-file-item {
  grid-template-columns: 1fr;
  align-items: stretch;
}
body.route-cinema .cinema-stored-actions {
  justify-content: stretch;
}
body.route-cinema .cinema-stored-actions button {
  flex: 1 1 118px;
}
body.route-cinema .cinema-panel-form {
  max-width: none;
}
@media (max-width: 820px) {
  body.route-cinema .page { padding: 10px; }
  body.route-cinema .cinema-stage-room {
    border-radius: 26px;
  }
  body.route-cinema .cinema-slide-panel {
    top: 86px;
    bottom: 10px;
    width: calc(100vw - 28px);
  }
  body.route-cinema .cinema-controls-panel { left: 14px; }
  body.route-cinema .cinema-setup-panel { right: 14px; }
  body.route-cinema .cinema-panel-toggle {
    top: auto;
    bottom: 18px;
    transform: none;
    z-index: 760;
  }
  body.route-cinema .cinema-panel-toggle-left { left: 18px; }
  body.route-cinema .cinema-panel-toggle-right { right: 18px; }
  body.route-cinema .cinema-now-strip {
    left: 14px;
    right: 14px;
    bottom: 72px;
    max-width: none;
  }
  body.route-cinema .play-gate {
    bottom: 126px;
  }
}
@media (max-width: 560px) {
  body.route-cinema .cinema-slide-panel {
    padding: 12px;
    border-radius: 22px;
  }
  body.route-cinema .cinema-panel-toggle span {
    font-size: .9rem;
  }
}
body.route-cinema .cinema-controls-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

/* v1.2.15: cleaner cinema edge handles + subtitle management */
body.route-cinema .cinema-panel-toggle {
  width: 42px;
  height: 148px;
  min-width: 0;
  padding: 0;
  top: 50%;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 0 18px 18px 0;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(16,13,23,.82), rgba(9,8,13,.72));
  color: rgba(255,249,240,.86);
  box-shadow: 0 18px 60px rgba(0,0,0,.38);
  backdrop-filter: blur(22px) saturate(1.1);
}
body.route-cinema .cinema-panel-toggle span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .68rem;
  font-weight: 950;
}
body.route-cinema .cinema-panel-toggle-left {
  left: -1px;
  transform: translateY(-50%);
}
body.route-cinema .cinema-panel-toggle-right {
  right: -1px;
  transform: translateY(-50%);
  border-radius: 18px 0 0 18px;
}
body.route-cinema .cinema-panel-toggle-right span {
  transform: none;
}
body.route-cinema .cinema-panel-toggle-left:hover,
body.route-cinema .cinema-panel-toggle-left.active {
  transform: translateY(-50%) translateX(6px);
}
body.route-cinema .cinema-panel-toggle-right:hover,
body.route-cinema .cinema-panel-toggle-right.active {
  transform: translateY(-50%) translateX(-6px);
}
body.route-cinema .cinema-panel-toggle:hover,
body.route-cinema .cinema-panel-toggle.active {
  background: linear-gradient(180deg, rgba(255,249,240,.96), rgba(233,220,204,.94));
  color: #19131b;
}
body.route-cinema .cinema-slide-panel {
  width: min(470px, calc(100vw - 58px));
}
body.route-cinema .cinema-controls-panel {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}
body.route-cinema .cinema-subtitle-control-box,
body.route-cinema .cinema-subtitle-options {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  border-radius: 22px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
body.route-cinema .cinema-subtitle-options.hidden {
  display: none !important;
}
body.route-cinema .cinema-subtitle-option-head {
  display: grid;
  gap: 3px;
}
body.route-cinema .cinema-subtitle-option-head strong {
  color: var(--paper);
  font-weight: 950;
}
body.route-cinema .cinema-subtitle-option-head span,
body.route-cinema .cinema-subtitle-line {
  color: rgba(255,249,240,.62);
  font-size: .84rem;
  font-weight: 750;
}
body.route-cinema .cinema-subtitle-ready {
  color: #f0c981;
}
body.route-cinema .cinema-subtitle-missing {
  color: rgba(255,249,240,.44);
}
body.route-cinema .subtitle-delay-field {
  display: grid;
  gap: 7px;
  font-size: .82rem;
  font-weight: 900;
  color: rgba(255,249,240,.72);
}
body.route-cinema .subtitle-delay-field input {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: var(--paper);
  font: inherit;
  font-weight: 850;
}
body.route-cinema .subtitle-delay-field input:disabled,
body.route-cinema .cinema-subtitle-tune-row button:disabled {
  opacity: .48;
  cursor: not-allowed;
}
body.route-cinema .cinema-subtitle-tune-row {
  justify-content: stretch;
}
body.route-cinema .cinema-subtitle-tune-row button {
  flex: 1 1 auto;
}
body.route-cinema .cinema-file-item {
  gap: 12px;
}
body.route-cinema .cinema-file-item .item-main {
  min-width: 0;
}
body.route-cinema .cinema-stored-actions {
  gap: 7px;
}
body.route-cinema .cinema-stored-actions button {
  flex: 1 1 calc(50% - 8px);
}
body.route-cinema .cinema-panel-form em {
  opacity: .65;
  font-style: normal;
  font-weight: 850;
}
@media (max-width: 820px) {
  body.route-cinema .cinema-panel-toggle {
    top: 50%;
    bottom: auto;
    width: 40px;
    height: 124px;
  }
  body.route-cinema .cinema-panel-toggle-left { left: -1px; transform: translateY(-50%); }
  body.route-cinema .cinema-panel-toggle-right { right: -1px; transform: translateY(-50%); }
  body.route-cinema .cinema-panel-toggle-left:hover,
  body.route-cinema .cinema-panel-toggle-left.active { transform: translateY(-50%) translateX(5px); }
  body.route-cinema .cinema-panel-toggle-right:hover,
  body.route-cinema .cinema-panel-toggle-right.active { transform: translateY(-50%) translateX(-5px); }
}

/* v1.2.16: cinema stored movie posters + readable drawers + upload progress */
body.route-cinema .cinema-slide-panel {
  --muted: rgba(255,249,240,.62);
  --line: rgba(255,249,240,.15);
  color: rgba(255,249,240,.9);
}
body.route-cinema .cinema-slide-panel h2,
body.route-cinema .cinema-slide-panel h3,
body.route-cinema .cinema-slide-panel label,
body.route-cinema .cinema-slide-panel strong {
  color: rgba(255,249,240,.94);
}
body.route-cinema .cinema-slide-panel span,
body.route-cinema .cinema-slide-panel .panel-head span,
body.route-cinema .cinema-panel-form .panel-head span,
body.route-cinema .cinema-tab-panel > .panel-head span,
body.route-cinema .cinema-slide-panel .upload-help,
body.route-cinema .cinema-slide-panel .form-actions {
  color: rgba(255,249,240,.64);
}
body.route-cinema .cinema-tabs button:not(.active) {
  color: rgba(255,249,240,.58);
}
body.route-cinema .cinema-tabs button.active {
  color: #19131b;
}
body.route-cinema .cinema-slide-panel input,
body.route-cinema .cinema-slide-panel select,
body.route-cinema .cinema-slide-panel textarea {
  color: rgba(255,249,240,.92);
  background: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.16);
}
body.route-cinema .cinema-slide-panel input::placeholder,
body.route-cinema .cinema-slide-panel textarea::placeholder {
  color: rgba(255,249,240,.38);
}
body.route-cinema .cinema-slide-panel .file-picker-row {
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.15);
}
body.route-cinema .cinema-slide-panel .file-picker-name {
  color: rgba(255,249,240,.62);
}
body.route-cinema .cinema-movie-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}
body.route-cinema .cinema-movie-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: 0 14px 42px rgba(0,0,0,.22);
}
body.route-cinema .cinema-movie-poster {
  aspect-ratio: 2 / 3;
  width: 86px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(215,168,110,.22), rgba(155,108,255,.18), rgba(255,255,255,.055));
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: grid;
  place-items: end stretch;
  box-shadow: inset 0 -42px 56px rgba(0,0,0,.42), 0 12px 26px rgba(0,0,0,.26);
}
body.route-cinema .cinema-movie-poster.no-poster {
  place-items: center;
  padding: 8px;
  text-align: center;
  background:
    radial-gradient(circle at 22% 18%, rgba(215,168,110,.28), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
}
body.route-cinema .cinema-movie-poster.no-poster strong,
body.route-cinema .cinema-movie-poster.has-poster span {
  width: 100%;
  padding: 8px;
  color: rgba(255,249,240,.95);
  font-size: .78rem;
  line-height: 1.12;
  font-weight: 950;
  overflow-wrap: anywhere;
}
body.route-cinema .cinema-movie-info {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}
body.route-cinema .cinema-movie-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
body.route-cinema .cinema-movie-topline strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  letter-spacing: -.02em;
}
body.route-cinema .cinema-movie-topline span,
body.route-cinema .cinema-movie-meta {
  color: rgba(255,249,240,.56);
  font-size: .8rem;
  font-weight: 800;
}
body.route-cinema .cinema-movie-topline span {
  flex: 0 0 auto;
}
body.route-cinema .cinema-poster-ready {
  color: #f0c981 !important;
  font-weight: 850;
  font-size: .82rem;
}
body.route-cinema .cinema-poster-missing {
  color: rgba(255,249,240,.42) !important;
  font-weight: 850;
  font-size: .82rem;
}
body.route-cinema .cinema-movie-card .cinema-stored-actions {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
body.route-cinema .cinema-movie-card .cinema-stored-actions button {
  width: 100%;
  min-height: 38px;
  padding-inline: 10px;
}
body.route-cinema .cinema-upload-progress {
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  border-radius: 22px;
  padding: 12px;
}
body.route-cinema #uploadPercent {
  color: var(--gold, #d7a86e);
  font-weight: 950;
}
body.route-cinema #cinemaUploadButton:disabled {
  opacity: .55;
  cursor: wait;
}
@media (max-width: 560px) {
  body.route-cinema .cinema-movie-card {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 8px;
  }
  body.route-cinema .cinema-movie-poster {
    width: 72px;
    border-radius: 13px;
  }
  body.route-cinema .cinema-movie-card .cinema-stored-actions {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   Shared Space 2.0 overrides
   ============================== */
.topbar-inner { max-width: min(1360px, calc(100vw - 32px)); }
.room-nav { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.room-nav::-webkit-scrollbar { display: none; }
.room-nav a { white-space: nowrap; }

/* Cinema: less ugly controls, less intrusive media label */
.cinema-now-strip {
  left: 18px !important;
  bottom: 18px !important;
  right: auto !important;
  width: auto !important;
  max-width: min(420px, calc(100vw - 90px)) !important;
  padding: 9px 13px !important;
  border-radius: 999px !important;
  font-size: .82rem !important;
  line-height: 1.1 !important;
  opacity: .82 !important;
  pointer-events: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cinema-panel-toggle {
  width: 34px !important;
  height: 132px !important;
  min-height: 132px !important;
  padding: 0 !important;
  border-radius: 18px !important;
  opacity: .78;
  backdrop-filter: blur(18px);
}
.cinema-panel-toggle span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .72rem;
}
.cinema-panel-toggle:hover,
.cinema-panel-toggle.active { opacity: 1; }
.cinema-panel-toggle-left { left: 10px !important; }
.cinema-panel-toggle-right { right: 10px !important; }
.cinema-slide-panel { color: var(--paper); }
.cinema-slide-panel input,
.cinema-slide-panel textarea,
.cinema-slide-panel select { color: var(--paper); background: rgba(255,255,255,.08); }
.cinema-slide-panel input::placeholder,
.cinema-slide-panel textarea::placeholder { color: rgba(245,239,229,.56); }
.cinema-slide-panel .file-picker-name,
.cinema-slide-panel .upload-help,
.cinema-slide-panel .muted,
.cinema-slide-panel small,
.cinema-slide-panel span { color: rgba(245,239,229,.72); }
.cinema-slide-panel h2,
.cinema-slide-panel h3,
.cinema-slide-panel strong,
.cinema-slide-panel label { color: var(--paper); }
.cinema-upload-progress { display: grid; gap: 8px; }
.cinema-movie-list { max-height: min(65vh, 720px); overflow: auto; padding-right: 6px; }
.cinema-movie-card { min-height: 120px; }

/* Library modal: centered, not jammed under the navbar */
.library-modal.modal-backdrop,
#libraryModal.modal-backdrop {
  place-items: center !important;
  align-items: center !important;
  padding-top: max(90px, env(safe-area-inset-top)) !important;
  padding-bottom: 42px !important;
}
.library-modal-card.modal-card {
  max-height: min(760px, calc(100vh - 150px)) !important;
  overflow: auto !important;
  margin: 0 auto !important;
}

/* Chat */
.chat-room { width: min(1500px, calc(100vw - 36px)); margin: 0 auto; }
.chat-shell {
  display: grid;
  grid-template-columns: 290px minmax(420px, 1fr) 320px;
  min-height: min(760px, calc(100vh - 190px));
  overflow: hidden;
  padding: 0;
}
.chat-contact-panel,
.chat-info-panel {
  padding: 18px;
  border-right: 1px solid rgba(255,255,255,.08);
  overflow: auto;
}
.chat-info-panel { border-right: 0; border-left: 1px solid rgba(255,255,255,.08); }
.chat-conversation-panel { display: grid; grid-template-rows: auto 1fr auto auto; min-height: 0; }
.chat-conversation-head {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.chat-conversation-head span { display: block; color: var(--paper-soft); font-size: .9rem; margin-top: 2px; }
.chat-contact-list { display: grid; gap: 8px; }
.chat-contact {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px; border-radius: 18px; background: transparent; color: var(--paper);
}
.chat-contact.active,
.chat-contact:hover { background: rgba(255,255,255,.10); }
.chat-contact span:last-child { display: grid; gap: 2px; }
.chat-contact small { color: var(--paper-soft); }
.chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #7b61ff); color: #fff; font-weight: 900;
  background-size: cover; background-position: center;
}
.chat-messages { overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.chat-message { display: flex; gap: 10px; align-items: flex-end; max-width: 82%; }
.chat-message.own { margin-left: auto; }
.chat-bubble {
  padding: 12px 14px; border-radius: 22px; background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.08); color: var(--paper);
}
.chat-message.own .chat-bubble { background: var(--paper); color: var(--ink); }
.chat-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; font-size: .75rem; opacity: .76; }
.chat-bubble p { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.chat-compose { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.chat-compose input { border-radius: 999px; }
.chat-compose-status { padding: 0 20px 14px; color: var(--paper-soft); font-weight: 800; }
.chat-tool-card { border: 1px solid rgba(255,255,255,.10); border-radius: 22px; padding: 14px; margin-bottom: 12px; background: rgba(255,255,255,.05); }
.chat-tool-card textarea { min-height: 120px; }
.chat-letter { display: grid; gap: 8px; min-width: min(340px, 70vw); }
.chat-letter.locked { padding: 12px; border-radius: 18px; background: rgba(215,168,110,.16); border: 1px solid rgba(215,168,110,.36); }
.chat-request-card { display: grid; gap: 5px; min-width: 260px; padding: 12px; border-radius: 18px; background: rgba(215,168,110,.14); border: 1px solid rgba(215,168,110,.32); }
.chat-request-card a { font-weight: 900; text-decoration: none; color: inherit; }
.chat-attachment img,
.chat-attachment video { max-width: min(360px, 70vw); max-height: 240px; border-radius: 16px; display: block; margin-top: 8px; object-fit: contain; }
.chat-gif-box { margin-top: 16px; }
.gif-library { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 270px; overflow: auto; }
.gif-thumb { aspect-ratio: 1; border-radius: 14px; background-size: cover; background-position: center; min-height: 70px; padding: 0; }
@media (max-width: 1100px) { .chat-shell { grid-template-columns: 1fr; } .chat-contact-panel, .chat-info-panel { border: 0; border-bottom: 1px solid rgba(255,255,255,.08); } .chat-message { max-width: 96%; } }

/* Agenda period tracker */
.period-panel { margin-top: 18px; }
.period-layout { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(300px, .7fr); gap: 18px; align-items: start; }
.period-entry small { display: block; color: var(--paper-soft); margin-top: 5px; }
@media (max-width: 860px) { .period-layout { grid-template-columns: 1fr; } }

/* Stats 2.0 */
.discord-stats-section { width: 100%; margin-top: 10px; }
.section-label { color: var(--paper-soft); text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; font-weight: 900; margin: 0 0 10px 4px; }
.stats-discord-grid { margin-bottom: 18px; }
.personal-stats-panel { margin-top: 18px; }
.counter-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.counter-card { padding: 16px; border-radius: 22px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10); display: grid; gap: 8px; }
.counter-card span { color: var(--paper-soft); font-weight: 900; }
.counter-card strong { font-size: 2.2rem; letter-spacing: -.06em; }
@media (max-width: 900px) { .counter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .counter-grid { grid-template-columns: 1fr; } }

/* Pinwall pages */
.pinwall-room { width: min(1420px, calc(100vw - 36px)); margin: 0 auto; }
.pinwall-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pinwall-form-panel { position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-list,
.recipe-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.shop-card,
.recipe-card { overflow: hidden; border-radius: 24px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10); }
.shop-image,
.recipe-image { aspect-ratio: 4/3; background: linear-gradient(135deg, rgba(215,168,110,.34), rgba(90,66,125,.24)); background-size: cover; background-position: center; display: grid; place-items: center; padding: 18px; text-align: center; font-weight: 950; }
.shop-image.has-image span,
.recipe-image.has-image span { opacity: 0; }
.shop-body,
.recipe-body { padding: 14px; display: grid; gap: 8px; }
.shop-body > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.shop-body small,
.recipe-body small { color: var(--paper-soft); font-weight: 800; }
.recipe-body ul,
.recipe-body ol { padding-left: 20px; margin: 8px 0; color: var(--paper-soft); }
@media (max-width: 900px) { .pinwall-layout { grid-template-columns: 1fr; } .pinwall-form-panel { position: static; max-height: none; } }

/* ==============================
   Shared Space 2.0.1 cleanup pass
   ============================== */
:root {
  --soft-peach: #f3b77e;
  --period-red: #de6f76;
  --period-blue: #73a9e9;
}
.topbar { z-index: 1200; }
.topbar-inner {
  width: min(1180px, calc(100vw - 40px));
  max-width: min(1180px, calc(100vw - 40px)) !important;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: visible;
}
.room-nav {
  min-width: 0;
  justify-content: center;
  overflow: visible !important;
}
.room-nav a { padding-inline: clamp(10px, 1.2vw, 18px); }
.top-actions { align-items: center; min-width: 0; }
.profile-chip {
  max-width: 210px;
  min-width: 0;
  overflow: hidden;
}
.profile-chip span:last-child,
#topName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.more-nav { position: relative; z-index: 1500; }
.more-nav summary {
  list-style: none;
  width: 44px;
  min-height: 40px;
  display: grid;
  place-content: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--white-line);
  background: var(--white-soft);
  cursor: pointer;
}
.more-nav summary::-webkit-details-marker { display: none; }
.more-nav summary span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--paper);
}
.more-nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 210px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid var(--white-line);
  background: rgba(17, 13, 22, .94);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}
.more-nav-menu a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--paper-soft);
  font-weight: 800;
}
.more-nav-menu a:hover,
.more-nav-menu a.active { background: var(--paper); color: var(--ink); }
@media (max-width: 820px) {
  .topbar-inner { grid-template-columns: 1fr auto; border-radius: 28px; }
  .brand { grid-column: 1; justify-content: flex-start; }
  .room-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto !important; padding-bottom: 2px; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .profile-chip #topName { display: none; }
}

/* File picker reliability: real buttons must receive the click. */
.file-picker-button { pointer-events: auto !important; border: 0; border-radius: 999px; background: var(--paper); color: var(--ink); padding: 10px 15px; font-weight: 900; box-shadow: none; white-space: nowrap; }
.file-picker-name { pointer-events: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.native-upload-field[role="group"] { font-weight: 900; color: inherit; }
.native-upload-field[role="group"] .file-picker-row { margin-top: 7px; }

/* Library upload modal: centered, lower than nav, no weird auto scroll. */
.library-modal.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 5000 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 118px 22px 42px !important;
  background: rgba(5, 4, 7, .52);
}
.library-modal-card.modal-card {
  width: min(820px, calc(100vw - 44px)) !important;
  max-height: min(760px, calc(100dvh - 170px)) !important;
  border-radius: 30px !important;
}
.library-modal-card .modal-topline {
  top: 0 !important;
  margin: -22px -22px 16px !important;
  padding: 22px 22px 14px !important;
}
@media (max-height: 760px) {
  .library-modal.modal-backdrop { align-items: flex-start !important; padding-top: 86px !important; }
  .library-modal-card.modal-card { max-height: calc(100dvh - 110px) !important; }
}

/* Chat: centered Messenger-ish layout, not flung across the whole screen. */
.chat-room.messenger-room {
  width: min(1240px, calc(100vw - 40px));
  margin: 28px auto 0;
}
.messenger-shell.chat-shell {
  grid-template-columns: 270px minmax(430px, 1fr) 285px;
  min-height: min(760px, calc(100dvh - 145px));
  border-radius: 32px;
}
.chat-panel-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.chat-panel-title h2 { font-size: 1rem; }
.chat-panel-title span { color: var(--paper-soft); font-weight: 700; }
.chat-search-fake { border-radius: 999px; padding: 12px 14px; background: rgba(255,255,255,.08); color: var(--paper-soft); margin-bottom: 14px; font-weight: 750; }
.chat-media-uploader { display: grid; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.chat-media-uploader > span { color: var(--paper-soft); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messenger-conversation { background: rgba(0,0,0,.08); }
.messenger-tools { background: rgba(255,255,255,.025); }
.chat-message { max-width: 78%; }
.chat-message.own .chat-bubble { background: #efe9df; }
.gif-library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gif-thumb { min-height: 92px; }
@media (max-width: 1120px) {
  .messenger-shell.chat-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .messenger-tools { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
}
@media (max-width: 760px) {
  .chat-room.messenger-room { width: calc(100vw - 22px); }
  .messenger-shell.chat-shell { grid-template-columns: 1fr; min-height: auto; }
  .chat-contact-panel, .chat-info-panel { max-height: none; }
}

/* Agenda period badges */
.agenda-headline { display: flex; align-items: end; justify-content: space-between; gap: 18px; max-width: none; }
.period-calendar-event { background: rgba(222, 111, 118, .16) !important; border-color: rgba(222, 111, 118, .46) !important; }
.period-calendar-event strong::before { content: "● "; color: #ff98a0; }
.period-upcoming { border-left: 4px solid var(--period-red); }
@media (max-width: 720px) { .agenda-headline { display: grid; } }

/* Period tracker standalone UI */
.period-app-room {
  --period-bg: #f2bd83;
  --period-card: rgba(255, 255, 255, .93);
  --period-ink: #231f20;
  --period-muted: rgba(35, 31, 32, .62);
  width: min(1280px, calc(100vw - 40px));
  margin: 24px auto 0;
  color: var(--period-ink);
}
.period-app-shell {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(340px, 1fr) minmax(280px, .9fr);
  gap: 28px;
  align-items: start;
  padding: 38px;
  border-radius: 40px;
  background:
    radial-gradient(circle at 8% 35%, rgba(255,255,255,.32), transparent 20%),
    radial-gradient(circle at 88% 16%, rgba(255,255,255,.22), transparent 18%),
    linear-gradient(135deg, #f3c18c, #f0af75);
  box-shadow: var(--shadow);
}
.period-phone-card {
  min-height: 520px;
  padding: 22px;
  border-radius: 28px;
  background: var(--period-card);
  color: var(--period-ink);
  box-shadow: 0 22px 70px rgba(65, 39, 24, .18);
  border: 1px solid rgba(255,255,255,.7);
}
.period-phone-top, .period-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.period-kicker, .period-phone-card .eyebrow { color: var(--period-muted); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 900; }
.period-phone-card h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.06em; margin: 4px 0 0; }
.period-phone-card h2 { font-size: 1.15rem; }
.period-agenda-link, .period-back-ghost { color: #538fe2; font-weight: 900; background: transparent; box-shadow: none; padding: 7px 8px; }
.period-week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 26px 0; }
.period-day-dot { display: grid; place-items: center; gap: 2px; min-height: 54px; border-radius: 18px; color: var(--period-muted); }
.period-day-dot.active { background: #f1b677; color: white; }
.period-day-dot b { font-size: .8rem; }
.period-day-dot i { font-style: normal; font-weight: 900; }
.period-orb {
  width: min(250px, 70vw);
  aspect-ratio: 1;
  margin: 26px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  background: #db7378;
  color: white;
  outline: 2px dotted rgba(219, 115, 120, .7);
  outline-offset: 14px;
}
.period-orb strong { font-size: 4rem; line-height: .9; }
.period-orb span, .period-orb small { font-weight: 900; }
.period-orb small { opacity: .9; max-width: 150px; }
.period-orb:not(.active-period) { background: #74a9e9; outline-color: rgba(116,169,233,.65); }
.period-insights, .period-profile-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.period-profile-metrics { grid-template-columns: repeat(2, 1fr); }
.period-insights article, .period-profile-metrics article {
  border-radius: 16px;
  padding: 14px;
  background: #f7f4f1;
  display: grid;
  gap: 4px;
}
.period-insights span, .period-profile-metrics span { color: var(--period-muted); font-size: .8rem; font-weight: 900; }
.period-insights strong, .period-profile-metrics strong { font-size: 1.65rem; color: #de7076; }
.period-log-form { display: grid; gap: 14px; margin-top: 20px; }
.period-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period-log-form input, .period-log-form select, .period-log-form textarea {
  background: #f7f4f1;
  color: var(--period-ink);
  border-color: rgba(0,0,0,.06);
}
.period-soft-section { border-radius: 18px; background: #f7f4f1; padding: 14px; display: grid; gap: 10px; }
.period-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.period-choice, .period-flow-choice { cursor: pointer; }
.period-choice input, .period-flow-choice input { position: absolute; opacity: 0; pointer-events: none; }
.period-choice span, .period-flow-choice span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: white;
  color: var(--period-muted);
  font-weight: 900;
  font-size: .78rem;
  text-align: center;
  padding: 7px;
}
.period-choice input:checked + span, .period-flow-choice input:checked + span { background: #df7077; color: white; }
.period-flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.period-note-label textarea { min-height: 94px; }
.period-form-actions { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.period-form-actions span { color: var(--period-muted); font-weight: 900; }
.period-form-actions button { background: #f0b374; color: white; min-width: 160px; }
.period-profile-avatar { width: 84px; height: 84px; margin: 24px auto 10px; border-radius: 50%; background: #f2eeee; display: grid; place-items: center; font-size: 2.2rem; color: #df7077; }
.period-profile-card { text-align: center; }
.period-history { text-align: left; margin-top: 24px; }
.period-history-card { display: flex; justify-content: space-between; gap: 10px; align-items: start; padding: 12px; border-radius: 16px; background: #f7f4f1; margin-top: 10px; }
.period-history-card span, .period-history-card small { display: block; color: var(--period-muted); margin-top: 3px; }
@media (max-width: 1080px) { .period-app-shell { grid-template-columns: 1fr; } .period-phone-card { min-height: auto; } }
@media (max-width: 560px) { .period-app-room { width: calc(100vw - 18px); } .period-app-shell { padding: 12px; gap: 14px; border-radius: 26px; } .period-date-row, .period-choice-grid, .period-flow-grid, .period-insights { grid-template-columns: 1fr 1fr; } }

/* Shopping + Cooking: softer app-card UI inspired by supplied refs. */
.app-ui-room { width: min(1320px, calc(100vw - 40px)); margin: 28px auto 0; }
.app-phone-layout { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(360px, .75fr); gap: 28px; align-items: start; }
.app-phone-board {
  min-height: min(780px, calc(100dvh - 150px));
  padding: 24px;
  border-radius: 34px;
  background: rgba(255,255,255,.94);
  color: #1f1d1f;
  box-shadow: 0 28px 90px rgba(0,0,0,.22);
  overflow: auto;
}
.app-screen-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.app-screen-top h1 { font-size: clamp(2rem, 4vw, 3.6rem); color: #1f1d1f; }
.app-count-pill { border-radius: 999px; background: #f0f0f0; color: rgba(0,0,0,.62); padding: 9px 12px; font-weight: 900; }
.app-search { min-height: 52px; border-radius: 16px; background: white; display: flex; align-items: center; padding: 0 18px; color: rgba(0,0,0,.38); font-weight: 800; box-shadow: 0 12px 26px rgba(0,0,0,.08); margin-bottom: 22px; }
.app-card-list { display: grid !important; grid-template-columns: 1fr !important; gap: 18px !important; }
.app-list-card { border: 0 !important; background: #fff !important; color: #1f1d1f !important; border-radius: 24px !important; box-shadow: 0 16px 40px rgba(0,0,0,.10); overflow: hidden; }
.app-card-image { aspect-ratio: 16/7 !important; min-height: 150px; background-color: #f2c590; background-image: linear-gradient(135deg, #f2c590, #e7e2dc); background-size: cover !important; background-position: center !important; color: #1f1d1f !important; }
.app-card-image.has-image { background-color: #ddd !important; }
.app-card-body { padding: 18px 22px 22px !important; color: #1f1d1f !important; }
.app-card-body strong { font-size: 1.25rem; }
.app-card-body small, .app-card-body p, .app-card-body li { color: rgba(0,0,0,.62) !important; }
.app-card-body .secondary { background: #f1f1f1; color: #1f1d1f; }
.app-phone-form { border-radius: 34px; max-height: min(780px, calc(100dvh - 150px)); overflow: auto; }
.app-phone-form textarea { min-height: 90px; }
@media (max-width: 900px) { .app-phone-layout { grid-template-columns: 1fr; } .app-phone-board, .app-phone-form { min-height: auto; max-height: none; } }

/* route sizing after nav cleanup */
body[data-route="chat"] .wrap,
body[data-route="period"] .wrap,
body[data-route="shopping"] .wrap,
body[data-route="cooking"] .wrap { max-width: none; }

/* Shared Space 2.0.2 interaction/layout repair pass */
[hidden], .hidden { display: none !important; }
button, summary, [role="button"], .file-picker-button { touch-action: manipulation; }
summary { cursor: pointer; user-select: none; }

/* Topnav: stop clipping and make the 3-line menu actually visible. */
.topbar, .topbar-inner, .top-actions, .more-nav { overflow: visible !important; }
.more-nav[open] .more-nav-menu {
  position: fixed !important;
  top: 82px !important;
  right: 22px !important;
  z-index: 9000 !important;
  width: min(240px, calc(100vw - 32px));
}
.more-nav summary { color: var(--paper); }
@media (max-width: 820px) {
  .more-nav[open] .more-nav-menu { top: 74px !important; right: 12px !important; }
}

/* Map: keep the map usable and prevent the header/search row from eating itself. */
body.route-map .topbar { z-index: 2600 !important; width: min(760px, calc(100vw - 28px)) !important; }
body.route-map .topbar-inner { overflow: visible !important; }
body.route-map .map-searchbar {
  z-index: 2200 !important;
  top: 88px !important;
  left: 14px !important;
  right: 14px !important;
  width: auto !important;
  grid-template-columns: 44px minmax(0, 1fr) auto auto !important;
}
body.route-map .map-drawer { z-index: 2100 !important; top: 154px !important; }
body.route-map .map-modal { z-index: 5000 !important; }
@media (min-width: 1180px) {
  body.route-map .topbar { width: min(720px, 50vw) !important; }
  body.route-map .map-searchbar { left: calc(min(720px, 50vw) + 28px) !important; top: 14px !important; }
  body.route-map .map-drawer { top: 88px !important; }
}
@media (max-width: 760px) {
  body.route-map .map-style-select { display: none !important; }
  body.route-map .map-searchbar { top: 132px !important; grid-template-columns: 42px minmax(0,1fr) !important; }
  body.route-map .map-searchbar > #addMapPin { display: none !important; }
  body.route-map .map-drawer { top: 200px !important; }
}

/* Library: turn upload/settings into right-side drawers, not awkward center modals. */
.library-modal.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 6200 !important;
  display: block !important;
  padding: 0 !important;
  background: rgba(3, 3, 6, .45) !important;
  backdrop-filter: blur(14px) saturate(1.05);
}
.library-modal.modal-backdrop.hidden { display: none !important; }
.library-modal-card.modal-card {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: min(560px, 100vw) !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 30px 0 0 30px !important;
  overflow: auto !important;
  padding: 26px !important;
  background: linear-gradient(180deg, rgba(24, 24, 34, .98), rgba(8, 7, 12, .98)) !important;
  color: var(--paper) !important;
  box-shadow: -26px 0 90px rgba(0,0,0,.55) !important;
}
.library-modal-card .modal-topline {
  position: sticky !important;
  top: -26px !important;
  margin: -26px -26px 20px !important;
  padding: 26px 26px 16px !important;
  background: linear-gradient(180deg, rgba(20,20,28,.99), rgba(20,20,28,.88)) !important;
  z-index: 3 !important;
}
.library-modal-card input,
.library-modal-card select,
.library-modal-card textarea {
  color: var(--paper) !important;
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.18) !important;
}
.library-modal-card input::placeholder,
.library-modal-card textarea::placeholder { color: rgba(255,249,240,.45) !important; }

/* Generic side drawers for shopping/cooking. */
.app-phone-layout { grid-template-columns: minmax(360px, 1fr) !important; }
.app-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 6200 !important;
  display: block !important;
  background: rgba(4,4,8,.45) !important;
  backdrop-filter: blur(14px);
}
.app-drawer-backdrop.hidden { display: none !important; }
.app-side-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: min(560px, 100vw) !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 30px 0 0 30px !important;
  overflow: auto !important;
  box-shadow: -26px 0 90px rgba(0,0,0,.55) !important;
}
.app-screen-top .button-row { align-items: center; }
.app-screen-top .button-row button { min-height: 42px; }

/* Chat: bigger, centered, and popup tools instead of cramped side forms. */
.big-chat-room.chat-room.messenger-room {
  width: min(1580px, calc(100vw - 28px)) !important;
  margin: 18px auto 0 !important;
}
.big-chat-room .messenger-shell.chat-shell {
  grid-template-columns: 285px minmax(560px, 1fr) 265px !important;
  min-height: min(850px, calc(100dvh - 122px)) !important;
  height: calc(100dvh - 126px) !important;
}
.big-chat-room .chat-messages { min-height: 0; }
.big-chat-room .chat-message { max-width: 72%; }
.chat-popup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 6400 !important;
  display: grid !important;
  place-items: center !important;
  padding: 22px !important;
  background: rgba(3,3,7,.55) !important;
  backdrop-filter: blur(16px);
}
.chat-popup.hidden { display: none !important; }
.chat-popup-card {
  width: min(560px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 44px) !important;
  overflow: auto !important;
  border-radius: 30px !important;
}
.chat-bet-amount-row { display: grid; grid-template-columns: 1fr 52px 52px; gap: 10px; align-items: end; }
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 20px 0;
  color: var(--paper-soft);
  font-size: .9rem;
  font-weight: 800;
}
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-soft);
  animation: typing-bounce 1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
@media (max-width: 1180px) {
  .big-chat-room .messenger-shell.chat-shell { grid-template-columns: 240px minmax(0, 1fr) !important; height: auto !important; }
  .big-chat-room .messenger-tools { grid-column: 1 / -1; }
}

/* Casino request popup + cleaner amount stepper. */
.casino-compose.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 6400 !important;
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
  background: rgba(3,3,7,.55) !important;
  backdrop-filter: blur(16px);
}
.casino-compose.modal-backdrop.hidden { display: none !important; }
.casino-bet-popup { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; border-radius: 32px; }
.casino-popup-form { display: grid; gap: 16px; }
.casino-amount-stepper { display: grid; grid-template-columns: 1fr 54px 54px; gap: 10px; align-items: end; }
.casino-amount-stepper button { min-height: 54px; font-size: 1.35rem; }
.casino-clean-bet { transition: transform .15s ease, background .15s ease; }
.casino-clean-bet:hover { transform: translateY(-1px); }

/* Period tracker: make pills feel like real buttons and stop text selecting. */
.period-choice span,
.period-flow-choice span {
  user-select: none;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.04);
  transition: transform .12s ease, background .12s ease;
}
.period-choice span:hover,
.period-flow-choice span:hover { transform: translateY(-1px); }
.period-log-form button[type="submit"] { min-height: 52px; }
.period-phone-card input,
.period-phone-card select,
.period-phone-card textarea { font-size: 1rem; }

/* Agenda timezones */
.agenda-timezone-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
#timezoneFields { display: grid; gap: 10px; }
#timezoneFields label { display: grid; gap: 6px; }
#timezoneFields small { color: var(--paper-soft); font-weight: 800; }

/* Stats: bundle Discord as one clean block instead of two floating islands. */
.discord-stats-section {
  width: min(1420px, calc(100vw - 40px));
  margin: 0 auto 10px;
}
.stats-top-grid.stats-discord-grid,
.stats-lower {
  width: min(1420px, calc(100vw - 40px));
  margin-inline: auto;
}
.stats-top-grid.stats-discord-grid {
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, .7fr) !important;
  align-items: stretch;
}
.stats-lower {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;
}
.stats-lower .call-details {
  width: 100%;
  max-width: none;
}
.stats-lower .call-details[open] {
  display: block;
}
.call-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 950;
}
.call-details summary::after { content: '−'; opacity: .8; }
.call-details:not([open]) summary::after { content: '+'; }
.room-label-editor summary { pointer-events: auto !important; }

/* File inputs: keep browser-native input hidden where we use custom buttons. */
.visually-hidden-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}

/* v2.0.3: date picker, map search moved into Places drawer, and larger readable chat tools */
input[type="date"], input[type="datetime-local"] {
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .95;
}

body.route-map .topbar {
  z-index: 1800 !important;
}
body.route-map .map-shell {
  overflow: hidden !important;
}
body.route-map .map-drawer-tab {
  left: 18px;
  top: 92px;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(15, 16, 25, .82);
  color: var(--paper);
  border: 1px solid rgba(255,249,240,.18);
  box-shadow: 0 16px 55px rgba(0,0,0,.32);
  backdrop-filter: blur(18px) saturate(1.2);
}
body.route-map .map-drawer:not(.collapsed) + .map-drawer-tab,
body.route-map .map-drawer-tab[hidden] {
  display: none;
}
body.route-map .map-drawer {
  top: 84px !important;
  left: 16px !important;
  bottom: 16px !important;
  width: min(430px, calc(100vw - 32px)) !important;
  z-index: 1200 !important;
}
body.route-map .map-drawer.collapsed {
  transform: translateX(calc(-100% - 30px)) !important;
}
body.route-map .map-drawer-search.map-searchbar,
.map-drawer .map-drawer-search.map-searchbar {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  margin: 18px 0 16px !important;
  padding: 12px !important;
  border-radius: 24px !important;
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body.route-map .map-drawer-search .map-search-form,
.map-drawer-search .map-search-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  min-width: 0 !important;
}
body.route-map .map-drawer-search input,
.map-drawer-search input {
  height: 46px !important;
  min-width: 0 !important;
}
.map-drawer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
body.route-map .map-drawer-search .map-style-select,
.map-drawer-search .map-style-select,
body.route-map .map-drawer-search button,
.map-drawer-search button {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
body.route-map .map-drawer-search .map-search-results,
.map-drawer-search .map-search-results {
  position: static !important;
  width: 100% !important;
  max-height: 280px !important;
  margin-top: 2px !important;
  background: rgba(8,10,18,.92) !important;
  border-color: rgba(255,255,255,.16) !important;
}
body.route-map .map-searchbar:not(.map-drawer-search) {
  display: none !important;
}
@media (max-width: 760px) {
  body.route-map .map-drawer { top: 80px !important; }
  body.route-map .map-drawer-search .map-search-form { grid-template-columns: 1fr !important; }
  .map-drawer-actions { grid-template-columns: 1fr; }
}

.chat-popup-card {
  width: min(980px, calc(100vw - 40px)) !important;
  max-height: calc(100dvh - 38px) !important;
  padding: clamp(22px, 3vw, 38px) !important;
  border-radius: 34px !important;
  background: rgba(16, 15, 22, .94) !important;
  color: var(--paper) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}
.chat-popup-card .modal-topline {
  align-items: flex-start;
  margin-bottom: 18px;
}
.chat-popup-card .modal-topline span,
.chat-popup-card .eyebrow,
.chat-popup-card .form-actions {
  color: rgba(255,249,240,.72) !important;
}
.chat-popup-card input,
.chat-popup-card textarea,
.chat-popup-card select {
  background: rgba(255,255,255,.09) !important;
  color: var(--paper) !important;
  border-color: rgba(255,255,255,.15) !important;
}
.chat-popup-card input::placeholder,
.chat-popup-card textarea::placeholder {
  color: rgba(255,249,240,.52) !important;
}
#letterForm textarea[name="text"] {
  min-height: min(44vh, 380px) !important;
}
#letterForm.chat-tool-card,
#requestForm.chat-tool-card {
  padding: clamp(18px, 2.5vw, 28px) !important;
  border-radius: 28px !important;
  background: rgba(255,255,255,.055) !important;
}
#letterForm .form-actions,
#requestForm .form-actions {
  position: sticky;
  bottom: -10px;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, rgba(16,15,22,.94) 38%);
}

/* ==============================
   v2.1.0 stable upload rebuild
   Preserve working upload fallback; add queue/reorder/mobile polish.
   ============================== */
.mobile-menu-only { display: none !important; }
.cinema-upload-queue-box {
  border: 1px solid var(--white-line);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255,255,255,.045);
  display: grid;
  gap: 10px;
}
.cinema-upload-queue {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.cinema-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
}
.cinema-queue-item strong,
.cinema-queue-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cinema-queue-item .cinema-progress-bar { grid-column: 1 / -1; height: 7px; }
.cinema-queue-item.done { border-color: rgba(128, 220, 170, .45); }
.cinema-queue-item.error { border-color: rgba(255, 120, 120, .55); }
.shelf-card[draggable="true"] { cursor: grab; }
.shelf-card.is-dragging-card { opacity: .55; transform: scale(.98); cursor: grabbing; outline: 2px solid var(--accent); }
.library-preview-file { display:grid; place-items:center; min-height:110px; border-radius:18px; background:rgba(255,255,255,.08); font-weight:900; }
.modal-card,
.chat-popup-card,
.library-modal-card,
.app-side-drawer,
.period-phone-card,
.app-phone-form {
  color: var(--ink);
}
.dark-panel,
.dark-panel input,
.dark-panel textarea,
.dark-panel select,
.chat-popup-card.dark-panel,
.library-modal-card.dark-panel,
.app-side-drawer.dark-panel {
  color: var(--paper);
}
.dark-panel input::placeholder,
.dark-panel textarea::placeholder { color: rgba(244,239,231,.55); }
.modal-card:not(.dark-panel) input,
.modal-card:not(.dark-panel) textarea,
.modal-card:not(.dark-panel) select {
  color: #241f22;
  background: rgba(255,255,255,.66);
}
.more-nav-menu { z-index: 9999 !important; }
.more-nav[open] .more-nav-menu {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 76px) !important;
  right: 14px !important;
  left: auto !important;
  max-height: calc(100dvh - 96px) !important;
  overflow: auto !important;
}
@media (max-width: 700px) {
  .wrap { width: 100%; padding: 10px; }
  .topbar { position: sticky; top: 8px; margin-bottom: 14px; z-index: 5000; }
  .topbar-inner {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    grid-template-columns: auto 1fr auto !important;
    gap: 8px !important;
    padding: 8px !important;
    border-radius: 22px !important;
  }
  .brand { min-height: 42px; padding: 0 10px; }
  .brand strong { display: none; }
  .room-nav { display: none !important; }
  .top-actions { gap: 6px !important; }
  .top-actions .profile-chip { padding: 0 8px; min-height: 42px; }
  .top-actions #logoutButton { display: none; }
  .more-nav { order: -1; }
  .more-nav summary { width: 44px; min-height: 42px; }
  .mobile-menu-only { display: flex !important; }
  .more-nav[open] .more-nav-menu {
    top: calc(env(safe-area-inset-top) + 66px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-height: calc(100dvh - 84px) !important;
    border-radius: 22px !important;
    padding: 8px !important;
  }
  .more-nav-menu a { min-height: 44px; }
  .main { min-width: 0; }
  .intro { margin: 22px 0 18px; }
  .intro h1, .cinema-clean-hero h1 { font-size: clamp(3rem, 18vw, 5.5rem); line-height: .9; }
  .grid, .split-board, .library-tools, .pinwall-layout, .app-phone-layout, .period-app-shell, .chat-shell, .messenger-shell.chat-shell {
    grid-template-columns: 1fr !important;
  }
  .modal-card { width: min(100%, calc(100vw - 18px)); padding: 18px; border-radius: 24px; }
  .quick-form-grid { grid-template-columns: 1fr !important; }
  .library-room { width: 100%; max-width: none; }
  .library-wall-wrap.full-wall { padding-inline: 0; }
  .library-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .library-fab { right: 16px; bottom: 16px; }
  .cinema-slide-panel { width: min(100vw - 18px, 440px) !important; }
  .cinema-setup-panel { right: 9px !important; }
  .cinema-controls-panel { left: 9px !important; }
  .cinema-movie-list { max-height: 52dvh; }
  .messenger-shell.chat-shell { height: calc(100dvh - 105px) !important; }
  .chat-contact-panel, .chat-info-panel { display: none; }
  .chat-conversation-panel { min-height: 0; }
  .chat-message { max-width: 96% !important; }
  .chat-compose { grid-template-columns: auto minmax(0, 1fr) auto !important; padding: 10px; }
  .app-phone-board, .app-phone-form, .period-phone-card { border-radius: 28px; }
  .app-card-list, .recipe-list { grid-template-columns: 1fr !important; }
  body.route-map .topbar { width: calc(100vw - 16px) !important; left: 8px !important; right: 8px !important; top: 8px !important; }
}
@media (max-width: 430px) {
  .library-masonry { grid-template-columns: 1fr; }
  .top-actions .profile-chip { max-width: 54px; }
  .cinema-panel-toggle span { writing-mode: vertical-rl; }
}

/* ODH v3.1.0 mega patch polish + layout safeguards */
:root { --ease-out: cubic-bezier(.2,.8,.2,1); }
* { scroll-behavior: smooth; }
.room-view, .dark-panel, .panel, .cinema-movie-card, .shelf-card, .chat-message, .app-list-card { animation: odhSoftIn .28s var(--ease-out) both; }
@keyframes odhSoftIn { from { opacity: 0; transform: translateY(8px) scale(.995); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Correct dropdown: anchored to the hamburger, kept inside viewport */
.topbar, .topbar-inner, .top-actions, .more-nav { overflow: visible !important; }
.more-nav { position: relative !important; }
.more-nav-menu { right: 0 !important; left: auto !important; top: calc(100% + 12px) !important; position: absolute !important; transform: none !important; width: min(260px, calc(100vw - 24px)) !important; max-height: calc(100dvh - 110px); overflow-y: auto; z-index: 9999 !important; }
.more-nav[open] .more-nav-menu { position: absolute !important; top: calc(100% + 12px) !important; right: 0 !important; left: auto !important; }
@media (max-width: 760px) { .room-nav { display: none !important; } .brand strong { display: none; } .topbar-inner { grid-template-columns: auto 1fr !important; } .top-actions { justify-self: end; gap: 8px; } .profile-chip { padding: 6px 8px; } #logoutButton { padding-inline: 12px; } .more-nav[open] .more-nav-menu { right: 0 !important; width: min(280px, calc(100vw - 18px)) !important; } }

/* Cinema queue + options */
.cinema-queue-item { position: relative; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; }
.cinema-queue-item .cinema-progress-bar { grid-column: 1 / -1; }
.queue-delete { padding: 7px 10px !important; min-height: 32px !important; }
.movie-options-menu { position: absolute; top: 12px; right: 12px; z-index: 5; }
.movie-options-menu > summary { list-style: none; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; background: rgba(0,0,0,.5); color: var(--paper); font-size: 1.3rem; border: 1px solid rgba(255,255,255,.16); }
.movie-options-menu > summary::-webkit-details-marker { display: none; }
.movie-options-popover { position: absolute; right: 0; top: calc(100% + 8px); width: 170px; display: grid; gap: 6px; padding: 8px; background: rgba(18,14,22,.96); border: 1px solid var(--white-line); border-radius: 18px; box-shadow: var(--shadow); }
.movie-options-popover button { width: 100%; justify-content: center; }
.movie-rating-pill { background: rgba(215,168,110,.22); border: 1px solid rgba(215,168,110,.45); color: var(--gold); border-radius: 999px; padding: 5px 9px; font-weight: 900; }
.movie-info-text { margin: 4px 0 7px; color: var(--paper-soft); font-weight: 650; line-height: 1.35; }
.cinema-movie-card-compact { position: relative; }

/* Chat notification toast */
.odh-toast { position: fixed; right: 18px; bottom: 18px; z-index: 12000; width: min(340px, calc(100vw - 36px)); display: grid; gap: 4px; padding: 16px 18px; border-radius: 22px; background: rgba(18,14,22,.96); color: var(--paper); border: 1px solid var(--white-line); box-shadow: var(--shadow); animation: odhToast .28s var(--ease-out) both; }
.odh-toast span { color: var(--paper-soft); }
@keyframes odhToast { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.typing-dots i { display: inline-block; width: 5px; height: 5px; margin: 0 2px; border-radius: 50%; background: currentColor; animation: typingDots 1s infinite ease-in-out; }
.typing-dots i:nth-child(2){ animation-delay: .12s; } .typing-dots i:nth-child(3){ animation-delay: .24s; }
@keyframes typingDots { 0%,80%,100% { opacity:.25; transform: translateY(0); } 40% { opacity:1; transform: translateY(-3px); } }

/* New pages */
.coming-soon-room, .journal-room, .presence-room, .radio-room { width: min(1180px, calc(100vw - 36px)); margin: 28px auto 0; }
.coming-soon-panel { min-height: 360px; display: grid; place-items: center; text-align: center; }
.journal-layout, .presence-layout { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 20px; align-items: start; }
.journal-editor textarea { min-height: 260px; resize: vertical; }
.journal-list, .presence-list { display: grid; gap: 14px; }
.journal-entry-card, .presence-person-card { border: 1px solid var(--white-line); background: rgba(255,255,255,.055); border-radius: 28px; padding: 18px; }
.journal-entry-card strong { display: block; font-size: 1.2rem; } .journal-entry-card p { color: var(--paper-soft); line-height: 1.55; } .journal-entry-card footer { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.presence-person-card { display: grid; grid-template-columns: 92px 1fr; gap: 18px; min-height: 280px; }
.presence-avatar { width: 92px; height: 92px; border-radius: 32px; background: linear-gradient(135deg, var(--gold), #8c6cf5); background-size: cover; background-position: center; display:grid; place-items:center; font-size:2rem; font-weight:900; }
.presence-person-head { display:flex; justify-content:space-between; gap:10px; align-items:center; } .presence-person-head strong { font-size:1.6rem; }
.presence-person-card dl { display:grid; gap:8px; margin:14px 0; } .presence-person-card dl div { display:grid; grid-template-columns: 90px 1fr; gap:10px; }
.presence-level { height: 10px; border-radius:999px; background: rgba(255,255,255,.14); overflow:hidden; margin:6px 0 10px; } .presence-level span { display:block; height:100%; background: linear-gradient(90deg, var(--gold), #ff7aa2); }
.radio-stage { min-height: calc(100dvh - 140px); display:grid; grid-template-columns: minmax(360px,1fr) minmax(300px,420px); gap:24px; align-items:center; padding:42px; }
.radio-clock { font-size: clamp(4rem, 13vw, 12rem); font-weight: 300; letter-spacing: .02em; text-align:center; color: var(--paper); }
.radio-player-card { display:grid; gap:14px; max-width: 620px; margin-inline:auto; text-align:center; }
.radio-player-card audio { width:100%; }
.radio-station-form, .radio-message-form { display:grid; grid-template-columns: 1fr 1fr auto; gap:8px; } .radio-message-form { grid-template-columns: 1fr auto; }
.radio-chat { align-self: stretch; display:flex; flex-direction:column; min-height: 520px; padding:24px; border-radius:32px; border:1px solid var(--white-line); background: rgba(255,255,255,.045); }
.radio-messages { flex:1; display:flex; flex-direction:column; justify-content:flex-end; gap:10px; overflow:hidden; mask-image: linear-gradient(transparent, #000 22%, #000); }
.radio-msg { padding:12px 14px; border-radius:18px; background: rgba(255,255,255,.08); }
.radio-msg strong { display:block; } .radio-msg span { color:var(--paper-soft); }
.personalization-collapsible > summary { list-style: none; } .personalization-collapsible > summary::-webkit-details-marker { display:none; }

/* Daily period tweaks */
.daily-period-shell .period-day-dot { border:0; background:transparent; color:inherit; cursor:pointer; }
.daily-period-shell .period-day-dot.active { background: var(--period-peach); border-radius: 18px; }
#hornyValue { display:inline-block; margin-left:8px; font-weight:900; color: var(--period-red); }

@media (max-width: 900px) { .journal-layout, .presence-layout, .radio-stage { grid-template-columns: 1fr; } .radio-stage { padding:22px; } .radio-chat { min-height:360px; } .radio-station-form { grid-template-columns:1fr; } }
@media (max-width: 640px) { .wrap { width: 100%; } .main { padding-inline: 10px; } .intro h1 { font-size: clamp(2.5rem, 16vw, 4.5rem); } .journal-room, .presence-room, .radio-room, .coming-soon-room { width: calc(100vw - 20px); } .presence-person-card { grid-template-columns: 1fr; } .presence-avatar { width:76px; height:76px; border-radius:26px; } .radio-clock { font-size: clamp(3.4rem, 22vw, 7rem); } }

/* v3.1.1 cleanup: radio, journal, cinema drawers, personalization */
html { font-size: calc(16px * var(--ui-font-scale, 1)); }
html[data-theme="slate"] { --bg:#0b1018; --paper:rgba(236,241,249,.93); --paper-strong:#f4f7fb; --paper-soft:rgba(236,241,249,.70); --ink:#111821; --muted:rgba(17,24,33,.60); --line:rgba(17,24,33,.16); --white-line:rgba(236,241,249,.16); --white-soft:rgba(236,241,249,.09); --glass-dark:rgba(7,11,17,.52); --glass-darker:rgba(7,11,17,.78); }
html[data-theme="cream"] { --bg:#f4eddf; --paper:rgba(255,250,241,.94); --paper-strong:#fffaf1; --paper-soft:rgba(67,54,44,.70); --ink:#2c241d; --muted:rgba(44,36,29,.62); --line:rgba(44,36,29,.15); --white-line:rgba(44,36,29,.13); --white-soft:rgba(44,36,29,.06); --glass-dark:rgba(255,249,238,.58); --glass-darker:rgba(255,249,238,.84); }
html[data-theme="violet"] { --bg:#10091a; --paper:rgba(245,238,255,.93); --paper-strong:#fbf7ff; --paper-soft:rgba(245,238,255,.70); --ink:#20112e; --muted:rgba(32,17,46,.58); --line:rgba(32,17,46,.16); --white-line:rgba(245,238,255,.16); --white-soft:rgba(245,238,255,.09); --glass-dark:rgba(14,7,24,.52); --glass-darker:rgba(14,7,24,.78); }
html[data-background="dawn"] .background { background: radial-gradient(circle at 47% 62%, rgba(255,240,174,.48), transparent 18%), radial-gradient(circle at 20% 18%, rgba(89,203,222,.36), transparent 34%), linear-gradient(180deg, #55c5d4 0%, #f5c27c 52%, #102333 100%); }
html[data-background="noir"] .background { background: radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 32%), linear-gradient(135deg,#050507,#12111a 58%,#060509); }
html[data-background="plain"] .background { background: linear-gradient(135deg, var(--bg), #111018); }
html[data-surface="clean"] .panel,
html[data-surface="clean"] .dark-panel { background: rgba(255,255,255,.88); color: var(--ink); border-color: rgba(0,0,0,.10); box-shadow: 0 20px 70px rgba(0,0,0,.12); }
html[data-surface="clean"] .panel input,
html[data-surface="clean"] .panel select,
html[data-surface="clean"] .panel textarea,
html[data-surface="clean"] .dark-panel input,
html[data-surface="clean"] .dark-panel select,
html[data-surface="clean"] .dark-panel textarea { background: rgba(0,0,0,.04); color: var(--ink); border-color: rgba(0,0,0,.14); }
html[data-contrast="high"] { --paper: rgba(255,255,255,.96); --paper-soft: rgba(255,255,255,.82); --white-line: rgba(255,255,255,.28); }
html[data-contrast="soft"] { --paper: rgba(245,239,229,.86); --paper-soft: rgba(245,239,229,.58); --white-line: rgba(245,239,229,.11); }
html[data-button-style="outline"] button:not(.danger),
html[data-button-style="outline"] .btn { background: transparent; border: 1px solid currentColor; box-shadow: none; }
html[data-button-style="soft"] button:not(.danger),
html[data-button-style="soft"] .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.18); }
html[data-form-size="large"] input,
html[data-form-size="large"] select,
html[data-form-size="large"] textarea { min-height: 54px; font-size: 1.05rem; }
html[data-form-size="compact"] input,
html[data-form-size="compact"] select,
html[data-form-size="compact"] textarea { min-height: 38px; padding-block: 8px; font-size: .92rem; }
html[data-motion="smooth"] * { scroll-behavior: smooth; }
html[data-motion="smooth"] .room-view,
html[data-motion="smooth"] .panel,
html[data-motion="smooth"] .dark-panel { transition: transform .28s ease, opacity .28s ease, background .28s ease, border-color .28s ease; }

/* Robust cinema drawer hiding, even when route classes lag during render. */
.cinema-overlay-layout { position: relative; overflow: hidden !important; }
.cinema-overlay-layout .cinema-slide-panel { position: absolute !important; top: 88px !important; bottom: 18px !important; z-index: 740 !important; width: min(430px, calc(100vw - 58px)) !important; opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; transition: transform .28s ease, opacity .22s ease, visibility .22s ease !important; }
.cinema-overlay-layout .cinema-controls-panel { left: 18px !important; right: auto !important; transform: translateX(calc(-100% - 48px)) !important; }
.cinema-overlay-layout .cinema-setup-panel { right: 18px !important; left: auto !important; transform: translateX(calc(100% + 48px)) !important; }
.cinema-overlay-layout .cinema-slide-panel.open { opacity: 1 !important; pointer-events: auto !important; visibility: visible !important; transform: translateX(0) !important; }
.cinema-overlay-layout .cinema-panel-backdrop { pointer-events: none !important; opacity: 0 !important; }
.cinema-overlay-layout.cinema-any-panel-open .cinema-panel-backdrop { pointer-events: auto !important; opacity: 1 !important; }

/* Radio station */
.radio-room { width: 100vw; max-width: none; min-height: calc(100vh - 84px); margin: -4px 0 0; }
.radio-immersive-stage { position: relative; min-height: calc(100vh - 88px); overflow: hidden; border-radius: 0; background: linear-gradient(180deg, #5fc6d4, #f5c778 54%, #113044); color: #fff; isolation: isolate; }
.radio-bg-layer { position:absolute; inset:0; background-size: cover; background-position: center; opacity:0; transition: opacity 1.2s ease; z-index:-3; }
.radio-bg-layer.active { opacity:1; }
.radio-bg-dim { position:absolute; inset:0; z-index:-1; background:rgba(0,0,0,.26); transition: background .3s ease; }
.radio-immersive-stage[data-bg-mode="gradient"]::before { content:""; position:absolute; inset:0; z-index:-2; background: radial-gradient(circle at 46% 58%, rgba(255,246,183,.50), transparent 14%), radial-gradient(circle at 18% 22%, rgba(255,255,255,.22), transparent 10%), linear-gradient(180deg, rgba(73,194,213,.94), rgba(244,196,119,.86) 58%, rgba(7,40,57,.96)); }
.radio-main-clock { position:absolute; left: clamp(22px, 7vw, 112px); top: clamp(80px, 18vh, 190px); text-shadow: 0 18px 50px rgba(0,0,0,.24); }
.radio-clock { font-size: clamp(4.6rem, 11vw, 10rem); line-height:.9; font-weight: 300; letter-spacing: -.06em; }
.radio-date { margin-top: 18px; font-size: clamp(1.05rem, 2vw, 1.6rem); font-weight: 800; opacity:.95; }
.radio-now-card { position:absolute; right: clamp(26px, 7vw, 120px); top: clamp(96px, 20vh, 210px); width:min(420px, calc(100vw - 54px)); padding:20px; border-radius:28px; background:rgba(5,8,14,.24); border:1px solid rgba(255,255,255,.18); backdrop-filter: blur(18px); box-shadow:0 22px 70px rgba(0,0,0,.18); }
.radio-now-card h1 { margin:4px 0 14px; font-size: clamp(1.6rem,3vw,3rem); }
.radio-now-card audio { width:100%; }
.radio-config-toggle { position:absolute; right: 28px; bottom: 28px; z-index:12; background:rgba(5,8,14,.55); color:#fff; border:1px solid rgba(255,255,255,.18); }
.radio-config-drawer { position:absolute; top:22px; right:22px; bottom:22px; width:min(430px, calc(100vw - 32px)); z-index:30; padding:18px; display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:14px; overflow:auto; transform: translateX(calc(100% + 48px)); opacity:0; pointer-events:none; visibility:hidden; transition: transform .28s ease, opacity .22s ease, visibility .22s ease; }
.radio-config-drawer.open { transform: translateX(0); opacity:1; pointer-events:auto; visibility:visible; }
.radio-station-form { align-content:start; }
.radio-library-hint { color:var(--paper-soft); font-weight:800; }
.radio-fade-chat { position:absolute; left:50%; transform:translateX(-50%); bottom: 28px; width:min(620px, calc(100vw - 56px)); display:grid; gap:10px; }
.radio-messages { display:flex; flex-direction:column; gap:8px; max-height: 190px; overflow:hidden; justify-content:flex-end; }
.radio-msg { align-self:center; max-width:min(520px, 100%); padding:10px 14px; border-radius:18px; background:rgba(5,8,14,.34); border:1px solid rgba(255,255,255,.16); backdrop-filter:blur(14px); animation: radioFadeIn .28s ease; }
.radio-msg strong { margin-right:8px; }
.radio-message-form { display:grid; grid-template-columns:1fr auto; gap:8px; padding:8px; border-radius:999px; background:rgba(5,8,14,.36); border:1px solid rgba(255,255,255,.16); backdrop-filter:blur(14px); }
.radio-message-form input { background:transparent; border:0; color:#fff; }
@keyframes radioFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Journal focus layout */
.journal-focus-room { width:100vw; max-width:none; min-height:calc(100vh - 90px); margin:0; position:relative; overflow:hidden; }
.journal-focus-stage { width:min(980px, calc(100vw - 52px)); min-height:calc(100vh - 128px); margin:24px auto; display:grid; align-items:stretch; }
.journal-page-editor { display:grid; grid-template-rows:auto auto minmax(360px, 1fr) auto; gap:18px; padding: clamp(20px, 4vw, 46px); border-radius:36px; background:rgba(245,239,229,.94); color:#211b18; box-shadow:0 30px 100px rgba(0,0,0,.24); border:1px solid rgba(0,0,0,.10); }
.journal-editor-top { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.journal-editor-top h1 { font-size: clamp(3rem,8vw,7rem); margin:0; letter-spacing:-.07em; }
.journal-meta-grid { display:grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap:12px; }
.journal-meta-grid .wide { grid-column: 1 / -1; }
.journal-page-editor input,
.journal-page-editor select,
.journal-page-editor textarea { background:rgba(255,255,255,.72); color:#211b18; border-color:rgba(0,0,0,.12); }
.journal-body-label { display:grid; gap:8px; min-height:0; }
.journal-body-label textarea { min-height: clamp(360px, 48vh, 720px); resize:vertical; line-height:1.55; font-size:1.08rem; }
.journal-action-row { display:flex; justify-content:flex-end; }
.journal-sidebar-toggle { position:absolute; right:24px; top:24px; z-index:12; }
.journal-side-drawer { position:absolute; top:18px; right:18px; bottom:18px; width:min(430px, calc(100vw - 32px)); z-index:30; padding:18px; transform:translateX(calc(100% + 48px)); opacity:0; pointer-events:none; visibility:hidden; transition:transform .28s ease, opacity .22s ease, visibility .22s ease; display:grid; grid-template-rows:auto minmax(0,1fr); }
.journal-side-drawer.open { transform:translateX(0); opacity:1; pointer-events:auto; visibility:visible; }
.journal-side-drawer .journal-list { overflow:auto; display:grid; gap:12px; }

/* General text/contrast guardrails */
.modal-card, .panel, .dark-panel { color: var(--paper); }
.panel:not(.dark-panel):not(.journal-page-editor) { color: var(--ink); }
.dark-panel input::placeholder,
.dark-panel textarea::placeholder { color: rgba(245,239,229,.58); }
.panel input::placeholder,
.panel textarea::placeholder { color: rgba(33,27,24,.48); }
.preferences-panel summary { cursor:pointer; }
.preferences-grid { align-items:end; }

@media (max-width: 820px) {
  .radio-now-card { left:22px; right:22px; top:auto; bottom:120px; width:auto; }
  .radio-main-clock { left:24px; top:90px; }
  .radio-config-toggle { bottom:22px; right:22px; }
  .radio-fade-chat { bottom:80px; }
  .journal-meta-grid { grid-template-columns:1fr 1fr; }
  .journal-focus-stage { width:calc(100vw - 24px); margin-top:16px; }
  .journal-page-editor { border-radius:26px; }
  .cinema-overlay-layout .cinema-slide-panel { top:74px !important; bottom:10px !important; width:min(440px, calc(100vw - 20px)) !important; }
}
@media (max-width: 560px) {
  .journal-meta-grid { grid-template-columns:1fr; }
  .radio-clock { font-size: clamp(3.8rem, 22vw, 6rem); }
  .radio-now-card { padding:14px; border-radius:22px; }
  .journal-body-label textarea { min-height: 48vh; }
}


/* ==============================
   v3.1.2 viewport layout repair
   - Radio uses map/cinema-style viewport stage.
   - Letter popup is centered and larger.
   - Cinema side panels stay hidden until explicitly opened.
   Upload fallback untouched.
   ============================== */

body[data-route="radio"] {
  overflow: hidden !important;
}
body[data-route="radio"] .page {
  min-height: 100dvh !important;
  padding: 14px !important;
}
body[data-route="radio"] .wrap,
body[data-route="radio"] .main,
body[data-route="radio"] .room-view,
body[data-route="radio"] .radio-room,
body[data-route="radio"] .radio-immersive-stage {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: calc(100dvh - 28px) !important;
}
body[data-route="radio"] .wrap {
  margin: 0 !important;
}
body[data-route="radio"] .main {
  padding: 0 !important;
  margin: 0 !important;
}
body[data-route="radio"] .topbar {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 14px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(1120px, calc(100vw - 28px)) !important;
  z-index: 1400 !important;
  margin: 0 !important;
}
body[data-route="radio"] .radio-room {
  margin: 0 !important;
}
body[data-route="radio"] .radio-immersive-stage {
  position: relative !important;
  border-radius: 34px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  box-shadow: 0 28px 90px rgba(0,0,0,.42) !important;
  overflow: hidden !important;
}
body[data-route="radio"] .radio-main-clock {
  top: clamp(116px, 20vh, 200px) !important;
}
body[data-route="radio"] .radio-config-toggle {
  right: 28px !important;
  bottom: 28px !important;
}
body[data-route="radio"] .radio-config-drawer {
  top: 92px !important;
  right: 22px !important;
  bottom: 22px !important;
  max-height: calc(100dvh - 114px) !important;
}
body[data-route="radio"] .radio-fade-chat {
  bottom: 28px !important;
}

@media (max-width: 860px) {
  body[data-route="radio"] .radio-main-clock {
    left: 24px !important;
    right: 24px !important;
    top: 104px !important;
  }
  body[data-route="radio"] .radio-now-card {
    left: 22px !important;
    right: 22px !important;
    top: auto !important;
    bottom: 132px !important;
    width: auto !important;
  }
  body[data-route="radio"] .radio-fade-chat {
    display: none !important;
  }
  body[data-route="radio"] .radio-config-toggle {
    right: 20px !important;
    bottom: 20px !important;
  }
  body[data-route="radio"] .radio-config-drawer {
    top: 86px !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
  }
}

/* Letter / request modal centering and usable writing space */
.chat-popup,
#letterModal.chat-popup,
#requestModal.chat-popup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 6500 !important;
  display: grid !important;
  place-items: center !important;
  padding: clamp(14px, 3vw, 34px) !important;
  background: rgba(3,3,7,.60) !important;
  backdrop-filter: blur(16px) !important;
}
.chat-popup.hidden,
#letterModal.chat-popup.hidden,
#requestModal.chat-popup.hidden {
  display: none !important;
}
#letterModal .chat-popup-card {
  width: min(1120px, calc(100vw - 48px)) !important;
  max-height: calc(100dvh - 48px) !important;
  min-height: min(760px, calc(100dvh - 48px)) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  padding: clamp(24px, 3.2vw, 44px) !important;
  overflow: hidden !important;
}
#letterModal .chat-popup-card .modal-topline {
  margin-bottom: 18px !important;
}
#letterForm.chat-tool-card {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(260px, 1fr) auto !important;
  gap: 16px !important;
  overflow: hidden !important;
}
#letterForm.chat-tool-card label:has(textarea),
#letterForm.chat-tool-card label:nth-of-type(3) {
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}
#letterForm textarea[name="text"] {
  min-height: 0 !important;
  height: 100% !important;
  resize: none !important;
}
#letterForm .form-actions {
  position: static !important;
  padding-top: 10px !important;
  background: transparent !important;
}
@media (max-width: 720px) {
  #letterModal .chat-popup-card {
    width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    min-height: calc(100dvh - 20px) !important;
    padding: 18px !important;
    border-radius: 26px !important;
  }
  #letterForm.chat-tool-card {
    grid-template-rows: auto auto minmax(220px, 1fr) auto !important;
  }
}

/* Cinema drawer hard fix: keep panels offscreen unless opened. */
body.route-cinema .cinema-overlay-layout .cinema-slide-panel,
.cinema-overlay-layout .cinema-slide-panel {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
body.route-cinema .cinema-overlay-layout .cinema-controls-panel,
.cinema-overlay-layout .cinema-controls-panel {
  transform: translateX(calc(-100% - 60px)) !important;
}
body.route-cinema .cinema-overlay-layout .cinema-setup-panel,
.cinema-overlay-layout .cinema-setup-panel {
  transform: translateX(calc(100% + 60px)) !important;
}
body.route-cinema .cinema-overlay-layout .cinema-slide-panel.open,
.cinema-overlay-layout .cinema-slide-panel.open {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  transform: translateX(0) !important;
}
body.route-cinema .cinema-overlay-layout .cinema-panel-backdrop,
.cinema-overlay-layout .cinema-panel-backdrop {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.route-cinema .cinema-overlay-layout.cinema-any-panel-open .cinema-panel-backdrop,
.cinema-overlay-layout.cinema-any-panel-open .cinema-panel-backdrop {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ==============================
   v3.1.3 cinema/radio/journal/nav polish
   Upload picker fallback untouched.
   ============================== */

/* Compact map-style top navigation preference */
html[data-nav="compact"] .topbar {
  width: min(1160px, calc(100vw - 26px));
  margin-inline: auto;
}
html[data-nav="compact"] .topbar-inner {
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(20, 17, 24, .78);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 16px 42px rgba(0,0,0,.28);
  backdrop-filter: blur(20px);
}
html[data-nav="compact"] .brand {
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
}
html[data-nav="compact"] .brand .brand-dot { width: 24px; height: 24px; }
html[data-nav="compact"] .room-nav { gap: 4px; }
html[data-nav="compact"] .room-nav a {
  min-height: 34px;
  padding: 7px 12px;
  font-size: .9rem;
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
}
html[data-nav="compact"] .room-nav a.active {
  background: var(--paper);
  color: var(--ink);
}
html[data-nav="compact"] .top-actions { gap: 6px; }
html[data-nav="compact"] .more-nav summary,
html[data-nav="compact"] .profile-chip,
html[data-nav="compact"] #logoutButton {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
}
html[data-nav="compact"] .profile-avatar { width: 26px; height: 26px; }

/* Cinema placeholder */
.cinema-video-viewport { background: radial-gradient(circle at 50% 45%, rgba(215,168,110,.12), transparent 28%), #050507; }
.cinema-empty-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: rgba(245,239,229,.86);
  background:
    radial-gradient(circle at 45% 44%, rgba(215,168,110,.22), transparent 16%),
    radial-gradient(circle at 58% 56%, rgba(116,94,255,.13), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(0,0,0,.26));
  transition: opacity .28s ease, transform .28s ease;
  pointer-events: none;
}
.cinema-video-viewport.has-media .cinema-empty-placeholder,
.cinema-video-viewport video[src] ~ .cinema-empty-placeholder {
  opacity: 0;
  transform: scale(.985);
  visibility: hidden;
}
.cinema-empty-placeholder strong {
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: -.04em;
}
.cinema-empty-placeholder small {
  max-width: 340px;
  color: rgba(245,239,229,.62);
  font-weight: 800;
}
.cinema-orbit {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  position: relative;
  border: 1px solid rgba(245,239,229,.18);
  box-shadow: inset 0 0 50px rgba(215,168,110,.08), 0 18px 60px rgba(0,0,0,.26);
  animation: odhOrbitPulse 4.2s ease-in-out infinite;
}
.cinema-orbit span { position:absolute; width:10px; height:10px; border-radius:999px; background: var(--gold); box-shadow:0 0 18px rgba(215,168,110,.55); }
.cinema-orbit span:nth-child(1) { left: 12px; top: 20px; }
.cinema-orbit span:nth-child(2) { right: 12px; top: 34px; animation-delay:.7s; }
.cinema-orbit span:nth-child(3) { left: 38px; bottom: 10px; animation-delay:1.4s; }
@keyframes odhOrbitPulse { 0%,100% { transform: translateY(0); opacity:.86; } 50% { transform: translateY(-5px); opacity:1; } }

/* Cinema stored movie cards: no clipped option popovers. Edit expands inline. */
body.route-cinema .cinema-movie-list,
.cinema-movie-list {
  gap: 12px;
  overflow-x: hidden;
}
body.route-cinema .cinema-movie-card,
.cinema-movie-card-compact {
  position: relative;
  display: grid !important;
  grid-template-columns: 82px minmax(0, 1fr) !important;
  gap: 12px !important;
  overflow: visible !important;
  align-items: start;
}
body.route-cinema .cinema-movie-poster { width: 82px !important; }
.cinema-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.cinema-card-actions button { flex: 1 1 118px; min-height: 36px; }
.cinema-movie-edit-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}
.cinema-movie-edit-panel.hidden { display: none !important; }
.cinema-edit-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}
.cinema-edit-grid .wide { grid-column: 1 / -1; }
.cinema-edit-grid textarea { min-height: 86px; resize: vertical; }
.cinema-edit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.cinema-edit-actions button { width: 100%; }
.cinema-subtitle-options { margin-top: 4px; }
@media (max-width: 560px) {
  body.route-cinema .cinema-movie-card,
  .cinema-movie-card-compact { grid-template-columns: 68px minmax(0,1fr) !important; }
  body.route-cinema .cinema-movie-poster { width: 68px !important; }
  .cinema-edit-grid, .cinema-edit-actions { grid-template-columns: 1fr; }
}

/* Radio: stable chat, no recurring flicker from unchanged messages. */
.radio-messages { contain: layout paint; }
.radio-msg { animation: none !important; }
.radio-msg:last-child { animation: radioFadeIn .24s ease both !important; }

/* Journal: full work surface, editor centered, sidebar hidden until requested. */
body[data-route="journal"] {
  overflow: hidden !important;
}
body[data-route="journal"] .page {
  min-height: 100dvh;
  padding: 14px !important;
}
body[data-route="journal"] .wrap,
body[data-route="journal"] .main,
body[data-route="journal"] .journal-room {
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100dvh - 28px) !important;
  margin: 0 !important;
  padding: 0 !important;
}
body[data-route="journal"] .topbar {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 14px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(1120px, calc(100vw - 28px)) !important;
  z-index: 1400 !important;
  margin: 0 !important;
}
body[data-route="journal"] .journal-focus-room {
  position: relative;
  overflow: hidden;
  min-height: calc(100dvh - 28px) !important;
}
body[data-route="journal"] .journal-focus-stage {
  width: min(1240px, calc(100vw - 34px)) !important;
  min-height: calc(100dvh - 132px) !important;
  margin: 104px auto 14px !important;
}
body[data-route="journal"] .journal-page-editor {
  min-height: calc(100dvh - 132px) !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  border-radius: 34px !important;
}
body[data-route="journal"] .journal-body-label textarea {
  min-height: 0 !important;
  height: 100% !important;
  resize: none !important;
  font-size: clamp(1.04rem, 1.4vw, 1.2rem);
}
body[data-route="journal"] .journal-sidebar-toggle {
  position: fixed !important;
  right: 24px !important;
  top: 94px !important;
  z-index: 1500 !important;
}
body[data-route="journal"] .journal-side-drawer {
  position: fixed !important;
  top: 88px !important;
  right: 18px !important;
  bottom: 18px !important;
  z-index: 1800 !important;
}
@media (max-width: 760px) {
  body[data-route="journal"] .journal-focus-stage { width: calc(100vw - 18px) !important; margin-top: 86px !important; }
  body[data-route="journal"] .journal-page-editor { padding: 18px !important; border-radius: 26px !important; }
  body[data-route="journal"] .journal-editor-top h1 { font-size: clamp(3rem, 16vw, 5rem); }
  body[data-route="journal"] .journal-sidebar-toggle { top: auto !important; bottom: 18px !important; right: 18px !important; }
}
body.route-cinema .page {
  padding: clamp(10px, 2vw, 20px) !important;
  background: #0b0a10;
}
body.route-cinema .wrap,
body.route-cinema .main,
body.route-cinema .room-view,
body.route-cinema .cinema-stage-room {
  min-height: calc(100dvh - clamp(20px, 4vw, 40px)) !important;
  height: calc(100dvh - clamp(20px, 4vw, 40px)) !important;
}
body.route-cinema .cinema-stage-room {
  position: relative !important;
  overflow: hidden !important;
  border-radius: clamp(18px, 2.4vw, 34px) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 34px 120px rgba(0,0,0,.56) !important;
  background:
    radial-gradient(circle at 18% 14%, rgba(215,168,110,.18), transparent 28%),
    radial-gradient(circle at 87% 22%, rgba(80,104,255,.16), transparent 26%),
    linear-gradient(180deg, rgba(0,0,0,.96), rgba(9,8,13,.98));
}
body.route-cinema .cinema-stage-room::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  opacity: .55;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,.56) 28%, rgba(0,0,0,.9)),
    radial-gradient(ellipse at 50% 100%, rgba(118,20,28,.88), transparent 62%);
}
body.route-cinema .cinema-view {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transform: translateY(18px) scale(.992);
  pointer-events: none;
  transition: opacity .34s ease, transform .34s ease;
}
body.route-cinema .cinema-view.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
body.route-cinema .cinema-window-shell {
  position: absolute;
  inset: 0;
  padding: clamp(16px, 3.2vw, 48px);
  display: grid;
  grid-template-rows: auto minmax(220px, .88fr) minmax(180px, .78fr);
  gap: clamp(14px, 2vw, 24px);
  overflow: hidden;
}
body.route-cinema .cinema-library-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 5;
}
body.route-cinema .cinema-mini-nav,
body.route-cinema .cinema-library-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
body.route-cinema .cinema-mini-nav a,
body.route-cinema .cinema-mini-nav button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,249,240,.76);
  box-shadow: none;
  font-size: .88rem;
  font-weight: 850;
}
body.route-cinema .cinema-mini-nav a:hover,
body.route-cinema .cinema-mini-nav button:hover,
body.route-cinema .cinema-mini-nav button.active {
  color: #fff9f0;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
body.route-cinema .cinema-library-hero {
  min-height: 0;
  display: grid;
  align-items: center;
}
body.route-cinema .cinema-library-hero-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(120px, 210px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
  width: min(920px, 100%);
}
body.route-cinema .cinema-library-hero-empty {
  grid-template-columns: 1fr;
  width: min(720px, 100%);
}
body.route-cinema .cinema-hero-poster-wrap {
  width: min(210px, 22vw);
  min-width: 120px;
}
body.route-cinema .cinema-hero-poster {
  width: 100% !important;
  aspect-ratio: 2 / 3;
  border-radius: 22px !important;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12) inset;
}
body.route-cinema .cinema-hero-copy {
  min-width: 0;
  max-width: 680px;
}
body.route-cinema .cinema-hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 5.4vw, 5.6rem);
  letter-spacing: -.075em;
  line-height: .9;
  overflow-wrap: anywhere;
}
body.route-cinema .cinema-hero-copy p {
  margin: 12px 0 0;
  max-width: 620px;
  color: rgba(255,249,240,.72);
  line-height: 1.55;
}
body.route-cinema .cinema-hero-meta,
body.route-cinema .cinema-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
body.route-cinema .cinema-hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: rgba(255,249,240,.78);
  font-size: .78rem;
  font-weight: 850;
}
body.route-cinema .cinema-hero-actions {
  margin-top: 18px;
}
body.route-cinema .cinema-primary-action,
body.route-cinema .cinema-hero-actions button:not(.secondary) {
  background: linear-gradient(135deg, #fff2d6, #d7a86e) !important;
  color: #171019 !important;
  border: 0 !important;
}
body.route-cinema .cinema-library-panel {
  min-height: 0;
  overflow: hidden;
}
body.route-cinema .cinema-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
body.route-cinema .cinema-section-head h2 {
  font-size: 1rem;
  letter-spacing: -.03em;
}
body.route-cinema .cinema-section-head span {
  color: rgba(255,249,240,.58);
  font-size: .82rem;
  font-weight: 760;
}
body.route-cinema .cinema-poster-rail {
  display: flex !important;
  gap: clamp(12px, 1.5vw, 18px) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 4px 2px 18px !important;
  scroll-snap-type: x proximity;
}
body.route-cinema .cinema-poster-rail::-webkit-scrollbar { height: 8px; }
body.route-cinema .cinema-poster-rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }
body.route-cinema .cinema-library-card {
  flex: 0 0 clamp(150px, 15.5vw, 210px);
  width: clamp(150px, 15.5vw, 210px);
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scroll-snap-align: start;
  transition: transform .22s ease, filter .22s ease;
}
body.route-cinema .cinema-library-card:hover {
  transform: translateY(-6px);
  filter: brightness(1.08);
}
body.route-cinema .cinema-library-card .cinema-movie-poster {
  width: 100% !important;
  aspect-ratio: 2 / 3;
  border-radius: 17px !important;
}
body.route-cinema .cinema-library-card .cinema-movie-info {
  display: grid;
  gap: 7px;
}
body.route-cinema .cinema-library-card .cinema-movie-topline strong {
  font-size: .95rem !important;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
body.route-cinema .cinema-library-card .cinema-movie-meta,
body.route-cinema .cinema-library-card .cinema-subtitle-line,
body.route-cinema .cinema-library-card .movie-info-text {
  display: none;
}
body.route-cinema .cinema-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
body.route-cinema .cinema-card-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: .8rem;
}
body.route-cinema .cinema-movie-edit-panel:not(.hidden) {
  position: fixed;
  z-index: 950;
  top: clamp(20px, 4vw, 46px);
  right: clamp(16px, 3vw, 46px);
  bottom: clamp(16px, 3vw, 46px);
  width: min(430px, calc(100vw - 32px));
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 28px;
  background: rgba(14,11,18,.94);
  backdrop-filter: blur(26px);
  box-shadow: 0 32px 110px rgba(0,0,0,.6);
  padding: 18px;
}
body.route-cinema .cinema-local-card,
body.route-cinema .cinema-upload-card {
  max-width: min(980px, 100%);
  max-height: 100%;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 28px;
  background: rgba(255,255,255,.055);
  padding: clamp(16px, 2.4vw, 24px);
  backdrop-filter: blur(20px);
}
body.route-cinema .cinema-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
body.route-cinema .cinema-back-arrow {
  position: absolute;
  z-index: 40;
  top: clamp(16px, 2.5vw, 30px);
  left: clamp(16px, 2.5vw, 30px);
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,8,14,.62);
  color: #fff9f0;
  box-shadow: 0 18px 50px rgba(0,0,0,.32);
  backdrop-filter: blur(18px);
}
body.route-cinema .cinema-back-arrow[hidden] { display: none !important; }
body.route-cinema .cinema-loading-screen {
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
}
body.route-cinema .cinema-loading-card {
  width: min(760px, 100%);
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 42px);
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  box-shadow: 0 28px 100px rgba(0,0,0,.45);
  backdrop-filter: blur(24px);
}
body.route-cinema .cinema-loader-ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 4px;
}
body.route-cinema .cinema-loader-ring span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  border-top-color: rgba(255,242,214,.96);
  animation: cinemaSpin 1.4s linear infinite;
}
body.route-cinema .cinema-loader-ring span:nth-child(2) {
  inset: 13px;
  animation-duration: 1.85s;
  animation-direction: reverse;
  border-top-color: rgba(215,168,110,.88);
}
body.route-cinema .cinema-loader-ring span:nth-child(3) {
  inset: 28px;
  animation-duration: 2.2s;
  border-top-color: rgba(255,255,255,.46);
}
@keyframes cinemaSpin { to { transform: rotate(360deg); } }
body.route-cinema .cinema-load-head-large strong {
  display: block;
  max-width: 100%;
  font-size: clamp(1.6rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
body.route-cinema .cinema-load-head-large > span {
  font-size: clamp(2.1rem, 5vw, 5rem);
  font-weight: 950;
  letter-spacing: -.08em;
  color: #fff2d6;
}
body.route-cinema .cinema-progress-bar-large {
  height: 12px !important;
  background: rgba(255,255,255,.12) !important;
}
body.route-cinema .cinema-progress-bar-large span {
  background: linear-gradient(90deg, #d7a86e, #fff2d6) !important;
}
body.route-cinema .cinema-watch-screen .cinema-player.dark-panel {
  position: absolute !important;
  inset: 0 !important;
  padding: 0 !important;
  border-radius: inherit !important;
  border: 0 !important;
  overflow: hidden !important;
  background: #020204 !important;
}
body.route-cinema .cinema-watch-screen .cinema-video-viewport,
body.route-cinema .cinema-watch-screen .video-shell,
body.route-cinema .cinema-watch-screen video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: inherit !important;
}
body.route-cinema .cinema-player-controls {
  position: absolute;
  z-index: 22;
  left: clamp(16px, 2vw, 26px);
  right: clamp(16px, 2vw, 26px);
  bottom: clamp(16px, 2vw, 26px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}
body.route-cinema .cinema-player-controls > * {
  pointer-events: auto;
}
body.route-cinema .cinema-player-controls .cinema-sync-row,
body.route-cinema .cinema-player-controls .cinema-subtitle-control-box {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,7,12,.62);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 70px rgba(0,0,0,.28);
  padding: 10px;
}
body.route-cinema .cinema-player-controls .cinema-subtitle-control-box {
  width: min(380px, 42vw);
}
body.route-cinema .cinema-readiness-dock {
  position: absolute;
  z-index: 24;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
body.route-cinema .cinema-show-loading .cinema-readiness-dock,
body.route-cinema .cinema-show-player .cinema-readiness-dock {
  opacity: 1;
  transform: none;
}
body.route-cinema .cinema-show-loading .cinema-readiness-dock {
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(20px, 4vw, 56px);
  width: min(420px, calc(100vw - 40px));
}
body.route-cinema .cinema-show-player .cinema-readiness-dock {
  right: clamp(16px, 2vw, 26px);
  top: clamp(72px, 9vw, 98px);
  width: min(360px, calc(100vw - 32px));
}
body.route-cinema .cinema-ready-grid {
  display: grid !important;
  gap: 10px !important;
  max-height: min(52vh, 440px);
  overflow-y: auto;
  pointer-events: auto;
}
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(8,7,12,.64);
  border-radius: 20px;
  padding: 12px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 58px rgba(0,0,0,.25);
}
body.route-cinema .ready-summary strong,
body.route-cinema .ready-card strong {
  color: rgba(255,249,240,.94);
}
body.route-cinema .ready-summary span,
body.route-cinema .ready-card span,
body.route-cinema .ready-card em,
body.route-cinema .ready-card small {
  color: rgba(255,249,240,.66);
  font-size: .78rem;
}
body.route-cinema .ready-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.route-cinema .ready-card.is-ready {
  border-color: rgba(215,168,110,.38);
}
body.route-cinema .ready-card.is-ready .cinema-progress-bar span,
body.route-cinema .ready-summary .cinema-progress-bar span {
  background: linear-gradient(90deg, #d7a86e, #fff2d6);
}
body.route-cinema .cinema-now-strip {
  left: clamp(16px, 2vw, 26px) !important;
  top: clamp(70px, 8vw, 92px) !important;
  bottom: auto !important;
}
body.route-cinema .play-gate {
  bottom: clamp(110px, 13vw, 138px) !important;
}
body.route-cinema .cinema-empty-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255,249,240,.7);
  pointer-events: none;
}
body.route-cinema .cinema-video-viewport.has-media .cinema-empty-placeholder {
  display: none;
}
@media (max-width: 860px) {
  body.route-cinema .cinema-window-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow-y: auto;
  }
  body.route-cinema .cinema-library-nav,
  body.route-cinema .cinema-player-controls {
    align-items: stretch;
    flex-direction: column;
  }
  body.route-cinema .cinema-library-hero-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }
  body.route-cinema .cinema-hero-poster-wrap {
    width: 92px;
  }
  body.route-cinema .cinema-hero-copy h1 {
    font-size: clamp(1.8rem, 9vw, 3.2rem);
  }
  body.route-cinema .cinema-upload-grid,
  body.route-cinema .quick-form-grid {
    grid-template-columns: 1fr;
  }
  body.route-cinema .cinema-player-controls .cinema-subtitle-control-box {
    width: 100%;
  }
  body.route-cinema .cinema-show-player .cinema-readiness-dock {
    display: none;
  }
  body.route-cinema .cinema-show-loading .cinema-readiness-dock {
    left: 20px;
    right: 20px;
    width: auto;
  }
}

/* v3.1.5 Cinema UI reset: full-screen carousel, disk-backed preload friendly */
body.route-cinema {
  overflow: hidden !important;
  background: #050507 !important;
}
body.route-cinema .page,
body.route-cinema .wrap,
body.route-cinema .main,
body.route-cinema .room-view,
body.route-cinema .cinema-stage-room {
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-stage-room {
  position: fixed !important;
  inset: 0 !important;
  display: block !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #f7efe4 !important;
}
body.route-cinema .cinema-view {
  position: absolute !important;
  inset: 0 !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(.992);
  transition: opacity .24s ease, transform .28s ease;
}
body.route-cinema .cinema-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
body.route-cinema .cinema-window-shell {
  width: 100vw !important;
  height: 100dvh !important;
  padding: clamp(18px, 3vw, 44px) clamp(18px, 4vw, 68px) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: clamp(14px, 2vw, 28px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 70% 18%, rgba(67, 83, 170, .25), transparent 34%),
    radial-gradient(circle at 18% 78%, rgba(180, 95, 57, .18), transparent 36%),
    linear-gradient(135deg, #050505 0%, #07070b 54%, #0b0c18 100%) !important;
}
body.route-cinema .cinema-library-nav {
  position: relative !important;
  z-index: 20 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
body.route-cinema .cinema-mini-nav {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}
body.route-cinema .cinema-mini-nav a,
body.route-cinema .cinema-mini-nav button,
body.route-cinema .cinema-library-actions button {
  min-height: 38px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(255,255,255,.07) !important;
  color: rgba(255,249,240,.88) !important;
  font-weight: 750 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  backdrop-filter: blur(14px) !important;
  transition: transform .18s ease, background .18s ease, border-color .18s ease !important;
}
body.route-cinema .cinema-mini-nav a:hover,
body.route-cinema .cinema-mini-nav button:hover,
body.route-cinema .cinema-library-actions button:hover {
  transform: translateY(-1px) !important;
  background: rgba(255,255,255,.13) !important;
}
body.route-cinema .cinema-mini-nav button.active {
  background: rgba(245, 224, 185, .20) !important;
  border-color: rgba(245, 224, 185, .34) !important;
  color: #fff8ee !important;
}
body.route-cinema .cinema-library-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
body.route-cinema #storageStatus {
  max-width: min(42vw, 520px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body.route-cinema .cinema-library-panel[data-cinema-panel="stored"] {
  display: contents !important;
}
body.route-cinema .cinema-library-panel.hidden[data-cinema-panel="stored"] {
  display: none !important;
}
body.route-cinema .cinema-library-hero {
  min-height: 0 !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-focus-card {
  width: min(1100px, 92vw) !important;
  height: 100% !important;
  max-height: min(65vh, 700px) !important;
  display: grid !important;
  grid-template-rows: minmax(230px, 1fr) auto !important;
  justify-items: center !important;
  align-content: center !important;
  gap: clamp(14px, 2vh, 22px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  animation: cinemaFocusIn .32s ease both !important;
}
@keyframes cinemaFocusIn {
  from { opacity: 0; transform: translateX(18px) scale(.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
body.route-cinema .cinema-focus-poster-wrap,
body.route-cinema .cinema-focus-poster {
  width: min(250px, 38vw) !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  box-shadow: 0 28px 90px rgba(0,0,0,.62), 0 0 0 1px rgba(255,255,255,.14) inset !important;
}
body.route-cinema .cinema-focus-poster {
  width: 100% !important;
  height: 100% !important;
  background-size: cover !important;
  background-position: center !important;
}
body.route-cinema .cinema-empty-poster {
  display: grid !important;
  place-items: center !important;
  background: rgba(255,255,255,.08) !important;
}
body.route-cinema .cinema-focus-info {
  width: min(840px, 92vw) !important;
  display: grid !important;
  justify-items: center !important;
  gap: 10px !important;
  text-align: center !important;
}
body.route-cinema .cinema-focus-info h1 {
  max-width: 100% !important;
  margin: 0 !important;
  font-size: clamp(2rem, 6vw, 5.8rem) !important;
  line-height: .88 !important;
  letter-spacing: -.075em !important;
  color: #fff8ec !important;
  overflow-wrap: anywhere !important;
}
body.route-cinema .cinema-focus-info p {
  max-width: 720px !important;
  margin: 0 !important;
  color: rgba(255,249,240,.72) !important;
  font-weight: 560 !important;
}
body.route-cinema .cinema-focus-meta {
  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
body.route-cinema .cinema-focus-meta span,
body.route-cinema .movie-rating-pill {
  border-radius: 999px !important;
  padding: 6px 10px !important;
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,249,240,.86) !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
}
body.route-cinema .cinema-focus-actions {
  display: flex !important;
  justify-content: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  padding-top: 4px !important;
}
body.route-cinema .cinema-focus-actions button,
body.route-cinema .cinema-edit-actions button,
body.route-cinema .form-actions button {
  border-radius: 999px !important;
  min-height: 42px !important;
  padding: 0 18px !important;
}
body.route-cinema .cinema-section-head {
  display: none !important;
}
body.route-cinema .cinema-carousel-frame {
  position: relative !important;
  min-height: 182px !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  z-index: 20 !important;
}
body.route-cinema .cinema-carousel-arrow {
  width: 44px !important;
  height: 64px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.07) !important;
  color: rgba(255,249,240,.9) !important;
  font-size: 2rem !important;
  cursor: pointer !important;
  backdrop-filter: blur(14px) !important;
}
body.route-cinema .cinema-poster-rail {
  max-height: none !important;
  height: 178px !important;
  display: flex !important;
  gap: 16px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  padding: 6px 6px 18px !important;
  scrollbar-width: thin !important;
}
body.route-cinema .cinema-carousel-card {
  flex: 0 0 clamp(112px, 12vw, 150px) !important;
  width: clamp(112px, 12vw, 150px) !important;
  min-height: unset !important;
  display: grid !important;
  grid-template-rows: 1fr auto !important;
  gap: 8px !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: transparent !important;
  box-shadow: none !important;
  scroll-snap-align: center !important;
  cursor: pointer !important;
  opacity: .72 !important;
  transform: scale(.96) !important;
  transition: transform .18s ease, opacity .18s ease !important;
}
body.route-cinema .cinema-carousel-card:hover,
body.route-cinema .cinema-carousel-card.selected {
  opacity: 1 !important;
  transform: scale(1) translateY(-2px) !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  box-shadow: 0 18px 44px rgba(0,0,0,.56), 0 0 0 2px rgba(245, 224, 185, .72) inset !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  width: 100% !important;
  aspect-ratio: 2/3 !important;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 16px !important;
  background-size: cover !important;
  background-position: center !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info {
  display: grid !important;
  gap: 3px !important;
  padding: 0 2px !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info strong {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: .86rem !important;
  color: #fff8ec !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-meta,
body.route-cinema .cinema-carousel-card .movie-rating-pill {
  display: none !important;
}
body.route-cinema .cinema-tab-panel:not([data-cinema-panel="stored"]) {
  width: min(720px, calc(100vw - 34px)) !important;
  max-height: calc(100dvh - 130px) !important;
  overflow: auto !important;
  place-self: center !important;
  padding: 24px !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(10,10,14,.74) !important;
  backdrop-filter: blur(24px) !important;
}
body.route-cinema .cinema-loading-screen {
  display: grid !important;
  place-items: center !important;
  background:
    radial-gradient(circle at 50% 28%, rgba(245,224,185,.10), transparent 36%),
    linear-gradient(145deg, #050506, #0b0b12) !important;
}
body.route-cinema .cinema-loading-card {
  width: min(680px, calc(100vw - 42px)) !important;
  display: grid !important;
  gap: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}
body.route-cinema .cinema-loading-line {
  width: 84px !important;
  height: 2px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.12) !important;
}
body.route-cinema .cinema-loading-line span {
  display: block !important;
  width: 35% !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: rgba(245,224,185,.86) !important;
  animation: cinemaLoadSweep 1.35s ease-in-out infinite !important;
}
@keyframes cinemaLoadSweep {
  0% { transform: translateX(-120%); }
  55% { transform: translateX(250%); }
  100% { transform: translateX(250%); }
}
body.route-cinema .cinema-loader-ring,
body.route-cinema .cinema-orbit { display: none !important; }
body.route-cinema .cinema-progress-bar {
  height: 9px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: rgba(255,255,255,.10) !important;
}
body.route-cinema .cinema-progress-bar span {
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, rgba(245,224,185,.92), rgba(255,255,255,.86)) !important;
  transition: width .28s ease !important;
}
body.route-cinema .cinema-back-arrow {
  position: fixed !important;
  top: 18px !important;
  left: 18px !important;
  z-index: 900 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(8,8,10,.62) !important;
  color: #fff8ec !important;
  backdrop-filter: blur(14px) !important;
  cursor: pointer !important;
}
body.route-cinema .cinema-watch-screen {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  background: #020203 !important;
}
body.route-cinema .cinema-player.dark-panel,
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
}
body.route-cinema .cinema-player-controls {
  position: absolute !important;
  left: 18px !important;
  right: 18px !important;
  bottom: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 12px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(0,0,0,.48) !important;
  backdrop-filter: blur(18px) !important;
  z-index: 40 !important;
}
body.route-cinema .cinema-readiness-dock {
  position: fixed !important;
  right: 18px !important;
  top: 84px !important;
  z-index: 50 !important;
  width: min(360px, calc(100vw - 36px)) !important;
  pointer-events: none !important;
}
body.route-cinema .cinema-show-library .cinema-readiness-dock { display: none !important; }
body.route-cinema .ready-grid,
body.route-cinema .cinema-ready-grid {
  display: grid !important;
  gap: 10px !important;
}
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  padding: 12px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(0,0,0,.44) !important;
  backdrop-filter: blur(14px) !important;
}
body.route-cinema .ready-card-top {
  display: flex !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
body.route-cinema .cinema-edit-modal.hidden { display: none !important; }
body.route-cinema .cinema-edit-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
  background: rgba(0,0,0,.62) !important;
  backdrop-filter: blur(14px) !important;
}
body.route-cinema .cinema-edit-modal-card {
  position: relative !important;
  width: min(760px, calc(100vw - 34px)) !important;
  max-height: min(84dvh, 760px) !important;
  overflow: auto !important;
  padding: clamp(18px, 3vw, 30px) !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(12,12,16,.92) !important;
  box-shadow: 0 34px 110px rgba(0,0,0,.58) !important;
}
body.route-cinema .cinema-modal-close {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 999px !important;
}
body.route-cinema .cinema-edit-modal-head {
  display: flex !important;
  justify-content: space-between !important;
  gap: 16px !important;
  align-items: start !important;
  margin-bottom: 18px !important;
}
body.route-cinema .cinema-edit-modal-head h2 {
  margin: 0 !important;
  font-size: clamp(1.6rem, 4vw, 3rem) !important;
  line-height: .94 !important;
  letter-spacing: -.04em !important;
  color: #fff8ec !important;
}
body.route-cinema .cinema-edit-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
body.route-cinema .cinema-edit-grid .wide { grid-column: 1 / -1 !important; }
body.route-cinema .cinema-edit-grid input,
body.route-cinema .cinema-edit-grid textarea,
body.route-cinema .cinema-tab-panel input,
body.route-cinema .cinema-tab-panel textarea {
  color: #fff8ec !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}
body.route-cinema .cinema-edit-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin: 16px 0 !important;
}
body.route-cinema .cinema-subtitle-options {
  padding: 14px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
@media (max-width: 760px) {
  body.route-cinema .cinema-window-shell { padding: 16px !important; }
  body.route-cinema .cinema-library-nav { align-items: stretch !important; flex-direction: column !important; }
  body.route-cinema .cinema-library-actions { justify-content: space-between !important; }
  body.route-cinema #storageStatus { max-width: 100% !important; }
  body.route-cinema .cinema-focus-card { max-height: min(58vh, 560px) !important; }
  body.route-cinema .cinema-focus-poster-wrap,
  body.route-cinema .cinema-focus-poster { width: min(190px, 46vw) !important; }
  body.route-cinema .cinema-carousel-frame { grid-template-columns: minmax(0, 1fr) !important; }
  body.route-cinema .cinema-carousel-arrow { display: none !important; }
  body.route-cinema .cinema-player-controls { align-items: stretch !important; flex-direction: column !important; }
  body.route-cinema .cinema-edit-grid { grid-template-columns: 1fr !important; }
}

/* v3.1.6: cinema reference UI correction — poster rail first, detail below, full viewport */
body.route-cinema {
  overflow: hidden !important;
  background: #020203 !important;
}
body.route-cinema .page,
body.route-cinema .wrap,
body.route-cinema .main,
body.route-cinema .room-view,
body.route-cinema .cinema-stage-room {
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-stage-room {
  position: fixed !important;
  inset: 0 !important;
  color: #fff7ea !important;
  background: #030304 !important;
}
body.route-cinema .cinema-window-shell {
  width: 100vw !important;
  height: 100dvh !important;
  padding: clamp(20px, 3vw, 44px) clamp(18px, 3.8vw, 64px) clamp(24px, 3vw, 52px) !important;
  display: grid !important;
  grid-template-rows: auto minmax(238px, 42vh) minmax(220px, 1fr) !important;
  grid-template-columns: 1fr !important;
  gap: clamp(16px, 2vw, 26px) !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 78% 14%, rgba(41, 57, 150, .28), transparent 34%),
    radial-gradient(circle at 8% 78%, rgba(169, 72, 42, .20), transparent 38%),
    linear-gradient(180deg, rgba(5,5,6,.96) 0%, rgba(5,5,7,.92) 45%, rgba(7,2,4,.98) 100%) !important;
}
body.route-cinema .cinema-library-nav {
  position: relative !important;
  z-index: 50 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 0 !important;
  background: transparent !important;
  pointer-events: auto !important;
}
body.route-cinema .cinema-mini-nav,
body.route-cinema .cinema-library-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}
body.route-cinema .cinema-mini-nav a,
body.route-cinema .cinema-mini-nav button,
body.route-cinema .cinema-library-actions button {
  appearance: none !important;
  min-height: 38px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  background: rgba(255,255,255,.075) !important;
  color: rgba(255,248,235,.92) !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  backdrop-filter: blur(14px) !important;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease !important;
}
body.route-cinema .cinema-mini-nav a:hover,
body.route-cinema .cinema-mini-nav button:hover,
body.route-cinema .cinema-library-actions button:hover {
  transform: translateY(-1px) !important;
  background: rgba(255,255,255,.14) !important;
  border-color: rgba(255,255,255,.24) !important;
}
body.route-cinema .cinema-mini-nav button.active {
  background: rgba(245,224,185,.20) !important;
  border-color: rgba(245,224,185,.36) !important;
  color: #fff8ec !important;
}
body.route-cinema #storageStatus {
  max-width: min(36vw, 520px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  opacity: .72 !important;
}
body.route-cinema .cinema-library-panel[data-cinema-panel="stored"] {
  grid-row: 2 !important;
  display: block !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
body.route-cinema .cinema-library-panel.hidden[data-cinema-panel="stored"] { display: none !important; }
body.route-cinema .cinema-carousel-frame {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 18px !important;
  overflow: visible !important;
}
body.route-cinema .cinema-poster-rail {
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: clamp(18px, 2.4vw, 34px) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-padding-inline: 45vw !important;
  padding: 8px 12px 18px !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}
body.route-cinema .cinema-poster-rail::-webkit-scrollbar { display: none !important; }
body.route-cinema .cinema-carousel-card {
  flex: 0 0 clamp(126px, 12vw, 178px) !important;
  width: clamp(126px, 12vw, 178px) !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: block !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  scroll-snap-align: center !important;
  opacity: .58 !important;
  transform: scale(.90) translateY(8px) !important;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease, filter .22s ease !important;
  filter: saturate(.82) brightness(.88) !important;
}
body.route-cinema .cinema-carousel-card:hover,
body.route-cinema .cinema-carousel-card.selected {
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
  filter: saturate(1.05) brightness(1) !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  box-shadow: 0 26px 72px rgba(0,0,0,.62), 0 0 0 2px rgba(245,224,185,.72) inset !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  width: 100% !important;
  aspect-ratio: 2 / 3 !important;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid rgba(255,255,255,.11) !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster.no-poster {
  display: grid !important;
  place-items: center !important;
  padding: 12px !important;
  background:
    radial-gradient(circle at 40% 25%, rgba(245,224,185,.15), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025)) !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info { display: none !important; }
body.route-cinema .cinema-carousel-arrow {
  width: 46px !important;
  height: 58px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.075) !important;
  color: #fff7ea !important;
  font-size: 2.3rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  backdrop-filter: blur(16px) !important;
  transition: transform .16s ease, background .16s ease !important;
  z-index: 25 !important;
}
body.route-cinema .cinema-carousel-arrow:hover { transform: scale(1.04) !important; background: rgba(255,255,255,.14) !important; }
body.route-cinema .cinema-library-hero {
  grid-row: 3 !important;
  position: relative !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: block !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.46) 18%, rgba(0,0,0,.72) 100%) !important;
}
body.route-cinema .cinema-library-hero::before {
  content: "" !important;
  position: absolute !important;
  left: -5vw !important;
  right: -5vw !important;
  bottom: -5vh !important;
  height: min(36vh, 310px) !important;
  opacity: .82 !important;
  background:
    linear-gradient(90deg, transparent 0 4%, rgba(0,0,0,.36) 4% 5.2%, transparent 5.2% 11.8%, rgba(0,0,0,.36) 11.8% 13%, transparent 13% 20%),
    repeating-linear-gradient(90deg, rgba(98,14,19,.88) 0 72px, rgba(125,20,25,.90) 72px 132px, rgba(35,4,8,.95) 132px 146px),
    linear-gradient(180deg, rgba(140,22,28,.95), rgba(54,5,10,.98)) !important;
  clip-path: polygon(0 34%, 100% 10%, 100% 100%, 0 100%) !important;
  filter: blur(.2px) saturate(.9) !important;
  pointer-events: none !important;
}
body.route-cinema .cinema-library-hero::after {
  content: "" !important;
  position: absolute !important;
  left: 48% !important;
  bottom: -3vh !important;
  width: min(18vw, 230px) !important;
  height: min(36vh, 320px) !important;
  transform: translateX(-50%) perspective(240px) rotateX(38deg) !important;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.54) 0 4px, transparent 4px 34px),
    linear-gradient(90deg, transparent 0 24%, rgba(0,0,0,.78) 24% 76%, transparent 76% 100%) !important;
  opacity: .44 !important;
  pointer-events: none !important;
}
body.route-cinema .cinema-detail-panel {
  position: relative !important;
  z-index: 5 !important;
  width: min(680px, 56vw) !important;
  margin-top: clamp(4px, 1vh, 20px) !important;
  padding: 0 0 0 clamp(0px, 1vw, 12px) !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-detail-backdrop {
  position: fixed !important;
  right: -4vw !important;
  bottom: 1vh !important;
  width: min(38vw, 560px) !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 36px !important;
  background-size: cover !important;
  background-position: center !important;
  opacity: .08 !important;
  filter: blur(8px) saturate(.7) !important;
  pointer-events: none !important;
}
body.route-cinema .cinema-detail-copy {
  position: relative !important;
  z-index: 2 !important;
  animation: cinemaDetailIn .28s ease both !important;
}
@keyframes cinemaDetailIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
body.route-cinema .cinema-detail-panel .eyebrow {
  margin-bottom: 10px !important;
  color: rgba(255,248,235,.66) !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
}
body.route-cinema .cinema-detail-panel h1 {
  max-width: 14ch !important;
  margin: 0 0 10px !important;
  font-size: clamp(2.2rem, 5.2vw, 5.25rem) !important;
  line-height: .88 !important;
  letter-spacing: -.075em !important;
  color: #fff8ec !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 560px !important;
  margin: 12px 0 10px !important;
  color: rgba(255,248,235,.83) !important;
  font-weight: 650 !important;
  line-height: 1.55 !important;
}
body.route-cinema .cinema-focus-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 0 0 8px !important;
}
body.route-cinema .cinema-focus-meta span,
body.route-cinema .movie-rating-pill {
  border-radius: 999px !important;
  padding: 6px 10px !important;
  background: rgba(255,255,255,.11) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,248,235,.9) !important;
  font-weight: 850 !important;
  font-size: .82rem !important;
}
body.route-cinema .cinema-subtitle-line { color: rgba(255,248,235,.68) !important; font-weight: 750 !important; }
body.route-cinema .cinema-focus-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 18px !important;
}
body.route-cinema .cinema-focus-actions button,
body.route-cinema .cinema-edit-actions button,
body.route-cinema .form-actions button {
  min-height: 42px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  color: #fff8ec !important;
  background: rgba(255,255,255,.11) !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}
body.route-cinema .cinema-focus-actions .cinema-primary-action,
body.route-cinema .cinema-focus-actions button:first-child {
  color: #20170f !important;
  background: linear-gradient(135deg, #ffe8b4, #d5a968) !important;
  border-color: rgba(255,232,180,.72) !important;
}
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-hero { display: none !important; }
body.route-cinema .cinema-tab-panel:not([data-cinema-panel="stored"]) {
  grid-row: 2 / 4 !important;
  place-self: center !important;
  width: min(760px, calc(100vw - 34px)) !important;
  max-height: calc(100dvh - 128px) !important;
  overflow: auto !important;
  padding: 24px !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(8,8,12,.82) !important;
  backdrop-filter: blur(24px) !important;
  z-index: 40 !important;
}
body.route-cinema .cinema-tab-panel.hidden:not([data-cinema-panel="stored"]) { display: none !important; }
body.route-cinema .cinema-tab-panel input,
body.route-cinema .cinema-tab-panel textarea,
body.route-cinema .cinema-edit-grid input,
body.route-cinema .cinema-edit-grid textarea {
  color: #fff8ec !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}
body.route-cinema .cinema-loading-screen {
  display: grid !important;
  place-items: center !important;
  background: radial-gradient(circle at 50% 30%, rgba(245,224,185,.08), transparent 38%), #030304 !important;
}
body.route-cinema .cinema-loading-card {
  width: min(680px, calc(100vw - 42px)) !important;
  display: grid !important;
  gap: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-loading-line { display: none !important; }
body.route-cinema .cinema-load-head-large strong,
body.route-cinema #loadMovieTitle {
  display: block !important;
  font-size: clamp(2rem, 5vw, 4.8rem) !important;
  line-height: .9 !important;
  letter-spacing: -.065em !important;
  color: #fff8ec !important;
}
body.route-cinema .cinema-progress-bar {
  height: 8px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: rgba(255,255,255,.11) !important;
}
body.route-cinema .cinema-progress-bar span {
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #d5a968, #fff0c8) !important;
  transition: width .35s ease !important;
}
body.route-cinema .cinema-loader-ring,
body.route-cinema .cinema-orbit { display: none !important; }
body.route-cinema .cinema-readiness-dock {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  top: auto !important;
  z-index: 80 !important;
  width: min(380px, calc(100vw - 40px)) !important;
  pointer-events: none !important;
}
body.route-cinema .cinema-show-library .cinema-readiness-dock { display: none !important; }
body.route-cinema .ready-grid,
body.route-cinema .cinema-ready-grid { display: grid !important; gap: 8px !important; }
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  padding: 10px 12px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  background: rgba(0,0,0,.48) !important;
  backdrop-filter: blur(16px) !important;
  color: rgba(255,248,235,.86) !important;
}
body.route-cinema .ready-card small,
body.route-cinema .ready-card em,
body.route-cinema .ready-summary span { color: rgba(255,248,235,.66) !important; }
body.route-cinema .cinema-watch-screen { display: grid !important; grid-template-rows: 1fr !important; background: #000 !important; }
body.route-cinema .cinema-player.dark-panel,
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell,
body.route-cinema .cinema-player .video-shell video {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
}
body.route-cinema .cinema-player-controls {
  position: fixed !important;
  left: 20px !important;
  right: 420px !important;
  bottom: 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px !important;
  border-radius: 20px !important;
  background: rgba(0,0,0,.42) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  backdrop-filter: blur(18px) !important;
  z-index: 70 !important;
}
body.route-cinema .cinema-back-arrow {
  position: fixed !important;
  top: 18px !important;
  left: 18px !important;
  z-index: 900 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(5,5,6,.64) !important;
  color: #fff8ec !important;
  cursor: pointer !important;
  backdrop-filter: blur(14px) !important;
}
body.route-cinema .cinema-edit-modal.hidden { display: none !important; }
body.route-cinema .cinema-edit-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
  background: rgba(0,0,0,.68) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema .cinema-edit-modal-card {
  position: relative !important;
  width: min(780px, calc(100vw - 34px)) !important;
  max-height: min(84dvh, 780px) !important;
  overflow: auto !important;
  padding: clamp(18px, 3vw, 30px) !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(12,12,16,.94) !important;
  box-shadow: 0 34px 110px rgba(0,0,0,.58) !important;
}
@media (max-width: 900px) {
  body.route-cinema .cinema-window-shell { grid-template-rows: auto minmax(220px, 38vh) minmax(220px, 1fr) !important; padding: 16px !important; }
  body.route-cinema .cinema-library-nav { align-items: stretch !important; flex-direction: column !important; }
  body.route-cinema .cinema-library-actions { justify-content: space-between !important; }
  body.route-cinema #storageStatus { max-width: 100% !important; }
  body.route-cinema .cinema-carousel-frame { grid-template-columns: minmax(0, 1fr) !important; }
  body.route-cinema .cinema-carousel-arrow { display: none !important; }
  body.route-cinema .cinema-detail-panel { width: min(100%, 640px) !important; }
  body.route-cinema .cinema-detail-panel h1 { max-width: 11ch !important; font-size: clamp(2.1rem, 12vw, 4.2rem) !important; }
  body.route-cinema .cinema-player-controls { right: 20px !important; flex-direction: column !important; align-items: stretch !important; }
  body.route-cinema .cinema-readiness-dock { display: none !important; }
}


/* v3.1.7: cinema polish — shared topnav, cleaner library, autohide player controls */
body.route-cinema {
  --cinema-cream: rgba(255, 248, 235, .94);
  --cinema-muted: rgba(255, 248, 235, .66);
  --cinema-soft: rgba(255, 255, 255, .08);
  --cinema-border: rgba(255, 255, 255, .13);
  overflow: hidden !important;
  background: #050507 !important;
}
body.route-cinema .background { opacity: .22 !important; }
body.route-cinema .cinema-window-shell {
  padding-top: clamp(92px, 11vh, 122px) !important;
  grid-template-rows: auto minmax(210px, 37vh) minmax(230px, 1fr) !important;
  background:
    radial-gradient(circle at 77% 18%, rgba(57,74,139,.22), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(180,117,58,.10), transparent 36%),
    linear-gradient(180deg, rgba(5,5,7,.99) 0%, rgba(8,8,12,.97) 48%, rgba(5,5,7,.99) 100%) !important;
}
body.route-cinema .cinema-library-nav {
  z-index: 120 !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-top: 0 !important;
}
body.route-cinema .cinema-mini-nav a { display: none !important; }
body.route-cinema .cinema-mini-nav button,
body.route-cinema .cinema-library-actions button {
  min-height: 36px !important;
  padding: 0 16px !important;
  font-size: .82rem !important;
  font-weight: 780 !important;
  color: rgba(255,248,235,.88) !important;
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-mini-nav button.active {
  color: #241a10 !important;
  background: linear-gradient(135deg, #ffe8b4, #d5a968) !important;
  border-color: rgba(255,232,180,.60) !important;
}
body.route-cinema #storageStatus {
  color: rgba(255,248,235,.64) !important;
  background: transparent !important;
  border: 0 !important;
  font-weight: 760 !important;
}
body.route-cinema .cinema-carousel-frame { align-items: center !important; }
body.route-cinema .cinema-poster-rail {
  padding: 6px 10px 16px !important;
  justify-content: center !important;
}
body.route-cinema .cinema-carousel-card {
  flex-basis: clamp(132px, 11.4vw, 172px) !important;
  width: clamp(132px, 11.4vw, 172px) !important;
  opacity: .66 !important;
  filter: saturate(.88) brightness(.92) !important;
}
body.route-cinema .cinema-carousel-card.selected {
  opacity: 1 !important;
  transform: scale(1.04) translateY(-2px) !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster { border-radius: 20px !important; }
body.route-cinema .cinema-carousel-arrow {
  width: 44px !important;
  height: 50px !important;
  font-size: 2rem !important;
  background: rgba(255,255,255,.075) !important;
  color: rgba(255,248,235,.88) !important;
}
body.route-cinema .cinema-library-hero {
  display: grid !important;
  align-items: end !important;
  justify-items: start !important;
  padding: 0 clamp(26px, 5vw, 88px) clamp(24px, 5vh, 58px) !important;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.20) 48%, rgba(0,0,0,.42) 100%) !important;
  overflow: visible !important;
}
body.route-cinema .cinema-library-hero::before,
body.route-cinema .cinema-library-hero::after { display: none !important; content: none !important; }
body.route-cinema .cinema-detail-panel {
  width: min(720px, 58vw) !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  align-self: end !important;
  justify-self: start !important;
}
body.route-cinema .cinema-detail-copy { text-align: left !important; }
body.route-cinema .cinema-detail-backdrop {
  right: clamp(28px, 5vw, 86px) !important;
  bottom: 2vh !important;
  opacity: .07 !important;
  filter: blur(12px) saturate(.65) !important;
}
body.route-cinema .cinema-detail-panel .eyebrow {
  margin-bottom: 8px !important;
  font-size: .70rem !important;
  letter-spacing: .16em !important;
  color: var(--cinema-muted) !important;
}
body.route-cinema .cinema-detail-panel h1,
body.route-cinema #loadMovieTitle {
  max-width: min(840px, 76vw) !important;
  font-size: clamp(2.25rem, 4.6vw, 4.9rem) !important;
  line-height: .98 !important;
  letter-spacing: -.045em !important;
  font-weight: 820 !important;
  color: var(--cinema-cream) !important;
  text-align: left !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 640px !important;
  margin: 12px 0 8px !important;
  color: rgba(255,248,235,.76) !important;
  font-weight: 620 !important;
  line-height: 1.48 !important;
  text-align: left !important;
}
body.route-cinema .cinema-focus-meta { justify-content: flex-start !important; }
body.route-cinema .cinema-subtitle-line { color: rgba(255,248,235,.58) !important; }
body.route-cinema .cinema-focus-actions { justify-content: flex-start !important; }
body.route-cinema .cinema-loading-screen {
  background:
    radial-gradient(circle at 50% 42%, rgba(255,232,180,.055), transparent 36%),
    linear-gradient(180deg, #050507, #020203) !important;
}
body.route-cinema .cinema-load-head-large { align-items: end !important; }
body.route-cinema .cinema-load-head-large strong,
body.route-cinema #loadMovieTitle { letter-spacing: -.04em !important; font-weight: 800 !important; }
body.route-cinema .cinema-player-controls,
body.route-cinema .cinema-readiness-dock,
body.route-cinema .cinema-now-strip,
body.route-cinema .play-gate,
body.route-cinema .cinema-back-arrow {
  transition: opacity .22s ease, transform .22s ease, filter .22s ease !important;
}
body.route-cinema .cinema-player-controls {
  left: 18px !important;
  right: auto !important;
  bottom: 18px !important;
  width: min(780px, calc(100vw - 430px)) !important;
  max-width: calc(100vw - 36px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 350px) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 20px !important;
  background: rgba(5,5,7,.48) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(255,248,235,.88) !important;
}
body.route-cinema .cinema-sync-row { min-width: 0 !important; overflow: hidden !important; }
body.route-cinema .cinema-subtitle-control-box {
  min-width: 0 !important;
  padding: 10px !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
}
body.route-cinema .cinema-controls-hide,
body.route-cinema .cinema-controls-peek {
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.08) !important;
  color: rgba(255,248,235,.90) !important;
  font-weight: 830 !important;
  cursor: pointer !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema .cinema-controls-hide { white-space: nowrap !important; }
body.route-cinema .cinema-controls-peek {
  position: fixed !important;
  left: 18px !important;
  bottom: 18px !important;
  z-index: 120 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(10px) !important;
}
body.route-cinema .cinema-controls-hidden .cinema-player-controls,
body.route-cinema .cinema-controls-hidden .cinema-readiness-dock,
body.route-cinema .cinema-controls-hidden .cinema-now-strip,
body.route-cinema .cinema-controls-hidden .play-gate {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(16px) !important;
}
body.route-cinema .cinema-controls-hidden .cinema-controls-peek {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
body.route-cinema .cinema-readiness-dock {
  right: 18px !important;
  bottom: 18px !important;
  width: min(370px, calc(100vw - 36px)) !important;
}
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  background: rgba(5,5,7,.52) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.route-cinema .cinema-back-arrow {
  top: 82px !important;
  left: 18px !important;
  background: rgba(5,5,7,.56) !important;
}
@media (max-width: 980px) {
  body.route-cinema .cinema-window-shell { padding-top: 112px !important; grid-template-rows: auto minmax(190px, 34vh) minmax(220px, 1fr) !important; }
  body.route-cinema .cinema-library-nav { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  body.route-cinema .cinema-mini-nav,
  body.route-cinema .cinema-library-actions { justify-content: flex-start !important; }
  body.route-cinema .cinema-detail-panel { width: min(100%, 680px) !important; }
  body.route-cinema .cinema-detail-panel h1 { font-size: clamp(2rem, 9vw, 3.8rem) !important; letter-spacing: -.035em !important; }
  body.route-cinema .cinema-player-controls { width: calc(100vw - 36px) !important; grid-template-columns: 1fr !important; align-items: stretch !important; }
  body.route-cinema .cinema-readiness-dock { display: none !important; }
}
@media (max-width: 720px) {
  body.route-cinema .cinema-window-shell { padding: 112px 14px 20px !important; }
  body.route-cinema .cinema-poster-rail { justify-content: flex-start !important; }
  body.route-cinema .cinema-library-hero { padding-inline: 8px !important; }
  body.route-cinema .cinema-detail-panel h1 { max-width: 100% !important; }
  body.route-cinema .cinema-library-actions { align-items: stretch !important; }
  body.route-cinema #storageStatus { display: none !important; }
}

/* ==============================
   v3.1.9 Cinema cleanup
   Fix shared topnav alignment, keep player controls manual-only, clean library layout.
   ============================== */
body.route-cinema {
  --cinema-cream: #fff8ec;
  --cinema-muted: rgba(255,248,236,.66);
  overflow: hidden !important;
  background: #050507 !important;
}
body.route-cinema .background {
  background:
    radial-gradient(circle at 78% 16%, rgba(48,62,116,.24), transparent 34%),
    radial-gradient(circle at 8% 88%, rgba(189,126,66,.10), transparent 34%),
    linear-gradient(120deg, #050506 0%, #08080d 54%, #0c1020 100%) !important;
}
body.route-cinema .background::after { opacity: .04 !important; }
body.route-cinema .page {
  padding: 0 !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
  background: transparent !important;
}
body.route-cinema .wrap,
body.route-cinema .main,
body.route-cinema .room-view,
body.route-cinema .cinema-stage-room {
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-stage-room {
  position: relative !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background:
    radial-gradient(circle at 84% 20%, rgba(47,61,114,.22), transparent 34%),
    radial-gradient(circle at 8% 88%, rgba(159,101,54,.10), transparent 34%),
    linear-gradient(135deg, #050506 0%, #07070b 54%, #0b1020 100%) !important;
}
body.route-cinema .cinema-stage-room::before,
body.route-cinema .cinema-stage-room::after {
  display: none !important;
  content: none !important;
}

/* Library layout: carousel first, selected movie details below, all left aligned. */
body.route-cinema .cinema-window-shell {
  position: absolute !important;
  inset: 0 !important;
  padding: 88px clamp(28px, 4vw, 70px) 34px !important;
  display: grid !important;
  grid-template-rows: auto minmax(178px, 28vh) minmax(280px, 1fr) !important;
  gap: clamp(14px, 2.2vh, 24px) !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 84% 14%, rgba(48,62,116,.23), transparent 33%),
    radial-gradient(circle at 4% 88%, rgba(176,114,62,.10), transparent 33%),
    linear-gradient(135deg, rgba(5,5,6,.99), rgba(7,7,10,.98) 56%, rgba(9,12,23,.98)) !important;
}
body.route-cinema .cinema-library-nav {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  z-index: 20 !important;
}
body.route-cinema .cinema-mini-nav {
  justify-content: flex-start !important;
  gap: 9px !important;
}
body.route-cinema .cinema-mini-nav a { display: none !important; }
body.route-cinema .cinema-mini-nav button,
body.route-cinema .cinema-library-actions button {
  min-height: 38px !important;
  border-radius: 999px !important;
  padding: 0 16px !important;
  font-size: .84rem !important;
  font-weight: 820 !important;
  letter-spacing: -.01em !important;
  color: rgba(255,248,236,.88) !important;
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-mini-nav button.active {
  color: #21170d !important;
  background: linear-gradient(135deg, #ffe8b6, #d3a665) !important;
  border-color: rgba(255,232,182,.55) !important;
}
body.route-cinema #storageStatus {
  max-width: 42vw !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: rgba(255,248,236,.58) !important;
  background: transparent !important;
  border: 0 !important;
}
body.route-cinema .cinema-carousel-frame {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: 46px minmax(0,1fr) 46px !important;
  align-items: center !important;
  gap: 16px !important;
  z-index: 10 !important;
}
body.route-cinema .cinema-poster-rail {
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 18px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 6px 8px 18px !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: thin !important;
}
body.route-cinema .cinema-carousel-card {
  flex: 0 0 clamp(118px, 10.5vw, 158px) !important;
  width: clamp(118px, 10.5vw, 158px) !important;
  height: auto !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: .72 !important;
  transform: none !important;
  transition: opacity .18s ease, transform .18s ease, filter .18s ease !important;
}
body.route-cinema .cinema-carousel-card:hover { opacity: .92 !important; transform: translateY(-3px) !important; }
body.route-cinema .cinema-carousel-card.selected { opacity: 1 !important; transform: translateY(-4px) !important; }
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  width: 100% !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 18px !important;
  background-color: rgba(255,255,255,.055) !important;
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.34) !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  border-color: rgba(255,232,184,.28) !important;
  box-shadow: 0 22px 62px rgba(0,0,0,.46), 0 0 0 1px rgba(255,232,184,.18) !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info strong {
  font-size: .82rem !important;
  line-height: 1.16 !important;
  color: rgba(255,248,236,.92) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-meta,
body.route-cinema .cinema-carousel-card .movie-rating-pill { display: none !important; }
body.route-cinema .cinema-carousel-arrow {
  width: 44px !important;
  height: 54px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(255,255,255,.07) !important;
  color: rgba(255,248,236,.90) !important;
  font-size: 2rem !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-library-hero {
  min-height: 0 !important;
  display: grid !important;
  align-items: end !important;
  justify-items: start !important;
  padding: 0 clamp(52px, 6vw, 92px) clamp(14px, 3vh, 40px) !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.18) 72%, rgba(0,0,0,.28)) !important;
}
body.route-cinema .cinema-library-hero::before,
body.route-cinema .cinema-library-hero::after,
body.route-cinema .cinema-detail-backdrop {
  display: none !important;
  content: none !important;
}
body.route-cinema .cinema-detail-panel {
  width: min(820px, calc(100vw - 160px)) !important;
  max-width: 820px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  justify-self: start !important;
  align-self: end !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-detail-copy {
  text-align: left !important;
  display: grid !important;
  justify-items: start !important;
  gap: 10px !important;
}
body.route-cinema .cinema-detail-panel .eyebrow {
  margin: 0 !important;
  color: rgba(255,248,236,.55) !important;
  font-size: .70rem !important;
  letter-spacing: .16em !important;
}
body.route-cinema .cinema-detail-panel h1 {
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 !important;
  font-size: clamp(2.1rem, 4.2vw, 4.9rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -.045em !important;
  font-weight: 760 !important;
  color: var(--cinema-cream) !important;
  text-align: left !important;
  overflow-wrap: anywhere !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-focus-meta,
body.route-cinema .cinema-focus-actions {
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 620px !important;
  margin: 0 !important;
  color: rgba(255,248,236,.75) !important;
  font-size: .98rem !important;
  line-height: 1.48 !important;
  font-weight: 580 !important;
  text-align: left !important;
}
body.route-cinema .cinema-subtitle-line {
  color: rgba(255,248,236,.58) !important;
  text-align: left !important;
}
body.route-cinema .cinema-focus-actions button {
  min-height: 42px !important;
  border-radius: 999px !important;
  padding: 0 18px !important;
}

/* Player: no auto-popup. Controls are manual-only. */
body.route-cinema .cinema-watch-screen {
  overflow: hidden !important;
  background: #000 !important;
}
body.route-cinema .cinema-player.dark-panel,
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell,
body.route-cinema .cinema-player .video-shell video {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
}
body.route-cinema .cinema-player-controls {
  position: fixed !important;
  left: 18px !important;
  bottom: 18px !important;
  right: auto !important;
  width: min(760px, calc(100vw - 36px)) !important;
  max-height: min(42dvh, 330px) !important;
  overflow: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(230px,320px) auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(5,5,7,.66) !important;
  backdrop-filter: blur(20px) !important;
  color: rgba(255,248,236,.90) !important;
  z-index: 2400 !important;
  transition: opacity .18s ease, transform .18s ease !important;
}
body.route-cinema .cinema-sync-row {
  min-width: 0 !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-subtitle-control-box {
  min-width: 0 !important;
  border-radius: 18px !important;
  padding: 10px !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
body.route-cinema .cinema-controls-hide,
body.route-cinema .cinema-controls-peek {
  min-height: 40px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(12,12,16,.72) !important;
  color: var(--cinema-cream) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px) !important;
  font-weight: 820 !important;
}
body.route-cinema .cinema-controls-peek {
  position: fixed !important;
  left: 18px !important;
  bottom: 18px !important;
  z-index: 2500 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(10px) !important;
  transition: opacity .18s ease, transform .18s ease !important;
}
body.route-cinema .cinema-controls-hidden .cinema-player-controls,
body.route-cinema .cinema-controls-hidden .cinema-readiness-dock {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
}
body.route-cinema .cinema-controls-hidden .cinema-controls-peek {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
body.route-cinema .cinema-readiness-dock {
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  top: auto !important;
  width: min(360px, calc(100vw - 36px)) !important;
  z-index: 2300 !important;
  transition: opacity .18s ease, transform .18s ease !important;
}
body.route-cinema .cinema-now-strip,
body.route-cinema .play-gate {
  z-index: 2200 !important;
  background: rgba(5,5,7,.55) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.route-cinema .cinema-back-arrow {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 80px) !important;
  left: 18px !important;
  z-index: 2600 !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(6,6,8,.68) !important;
  color: var(--cinema-cream) !important;
  box-shadow: none !important;
}

@media (max-width: 980px) {
  body.route-cinema .cinema-window-shell { padding: 92px 16px 24px !important; grid-template-rows: auto minmax(150px, 24vh) minmax(280px, 1fr) !important; }
  body.route-cinema .cinema-library-nav { flex-direction: column !important; align-items: stretch !important; }
  body.route-cinema .cinema-library-actions { justify-content: flex-start !important; }
  body.route-cinema #storageStatus { max-width: 100% !important; }
  body.route-cinema .cinema-library-hero { padding-inline: 60px 10px !important; }
  body.route-cinema .cinema-detail-panel { width: min(680px, calc(100vw - 92px)) !important; }
  body.route-cinema .cinema-detail-panel h1 { font-size: clamp(1.9rem, 7vw, 3.4rem) !important; }
  body.route-cinema .cinema-player-controls { grid-template-columns: 1fr !important; width: calc(100vw - 36px) !important; max-height: 55dvh !important; }
  body.route-cinema .cinema-readiness-dock { display: none !important; }
}
@media (max-width: 680px) {
  body.route-cinema .cinema-carousel-frame { grid-template-columns: 38px minmax(0,1fr) 38px !important; gap: 8px !important; }
  body.route-cinema .cinema-carousel-card { flex-basis: 112px !important; width: 112px !important; }
  body.route-cinema .cinema-library-hero { padding-inline: 50px 4px !important; }
  body.route-cinema .cinema-detail-panel { width: calc(100vw - 62px) !important; }
}

/* ==============================
   v3.1.9 Cinema UI menu/layout fix
   Keep mechanics intact, clean the layout layer.
   ============================== */
body.route-cinema {
  --cinema-bg: #050507;
  --cinema-cream: #fff5e6;
  --cinema-muted: rgba(255,245,230,.64);
  --cinema-line: rgba(255,255,255,.12);
  --cinema-panel: rgba(12,12,16,.72);
  background: var(--cinema-bg) !important;
  overflow: hidden !important;
}
body.route-cinema .background {
  opacity: 1 !important;
  background:
    radial-gradient(circle at 16% 82%, rgba(179,107,52,.18), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(44,62,123,.20), transparent 38%),
    radial-gradient(circle at 48% 50%, rgba(255,255,255,.025), transparent 42%),
    linear-gradient(135deg, #050506 0%, #07070b 48%, #0b1020 100%) !important;
}
body.route-cinema .background::after { opacity: .035 !important; }

/* Full cinema viewport without the hard rectangular panel edge. */
body.route-cinema .page { padding: 0 !important; background: transparent !important; overflow: hidden !important; }
body.route-cinema .wrap,
body.route-cinema .main,
body.route-cinema .room-view,
body.route-cinema .cinema-stage-room {
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-stage-room,
body.route-cinema .cinema-window-shell,
body.route-cinema .cinema-library-screen,
body.route-cinema .cinema-library-panel,
body.route-cinema .cinema-library-hero {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-stage-room {
  position: relative !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 12% 82%, rgba(172,102,52,.17), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(48,63,124,.22), transparent 40%),
    linear-gradient(135deg, #050506 0%, #07070b 52%, #0b1020 100%) !important;
}
body.route-cinema .cinema-window-shell {
  position: relative !important;
  display: grid !important;
  grid-template-rows: minmax(245px, 36vh) minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: clamp(96px, 12vh, 132px) clamp(34px, 5vw, 92px) clamp(26px, 4vh, 52px) !important;
  background: transparent !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-window-shell::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background:
    linear-gradient(90deg, rgba(0,0,0,.20), transparent 28%, transparent 78%, rgba(0,0,0,.22)),
    linear-gradient(180deg, rgba(0,0,0,.12), transparent 26%, rgba(0,0,0,.22)) !important;
}
body.route-cinema .cinema-window-shell > * { position: relative !important; z-index: 1 !important; }

/* Cinema page tools: hidden behind one clean three-dot menu. */
body.route-cinema .cinema-library-nav-menu {
  position: fixed !important;
  top: 96px !important;
  right: clamp(22px, 4vw, 72px) !important;
  left: auto !important;
  z-index: 2300 !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-status-pill {
  max-width: min(36vw, 520px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: rgba(255,245,230,.58) !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-kebab-menu { position: relative !important; }
body.route-cinema .cinema-kebab-button {
  display: inline-grid !important;
  place-items: center !important;
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  color: var(--cinema-cream) !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) !important;
  font-size: 1.8rem !important;
  line-height: 1 !important;
}
body.route-cinema .cinema-kebab-dropdown {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  min-width: 210px !important;
  padding: 8px !important;
  border-radius: 20px !important;
  background: rgba(12,12,16,.92) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.42) !important;
  backdrop-filter: blur(24px) !important;
}
body.route-cinema .cinema-kebab-dropdown[hidden] { display: none !important; }
body.route-cinema .cinema-kebab-dropdown button {
  width: 100% !important;
  justify-content: flex-start !important;
  min-height: 40px !important;
  padding: 0 12px !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: rgba(255,245,230,.88) !important;
  border: 0 !important;
  box-shadow: none !important;
  text-align: left !important;
}
body.route-cinema .cinema-kebab-dropdown button:hover:not(:disabled) {
  background: rgba(255,255,255,.10) !important;
  color: #fff !important;
}
body.route-cinema .cinema-kebab-dropdown button:disabled { opacity: .42 !important; cursor: default !important; }
body.route-cinema .cinema-mini-nav,
body.route-cinema .cinema-library-actions { display: none !important; }

/* Poster rail and selected movie: left aligned, soft selection, no hard border. */
body.route-cinema .cinema-carousel-frame {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-poster-rail {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: clamp(14px, 2vw, 26px) !important;
  width: 100% !important;
  height: 100% !important;
  padding: 4px 4px 16px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: none !important;
}
body.route-cinema .cinema-poster-rail::-webkit-scrollbar { display: none !important; }
body.route-cinema .cinema-carousel-card {
  flex: 0 0 clamp(128px, 11vw, 166px) !important;
  width: clamp(128px, 11vw, 166px) !important;
  opacity: .72 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  transition: opacity .18s ease, transform .18s ease, filter .18s ease !important;
  cursor: pointer !important;
}
body.route-cinema .cinema-carousel-card:hover { opacity: .95 !important; transform: translateY(-4px) !important; }
body.route-cinema .cinema-carousel-card.selected {
  opacity: 1 !important;
  transform: translateY(-5px) !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.34) !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  border-color: rgba(255,230,188,.24) !important;
  box-shadow: 0 20px 62px rgba(0,0,0,.44), 0 0 0 1px rgba(255,230,188,.10) !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info strong {
  color: rgba(255,245,230,.90) !important;
  font-size: .78rem !important;
  font-weight: 740 !important;
  letter-spacing: -.015em !important;
}
body.route-cinema .cinema-carousel-arrow {
  width: 46px !important;
  height: 52px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.065) !important;
  color: rgba(255,245,230,.82) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: none !important;
}

body.route-cinema .cinema-library-hero {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  padding: clamp(18px, 3vh, 38px) 56px 0 !important;
  overflow: visible !important;
  background: transparent !important;
  pointer-events: auto !important;
}
body.route-cinema .cinema-library-hero::before,
body.route-cinema .cinema-library-hero::after,
body.route-cinema .cinema-detail-backdrop { display: none !important; content: none !important; }
body.route-cinema .cinema-detail-panel {
  width: min(820px, 54vw) !important;
  max-width: 820px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--cinema-cream) !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 30 !important;
}
body.route-cinema .cinema-detail-copy {
  display: grid !important;
  justify-items: start !important;
  gap: 10px !important;
  text-align: left !important;
  pointer-events: auto !important;
}
body.route-cinema .cinema-detail-panel .eyebrow {
  margin: 0 !important;
  font-size: .68rem !important;
  font-weight: 760 !important;
  letter-spacing: .18em !important;
  color: rgba(255,245,230,.55) !important;
}
body.route-cinema .cinema-detail-panel h1 {
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 !important;
  font-size: clamp(2.15rem, 4.1vw, 4.75rem) !important;
  line-height: 1.03 !important;
  letter-spacing: -.028em !important;
  font-weight: 700 !important;
  color: var(--cinema-cream) !important;
  text-align: left !important;
  overflow-wrap: anywhere !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-focus-meta {
  justify-content: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
}
body.route-cinema .cinema-focus-meta span,
body.route-cinema .movie-rating-pill {
  background: rgba(255,255,255,.09) !important;
  color: rgba(255,245,230,.88) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 620px !important;
  margin: 0 !important;
  color: rgba(255,245,230,.74) !important;
  font-size: .96rem !important;
  line-height: 1.48 !important;
  font-weight: 540 !important;
  text-align: left !important;
}
body.route-cinema .cinema-subtitle-line {
  color: rgba(255,245,230,.52) !important;
  text-align: left !important;
}
body.route-cinema .cinema-focus-actions {
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 4px 0 0 !important;
  position: relative !important;
  z-index: 40 !important;
  pointer-events: auto !important;
}
body.route-cinema .cinema-focus-actions button {
  position: relative !important;
  z-index: 41 !important;
  pointer-events: auto !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}
body.route-cinema .cinema-focus-actions .cinema-primary-action {
  color: #21170e !important;
  background: linear-gradient(135deg, #ffe9b8, #dbb06e) !important;
}
body.route-cinema .cinema-focus-actions .secondary {
  color: rgba(255,245,230,.86) !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
}

/* Upload/local panels are clean pages with a simple back arrow. */
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-carousel-frame,
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-hero { display: none !important; }
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  display: block !important;
  padding-top: clamp(108px, 13vh, 142px) !important;
  overflow-y: auto !important;
}
body.route-cinema .cinema-panel-back-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 40px !important;
  margin: 0 0 16px !important;
  padding: 0 15px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(255,255,255,.075) !important;
  color: rgba(255,245,230,.90) !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-panel-form {
  width: min(820px, calc(100vw - 64px)) !important;
  margin: 0 !important;
  color: var(--cinema-cream) !important;
  background: rgba(12,12,16,.58) !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  border-radius: 28px !important;
  box-shadow: 0 24px 100px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(20px) !important;
}
body.route-cinema .cinema-panel-form .panel-head span,
body.route-cinema .cinema-panel-form .upload-help,
body.route-cinema .cinema-panel-form .form-actions,
body.route-cinema .cinema-panel-form em {
  color: rgba(255,245,230,.60) !important;
}

/* Player: black clean watch surface; controls are button-only. */
body.route-cinema .cinema-watch-screen { background: #000 !important; }
body.route-cinema .cinema-player.dark-panel,
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell,
body.route-cinema .cinema-player .video-shell video {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-stage-room:not(.cinema-show-player) .cinema-controls-peek,
body.route-cinema .cinema-stage-room:not(.cinema-show-player) .cinema-player-controls,
body.route-cinema .cinema-stage-room:not(.cinema-show-player) .cinema-readiness-dock { display: none !important; }
body.route-cinema .cinema-player-controls {
  position: fixed !important;
  left: 18px !important;
  bottom: 18px !important;
  right: auto !important;
  width: min(760px, calc(100vw - 420px)) !important;
  max-width: calc(100vw - 36px) !important;
  max-height: min(42dvh, 320px) !important;
  overflow: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(230px,320px) auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(5,5,7,.70) !important;
  backdrop-filter: blur(22px) !important;
  color: rgba(255,245,230,.90) !important;
  z-index: 2400 !important;
}
body.route-cinema .cinema-controls-peek {
  position: fixed !important;
  left: auto !important;
  right: 18px !important;
  bottom: 18px !important;
  z-index: 2500 !important;
}
body.route-cinema .cinema-controls-hidden .cinema-player-controls,
body.route-cinema .cinema-controls-hidden .cinema-readiness-dock,
body.route-cinema .cinema-controls-hidden .cinema-now-strip,
body.route-cinema .cinema-controls-hidden .play-gate {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
}
body.route-cinema .cinema-controls-hidden .cinema-controls-peek {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}
body.route-cinema .cinema-readiness-dock {
  position: fixed !important;
  right: 18px !important;
  bottom: 78px !important;
  top: auto !important;
  width: min(360px, calc(100vw - 36px)) !important;
  z-index: 2300 !important;
}

@media (max-width: 980px) {
  body.route-cinema .cinema-window-shell { padding: 88px 18px 24px !important; grid-template-rows: minmax(170px, 28vh) minmax(0, 1fr) !important; }
  body.route-cinema .cinema-library-nav-menu { top: 74px !important; right: 16px !important; }
  body.route-cinema .cinema-status-pill { display: none !important; }
  body.route-cinema .cinema-carousel-frame { grid-template-columns: 40px minmax(0,1fr) 40px !important; gap: 8px !important; }
  body.route-cinema .cinema-library-hero { padding: 12px 48px 0 !important; }
  body.route-cinema .cinema-detail-panel { width: min(700px, calc(100vw - 96px)) !important; }
  body.route-cinema .cinema-detail-panel h1 { font-size: clamp(2rem, 7vw, 3.6rem) !important; }
  body.route-cinema .cinema-player-controls { grid-template-columns: 1fr !important; width: calc(100vw - 36px) !important; }
  body.route-cinema .cinema-readiness-dock { display: none !important; }
}
@media (max-width: 680px) {
  body.route-cinema .cinema-carousel-card { flex-basis: 112px !important; width: 112px !important; }
  body.route-cinema .cinema-library-hero { padding-inline: 48px 8px !important; }
  body.route-cinema .cinema-detail-panel { width: calc(100vw - 64px) !important; }
  body.route-cinema .cinema-detail-panel h1 { font-size: clamp(1.85rem, 10vw, 3rem) !important; }
}

/* ==============================
   Cinema 3.1.10 cleanup
   - normal preference-aware topbar
   - compact library gap
   - player menu panels instead of bottom slab
   ============================== */
body.route-cinema .page {
  min-height: 100dvh !important;
  padding: 24px !important;
}

body.route-cinema .cinema-room {
  min-height: calc(100dvh - 118px) !important;
  margin: 0 !important;
  background:
    radial-gradient(circle at 78% 18%, rgba(52,65,120,.22), transparent 32%),
    radial-gradient(circle at 10% 82%, rgba(140,82,42,.16), transparent 38%),
    linear-gradient(135deg, #070707 0%, #08080d 48%, #0b1020 100%) !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-window-shell,
body.route-cinema .cinema-window-shell::before {
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema .cinema-window-shell::before { display: none !important; content: none !important; }
body.route-cinema .cinema-window-shell {
  min-height: calc(100dvh - 138px) !important;
  width: min(1440px, calc(100vw - 64px)) !important;
  max-width: min(1440px, calc(100vw - 64px)) !important;
  margin: 0 auto !important;
  padding: clamp(28px, 4vh, 48px) 0 34px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(18px, 3vh, 30px) !important;
  background: transparent !important;
  overflow: visible !important;
}
body.route-cinema .cinema-library-nav-menu {
  position: absolute !important;
  top: clamp(24px, 4vh, 42px) !important;
  right: clamp(10px, 2vw, 28px) !important;
  z-index: 1600 !important;
}
body.route-cinema .cinema-status-pill {
  max-width: 240px !important;
  color: rgba(255,245,230,.58) !important;
  background: transparent !important;
  border-color: transparent !important;
}
body.route-cinema .cinema-kebab-button,
body.route-cinema .cinema-player-menu-button {
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.08) !important;
  color: rgba(255,245,230,.92) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(18px) !important;
}
body.route-cinema .cinema-kebab-dropdown,
body.route-cinema .cinema-player-menu-dropdown {
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(11,11,14,.84) !important;
  backdrop-filter: blur(22px) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.42) !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-kebab-dropdown button,
body.route-cinema .cinema-player-menu-dropdown button {
  color: rgba(255,245,230,.88) !important;
  background: transparent !important;
  border: 0 !important;
  text-align: left !important;
  justify-content: flex-start !important;
}
body.route-cinema .cinema-kebab-dropdown button:hover,
body.route-cinema .cinema-player-menu-dropdown button:hover {
  background: rgba(255,255,255,.08) !important;
}

body.route-cinema .cinema-carousel-frame {
  width: 100% !important;
  min-height: 230px !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) 54px !important;
  align-items: center !important;
  gap: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-poster-rail {
  height: auto !important;
  min-height: 230px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 22px !important;
  padding: 0 6px 10px !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
}
body.route-cinema .cinema-carousel-card {
  flex: 0 0 154px !important;
  width: 154px !important;
  height: auto !important;
  display: grid !important;
  gap: 8px !important;
  scroll-snap-align: start !important;
  transform-origin: center bottom !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  width: 154px !important;
  height: 226px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255,245,220,.18) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.34) !important;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease, opacity .28s ease !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  transform: translateY(-6px) scale(1.025) !important;
  border-color: rgba(245,212,154,.58) !important;
  box-shadow: 0 28px 70px rgba(0,0,0,.46), 0 0 0 1px rgba(245,212,154,.18) inset !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info {
  display: none !important;
}
body.route-cinema .cinema-carousel-arrow {
  width: 46px !important;
  height: 54px !important;
  border-radius: 18px !important;
  color: rgba(255,245,230,.86) !important;
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.11) !important;
}

body.route-cinema .cinema-library-hero {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 72px !important;
  display: block !important;
}
body.route-cinema .cinema-detail-panel {
  width: min(760px, 100%) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body.route-cinema .cinema-detail-copy {
  display: grid !important;
  justify-items: start !important;
  gap: 11px !important;
  text-align: left !important;
}
body.route-cinema .cinema-detail-panel h1 {
  max-width: 760px !important;
  font-size: clamp(2.35rem, 5vw, 5.1rem) !important;
  line-height: .98 !important;
  letter-spacing: -.045em !important;
  font-weight: 690 !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 620px !important;
  color: rgba(255,245,230,.72) !important;
}
body.route-cinema .cinema-focus-actions { gap: 10px !important; }
body.route-cinema .cinema-focus-actions button { cursor: pointer !important; }

body.route-cinema .cinema-tab-panel.hidden { display: none !important; }
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  width: min(860px, calc(100vw - 48px)) !important;
  padding-top: clamp(18px, 4vh, 44px) !important;
  overflow-y: auto !important;
}
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-nav-menu { display: none !important; }

body.route-cinema .cinema-watch-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  background: #000 !important;
  z-index: 1100 !important;
}
body.route-cinema .cinema-show-player .cinema-back-arrow {
  z-index: 5200 !important;
}
body.route-cinema .cinema-player-tools {
  position: fixed !important;
  right: 22px !important;
  bottom: 76px !important;
  z-index: 3600 !important;
}
body.route-cinema .cinema-player-menu-dropdown {
  position: absolute !important;
  right: 0 !important;
  bottom: 56px !important;
  min-width: 160px !important;
  padding: 6px !important;
}
body.route-cinema .cinema-player-menu-dropdown[hidden] { display: none !important; }
body.route-cinema .cinema-player-menu-dropdown button {
  width: 100% !important;
  min-height: 40px !important;
  border-radius: 12px !important;
  padding: 0 12px !important;
  font-weight: 750 !important;
}
body.route-cinema .cinema-player-panel {
  position: fixed !important;
  right: 22px !important;
  bottom: 134px !important;
  width: min(390px, calc(100vw - 44px)) !important;
  z-index: 3500 !important;
  padding: 14px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(9,9,12,.80) !important;
  color: rgba(255,245,230,.90) !important;
  backdrop-filter: blur(22px) !important;
  box-shadow: 0 26px 90px rgba(0,0,0,.46) !important;
}
body.route-cinema .cinema-player-panel.hidden { display: none !important; }
body.route-cinema .cinema-panel-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}
body.route-cinema .cinema-panel-title button {
  width: 32px !important;
  height: 32px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,245,230,.84) !important;
  background: rgba(255,255,255,.07) !important;
}
body.route-cinema .cinema-debug-panel .cinema-sync-row,
body.route-cinema .cinema-debug-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}
body.route-cinema .cinema-debug-actions { margin-top: 10px !important; }
body.route-cinema .cinema-subtitle-panel .subtitle-delay-field,
body.route-cinema .cinema-subtitle-panel .cinema-subtitle-tune-row { margin-top: 10px !important; }
body.route-cinema .cinema-subtitle-panel input {
  width: 100% !important;
  color: rgba(255,245,230,.92) !important;
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
}
body.route-cinema .cinema-subtitle-tune-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1.2fr !important;
  gap: 8px !important;
}
body.route-cinema .cinema-player-controls,
body.route-cinema .cinema-controls-peek,
body.route-cinema .cinema-controls-hide { display: none !important; }
body.route-cinema .cinema-now-strip {
  top: 86px !important;
  left: 18px !important;
  max-width: min(420px, calc(100vw - 36px)) !important;
  opacity: .72 !important;
}
body.route-cinema .play-gate {
  left: 18px !important;
  bottom: 18px !important;
  max-width: min(520px, calc(100vw - 44px)) !important;
  border-radius: 18px !important;
  opacity: .86 !important;
}
body.route-cinema .cinema-readiness-dock {
  position: fixed !important;
  right: 22px !important;
  top: 108px !important;
  bottom: auto !important;
  width: min(360px, calc(100vw - 44px)) !important;
  z-index: 2800 !important;
}
body.route-cinema .cinema-ready-grid {
  display: grid !important;
  gap: 9px !important;
}
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  border-radius: 20px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  background: rgba(8,10,9,.64) !important;
  color: rgba(255,245,230,.90) !important;
  backdrop-filter: blur(18px) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.32) !important;
}
body.route-cinema .ready-summary { padding: 12px !important; }
body.route-cinema .ready-card {
  display: grid !important;
  grid-template-columns: 42px minmax(0,1fr) !important;
  gap: 11px !important;
  align-items: center !important;
  padding: 10px !important;
}
body.route-cinema .cinema-ready-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-size: cover !important;
  background-position: center !important;
  background-color: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,245,230,.25) !important;
  color: rgba(255,245,230,.92) !important;
  font-weight: 850 !important;
}
body.route-cinema .ready-card-body { min-width: 0 !important; }
body.route-cinema .ready-card-top {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
body.route-cinema .ready-card-top strong,
body.route-cinema .ready-card em {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body.route-cinema .ready-card-top span,
body.route-cinema .ready-card small { color: rgba(255,245,230,.62) !important; }
body.route-cinema .ready-card em { display: block !important; color: rgba(255,245,230,.68) !important; font-style: normal !important; font-size: .82rem !important; }
body.route-cinema .ready-card .cinema-progress-bar,
body.route-cinema .ready-summary .cinema-progress-bar { height: 6px !important; margin: 8px 0 5px !important; }

@media (max-width: 980px) {
  body.route-cinema .page { padding: 10px !important; }
  body.route-cinema .cinema-room { min-height: calc(100dvh - 88px) !important; }
  body.route-cinema .cinema-window-shell { width: calc(100vw - 28px) !important; min-height: calc(100dvh - 100px) !important; gap: 18px !important; }
  body.route-cinema .cinema-library-nav-menu { top: 16px !important; right: 10px !important; }
  body.route-cinema .cinema-status-pill { display: none !important; }
  body.route-cinema .cinema-carousel-frame { grid-template-columns: 44px minmax(0,1fr) 44px !important; min-height: 190px !important; gap: 8px !important; }
  body.route-cinema .cinema-poster-rail { min-height: 190px !important; gap: 14px !important; }
  body.route-cinema .cinema-carousel-card,
  body.route-cinema .cinema-carousel-card .cinema-movie-poster { width: 124px !important; flex-basis: 124px !important; }
  body.route-cinema .cinema-carousel-card .cinema-movie-poster { height: 184px !important; }
  body.route-cinema .cinema-library-hero { padding: 0 52px !important; }
  body.route-cinema .cinema-readiness-dock { display: none !important; }
  body.route-cinema .cinema-player-panel { right: 12px !important; bottom: 126px !important; width: calc(100vw - 24px) !important; }
}

/* ==============================
   v3.1.11 Cinema player clean/resume
   Final override: keep the normal site topbar, fix player viewport, compact readiness.
   ============================== */
body.route-cinema {
  --cinema-bg: #050506;
  --cinema-cream: #fff4e5;
  --cinema-muted: rgba(255,244,229,.66);
  overflow-x: hidden !important;
}
body.route-cinema .page {
  min-height: 100dvh !important;
  padding: 24px !important;
}
body.route-cinema .cinema-room {
  position: relative !important;
  min-height: calc(100dvh - 112px) !important;
  margin: 0 !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 14% 76%, rgba(180,108,62,.16), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(56,70,132,.18), transparent 40%),
    linear-gradient(135deg, #050506 0%, #08080d 50%, #0b1020 100%) !important;
}
body.route-cinema .cinema-frame-backdrop {
  position: absolute !important;
  inset: -36px !important;
  z-index: 0 !important;
  pointer-events: none !important;
  opacity: 0 !important;
  background-size: cover !important;
  background-position: center !important;
  filter: blur(34px) saturate(.92) brightness(.50) !important;
  transform: scale(1.04) !important;
  transition: opacity .38s ease, background-image .25s ease !important;
}
body.route-cinema .cinema-frame-backdrop.has-frame {
  opacity: .25 !important;
}
body.route-cinema .cinema-frame-backdrop.is-poster-fallback {
  opacity: .16 !important;
  filter: blur(38px) saturate(.9) brightness(.46) !important;
}
body.route-cinema .cinema-frame-backdrop::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(90deg, rgba(5,5,6,.86) 0%, rgba(5,5,6,.68) 44%, rgba(5,5,6,.82) 100%) !important;
}
body.route-cinema .cinema-window-shell {
  position: relative !important;
  z-index: 1 !important;
  width: min(1440px, calc(100vw - 64px)) !important;
  max-width: min(1440px, calc(100vw - 64px)) !important;
  min-height: calc(100dvh - 144px) !important;
  margin: 0 auto !important;
  padding: clamp(12px, 2.4vh, 28px) 0 34px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(20px, 3vh, 34px) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}
body.route-cinema .cinema-window-shell::before,
body.route-cinema .cinema-window-shell::after,
body.route-cinema .cinema-library-hero::before,
body.route-cinema .cinema-library-hero::after,
body.route-cinema .cinema-detail-backdrop {
  display: none !important;
  content: none !important;
}
body.route-cinema .cinema-library-nav-menu {
  position: absolute !important;
  top: 8px !important;
  right: 0 !important;
  z-index: 5 !important;
}
body.route-cinema .cinema-status-pill {
  max-width: 220px !important;
  background: transparent !important;
  border-color: transparent !important;
  color: rgba(255,244,229,.55) !important;
}
body.route-cinema .cinema-carousel-frame {
  width: 100% !important;
  min-height: 278px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  align-items: center !important;
  gap: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema .cinema-poster-rail {
  min-height: 278px !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 22px !important;
  padding: 8px 4px 12px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scroll-snap-type: x mandatory !important;
}
body.route-cinema .cinema-carousel-card {
  flex: 0 0 168px !important;
  width: 168px !important;
  height: auto !important;
  scroll-snap-align: start !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  width: 168px !important;
  height: 252px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 19px !important;
  border: 1px solid rgba(255,244,229,.13) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.32) !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  transform: translateY(-5px) scale(1.018) !important;
  border-color: rgba(239,205,145,.42) !important;
  box-shadow: 0 28px 72px rgba(0,0,0,.44), 0 0 0 1px rgba(239,205,145,.12) inset !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-info {
  display: none !important;
}
body.route-cinema .cinema-carousel-arrow {
  width: 44px !important;
  height: 54px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(255,244,229,.84) !important;
}
body.route-cinema .cinema-library-hero {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 70px !important;
  display: block !important;
  background: transparent !important;
  overflow: visible !important;
}
body.route-cinema .cinema-detail-panel {
  width: min(720px, 100%) !important;
  max-width: 720px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body.route-cinema .cinema-detail-copy {
  display: grid !important;
  justify-items: start !important;
  gap: 12px !important;
  text-align: left !important;
}
body.route-cinema .cinema-detail-panel h1 {
  max-width: 720px !important;
  margin: 0 !important;
  color: var(--cinema-cream) !important;
  font-size: clamp(2.8rem, 5vw, 5.2rem) !important;
  line-height: .98 !important;
  letter-spacing: -.052em !important;
  font-weight: 680 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 560px !important;
  margin: 0 !important;
  color: rgba(255,244,229,.72) !important;
  font-weight: 560 !important;
  line-height: 1.5 !important;
}
body.route-cinema .cinema-focus-meta,
body.route-cinema .cinema-focus-actions {
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}
body.route-cinema .cinema-focus-actions button {
  min-height: 44px !important;
  padding: 0 20px !important;
  cursor: pointer !important;
}
body.route-cinema .cinema-tab-panel.hidden { display: none !important; }
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  width: min(900px, calc(100vw - 48px)) !important;
  min-height: calc(100dvh - 144px) !important;
  overflow-y: auto !important;
}
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-carousel-frame,
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-hero,
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-nav-menu {
  display: none !important;
}

/* Player mode: real full-screen movie canvas. Topbar is hidden only while watching. */
body.route-cinema.cinema-player-active .page {
  padding: 0 !important;
}
body.route-cinema.cinema-player-active .topbar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-12px) !important;
  margin: 0 !important;
}
body.route-cinema .cinema-watch-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  background: #000 !important;
  z-index: 3000 !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-watch-screen:not(.active) { display: none !important; }
body.route-cinema .cinema-watch-screen.active { display: block !important; }
body.route-cinema .cinema-player.dark-panel,
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-player .video-shell video,
body.route-cinema #video {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100vw !important;
  height: 100dvh !important;
  object-fit: contain !important;
  background: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body.route-cinema .cinema-back-arrow {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  left: 18px !important;
  z-index: 5500 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.42) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: rgba(255,244,229,.92) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema .cinema-now-strip {
  top: 18px !important;
  left: 72px !important;
  max-width: min(380px, calc(100vw - 156px)) !important;
  opacity: .62 !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.28) !important;
  border-color: rgba(255,255,255,.08) !important;
}
body.route-cinema .play-gate {
  left: 18px !important;
  bottom: 18px !important;
  max-width: min(440px, calc(100vw - 36px)) !important;
  border-radius: 18px !important;
  opacity: .82 !important;
  background: rgba(0,0,0,.46) !important;
  border-color: rgba(255,255,255,.10) !important;
}
body.route-cinema .cinema-player-tools {
  position: fixed !important;
  right: 20px !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  bottom: auto !important;
  z-index: 5600 !important;
}
body.route-cinema .cinema-player-menu-button {
  width: 46px !important;
  height: 46px !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.42) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: rgba(255,244,229,.94) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema .cinema-player-menu-dropdown {
  position: absolute !important;
  right: 0 !important;
  top: 54px !important;
  bottom: auto !important;
  min-width: 170px !important;
  padding: 6px !important;
  z-index: 5601 !important;
}
body.route-cinema .cinema-player-panel {
  position: fixed !important;
  right: 20px !important;
  top: calc(env(safe-area-inset-top) + 76px) !important;
  bottom: auto !important;
  width: min(390px, calc(100vw - 40px)) !important;
  z-index: 5500 !important;
  border-radius: 22px !important;
  background: rgba(8,8,10,.78) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  backdrop-filter: blur(22px) !important;
}
body.route-cinema .cinema-readiness-dock {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  top: auto !important;
  width: auto !important;
  max-width: calc(100vw - 40px) !important;
  z-index: 5400 !important;
}
body.route-cinema .cinema-ready-grid {
  position: relative !important;
  display: block !important;
}
body.route-cinema .cinema-ready-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  padding: 6px 12px 6px 7px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(0,0,0,.42) !important;
  color: rgba(255,244,229,.86) !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.30) !important;
  cursor: pointer !important;
}
body.route-cinema .cinema-ready-mini {
  position: relative !important;
  display: inline-flex !important;
  width: 32px !important;
  height: 32px !important;
  margin-left: -8px !important;
}
body.route-cinema .cinema-ready-mini:first-child { margin-left: 0 !important; }
body.route-cinema .cinema-ready-mini .cinema-ready-avatar {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid rgba(255,244,229,.22) !important;
}
body.route-cinema .cinema-ready-mini i {
  position: absolute !important;
  left: 3px !important;
  right: 3px !important;
  bottom: -3px !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #f4d399 var(--ready), rgba(255,255,255,.20) 0) !important;
}
body.route-cinema .cinema-ready-toggle span:last-child {
  font-weight: 780 !important;
  font-size: .82rem !important;
  white-space: nowrap !important;
}
body.route-cinema .cinema-ready-details {
  position: absolute !important;
  right: 0 !important;
  bottom: 56px !important;
  width: min(370px, calc(100vw - 40px)) !important;
  display: grid !important;
  gap: 9px !important;
}
body.route-cinema .cinema-ready-details.hidden { display: none !important; }
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  border-radius: 19px !important;
  background: rgba(8,8,10,.78) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  backdrop-filter: blur(20px) !important;
}
body.route-cinema .ready-card {
  grid-template-columns: 42px minmax(0, 1fr) !important;
  padding: 10px !important;
}
body.route-cinema .cinema-ready-avatar {
  background-size: cover !important;
  background-position: center !important;
}

@media (max-width: 980px) {
  body.route-cinema .page { padding: 10px !important; }
  body.route-cinema .cinema-room { min-height: calc(100dvh - 88px) !important; }
  body.route-cinema .cinema-window-shell { width: calc(100vw - 28px) !important; min-height: calc(100dvh - 104px) !important; gap: 18px !important; }
  body.route-cinema .cinema-library-nav-menu { top: 10px !important; right: 4px !important; }
  body.route-cinema .cinema-status-pill { display: none !important; }
  body.route-cinema .cinema-carousel-frame { min-height: 210px !important; grid-template-columns: 42px minmax(0,1fr) 42px !important; gap: 8px !important; }
  body.route-cinema .cinema-poster-rail { min-height: 210px !important; gap: 14px !important; }
  body.route-cinema .cinema-carousel-card,
  body.route-cinema .cinema-carousel-card .cinema-movie-poster { width: 132px !important; flex-basis: 132px !important; }
  body.route-cinema .cinema-carousel-card .cinema-movie-poster { height: 198px !important; }
  body.route-cinema .cinema-library-hero { padding: 0 50px !important; }
  body.route-cinema .cinema-detail-panel h1 { font-size: clamp(2rem, 8vw, 3.5rem) !important; }
  body.route-cinema .cinema-readiness-dock { right: 12px !important; bottom: 12px !important; }
  body.route-cinema .cinema-player-tools { right: 12px !important; top: calc(env(safe-area-inset-top) + 12px) !important; }
  body.route-cinema .cinema-player-panel { right: 12px !important; top: calc(env(safe-area-inset-top) + 68px) !important; width: calc(100vw - 24px) !important; }
}
@media (max-width: 680px) {
  body.route-cinema .cinema-library-hero { padding: 0 44px !important; }
  body.route-cinema .cinema-detail-panel h1 { letter-spacing: -.04em !important; }
}
body.route-cinema .cinema-stage-room:not(.cinema-show-player) .cinema-readiness-dock {
  display: none !important;
}

/* ==============================
   v3.1.12 Cinema repair pass
   Shared-nav reset, cleaner library/player, less blur, cleaner upload.
   ============================== */
body.route-cinema {
  overflow-x: hidden !important;
}
body.route-cinema .page {
  padding: 24px !important;
  min-height: 100dvh !important;
}

body.route-cinema .cinema-room {
  min-height: calc(100dvh - 118px) !important;
  background:
    radial-gradient(circle at 18% 68%, rgba(160, 91, 55, .12), transparent 32%),
    radial-gradient(circle at 88% 22%, rgba(54, 68, 130, .13), transparent 38%),
    linear-gradient(135deg, #050506 0%, #07080d 52%, #0a0e18 100%) !important;
}
body.route-cinema .cinema-frame-backdrop {
  inset: -18px !important;
  opacity: 0 !important;
  filter: blur(14px) saturate(.96) brightness(.55) !important;
  transform: scale(1.018) !important;
}
body.route-cinema .cinema-frame-backdrop.has-frame {
  opacity: .34 !important;
}
body.route-cinema .cinema-frame-backdrop.is-poster-fallback {
  opacity: .18 !important;
  filter: blur(20px) saturate(.95) brightness(.48) !important;
}
body.route-cinema .cinema-frame-backdrop::after {
  background:
    radial-gradient(circle at 22% 42%, rgba(5,5,6,.52), rgba(5,5,6,.82) 54%, rgba(5,5,6,.92) 100%),
    linear-gradient(90deg, rgba(5,5,6,.86), rgba(5,5,6,.58) 42%, rgba(5,5,6,.82)) !important;
}
body.route-cinema .cinema-window-shell {
  width: min(1420px, calc(100vw - 64px)) !important;
  min-height: calc(100dvh - 148px) !important;
  padding: clamp(4px, 1.2vh, 16px) 0 24px !important;
  gap: clamp(14px, 2vh, 24px) !important;
}
body.route-cinema .cinema-carousel-frame {
  min-height: 238px !important;
  grid-template-columns: 46px minmax(0, 1fr) 46px !important;
  gap: 18px !important;
}
body.route-cinema .cinema-poster-rail {
  min-height: 238px !important;
  gap: 18px !important;
  padding: 4px 4px 8px !important;
}
body.route-cinema .cinema-carousel-card {
  flex: 0 0 152px !important;
  width: 152px !important;
}
body.route-cinema .cinema-carousel-card .cinema-movie-poster {
  width: 152px !important;
  height: 228px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 18px !important;
  background-size: cover, contain !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center, center !important;
  background-color: rgba(255,255,255,.045) !important;
  border-color: rgba(255,244,229,.10) !important;
  box-shadow: 0 16px 44px rgba(0,0,0,.28) !important;
}
body.route-cinema .cinema-carousel-card.selected .cinema-movie-poster {
  transform: translateY(-3px) scale(1.012) !important;
  border-color: rgba(239,205,145,.28) !important;
  box-shadow: 0 20px 58px rgba(0,0,0,.36), 0 0 0 1px rgba(239,205,145,.08) inset !important;
}
body.route-cinema .cinema-library-hero {
  padding: 0 64px !important;
}
body.route-cinema .cinema-detail-panel {
  width: min(660px, 100%) !important;
  max-width: 660px !important;
}
body.route-cinema .cinema-detail-panel h1 {
  max-width: 660px !important;
  font-size: clamp(2.45rem, 4.2vw, 4.55rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -.045em !important;
  font-weight: 640 !important;
  text-wrap: balance !important;
}
body.route-cinema .cinema-detail-panel p {
  max-width: 540px !important;
  color: rgba(255,244,229,.70) !important;
}
body.route-cinema .cinema-focus-actions button {
  min-height: 42px !important;
  padding-inline: 18px !important;
}
body.route-cinema .cinema-kebab-button,
body.route-cinema .cinema-carousel-arrow {
  box-shadow: 0 12px 34px rgba(0,0,0,.26) !important;
}
body.route-cinema .cinema-movie-poster.has-poster span { display: none !important; }

/* Player: keep movie canvas clean and controls discoverable without name clutter. */
body.route-cinema.cinema-player-active .page { padding: 0 !important; }
body.route-cinema.cinema-player-active .topbar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-10px) !important;
  margin: 0 !important;
}
body.route-cinema .cinema-watch-screen.active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: block !important;
  background: #000 !important;
  z-index: 5000 !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-player.dark-panel,
body.route-cinema .cinema-video-viewport,
body.route-cinema .cinema-player .video-shell {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
  overflow: hidden !important;
}
body.route-cinema #video {
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  object-fit: contain !important;
  background: #000 !important;
  display: block !important;
}
body.route-cinema .cinema-now-strip { display: none !important; }
body.route-cinema .play-gate {
  left: 18px !important;
  right: auto !important;
  bottom: 18px !important;
  max-width: min(390px, calc(100vw - 36px)) !important;
  padding: 10px 14px !important;
  border-radius: 16px !important;
  background: rgba(0,0,0,.42) !important;
  opacity: .72 !important;
}
body.route-cinema .cinema-player-tools {
  right: 18px !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  z-index: 5600 !important;
}
body.route-cinema .cinema-player-menu-button {
  width: 44px !important;
  height: 44px !important;
  background: rgba(0,0,0,.46) !important;
}
body.route-cinema .cinema-readiness-dock {
  right: 18px !important;
  bottom: 18px !important;
  z-index: 5500 !important;
}
body.route-cinema .cinema-ready-toggle {
  min-height: 42px !important;
  padding: 5px 11px 5px 6px !important;
  background: rgba(0,0,0,.40) !important;
}
body.route-cinema .cinema-ready-toggle span:last-child {
  font-size: .78rem !important;
  opacity: .78 !important;
}
body.route-cinema .cinema-ready-details {
  bottom: 52px !important;
  width: min(340px, calc(100vw - 36px)) !important;
}
body.route-cinema .ready-summary,
body.route-cinema .ready-card {
  background: rgba(8,8,10,.70) !important;
}
body.route-cinema .ready-card em,
body.route-cinema .ready-summary strong {
  display: none !important;
}

/* Cleaner upload/local panels. */
body.route-cinema .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  width: min(780px, calc(100vw - 48px)) !important;
  min-height: auto !important;
  overflow: visible !important;
}
body.route-cinema .cinema-panel-form {
  gap: 16px !important;
}
body.route-cinema .cinema-upload-card,
body.route-cinema .cinema-local-card {
  background: rgba(10,10,14,.46) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 28px !important;
  box-shadow: 0 20px 70px rgba(0,0,0,.22) !important;
}
body.route-cinema .cinema-upload-foldout,
body.route-cinema .cinema-upload-queue-box,
body.route-cinema .cinema-upload-progress {
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 22px !important;
  background: rgba(255,255,255,.045) !important;
  padding: 14px !important;
}
body.route-cinema .cinema-upload-foldout summary {
  cursor: pointer !important;
  color: rgba(255,244,229,.88) !important;
  font-weight: 850 !important;
  list-style: none !important;
}
body.route-cinema .cinema-upload-foldout summary::-webkit-details-marker { display: none !important; }
body.route-cinema .cinema-upload-foldout summary::after {
  content: "+" !important;
  float: right !important;
  opacity: .65 !important;
}
body.route-cinema .cinema-upload-foldout[open] summary::after { content: "−" !important; }
body.route-cinema .cinema-upload-optional-grid { margin-top: 14px !important; }
body.route-cinema .cinema-upload-grid {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}
body.route-cinema .cinema-upload-queue-box:nth-child(2) {
  display: none !important;
}
body.route-cinema .native-upload-field {
  background: rgba(255,255,255,.045) !important;
}

@media (max-width: 980px) {
  body.route-cinema .page { padding: 12px !important; }
  body.route-cinema .cinema-window-shell { width: calc(100vw - 28px) !important; min-height: calc(100dvh - 110px) !important; gap: 16px !important; }
  body.route-cinema .cinema-carousel-frame { min-height: 196px !important; grid-template-columns: 40px minmax(0, 1fr) 40px !important; gap: 8px !important; }
  body.route-cinema .cinema-poster-rail { min-height: 196px !important; gap: 12px !important; }
  body.route-cinema .cinema-carousel-card,
  body.route-cinema .cinema-carousel-card .cinema-movie-poster { width: 124px !important; flex-basis: 124px !important; }
  body.route-cinema .cinema-carousel-card .cinema-movie-poster { height: 186px !important; }
  body.route-cinema .cinema-library-hero { padding: 0 46px !important; }
  body.route-cinema .cinema-detail-panel h1 { font-size: clamp(2rem, 8vw, 3.4rem) !important; letter-spacing: -.04em !important; }
}

/* ==============================
   v3.1.14 Cinema deep repair
   Stop fighting old Cinema layers: final, scoped override for nav, library, player viewport.
   ============================== */
body.route-cinema {
  --cinema-cream: #fff4e6;
  --cinema-muted: rgba(255,244,230,.68);
  overflow-x: hidden !important;
}

/* Use the same page/topnav behavior as the rest of the app. Cinema content can be cinematic;
   the global nav should not be custom-skinned by Cinema. */
body.route-cinema:not(.cinema-player-active) .page {
  min-height: 100dvh !important;
  padding: 24px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: transparent !important;
}
body.route-cinema:not(.cinema-player-active) .wrap {
  width: auto !important;
  max-width: 1180px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
body.route-cinema:not(.cinema-player-active) .main {
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  min-height: 70vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Cinema stage can still use the full viewport width while the topbar remains shared/default. */
body.route-cinema:not(.cinema-player-active) .cinema-stage-room {
  position: relative !important;
  width: 100vw !important;
  max-width: none !important;
  height: auto !important;
  min-height: calc(100dvh - 128px) !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background:
    radial-gradient(circle at 14% 72%, rgba(151,82,45,.12), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(48,62,118,.12), transparent 40%),
    linear-gradient(135deg, #050506 0%, #07080c 52%, #090d17 100%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop {
  position: absolute !important;
  inset: -8px !important;
  z-index: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background-size: cover !important;
  background-position: center !important;
  filter: blur(6px) saturate(.98) brightness(.58) !important;
  transform: scale(1.006) !important;
  transition: opacity .32s ease, background-image .24s ease !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.has-frame { opacity: .38 !important; }
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.is-poster-fallback {
  opacity: .18 !important;
  filter: blur(10px) saturate(.94) brightness(.50) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background:
    radial-gradient(circle at 26% 42%, rgba(5,5,6,.34), rgba(5,5,6,.72) 56%, rgba(5,5,6,.90) 100%),
    linear-gradient(90deg, rgba(5,5,6,.82), rgba(5,5,6,.55) 45%, rgba(5,5,6,.82)) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
  position: relative !important;
  z-index: 1 !important;
  width: min(1180px, calc(100vw - 54px)) !important;
  max-width: min(1180px, calc(100vw - 54px)) !important;
  min-height: calc(100dvh - 128px) !important;
  margin: 0 auto !important;
  padding: clamp(12px, 2vh, 24px) 0 32px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(14px, 2vh, 24px) !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::before,
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::after,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::before,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::after,
body.route-cinema:not(.cinema-player-active) .cinema-detail-backdrop {
  display: none !important;
  content: none !important;
  pointer-events: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-library-nav-menu {
  position: absolute !important;
  top: 8px !important;
  right: 0 !important;
  z-index: 20 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-status-pill {
  max-width: min(260px, 30vw) !important;
  color: rgba(255,244,230,.56) !important;
  background: transparent !important;
  border-color: transparent !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-kebab-button {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,244,230,.92) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.24) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-kebab-dropdown {
  position: absolute !important;
  top: 52px !important;
  right: 0 !important;
  z-index: 40 !important;
  min-width: 210px !important;
}

/* Poster rail: no crop, no selected-poster clipping. */
body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
  width: min(620px, calc(100% - 110px)) !important;
  min-height: 220px !important;
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) 46px !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail {
  min-height: 220px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 18px !important;
  padding: 10px 4px 10px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail::-webkit-scrollbar { display: none !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card {
  flex: 0 0 136px !important;
  width: 136px !important;
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: .72 !important;
  transform: none !important;
  transition: opacity .22s ease, transform .22s ease, filter .22s ease !important;
  cursor: pointer !important;
  scroll-snap-align: start !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card:hover { opacity: .94 !important; transform: translateY(-2px) !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card.selected { opacity: 1 !important; transform: none !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster {
  width: 136px !important;
  height: 204px !important;
  aspect-ratio: 2 / 3 !important;
  border-radius: 17px !important;
  border: 1px solid rgba(255,244,229,.12) !important;
  background-color: rgba(255,255,255,.045) !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  box-shadow: 0 16px 44px rgba(0,0,0,.28) !important;
  overflow: hidden !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card.selected .cinema-movie-poster {
  border-color: rgba(239,205,145,.36) !important;
  box-shadow: 0 18px 54px rgba(0,0,0,.35), 0 0 0 1px rgba(239,205,145,.10) inset !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-info { display: none !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-arrow {
  width: 42px !important;
  height: 52px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.065) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,244,230,.86) !important;
  box-shadow: none !important;
}

/* Selected movie details: left, compact, clickable, no date. */
body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 0 0 92px !important;
  display: block !important;
  background: transparent !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel {
  width: min(620px, 100%) !important;
  max-width: 620px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-copy {
  display: grid !important;
  justify-items: start !important;
  gap: 11px !important;
  text-align: left !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
  max-width: 620px !important;
  margin: 0 !important;
  color: var(--cinema-cream) !important;
  font-size: clamp(2.35rem, 4.3vw, 4.65rem) !important;
  line-height: 1.01 !important;
  letter-spacing: -.042em !important;
  font-weight: 640 !important;
  overflow-wrap: anywhere !important;
  text-wrap: balance !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-meta span:nth-child(n+3) { display: none !important; }
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel p {
  max-width: 540px !important;
  margin: 0 !important;
  color: rgba(255,244,230,.72) !important;
  font-weight: 560 !important;
  line-height: 1.48 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions {
  position: relative !important;
  z-index: 30 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions button {
  min-height: 42px !important;
  padding: 0 18px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-carousel-frame,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-hero,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-nav-menu {
  display: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  width: min(780px, calc(100vw - 48px)) !important;
  max-width: min(780px, calc(100vw - 48px)) !important;
  min-height: auto !important;
  overflow: visible !important;
}

/* Player: the old failure was not just ugly CSS; video was stretched to the absolute viewport edge,
   which let native controls get clipped. This gives the video a safe control gutter. */
body.route-cinema.cinema-player-active,
body.route-cinema.cinema-player-active .page,
body.route-cinema.cinema-player-active .wrap,
body.route-cinema.cinema-player-active .main,
body.route-cinema.cinema-player-active .room-view,
body.route-cinema.cinema-player-active .cinema-stage-room {
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #000 !important;
}
body.route-cinema.cinema-player-active .topbar {
  display: none !important;
}
body.route-cinema .cinema-watch-screen.active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: block !important;
  background: #000 !important;
  z-index: 5000 !important;
  overflow: hidden !important;
}
body.route-cinema .cinema-watch-screen:not(.active) { display: none !important; }
body.route-cinema.cinema-player-active .cinema-player.dark-panel,
body.route-cinema.cinema-player-active .cinema-video-viewport,
body.route-cinema.cinema-player-active .cinema-player .video-shell {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: max(54px, env(safe-area-inset-bottom)) !important;
  width: 100vw !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  overflow: hidden !important;
}
body.route-cinema.cinema-player-active #video,
body.route-cinema.cinema-player-active .cinema-player .video-shell video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  background: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body.route-cinema.cinema-player-active .cinema-player-tools {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  right: 18px !important;
  bottom: auto !important;
  z-index: 5600 !important;
}
body.route-cinema.cinema-player-active .cinema-back-arrow {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  left: 18px !important;
  z-index: 5600 !important;
}
body.route-cinema.cinema-player-active .cinema-player-menu-button,
body.route-cinema.cinema-player-active .cinema-back-arrow {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.46) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: rgba(255,244,230,.94) !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.24) !important;
}
body.route-cinema.cinema-player-active .cinema-player-menu-dropdown {
  position: absolute !important;
  top: 54px !important;
  right: 0 !important;
  bottom: auto !important;
  z-index: 5601 !important;
}
body.route-cinema.cinema-player-active .cinema-player-panel {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 76px) !important;
  right: 18px !important;
  bottom: auto !important;
  width: min(390px, calc(100vw - 36px)) !important;
  z-index: 5500 !important;
}
body.route-cinema.cinema-player-active .cinema-now-strip { display: none !important; }
body.route-cinema.cinema-player-active .play-gate {
  position: fixed !important;
  left: 18px !important;
  bottom: max(66px, calc(env(safe-area-inset-bottom) + 66px)) !important;
  max-width: min(440px, calc(100vw - 36px)) !important;
  z-index: 5400 !important;
  opacity: .76 !important;
}
body.route-cinema.cinema-player-active .cinema-readiness-dock {
  position: fixed !important;
  right: 18px !important;
  bottom: max(66px, calc(env(safe-area-inset-bottom) + 66px)) !important;
  top: auto !important;
  width: auto !important;
  max-width: calc(100vw - 36px) !important;
  z-index: 5400 !important;
}
body.route-cinema.cinema-player-active .cinema-ready-toggle {
  min-height: 42px !important;
  padding: 5px 11px 5px 6px !important;
  background: rgba(0,0,0,.42) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema.cinema-player-active .cinema-ready-details {
  right: 0 !important;
  bottom: 52px !important;
  width: min(340px, calc(100vw - 36px)) !important;
}
body.route-cinema.cinema-player-active .ready-card em,
body.route-cinema.cinema-player-active .ready-summary strong { display: none !important; }

@media (max-width: 980px) {
  body.route-cinema:not(.cinema-player-active) .page { padding: 12px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-window-shell { width: calc(100vw - 28px) !important; min-height: calc(100dvh - 104px) !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame { width: calc(100% - 20px) !important; min-height: 196px !important; grid-template-columns: 40px minmax(0,1fr) 40px !important; gap: 8px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-poster-rail { min-height: 196px !important; gap: 12px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-card,
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster { width: 124px !important; flex-basis: 124px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster { height: 186px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-library-hero { padding-left: 50px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 { font-size: clamp(2rem, 8vw, 3.35rem) !important; letter-spacing: -.04em !important; }
}

/* ==============================
   v3.1.14 Cinema layout/resume repair
   Wider library canvas, one-loaded-movie switching, cleaner ready pill, diagonal frame background.
   ============================== */
body.route-cinema:not(.cinema-player-active) .wrap {
  max-width: min(90vw, 1680px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room {
  min-height: calc(100dvh - 116px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
  width: min(90vw, 1680px) !important;
  max-width: min(90vw, 1680px) !important;
  min-height: calc(100dvh - 116px) !important;
  padding-top: clamp(10px, 1.5vh, 18px) !important;
  gap: clamp(12px, 1.7vh, 22px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop {
  inset: 0 !important;
  opacity: 0 !important;
  filter: blur(1.5px) saturate(1.05) brightness(.72) contrast(1.02) !important;
  transform: none !important;
  clip-path: polygon(0 0, 100% 0, 0 100%) !important;
  -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,.96) 0%, rgba(0,0,0,.84) 38%, rgba(0,0,0,.38) 58%, transparent 76%) !important;
  mask-image: linear-gradient(135deg, rgba(0,0,0,.96) 0%, rgba(0,0,0,.84) 38%, rgba(0,0,0,.38) 58%, transparent 76%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.has-frame {
  opacity: .50 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.is-poster-fallback {
  opacity: .22 !important;
  filter: blur(5px) saturate(.96) brightness(.58) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop::after {
  background:
    linear-gradient(135deg, rgba(5,5,6,.24), rgba(5,5,6,.52) 52%, rgba(5,5,6,.82) 100%),
    radial-gradient(circle at 22% 38%, rgba(5,5,6,.12), rgba(5,5,6,.72) 70%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
  width: min(880px, calc(100% - 56px)) !important;
  min-height: 235px !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail {
  min-height: 235px !important;
  gap: 18px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card {
  flex-basis: 150px !important;
  width: 150px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster {
  width: 150px !important;
  height: 225px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
  padding-left: 94px !important;
  width: min(760px, 100%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel {
  width: min(760px, 100%) !important;
  max-width: 760px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
  max-width: 760px !important;
  font-size: clamp(2.45rem, 4.9vw, 5rem) !important;
  letter-spacing: -.035em !important;
  font-weight: 620 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel p {
  max-width: 620px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-library-nav-menu {
  right: 0 !important;
}
body.route-cinema .cinema-readiness-dock {
  transition: transform .22s ease, opacity .22s ease !important;
}
body.route-cinema.cinema-player-active .cinema-readiness-dock {
  right: 22px !important;
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px)) !important;
}
body.route-cinema .cinema-ready-toggle {
  min-height: 48px !important;
  padding: 6px 12px 6px 6px !important;
  gap: 9px !important;
  background: linear-gradient(135deg, rgba(18,18,22,.64), rgba(7,7,10,.48)) !important;
  border-color: rgba(255,244,229,.18) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08) !important;
  transform: translateZ(0) !important;
  transition: transform .18s ease, background .18s ease, border-color .18s ease !important;
}
body.route-cinema .cinema-ready-toggle:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(239,205,145,.34) !important;
  background: linear-gradient(135deg, rgba(25,25,29,.76), rgba(8,8,11,.58)) !important;
}
body.route-cinema .cinema-ready-mini {
  width: 34px !important;
  height: 34px !important;
}
body.route-cinema .cinema-ready-mini .cinema-ready-avatar {
  width: 34px !important;
  height: 34px !important;
  box-shadow: 0 0 0 1px rgba(255,244,229,.14), 0 8px 18px rgba(0,0,0,.24) !important;
}
body.route-cinema .cinema-ready-mini i {
  left: 4px !important;
  right: 4px !important;
  bottom: -4px !important;
  height: 3px !important;
  background: linear-gradient(90deg, #f4d399 var(--ready), rgba(255,255,255,.18) 0) !important;
}
body.route-cinema .cinema-ready-label {
  color: rgba(255,244,230,.72) !important;
  font-size: .78rem !important;
  font-weight: 760 !important;
  letter-spacing: .01em !important;
}
body.route-cinema .cinema-ready-count {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 1px !important;
  min-width: 30px !important;
  justify-content: flex-end !important;
  color: rgba(255,244,230,.94) !important;
  font-weight: 900 !important;
}
body.route-cinema .cinema-ready-count b {
  font-size: 1rem !important;
  line-height: 1 !important;
}
body.route-cinema .cinema-ready-count small {
  font-size: .76rem !important;
  opacity: .62 !important;
}
body.route-cinema.cinema-player-active .cinema-ready-details {
  bottom: 58px !important;
  width: min(360px, calc(100vw - 44px)) !important;
}
body.route-cinema.cinema-player-active .play-gate {
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px)) !important;
}
@media (max-width: 980px) {
  body.route-cinema:not(.cinema-player-active) .cinema-library-hero { padding-left: 50px !important; width: calc(100% - 50px) !important; }
}

/* ==============================
   v3.1.15 Cinema root repair
   Stop fighting the shared nav, remove hard frame edges, fix carousel/player layout.
   ============================== */
body.route-cinema {
  overflow-x: hidden !important;
}
body.route-cinema:not(.cinema-player-active) .page {
  padding: 24px !important;
}
body.route-cinema:not(.cinema-player-active) .wrap {
  max-width: 1180px !important;
  width: auto !important;
  margin: 0 auto !important;
}

/* Library canvas: wide again, no cube, no rectangular frame edge. */
body.route-cinema:not(.cinema-player-active) .cinema-stage-room {
  position: relative !important;
  min-height: calc(100dvh - 122px) !important;
  width: 100% !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
  position: relative !important;
  z-index: 2 !important;
  width: min(92vw, 1720px) !important;
  max-width: min(92vw, 1720px) !important;
  min-height: calc(100dvh - 126px) !important;
  margin: 0 auto !important;
  padding: clamp(16px, 2.4vh, 30px) clamp(22px, 3vw, 54px) clamp(38px, 6vh, 74px) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: clamp(16px, 3vh, 38px) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::before,
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::after,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::before,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::after,
body.route-cinema:not(.cinema-player-active) .cinema-detail-backdrop {
  display: none !important;
  content: none !important;
  pointer-events: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 0 !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  opacity: 0 !important;
  filter: blur(.4px) saturate(1.08) brightness(.74) contrast(1.04) !important;
  transform: none !important;
  clip-path: none !important;
  pointer-events: none !important;
  -webkit-mask-image: linear-gradient(to bottom right, rgba(0,0,0,.94) 0%, rgba(0,0,0,.78) 38%, rgba(0,0,0,.40) 58%, transparent 78%) !important;
  mask-image: linear-gradient(to bottom right, rgba(0,0,0,.94) 0%, rgba(0,0,0,.78) 38%, rgba(0,0,0,.40) 58%, transparent 78%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.has-frame { opacity: .62 !important; }
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.is-poster-fallback {
  opacity: .22 !important;
  filter: blur(2px) saturate(.96) brightness(.56) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(90deg, rgba(3,3,5,.72), rgba(3,3,5,.40) 36%, rgba(3,3,5,.86) 100%) !important;
  pointer-events: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-library-nav-menu {
  position: absolute !important;
  top: clamp(14px, 2vh, 28px) !important;
  right: clamp(20px, 3vw, 56px) !important;
  z-index: 20 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
  width: min(760px, 46vw) !important;
  max-width: 820px !important;
  min-height: 230px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  position: relative !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-arrow {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  width: 46px !important;
  height: 46px !important;
  z-index: 10 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail {
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 226px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding: 8px 4px 12px !important;
  scroll-behavior: smooth !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card {
  width: 148px !important;
  flex: 0 0 148px !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster,
body.route-cinema:not(.cinema-player-active) .cinema-movie-poster.has-poster,
body.route-cinema:not(.cinema-player-active) [data-movie-poster-id] {
  width: 148px !important;
  height: 222px !important;
  border-radius: 20px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-color: rgba(255,244,229,.045) !important;
  border: 1px solid rgba(255,244,229,.16) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.30) !important;
  overflow: hidden !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card.selected .cinema-movie-poster {
  border-color: rgba(240,205,142,.55) !important;
  box-shadow: 0 0 0 1px rgba(240,205,142,.20), 0 22px 56px rgba(0,0,0,.36) !important;
  transform: translateY(-2px) scale(1.01) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
  width: min(760px, 54vw) !important;
  max-width: 760px !important;
  padding: 0 0 0 92px !important;
  margin: 0 !important;
  align-self: start !important;
  text-align: left !important;
  z-index: 3 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel,
body.route-cinema:not(.cinema-player-active) .cinema-detail-copy {
  width: 100% !important;
  max-width: 760px !important;
  text-align: left !important;
  align-items: flex-start !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
  max-width: 760px !important;
  font-size: clamp(2.9rem, 5.1vw, 5.3rem) !important;
  line-height: .98 !important;
  letter-spacing: -.035em !important;
  font-weight: 640 !important;
  text-wrap: balance !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions {
  position: relative !important;
  z-index: 6 !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions button {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Player: native controls get full space; viewer/ready lives in menu, not by native controls. */
body.route-cinema.cinema-player-active .page { padding: 0 !important; }
body.route-cinema.cinema-player-active .topbar { display: none !important; }
body.route-cinema.cinema-player-active .cinema-watch-screen,
body.route-cinema.cinema-player-active .cinema-player.dark-panel,
body.route-cinema.cinema-player-active .cinema-video-viewport,
body.route-cinema.cinema-player-active .cinema-player .video-shell {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  box-shadow: none !important;
}
body.route-cinema.cinema-player-active #video {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  object-fit: contain !important;
  background: #000 !important;
}
body.route-cinema.cinema-player-active .cinema-readiness-dock {
  display: none !important;
}
body.route-cinema.cinema-player-active .cinema-player-tools {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  right: 20px !important;
  bottom: auto !important;
  z-index: 5600 !important;
}
body.route-cinema.cinema-player-active .cinema-player-panel {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 76px) !important;
  right: 20px !important;
  bottom: auto !important;
  width: min(390px, calc(100vw - 40px)) !important;
  max-height: calc(100dvh - 112px) !important;
  overflow: auto !important;
  z-index: 5599 !important;
}
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-grid,
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-details {
  position: static !important;
  display: grid !important;
  width: 100% !important;
  gap: 9px !important;
}
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-toggle {
  width: 100% !important;
  justify-content: flex-start !important;
  background: rgba(255,244,229,.06) !important;
}
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-details.hidden { display: grid !important; }
body.route-cinema.cinema-player-active .cinema-viewers-panel .ready-summary,
body.route-cinema.cinema-player-active .cinema-viewers-panel .ready-card {
  background: rgba(255,244,229,.055) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 17px !important;
}
body.route-cinema.cinema-player-active .play-gate {
  bottom: calc(env(safe-area-inset-bottom) + 22px) !important;
  left: 22px !important;
  max-width: min(430px, calc(100vw - 44px)) !important;
  opacity: .86 !important;
}

@media (max-width: 980px) {
  body.route-cinema:not(.cinema-player-active) .page { padding: 10px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    padding: 14px 12px 38px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
    width: 100% !important;
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 48px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
    font-size: clamp(2.15rem, 10vw, 3.6rem) !important;
  }
}

/* ==============================
   v3.1.16 Cinema surgical repair
   Shared nav is left alone; only Cinema content below the nav is scoped here.
   ============================== */
body.route-cinema {
  overflow-x: hidden !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-stage-room {
  position: relative !important;
  width: 100% !important;
  min-height: calc(100dvh - 122px) !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 218, 159, .055), transparent 30%),
    radial-gradient(circle at 88% 76%, rgba(82, 72, 132, .12), transparent 40%),
    linear-gradient(135deg, #050506 0%, #07080d 52%, #090d17 100%) !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
  position: relative !important;
  z-index: 2 !important;
  width: min(92vw, 1720px) !important;
  max-width: min(92vw, 1720px) !important;
  min-height: calc(100dvh - 128px) !important;
  margin: 0 auto !important;
  padding: clamp(16px, 2.4vh, 30px) clamp(22px, 3vw, 54px) clamp(38px, 6vh, 74px) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: clamp(16px, 3vh, 38px) !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-window-shell::before,
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::after,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::before,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::after,
body.route-cinema:not(.cinema-player-active) .cinema-detail-backdrop {
  display: none !important;
  content: none !important;
  pointer-events: none !important;
}

/* Diagonal frame: visible from top-left into bottom-right, with a soft fade and no cut edge. */
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop {
  position: fixed !important;
  inset: -1px !important;
  width: calc(100vw + 2px) !important;
  height: calc(100dvh + 2px) !important;
  z-index: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  filter: blur(1.2px) saturate(1.08) brightness(.72) contrast(1.03) !important;
  transform: none !important;
  clip-path: none !important;
  -webkit-mask-image: linear-gradient(to bottom right, rgba(0,0,0,.96) 0%, rgba(0,0,0,.84) 28%, rgba(0,0,0,.54) 52%, rgba(0,0,0,.20) 76%, transparent 100%) !important;
  mask-image: linear-gradient(to bottom right, rgba(0,0,0,.96) 0%, rgba(0,0,0,.84) 28%, rgba(0,0,0,.54) 52%, rgba(0,0,0,.20) 76%, transparent 100%) !important;
  transition: opacity .32s ease, background-image .24s ease !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.has-frame {
  opacity: .58 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.is-poster-fallback {
  opacity: .24 !important;
  filter: blur(4px) saturate(.98) brightness(.58) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background:
    linear-gradient(to bottom right, rgba(3,3,5,.26) 0%, rgba(3,3,5,.48) 46%, rgba(3,3,5,.88) 100%),
    radial-gradient(circle at 18% 24%, rgba(3,3,5,.08), rgba(3,3,5,.68) 74%) !important;
  pointer-events: none !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-library-nav-menu {
  position: absolute !important;
  top: clamp(14px, 2vh, 28px) !important;
  right: clamp(20px, 3vw, 56px) !important;
  z-index: 20 !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
  width: min(760px, 46vw) !important;
  max-width: 820px !important;
  min-height: 230px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-arrow {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  z-index: 10 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail {
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
  min-height: 226px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding: 8px 4px 12px !important;
  scroll-behavior: smooth !important;
  scrollbar-width: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail::-webkit-scrollbar {
  display: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card {
  width: 148px !important;
  flex: 0 0 148px !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster,
body.route-cinema:not(.cinema-player-active) .cinema-movie-poster.has-poster,
body.route-cinema:not(.cinema-player-active) [data-movie-poster-id] {
  width: 148px !important;
  height: 222px !important;
  border-radius: 20px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-color: rgba(255,244,229,.045) !important;
  border: 1px solid rgba(255,244,229,.16) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.30) !important;
  overflow: hidden !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card.selected .cinema-movie-poster {
  border-color: rgba(240,205,142,.55) !important;
  box-shadow: 0 0 0 1px rgba(240,205,142,.20), 0 22px 56px rgba(0,0,0,.36) !important;
  transform: translateY(-2px) scale(1.01) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
  width: min(760px, 54vw) !important;
  max-width: 760px !important;
  padding: 0 0 0 92px !important;
  margin: 0 !important;
  align-self: start !important;
  text-align: left !important;
  z-index: 3 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel,
body.route-cinema:not(.cinema-player-active) .cinema-detail-copy {
  width: 100% !important;
  max-width: 760px !important;
  text-align: left !important;
  align-items: flex-start !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
  max-width: 760px !important;
  font-size: clamp(2.9rem, 5.1vw, 5.3rem) !important;
  line-height: .98 !important;
  letter-spacing: -.035em !important;
  font-weight: 640 !important;
  text-wrap: balance !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions {
  position: relative !important;
  z-index: 6 !important;
  pointer-events: auto !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-carousel-frame,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-hero,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-nav-menu {
  display: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  width: min(780px, calc(100vw - 48px)) !important;
  max-width: min(780px, calc(100vw - 48px)) !important;
  min-height: auto !important;
}

/* Player: keep native controls clean; readiness is accessed through the three-dot dropdown only. */
body.route-cinema.cinema-player-active .cinema-readiness-dock {
  display: none !important;
}
body.route-cinema.cinema-player-active .cinema-player-tools {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 18px) !important;
  right: 20px !important;
  bottom: auto !important;
  z-index: 5600 !important;
}
body.route-cinema.cinema-player-active .cinema-player-panel {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 76px) !important;
  right: 20px !important;
  bottom: auto !important;
  width: min(390px, calc(100vw - 40px)) !important;
  max-height: calc(100dvh - 112px) !important;
  overflow: auto !important;
  z-index: 5599 !important;
}
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-grid,
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-details {
  position: static !important;
  display: grid !important;
  width: 100% !important;
  gap: 9px !important;
}
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-toggle {
  width: 100% !important;
  justify-content: flex-start !important;
  background: rgba(255,244,229,.06) !important;
}
body.route-cinema.cinema-player-active .cinema-viewers-panel .cinema-ready-details.hidden {
  display: grid !important;
}
body.route-cinema.cinema-player-active .play-gate {
  bottom: calc(env(safe-area-inset-bottom) + 22px) !important;
  left: 22px !important;
  max-width: min(430px, calc(100vw - 44px)) !important;
  opacity: .86 !important;
}

@media (max-width: 980px) {
  body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    padding: 14px 12px 38px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
    width: 100% !important;
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 48px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
    font-size: clamp(2.15rem, 10vw, 3.6rem) !important;
  }
}

/* ==============================
   v3.1.17 Cinema layout rebuild
   Full-bleed page below shared nav, sane empty state, balanced movie-library layout.
   ============================== */
body.route-cinema:not(.cinema-player-active) {
  overflow-x: hidden !important;
  background: #050506 !important;
}
body.route-cinema:not(.cinema-player-active) .page {
  padding: 0 24px 24px !important;
  min-height: 100dvh !important;
  overflow-x: hidden !important;
  background: transparent !important;
}
body.route-cinema:not(.cinema-player-active) .wrap {
  width: min(100%, 1360px) !important;
  max-width: 1360px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
}
body.route-cinema:not(.cinema-player-active) .main,
body.route-cinema:not(.cinema-player-active) .room-view {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Full bleed starts under the shared navbar; the nav itself is untouched. */
body.route-cinema:not(.cinema-player-active) .cinema-stage-room {
  position: relative !important;
  width: 100vw !important;
  max-width: none !important;
  min-height: calc(100dvh - 114px) !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  margin-top: 12px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 220, 166, .07), transparent 30%),
    radial-gradient(circle at 82% 76%, rgba(75, 86, 154, .14), transparent 42%),
    radial-gradient(circle at 4% 92%, rgba(141, 73, 38, .12), transparent 32%),
    linear-gradient(135deg, #050506 0%, #07080d 54%, #090e19 100%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background:
    linear-gradient(90deg, rgba(0,0,0,.42), transparent 22%, transparent 74%, rgba(0,0,0,.18)),
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,.28) 100%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
  position: relative !important;
  z-index: 3 !important;
  width: min(1360px, calc(100vw - 64px)) !important;
  max-width: min(1360px, calc(100vw - 64px)) !important;
  min-height: calc(100dvh - 132px) !important;
  margin: 0 auto !important;
  padding: clamp(22px, 4vh, 54px) clamp(18px, 2.8vw, 46px) clamp(34px, 6vh, 72px) !important;
  display: grid !important;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-template-areas:
    'hero tools'
    'hero rail' !important;
  gap: clamp(20px, 4vw, 72px) !important;
  align-items: center !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::before,
body.route-cinema:not(.cinema-player-active) .cinema-window-shell::after,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::before,
body.route-cinema:not(.cinema-player-active) .cinema-library-hero::after,
body.route-cinema:not(.cinema-player-active) .cinema-detail-backdrop {
  display: none !important;
  content: none !important;
}

/* Top-left to bottom-right frame/backdrop, softened so it never cuts as a hard rectangle. */
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop {
  position: absolute !important;
  inset: -24px !important;
  z-index: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  filter: blur(10px) saturate(1.04) brightness(.60) contrast(1.02) !important;
  transform: scale(1.025) !important;
  clip-path: none !important;
  -webkit-mask-image:
    linear-gradient(to bottom right, rgba(0,0,0,.94) 0%, rgba(0,0,0,.80) 26%, rgba(0,0,0,.48) 53%, rgba(0,0,0,.18) 76%, transparent 100%),
    radial-gradient(ellipse at 28% 28%, rgba(0,0,0,.92), transparent 72%) !important;
  -webkit-mask-composite: source-in !important;
  mask-image:
    linear-gradient(to bottom right, rgba(0,0,0,.94) 0%, rgba(0,0,0,.80) 26%, rgba(0,0,0,.48) 53%, rgba(0,0,0,.18) 76%, transparent 100%),
    radial-gradient(ellipse at 28% 28%, rgba(0,0,0,.92), transparent 72%) !important;
  mask-composite: intersect !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.has-frame { opacity: .48 !important; }
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop.is-poster-fallback { opacity: .26 !important; }
body.route-cinema:not(.cinema-player-active) .cinema-frame-backdrop::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  background:
    linear-gradient(to bottom right, rgba(3,3,5,.20) 0%, rgba(3,3,5,.48) 46%, rgba(3,3,5,.90) 100%),
    radial-gradient(circle at 18% 24%, rgba(3,3,5,.06), rgba(3,3,5,.66) 76%) !important;
}

body.route-cinema:not(.cinema-player-active) .cinema-library-nav-menu {
  grid-area: tools !important;
  position: relative !important;
  top: auto !important;
  right: auto !important;
  justify-self: end !important;
  align-self: start !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  z-index: 30 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-status-pill {
  max-width: min(320px, 32vw) !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,244,230,.70) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-kebab-button {
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  color: rgba(255,244,230,.92) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.24) !important;
  backdrop-filter: blur(16px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-kebab-dropdown {
  top: 54px !important;
  right: 0 !important;
  z-index: 50 !important;
}

body.route-cinema:not(.cinema-player-active) [data-cinema-panel='stored'] {
  grid-area: rail !important;
  align-self: center !important;
  justify-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
  width: 100% !important;
  max-width: none !important;
  min-height: 260px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-arrow {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.065) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,244,230,.88) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.20) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-arrow:disabled {
  opacity: .28 !important;
  pointer-events: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail {
  min-height: 260px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 20px !important;
  padding: 14px 6px 18px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scroll-behavior: smooth !important;
  scrollbar-width: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-poster-rail::-webkit-scrollbar { display: none !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card {
  width: 156px !important;
  flex: 0 0 156px !important;
  display: block !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: .74 !important;
  transition: opacity .22s ease, transform .22s ease !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card:hover { opacity: .94 !important; transform: translateY(-3px) !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card.selected { opacity: 1 !important; }
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster,
body.route-cinema:not(.cinema-player-active) .cinema-movie-poster.has-poster,
body.route-cinema:not(.cinema-player-active) [data-movie-poster-id] {
  width: 156px !important;
  height: 234px !important;
  border-radius: 20px !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-color: rgba(255,244,229,.045) !important;
  border: 1px solid rgba(255,244,229,.16) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.32) !important;
  overflow: hidden !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card.selected .cinema-movie-poster {
  border-color: rgba(240,205,142,.55) !important;
  box-shadow: 0 0 0 1px rgba(240,205,142,.20), 0 24px 58px rgba(0,0,0,.38) !important;
  transform: translateY(-2px) scale(1.012) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-info { display: none !important; }

body.route-cinema:not(.cinema-player-active) .cinema-library-hero {
  grid-area: hero !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: stretch !important;
  text-align: left !important;
  z-index: 5 !important;
  overflow: visible !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel,
body.route-cinema:not(.cinema-player-active) .cinema-detail-copy {
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  justify-items: start !important;
  align-items: start !important;
  text-align: left !important;
  gap: 14px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel .eyebrow {
  color: rgba(255,244,230,.58) !important;
  letter-spacing: .16em !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
  max-width: 11ch !important;
  margin: 0 !important;
  color: var(--cinema-cream, #fff4e6) !important;
  font-size: clamp(3.1rem, 5.8vw, 6rem) !important;
  line-height: .94 !important;
  letter-spacing: -.05em !important;
  font-weight: 680 !important;
  overflow-wrap: normal !important;
  text-wrap: balance !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-detail-panel p {
  max-width: 470px !important;
  margin: 0 !important;
  color: rgba(255,244,230,.72) !important;
  font-weight: 560 !important;
  line-height: 1.55 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-subtitle-line { color: rgba(255,244,230,.58) !important; }
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  position: relative !important;
  z-index: 8 !important;
  pointer-events: auto !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-focus-actions button {
  min-height: 44px !important;
  padding-inline: 18px !important;
}

/* Empty library: no orphan arrows, no cropped headline, clean centered call-to-action. */
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-window-shell {
  width: min(1180px, calc(100vw - 64px)) !important;
  max-width: min(1180px, calc(100vw - 64px)) !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-template-areas:
    'tools'
    'hero' !important;
  place-items: center !important;
  gap: 0 !important;
  padding-top: clamp(22px, 4vh, 52px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library [data-cinema-panel='stored'],
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-carousel-frame,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-poster-rail,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-carousel-arrow {
  display: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-library-nav-menu {
  grid-area: tools !important;
  justify-self: end !important;
  align-self: start !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-status-pill {
  display: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-library-hero {
  width: min(760px, calc(100vw - 80px)) !important;
  max-width: min(760px, calc(100vw - 80px)) !important;
  padding: 0 !important;
  margin: 0 auto !important;
  align-self: center !important;
  justify-self: center !important;
  text-align: center !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-detail-panel,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-detail-copy {
  max-width: 760px !important;
  justify-items: center !important;
  align-items: center !important;
  text-align: center !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-detail-panel h1 {
  max-width: none !important;
  width: 100% !important;
  font-size: clamp(3.4rem, 8vw, 7.2rem) !important;
  line-height: .92 !important;
  letter-spacing: -.06em !important;
  text-align: center !important;
  white-space: normal !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-detail-panel p {
  max-width: 620px !important;
  text-align: center !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-focus-actions {
  justify-content: center !important;
}

/* Local/upload modes: keep forms centered instead of inheriting the movie grid. */
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-window-shell {
  width: min(860px, calc(100vw - 64px)) !important;
  max-width: min(860px, calc(100vw - 64px)) !important;
  min-height: calc(100dvh - 132px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  padding: clamp(28px, 6vh, 72px) clamp(18px, 3vw, 44px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-nav-menu,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-carousel-frame,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-library-hero {
  display: none !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room:not(.cinema-tab-stored-active) .cinema-tab-panel:not(.hidden) {
  display: block !important;
  width: 100% !important;
}

@media (max-width: 1050px) {
  body.route-cinema:not(.cinema-player-active) .page { padding-inline: 12px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room { margin-top: 10px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-window-shell {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    min-height: calc(100dvh - 126px) !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      'tools'
      'hero'
      'rail' !important;
    align-items: start !important;
    gap: 24px !important;
    padding: 18px 16px 44px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-library-nav-menu { justify-self: end !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-library-hero { padding-top: 26px !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-detail-panel,
  body.route-cinema:not(.cinema-player-active) .cinema-detail-copy { max-width: 100% !important; }
  body.route-cinema:not(.cinema-player-active) .cinema-detail-panel h1 {
    max-width: 12ch !important;
    font-size: clamp(2.6rem, 12vw, 5.2rem) !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-frame {
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
    min-height: 228px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-card,
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster,
  body.route-cinema:not(.cinema-player-active) .cinema-movie-poster.has-poster,
  body.route-cinema:not(.cinema-player-active) [data-movie-poster-id] {
    width: 136px !important;
    flex-basis: 136px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-carousel-card .cinema-movie-poster,
  body.route-cinema:not(.cinema-player-active) .cinema-movie-poster.has-poster,
  body.route-cinema:not(.cinema-player-active) [data-movie-poster-id] { height: 204px !important; }
}
@media (max-width: 620px) {
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-library-hero {
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-empty-library .cinema-detail-panel h1 {
    font-size: clamp(2.7rem, 15vw, 4.2rem) !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-status-pill { display: none !important; }
}



/* ==============================
   v3.1.18 Cinema library tune
   - Poster rail on top, hero below.
   - Flip ambient/backdrop emphasis to the right.
   - Sharper, less blurry frame backdrop.
   ============================== */
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active {
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 220, 166, .10), transparent 30%),
    radial-gradient(circle at 18% 76%, rgba(75, 86, 154, .16), transparent 42%),
    radial-gradient(circle at 96% 88%, rgba(141, 73, 38, .10), transparent 28%),
    linear-gradient(135deg, #050506 0%, #07080d 54%, #090e19 100%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active::before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.48), transparent 20%, transparent 78%, rgba(0,0,0,.10)),
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,.24) 100%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-window-shell {
  width: min(1360px, calc(100vw - 64px)) !important;
  max-width: min(1360px, calc(100vw - 64px)) !important;
  min-height: calc(100dvh - 132px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  grid-template-areas:
    'tools'
    'rail'
    'hero' !important;
  gap: clamp(16px, 2.6vh, 30px) !important;
  align-items: start !important;
  padding: clamp(22px, 3.2vh, 42px) clamp(18px, 2.8vw, 46px) clamp(34px, 5vh, 60px) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-library-nav-menu {
  grid-area: tools !important;
  justify-self: end !important;
  align-self: start !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active [data-cinema-panel='stored'] {
  grid-area: rail !important;
  align-self: start !important;
  justify-self: stretch !important;
  width: 100% !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-carousel-frame {
  min-height: 252px !important;
  gap: 16px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-poster-rail {
  min-height: 252px !important;
  align-items: flex-start !important;
  padding: 10px 6px 14px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-library-hero {
  grid-area: hero !important;
  width: 100% !important;
  max-width: none !important;
  align-self: start !important;
  justify-self: stretch !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-panel,
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-copy {
  max-width: 780px !important;
  gap: 14px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-panel h1 {
  max-width: 10ch !important;
  font-size: clamp(2.9rem, 5.2vw, 5.8rem) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-panel p {
  max-width: 620px !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-frame-backdrop {
  background-position: right center !important;
  filter: blur(7px) saturate(1.04) brightness(.64) contrast(1.03) !important;
  transform: scale(1.014) !important;
  -webkit-mask-image:
    linear-gradient(to left, rgba(0,0,0,.95) 0%, rgba(0,0,0,.78) 24%, rgba(0,0,0,.42) 56%, rgba(0,0,0,.12) 82%, transparent 100%),
    radial-gradient(ellipse at 74% 28%, rgba(0,0,0,.88), transparent 72%) !important;
  mask-image:
    linear-gradient(to left, rgba(0,0,0,.95) 0%, rgba(0,0,0,.78) 24%, rgba(0,0,0,.42) 56%, rgba(0,0,0,.12) 82%, transparent 100%),
    radial-gradient(ellipse at 74% 28%, rgba(0,0,0,.88), transparent 72%) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-frame-backdrop.has-frame { opacity: .42 !important; }
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-frame-backdrop.is-poster-fallback {
  opacity: .22 !important;
  filter: blur(9px) saturate(1.02) brightness(.60) contrast(1.01) !important;
}
body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-frame-backdrop::after {
  background:
    linear-gradient(90deg, rgba(3,3,5,.90) 0%, rgba(3,3,5,.78) 22%, rgba(3,3,5,.54) 48%, rgba(3,3,5,.34) 100%),
    radial-gradient(circle at 78% 34%, rgba(3,3,5,.04), rgba(3,3,5,.56) 78%) !important;
}

@media (max-width: 1050px) {
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-window-shell {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      'tools'
      'rail'
      'hero' !important;
    gap: 20px !important;
    padding: 18px 16px 38px !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-library-hero {
    padding-top: 0 !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-panel,
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-copy {
    max-width: 100% !important;
  }
  body.route-cinema:not(.cinema-player-active) .cinema-stage-room.cinema-has-movies.cinema-tab-stored-active .cinema-detail-panel h1 {
    max-width: 12ch !important;
    font-size: clamp(2.4rem, 10vw, 4.8rem) !important;
  }
}


/* ==============================
   v3.1.19 Scores page
   Scoped styling imported from the uploaded FotMob-style demo.
   ============================== */
    .scores-room,
    .scores-room * {
      box-sizing: border-box;
    }

    .scores-room {
      width: min(100%, 1280px);
      margin: 0 auto;
      color: var(--paper, #fff9f0);
      display: grid;
      gap: 16px;
      --scores-panel: rgba(17, 17, 20, 0.74);
      --scores-panel-strong: rgba(20, 20, 24, 0.92);
      --scores-panel-soft: rgba(255, 255, 255, 0.055);
      --scores-line: var(--white-line, rgba(255, 249, 240, 0.14));
      --scores-muted: var(--paper-soft, rgba(255, 249, 240, 0.62));
      --scores-muted-2: rgba(255, 249, 240, 0.42);
      --scores-ink: var(--ink, #241d1e);
      --scores-accent: var(--accent, #d7a86e);
      --scores-green: #41e68b;
      --scores-red: #ff5d6c;
      --scores-yellow: #ffd166;
      --scores-blue: #7ea7ff;
      --scores-radius-xl: var(--radius-xl, 28px);
      --scores-radius-lg: var(--radius-lg, 22px);
      --scores-radius-md: var(--radius-md, 16px);
      --scores-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
    }

    .scores-room button,
    .scores-room select,
    .scores-room input {
      font: inherit;
    }

    .scores-hero {
      position: relative;
      overflow: hidden;
      min-height: 176px;
      border: 1px solid var(--scores-line);
      border-radius: var(--scores-radius-xl);
      background:
        radial-gradient(circle at 10% -35%, rgba(65, 230, 139, 0.24), transparent 34%),
        radial-gradient(circle at 28% -25%, rgba(255, 90, 92, 0.20), transparent 28%),
        radial-gradient(circle at 75% 0%, rgba(80, 115, 255, 0.24), transparent 36%),
        linear-gradient(135deg, rgba(25, 27, 35, 0.96), rgba(15, 15, 18, 0.92));
      box-shadow: var(--scores-shadow);
    }

    .scores-hero::after {
      content: "";
      position: absolute;
      inset: auto -12% -58% 52%;
      height: 220px;
      border-radius: 999px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
      transform: rotate(-14deg);
      pointer-events: none;
    }

    .scores-hero-top {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      padding: 26px 28px 18px;
    }

    .scores-title-lockup {
      display: flex;
      align-items: center;
      gap: 16px;
      min-width: 0;
    }

    .scores-logo {
      width: 52px;
      height: 52px;
      border-radius: 18px;
      display: grid;
      place-items: center;
      color: #181818;
      background: linear-gradient(135deg, #fff8df, #d8b35d 54%, #f7e7a7);
      box-shadow: 0 18px 50px rgba(215, 168, 110, 0.28);
      font-size: 1.6rem;
      flex: 0 0 auto;
    }

    .scores-title-lockup h1 {
      margin: 0;
      font-size: clamp(1.55rem, 3vw, 2.35rem);
      letter-spacing: -0.055em;
      line-height: 0.98;
    }

    .scores-subtitle {
      margin: 5px 0 0;
      color: var(--scores-muted);
      font-size: 0.95rem;
      line-height: 1.35;
    }

    .scores-hero-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      flex-wrap: wrap;
      gap: 10px;
    }

    .scores-pill,
    .scores-select,
    .scores-btn {
      min-height: 36px;
      border-radius: 999px;
      border: 1px solid var(--scores-line);
      background: rgba(255, 255, 255, 0.08);
      color: var(--paper, #fff9f0);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 0 14px;
      font-size: 0.86rem;
      font-weight: 800;
      letter-spacing: -0.01em;
      box-shadow: none;
      white-space: nowrap;
    }

    .scores-btn {
      cursor: pointer;
      transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    }

    .scores-btn:hover {
      transform: translateY(-1px);
      background: rgba(255, 255, 255, 0.13);
    }

    .scores-btn.primary {
      border-color: rgba(255, 255, 255, 0.8);
      background: var(--paper, #fff9f0);
      color: var(--scores-ink);
    }

    .scores-select {
      appearance: none;
      padding-right: 34px;
      background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
      background-position:
        calc(100% - 18px) 52%,
        calc(100% - 13px) 52%;
      background-size: 5px 5px, 5px 5px;
      background-repeat: no-repeat;
      cursor: pointer;
    }

    .scores-tabs {
      position: relative;
      z-index: 1;
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding: 0 28px 18px;
      scrollbar-width: none;
    }

    .scores-tabs::-webkit-scrollbar { display: none; }

    .scores-tab {
      position: relative;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: var(--scores-muted);
      padding: 12px 14px;
      font-weight: 850;
      letter-spacing: -0.02em;
      cursor: pointer;
      white-space: nowrap;
      box-shadow: none;
    }

    .scores-tab:hover {
      color: var(--paper, #fff9f0);
      background: rgba(255, 255, 255, 0.06);
    }

    .scores-tab.active {
      color: var(--paper, #fff9f0);
      background: rgba(255, 255, 255, 0.095);
    }

    .scores-tab.active::after {
      content: "";
      position: absolute;
      left: 16px;
      right: 16px;
      bottom: 4px;
      height: 3px;
      border-radius: 999px;
      background: var(--scores-green);
      box-shadow: 0 0 28px rgba(65, 230, 139, 0.52);
    }

    .scores-status-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .scores-mini-card,
    .scores-panel,
    .scores-rail,
    .scores-match-card,
    .scores-group-card {
      border: 1px solid var(--scores-line);
      border-radius: var(--scores-radius-lg);
      background: var(--scores-panel);
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.20);
      backdrop-filter: blur(20px);
    }

    .scores-mini-card {
      min-height: 84px;
      padding: 16px 17px;
      display: grid;
      gap: 8px;
    }

    .scores-mini-card span {
      color: var(--scores-muted);
      font-size: 0.78rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.12em;
    }

    .scores-mini-card strong {
      font-size: 1.25rem;
      line-height: 1;
      letter-spacing: -0.04em;
    }

    .scores-mini-card small {
      color: var(--scores-muted-2);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .scores-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(330px, 0.42fr);
      gap: 16px;
      align-items: start;
    }

    .scores-content {
      display: grid;
      gap: 14px;
      min-width: 0;
    }

    .scores-panel {
      overflow: hidden;
    }

    .scores-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 18px 20px;
      border-bottom: 1px solid var(--scores-line);
      background: rgba(255, 255, 255, 0.035);
    }

    .scores-panel-head h2,
    .scores-rail-head h2 {
      margin: 0;
      font-size: 1rem;
      letter-spacing: -0.03em;
    }

    .scores-panel-head span,
    .scores-rail-head span {
      color: var(--scores-muted);
      font-size: 0.82rem;
    }

    .scores-section-body {
      padding: 14px;
      display: grid;
      gap: 14px;
    }

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

    .scores-match-card {
      padding: 14px;
      display: grid;
      gap: 12px;
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
        var(--scores-panel);
    }

    .scores-match-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      color: var(--scores-muted);
      font-size: 0.8rem;
      font-weight: 760;
    }

    .scores-live-badge,
    .scores-status-badge,
    .scores-form-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 24px;
      border-radius: 999px;
      padding: 0 8px;
      font-size: 0.72rem;
      font-weight: 900;
      letter-spacing: -0.02em;
    }

    .scores-live-badge {
      color: #062414;
      background: var(--scores-green);
      box-shadow: 0 0 28px rgba(65, 230, 139, 0.34);
    }

    .scores-status-badge {
      color: var(--paper, #fff9f0);
      background: rgba(255, 255, 255, 0.10);
    }

    .scores-status-badge.finished { background: rgba(255, 255, 255, 0.12); color: var(--scores-muted); }
    .scores-status-badge.scheduled { background: rgba(126, 167, 255, 0.16); color: #cfe0ff; }

    .scores-teams {
      display: grid;
      gap: 9px;
    }

    .scores-team-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
    }

    .scores-team-name {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .scores-team-name span:last-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .scores-flag {
      width: 26px;
      height: 26px;
      display: inline-grid;
      place-items: center;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.10);
      flex: 0 0 auto;
      font-size: 1rem;
    }

    .scores-score {
      min-width: 26px;
      text-align: right;
      font-size: 1.15rem;
      font-weight: 950;
      letter-spacing: -0.04em;
    }

    .scores-match-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding-top: 10px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      color: var(--scores-muted-2);
      font-size: 0.78rem;
    }

    .scores-group-stack {
      display: grid;
      gap: 12px;
    }

    .scores-group-card {
      overflow: hidden;
      background: var(--scores-panel-strong);
    }

    .scores-group-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 18px;
      border-bottom: 1px solid var(--scores-line);
      background: rgba(255, 255, 255, 0.035);
    }

    .scores-group-title strong {
      font-size: 0.96rem;
      letter-spacing: -0.025em;
    }

    .scores-group-title span {
      color: var(--scores-muted);
      font-size: 0.78rem;
      font-weight: 800;
    }

    .scores-table-wrap {
      overflow-x: auto;
    }

    .scores-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 710px;
    }

    .scores-table th,
    .scores-table td {
      padding: 12px 10px;
      text-align: center;
      border-bottom: 1px solid rgba(255, 255, 255, 0.07);
      font-size: 0.84rem;
      white-space: nowrap;
    }

    .scores-table th {
      color: var(--scores-muted-2);
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 850;
    }

    .scores-table tr:last-child td {
      border-bottom: 0;
    }

    .scores-table td.team-cell,
    .scores-table th.team-cell {
      text-align: left;
      min-width: 230px;
    }

    .scores-table .rank-cell {
      position: relative;
      width: 42px;
      color: var(--scores-muted);
      font-weight: 850;
    }

    .scores-table .rank-cell::before {
      content: "";
      position: absolute;
      left: 0;
      top: 9px;
      bottom: 9px;
      width: 3px;
      border-radius: 999px;
      background: transparent;
    }

    .scores-table tr.qualify .rank-cell::before { background: var(--scores-green); }
    .scores-table tr.playoff .rank-cell::before { background: var(--scores-yellow); }
    .scores-table tr.out .rank-cell::before { background: transparent; }

    .scores-form-strip {
      display: flex;
      gap: 4px;
      justify-content: center;
    }

    .scores-form-badge.win { background: #09b86f; color: #031c11; }
    .scores-form-badge.draw { background: #9aa3ad; color: #101316; }
    .scores-form-badge.loss { background: #f0475c; color: #fff; }

    .scores-rail {
      position: sticky;
      top: 92px;
      overflow: hidden;
      background: rgba(17, 17, 20, 0.82);
    }

    .scores-rail-head {
      padding: 18px 18px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .scores-round-control {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--paper, #fff9f0);
      background: transparent;
      border: 0;
      font-weight: 900;
      cursor: pointer;
      padding: 8px 10px;
      border-radius: 999px;
      box-shadow: none;
    }

    .scores-rail-body {
      display: grid;
      gap: 10px;
      padding: 0 14px 14px;
      max-height: min(760px, calc(100vh - 210px));
      overflow: auto;
      scrollbar-width: thin;
    }

    .scores-date-block {
      display: grid;
      gap: 8px;
    }

    .scores-date-label {
      position: sticky;
      top: 0;
      z-index: 1;
      padding: 11px 13px;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.07);
      color: var(--paper, #fff9f0);
      font-size: 0.8rem;
      font-weight: 900;
      letter-spacing: -0.01em;
      backdrop-filter: blur(16px);
    }

    .scores-fixture-row {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) auto minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      min-height: 56px;
      padding: 10px 6px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      cursor: pointer;
      border-radius: 12px;
      transition: background 0.18s ease;
    }

    .scores-fixture-row:hover {
      background: rgba(255, 255, 255, 0.055);
    }

    .scores-fixture-status {
      justify-self: center;
      min-width: 32px;
      min-height: 24px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.09);
      color: var(--scores-muted);
      font-size: 0.7rem;
      font-weight: 950;
    }

    .scores-fixture-row.live .scores-fixture-status {
      color: #062414;
      background: var(--scores-green);
    }

    .scores-fixture-team {
      display: flex;
      align-items: center;
      gap: 7px;
      min-width: 0;
      font-size: 0.82rem;
      font-weight: 750;
    }

    .scores-fixture-team.home {
      justify-content: flex-end;
      text-align: right;
    }

    .scores-fixture-team span:last-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .scores-fixture-score {
      min-width: 52px;
      text-align: center;
      color: var(--paper, #fff9f0);
      font-weight: 950;
      letter-spacing: -0.03em;
    }

    .scores-empty {
      min-height: 190px;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 28px;
      border-radius: var(--scores-radius-lg);
      border: 1px dashed rgba(255, 255, 255, 0.18);
      color: var(--scores-muted);
      background: rgba(255, 255, 255, 0.035);
    }

    .scores-empty strong {
      display: block;
      color: var(--paper, #fff9f0);
      margin-bottom: 6px;
    }

    .scores-detail-drawer {
      position: fixed;
      inset: auto 18px 18px auto;
      z-index: 60;
      width: min(420px, calc(100vw - 36px));
      border: 1px solid var(--scores-line);
      border-radius: 26px;
      background:
        radial-gradient(circle at 20% 0%, rgba(65, 230, 139, 0.15), transparent 34%),
        rgba(18, 18, 22, 0.96);
      color: var(--paper, #fff9f0);
      box-shadow: 0 28px 100px rgba(0, 0, 0, 0.52);
      backdrop-filter: blur(24px);
      overflow: hidden;
      transform: translateY(18px);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .scores-detail-drawer.open {
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }

    .scores-detail-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--scores-line);
    }

    .scores-detail-head strong {
      letter-spacing: -0.03em;
    }

    .scores-detail-close {
      width: 36px;
      height: 36px;
      border: 1px solid var(--scores-line);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      color: var(--paper, #fff9f0);
      box-shadow: none;
      cursor: pointer;
    }

    .scores-detail-body {
      padding: 18px;
      display: grid;
      gap: 14px;
    }

    .scores-detail-scoreline {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      align-items: center;
      gap: 12px;
      text-align: center;
    }

    .scores-detail-team {
      display: grid;
      place-items: center;
      gap: 8px;
      font-weight: 900;
      min-width: 0;
    }

    .scores-detail-team .scores-flag {
      width: 44px;
      height: 44px;
      font-size: 1.45rem;
    }

    .scores-detail-score {
      font-size: 2rem;
      font-weight: 1000;
      letter-spacing: -0.06em;
    }

    .scores-detail-meta {
      display: grid;
      gap: 8px;
      padding: 12px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.055);
      color: var(--scores-muted);
      font-size: 0.85rem;
    }

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

    .scores-leader-card,
    .scores-bracket-card {
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.055);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 14px;
    }

    .scores-leader-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .scores-leader-card strong {
      display: block;
      letter-spacing: -0.025em;
    }

    .scores-leader-card span,
    .scores-bracket-card span {
      color: var(--scores-muted);
      font-size: 0.82rem;
    }

    .scores-leader-card b {
      font-size: 1.35rem;
    }

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

    .scores-bracket-card {
      min-height: 116px;
      display: grid;
      align-content: space-between;
      gap: 12px;
    }

    .scores-bracket-card strong {
      letter-spacing: -0.03em;
    }

    .scores-tiny-note {
      color: var(--scores-muted-2);
      font-size: 0.78rem;
      line-height: 1.45;
    }

    @media (max-width: 980px) {
      .scores-layout {
        grid-template-columns: 1fr;
      }

      .scores-rail {
        position: relative;
        top: 0;
      }

      .scores-rail-body {
        max-height: none;
      }

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

      .scores-live-grid,
      .scores-stat-grid,
      .scores-bracket-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 640px) {
      .scores-room {
        gap: 12px;
      }

      .scores-hero-top {
        display: grid;
        padding: 20px 18px 14px;
      }

      .scores-title-lockup {
        align-items: flex-start;
      }

      .scores-logo {
        width: 44px;
        height: 44px;
        border-radius: 15px;
      }

      .scores-hero-actions {
        justify-content: flex-start;
      }

      .scores-tabs {
        padding: 0 18px 14px;
      }

      .scores-status-grid {
        grid-template-columns: 1fr;
      }

      .scores-panel-head,
      .scores-group-title,
      .scores-rail-head {
        align-items: flex-start;
        flex-direction: column;
      }

      .scores-fixture-row {
        grid-template-columns: 36px minmax(0, 1fr) 44px minmax(0, 1fr);
        gap: 6px;
      }

      .scores-fixture-team {
        font-size: 0.76rem;
      }

      .scores-fixture-team .scores-flag {
        display: none;
      }
    }
  

/* App-shell fit for Scores. */
body.route-scores .main {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
}
body.route-scores .scores-room {
  padding-bottom: 42px;
}
@media (max-width: 700px) {
  body.route-scores .main { width: calc(100vw - 18px); }
}
