:root {
  --atlantic: #123c7a;
  --atlantic-dark: #08254e;
  --poster: #ef412f;
  --sky: #b9e7f7;
  --paper: #f7f6f1;
  --ink: #111827;
  --muted: #627083;
  --line: #cbd4dc;
  --white: #fff;
  --day-width: 190px;
  --axis-width: 64px;
  --slot-height: 24.6px;
  --grid-surface: #fff;
  --grid-line: #dce2e8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Archivo", Arial, sans-serif; font-variation-settings: "wdth" 98; }
button, input, select, dialog { font: inherit; }
button, select, summary, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .7rem 1rem; background: var(--white); color: var(--atlantic); }
:focus-visible { outline: 3px solid var(--poster); outline-offset: 2px; }

.masthead { display: grid; grid-template-columns: 8.5rem 1fr auto; min-height: 9.5rem; background: var(--atlantic); color: var(--white); }
.edition { display: grid; place-items: center; background: var(--poster); font-size: 4.7rem; font-weight: 800; letter-spacing: -.08em; }
.masthead__copy { align-self: center; padding: 1.4rem clamp(1.25rem, 3vw, 3.2rem); }
.masthead__copy p { margin: 0 0 .25rem; color: var(--sky); font-size: .82rem; }
.masthead h1 { margin: 0; font-family: "DM Serif Display", Georgia, serif; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 400; line-height: .95; letter-spacing: -.035em; }
.masthead__summary { align-self: center; min-width: 12rem; padding: 1.2rem 2rem; border-left: 1px solid rgb(255 255 255 / .28); }
.masthead__summary strong { display: block; color: var(--sky); font-size: 3.7rem; line-height: .9; letter-spacing: -.07em; }
.masthead__summary span { display: block; max-width: 8rem; margin-top: .5rem; font-size: .78rem; line-height: 1.25; }

.toolbar { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; align-items: center; min-height: 4.6rem; padding: .7rem clamp(1rem, 2.4vw, 2rem); border-bottom: 1px solid var(--line); background: rgb(247 246 241 / .96); backdrop-filter: blur(12px); }
.toolbar__message { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: baseline; }
.toolbar__message strong { color: var(--atlantic-dark); }
.toolbar__message span { color: var(--muted); font-size: .82rem; }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.45rem; padding: .55rem .8rem; border: 1px solid var(--atlantic); background: transparent; color: var(--atlantic); cursor: pointer; font-size: .77rem; font-weight: 750; }
.button--primary { background: var(--atlantic); color: var(--white); }
.file-button input { display: none; }
.status { grid-column: 1 / -1; min-height: 1em; margin: 0; color: var(--muted); font-size: .75rem; }
.status[data-tone="error"] { color: #a52619; font-weight: 650; }

.planner { display: grid; grid-template-columns: minmax(300px, 350px) minmax(0, 1fr); min-height: calc(100vh - 14rem); }
.catalogue { position: relative; z-index: 3; border-right: 1px solid var(--line); background: var(--white); }
.catalogue__heading { display: flex; justify-content: space-between; align-items: end; padding: 1.4rem 1.1rem 1rem; border-bottom: 4px solid var(--atlantic); }
.catalogue h2, .agenda h2 { margin: 0; color: var(--atlantic-dark); font-size: 1.45rem; letter-spacing: -.035em; }
.catalogue__heading p { margin: .2rem 0 0; color: var(--muted); font-size: .76rem; }
.text-button { border: 0; background: none; color: var(--poster); cursor: pointer; font-size: .76rem; font-weight: 720; text-decoration: underline; text-underline-offset: .2rem; }

.filters-panel { border-bottom: 1px solid var(--line); background: var(--paper); }
.filters-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem 1rem; color: var(--atlantic); cursor: pointer; font-size: .76rem; font-weight: 750; list-style: none; }
.filters-panel > summary::-webkit-details-marker { display: none; }
.filters-panel > summary::before { content: "▸"; margin-right: .45rem; color: var(--muted); }
.filters-panel[open] > summary::before { content: "▾"; }
.filters-panel > summary #filter-summary { margin-left: auto; color: var(--muted); font-size: .68rem; font-weight: 650; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; padding: 0 1rem 1rem; background: var(--paper); }
.filters label { display: grid; gap: .25rem; color: var(--muted); font-size: .7rem; }
.filters .search-field { grid-column: 1 / -1; }
.filters input, .filters select { width: 100%; min-width: 0; min-height: 2.35rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 0; background: var(--white); color: var(--ink); font-size: .78rem; }

.film-list { max-height: calc(100vh - 23.5rem); overflow: auto; overscroll-behavior: contain; }
.film-card { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: .65rem; align-items: start; padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: var(--white); cursor: grab; }
.film-card:hover { background: #f4f8fc; }
.film-card.is-selected { box-shadow: inset 5px 0 #176140; background: #e7efe9; }
.film-card.is-selected .film-card__byline, .film-card.is-selected .film-card__meta { opacity: .62; }
.film-card.is-selected h3 { opacity: .68; }
.film-card.is-selected .film-card__state { background: #176140; color: white; padding: .35rem .4rem; }
.film-card.is-selected .film-card__state::before { content: "✓ "; }
.film-card__type { display: inline-block; font-size: .62rem; color: var(--atlantic); font-weight: 750; margin-bottom: .3rem; }
.agenda-event__section { display: block; margin-top: .2rem; font-size: .56rem; color: var(--atlantic); }
.proposal-report { margin: .7rem 1.2rem; border-left: 4px solid var(--atlantic); padding: .65rem 1rem; background: white; font-size: .75rem; line-height: 1.5; }
.proposal-report summary { cursor: pointer; color: var(--atlantic); font-weight: 750; }
.proposal-report p { max-width: 110ch; margin: .55rem 0; }
.proposal-report ul { color: #8a382e; padding-left: 1rem; }
.film-card.is-mandatory { box-shadow: inset 4px 0 var(--atlantic); }
.film-card.is-locked { box-shadow: inset 4px 0 var(--poster), inset 8px 0 var(--atlantic); }
.film-card__rank { display: grid; place-items: center; min-height: 2rem; background: var(--atlantic); color: var(--white); font-size: .72rem; font-weight: 780; }
.film-card.is-mandatory .film-card__rank { background: var(--poster); font-size: 1rem; }
.film-card__section { display: inline-block; width: fit-content; margin-bottom: .3rem; padding: .18rem .35rem; background: var(--sky); color: var(--atlantic-dark); font-size: .59rem; font-weight: 760; line-height: 1.1; }
.film-card h3 { margin: 0; font-size: .88rem; line-height: 1.18; letter-spacing: -.015em; }
.film-card__byline, .film-card__meta, .film-card__reason { margin: .22rem 0 0; color: var(--muted); font-size: .69rem; line-height: 1.35; }
.film-card__state { margin: .38rem 0 0; color: #8a382e; font-size: .66rem; font-weight: 730; }
.film-card.is-selected .film-card__state { color: white; }
.film-card details { margin-top: .45rem; }
.film-card summary { width: fit-content; color: var(--atlantic); cursor: pointer; font-size: .7rem; font-weight: 680; }
.film-card__screenings { display: grid; gap: .25rem; margin-top: .5rem; }
.film-card__screenings button { padding: .35rem .45rem; border: 1px solid var(--line); background: var(--paper); text-align: left; cursor: pointer; font-size: .65rem; line-height: 1.25; }
.film-card__screenings button:disabled { color: #8d97a4; text-decoration: line-through; cursor: not-allowed; }
.film-card__actions { display: grid; gap: .35rem; }
.must-see { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; padding: 0; border: 1px solid var(--atlantic); border-radius: 50%; background: var(--white); color: var(--atlantic); cursor: pointer; font-family: Georgia, serif; font-size: .8rem; font-style: italic; font-weight: 700; }
.must-see { border-color: var(--poster); color: var(--poster); font-family: Arial, sans-serif; font-size: 1rem; font-style: normal; }
.must-see.is-active { background: var(--poster); color: var(--white); }
.must-see:disabled { opacity: .48; cursor: default; }
.add-film { min-width: 3.5rem; padding: .35rem .45rem; border: 1px solid var(--atlantic); background: transparent; color: var(--atlantic); cursor: pointer; font-size: .67rem; font-weight: 750; }
.film-card.is-selected .add-film { border-color: var(--poster); color: var(--poster); }
.add-film:disabled { border-color: var(--line); color: var(--muted); cursor: default; }

.agenda { min-width: 0; padding: 1.4rem clamp(1rem, 2vw, 2rem) 2rem; background: var(--paper); }
.agenda__heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.agenda__heading p { max-width: 48rem; margin: .3rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.legend { display: flex; flex-wrap: wrap; gap: .6rem 1rem; color: var(--muted); font-size: .68rem; }
.legend span { display: inline-flex; align-items: center; gap: .3rem; }
.legend i { width: 1rem; height: .55rem; border: 1px solid var(--line); }
.legend__press { background: var(--sky); }
.legend__buffer { background: repeating-linear-gradient(135deg, transparent 0 3px, #d5dde6 3px 5px); }
.legend__locked { border-top: 3px solid var(--poster) !important; background: #eef4fb; }
.legend__blocked { background: #f2d7d2; }

.timeline-scroll { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); background: var(--white); box-shadow: 0 9px 25px rgb(8 37 78 / .08); }
.timeline-inner { min-width: calc(var(--axis-width) + 9 * var(--day-width)); }
.timeline-header { position: sticky; z-index: 20; top: 0; display: grid; grid-template-columns: var(--axis-width) repeat(9, var(--day-width)); min-height: 4rem; border-bottom: 2px solid var(--atlantic); background: var(--white); }
.timeline-corner, .day-heading { padding: .65rem .6rem; border-right: 1px solid var(--line); }
.timeline-corner { color: var(--muted); font-size: .66rem; }
.day-heading span, .day-heading small { display: block; color: var(--muted); font-size: .64rem; }
.day-heading strong { display: block; margin: .1rem 0; color: var(--atlantic); font-size: .9rem; }
.day-heading:last-child { background: #f6e5e1; }
.timeline-body { position: relative; display: grid; grid-template-columns: var(--axis-width) 1fr; }
.time-axis { position: relative; z-index: 4; border-right: 1px solid var(--line); background: var(--white); }
.time-axis time { position: absolute; right: .5rem; transform: translateY(-.5em); color: var(--muted); font-size: .63rem; font-variant-numeric: tabular-nums; }
.day-grid { display: grid; grid-template-columns: repeat(9, var(--day-width)); }
.day-column { position: relative; border-right: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--grid-surface) 0, var(--grid-surface) calc(var(--slot-height) - 1px), var(--grid-line) calc(var(--slot-height) - 1px), var(--grid-line) var(--slot-height)); }
.day-column:nth-child(even) { background-color: #fbfcfd; background-blend-mode: multiply; }
.day-column.is-drop-target { box-shadow: inset 0 0 0 4px var(--poster); }
.time-slot { position: absolute; z-index: 0; left: 0; right: 0; height: var(--slot-height); padding: 0; border: 0; background: transparent; cursor: pointer; }
.time-slot:hover, .time-slot:focus-visible { z-index: 3; background: rgb(185 231 247 / .42); box-shadow: inset 0 1px var(--atlantic), inset 0 -1px var(--atlantic); }
.time-slot::after { content: "+ opciones"; position: absolute; right: .35rem; top: .2rem; opacity: 0; color: var(--atlantic); font-size: .56rem; font-weight: 760; }
.time-slot:hover::after, .time-slot:focus-visible::after { opacity: 1; }
.blocked-time { position: absolute; z-index: 1; inset-inline: 0; display: grid; align-content: start; gap: .25rem; padding: 1rem; background: repeating-linear-gradient(135deg, rgb(239 65 47 / .12) 0 8px, rgb(239 65 47 / .2) 8px 16px); color: #8d291f; pointer-events: none; }
.blocked-time--full { inset-block: 0; align-content: center; text-align: center; }
.blocked-time span { font-size: .7rem; }
.agenda-buffer { position: absolute; z-index: 2; left: 4px; right: 4px; background: repeating-linear-gradient(135deg, transparent 0 4px, rgb(18 60 122 / .12) 4px 6px); pointer-events: none; }
.agenda-event { position: absolute; z-index: 5; left: 5px; right: 5px; min-height: 26px; overflow: hidden; padding: .45rem 4.05rem .45rem .55rem; border: 1px solid var(--atlantic); border-left: 5px solid var(--atlantic); background: #eef4fb; color: var(--atlantic-dark); cursor: grab; box-shadow: 0 2px 6px rgb(8 37 78 / .12); }
.agenda-event.is-press { border-left-color: #15829a; background: #e7f7fb; }
.agenda-event.is-mandatory { border-color: var(--poster); border-left-color: var(--poster); background: #fff0ed; cursor: default; }
.agenda-event.is-locked { border-top: 3px solid var(--poster); background-image: linear-gradient(135deg, transparent 0 90%, rgb(239 65 47 / .15) 90%); cursor: default; }
.agenda-event__topline { display: flex; justify-content: space-between; gap: .35rem; color: var(--muted); font-size: .59rem; font-weight: 700; }
.agenda-event__rank { color: var(--poster); }
.agenda-event__title { display: block; margin-top: .18rem; font-size: .73rem; line-height: 1.08; }
.agenda-event__venue { display: block; margin-top: .22rem; color: var(--muted); font-size: .58rem; line-height: 1.1; }

.modal { width: min(920px, calc(100vw - 2rem)); max-height: min(88vh, 850px); padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgb(8 37 78 / .38); }
.modal::backdrop { background: rgb(8 20 39 / .7); backdrop-filter: blur(5px); }
.modal__bar { position: sticky; z-index: 4; top: 0; display: flex; justify-content: space-between; gap: 2rem; align-items: start; padding: 1.25rem 1.4rem; border-bottom: 4px solid var(--atlantic); background: var(--white); }
.modal__bar h2, .film-sheet h2 { margin: 0; color: var(--atlantic-dark); font-family: "DM Serif Display", Georgia, serif; font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 400; line-height: 1; }
.modal__eyebrow { margin: 0 0 .35rem; color: var(--poster); font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.modal__subtitle { margin: .45rem 0 0; color: var(--muted); font-size: .78rem; }
.modal__close { flex: 0 0 auto; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; padding: 0; border: 1px solid var(--atlantic); background: var(--white); color: var(--atlantic); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.modal__close--floating { position: fixed; z-index: 8; top: max(1.4rem, calc(6vh + .5rem)); right: max(1.4rem, calc((100vw - min(920px, calc(100vw - 2rem))) / 2 + .5rem)); }
.modal__notice { margin: 1rem 1.4rem 0; padding: .8rem 1rem; border-left: 4px solid var(--poster); background: #fff0ed; color: #68271f; font-size: .75rem; line-height: 1.45; }
.time-options { display: grid; gap: .7rem; padding: 1rem 1.4rem 1.5rem; }
.time-option { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .85rem; border: 1px solid var(--line); background: var(--white); }
.time-option[data-state="warning"] { border-left: 5px solid var(--poster); }
.time-option__time { color: var(--atlantic); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.time-option h3 { margin: 0; font-size: .9rem; line-height: 1.15; }
.time-option__meta { margin: .22rem 0 .45rem; color: var(--muted); font-size: .69rem; }
.warning-list { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.warning-list li { padding: .24rem .4rem; background: #f7ddd8; color: #7d271d; font-size: .62rem; font-weight: 680; }
.warning-list .is-ok { background: #def1e8; color: #176140; }
.time-option__actions { display: grid; gap: .35rem; min-width: 7.5rem; }
.time-option__actions .button { min-height: 2rem; padding: .35rem .5rem; font-size: .66rem; }
.button:disabled { border-color: var(--line); background: #eef0f2; color: #7e8793; cursor: not-allowed; }
.empty-options { padding: 2rem; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

.film-sheet { display: grid; grid-template-columns: minmax(260px, 37%) 1fr; min-height: 36rem; }
.film-sheet.without-image { grid-template-columns: 1fr; }
.film-sheet__visual { position: sticky; top: 0; align-self: start; height: min(88vh, 850px); margin: 0; overflow: hidden; background: var(--atlantic-dark); }
.film-sheet__visual[hidden] { display: none; }
.film-sheet__visual img { width: 100%; height: 100%; object-fit: cover; }
.film-sheet__visual img:not([src]), .film-sheet__visual img[src=""] { display: none; }
.film-sheet__visual figcaption { position: absolute; bottom: 0; left: 0; padding: .45rem .6rem; background: var(--atlantic-dark); color: var(--sky); font-size: .6rem; }
.film-sheet__content { padding: clamp(1.5rem, 4vw, 3.2rem); }
.film-sheet__byline { margin: .8rem 0 1rem; color: var(--muted); font-size: .9rem; }
.film-sheet__facts { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.6rem; }
.film-sheet__facts span { padding: .35rem .5rem; border: 1px solid var(--line); color: var(--atlantic); font-size: .67rem; font-weight: 700; }
.film-sheet h3 { margin: 1.3rem 0 .45rem; color: var(--atlantic-dark); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.film-sheet__synopsis { margin: 0; font-family: Georgia, serif; font-size: .94rem; line-height: 1.62; }
.film-sheet__ranking { margin-top: 1.2rem; padding: .9rem 1rem; border-left: 4px solid var(--atlantic); background: var(--white); color: #374151; font-size: .76rem; line-height: 1.5; }
.film-sheet__passes > div { display: grid; gap: .45rem; }
.film-pass { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .65rem; border-top: 1px solid var(--line); background: var(--white); }
.film-pass strong { display: block; color: var(--atlantic-dark); font-size: .75rem; }
.film-pass span { display: block; margin-top: .15rem; color: var(--muted); font-size: .64rem; }
.film-pass .button { min-height: 2rem; padding: .35rem .5rem; font-size: .63rem; }
.film-pass__actions { display: grid; gap: .3rem; }
.film-sheet__link { width: fit-content; margin-top: 1.3rem; text-decoration: none; }

.mobile-days { display: none; }
footer { display: flex; justify-content: space-between; gap: 2rem; padding: 1.5rem 2rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }

@media (max-width: 900px) {
  .masthead { grid-template-columns: 6.5rem 1fr; min-height: 7.5rem; }
  .edition { font-size: 3.6rem; }
  .masthead__summary { display: none; }
  .toolbar { position: static; grid-template-columns: 1fr; }
  .toolbar__actions { justify-content: flex-start; }
  .planner { grid-template-columns: 1fr; }
  .catalogue { border-right: 0; border-bottom: 1px solid var(--line); }
  .film-list { max-height: 24rem; }
  .agenda { padding-inline: .75rem; }
  .agenda__heading { display: block; }
  .legend { margin-top: .75rem; }
  .mobile-days { display: grid; grid-template-columns: repeat(9, minmax(4.5rem, 1fr)); overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--white); }
  .mobile-days button { min-height: 3.8rem; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--atlantic); }
  .mobile-days button span { display: block; color: var(--muted); font-size: .58rem; }
  .mobile-days button[aria-pressed="true"] { background: var(--atlantic); color: var(--white); }
  .mobile-days button[aria-pressed="true"] span { color: var(--sky); }
  .timeline-inner { min-width: calc(var(--axis-width) + min(78vw, 420px)); }
  .timeline-header { grid-template-columns: var(--axis-width) minmax(0, 1fr); }
  .day-grid { grid-template-columns: 1fr; }
  .day-heading[data-mobile-active="false"], .day-column[data-mobile-active="false"] { display: none; }
  .timeline-scroll { max-height: none; }
}

@media (max-width: 520px) {
  .masthead__copy { padding: 1rem; }
  .masthead h1 { font-size: 2.25rem; }
  .toolbar__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .button--primary { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 1fr; }
  footer { display: block; padding-inline: 1rem; }
  .modal { width: 100vw; max-width: none; max-height: 94vh; margin: auto 0 0; }
  .modal__bar { padding: 1rem; }
  .modal__notice { margin-inline: 1rem; }
  .time-options { padding-inline: 1rem; }
  .time-option { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .time-option__actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .film-sheet { display: block; }
  .film-sheet__visual { position: relative; height: 42vh; }
  .film-sheet__content { padding: 1.25rem 1rem 2rem; }
  .modal__close--floating { position: fixed; top: 4vh; right: .7rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .add-film, .mobile-days button { transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease; }
  .agenda-event { transition: box-shadow 140ms ease; }
}

/* Shared planning tools. Colour always accompanies an explicit status label. */
.toolbar { grid-template-columns: 1fr; }
.toolbar__actions { justify-content: flex-start; }
#save-indicator { font-size: .7rem; color: #176140; }
#save-indicator[data-state="bad"], #settings-error { color: #a52619; font-weight: 700; }
.quick-filters { display: flex; gap: .4rem; flex-wrap: wrap; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.quick-filters button { border: 1px solid var(--line); padding: .35rem .5rem; background: var(--paper); color: var(--muted); font-size: .68rem; cursor: pointer; }
.quick-filters button[aria-pressed="true"] { background: var(--atlantic); border-color: var(--atlantic); color: #fff; }
.film-card { border-left: 4px solid var(--section-color, var(--line)); }
.film-card__section { background: var(--section-color, var(--sky)); color: #172132; }
.film-card[draggable="false"] { cursor: default; }
.film-card__actions { justify-items: center; }
.agenda-event { padding: 1.5rem .5rem .4rem; }
.agenda-event__section { border-left: 3px solid var(--section-color, var(--sky)); padding-left: .3rem; }
.agenda-event__topline { flex-wrap: wrap; justify-content: flex-start; }
.time-axis { position: sticky; left: 0; z-index: 10; }
.timeline-corner { position: sticky; left: 0; background: var(--white); }
.drag-hint { position: sticky; top: 0; z-index: 21; margin: .6rem 0; padding: .7rem; background: var(--white); border-left: 4px solid var(--atlantic); color: var(--ink); font-size: .75rem; line-height: 1.5; }
.drag-hint[hidden] { display: none; }
.drag-preview { position: absolute; z-index: 12; left: 3px; right: 3px; padding: .45rem; border: 2px dashed; overflow: hidden; background: #e4f5eb; border-color: #267146; color: #15462e; box-shadow: 0 2px 7px #0002; font-size: .66rem; cursor: copy; }
.drag-preview strong, .drag-preview span { display: block; }
.drag-preview span { margin-top: .25rem; font-size: .62rem; line-height: 1.3; }
.drag-preview[data-state="warning"] { border-color: #a16e0b; color: #694500; background: #fff0c8; cursor: not-allowed; }
.drag-preview[data-state="bad"] { border-color: #ae3c36; color: #7b211d; background: #f8dcda; cursor: not-allowed; }
.agenda-event[data-state="warning"], .time-option[data-state="warning"] { border-left-color: #c8922a; }
.agenda-event[data-state="bad"], .time-option[data-state="bad"] { border-left: 5px solid #c04848; }
.agenda-event[data-state="bad"] { background: #f8dcda; }
.time-option[data-state="ok"] { border-left: 5px solid #2f9e6a; }
.time-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; margin: 1rem 1.4rem 0; font-size: .74rem; }
.time-controls label { display: flex; align-items: center; gap: .35rem; }
.time-controls select, .settings-form input, .settings-form select { min-width: 0; padding: .5rem; border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.settings-form { padding: 1.3rem; font-size: .8rem; }
.settings-form fieldset { margin: 0 0 1.3rem; padding: 1rem; border: 1px solid var(--line); }
.settings-form legend { color: var(--atlantic); font-size: .9rem; font-weight: 750; }
.settings-form p { color: var(--muted); line-height: 1.6; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.settings-grid label, .blackout-row label { display: grid; gap: .35rem; }
.settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.settings-travel-wrap { overflow-x: auto; padding-bottom: .15rem; }
.settings-travel-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .65rem; font-variant-numeric: tabular-nums; }
.settings-travel-table th, .settings-travel-table td { height: 2rem; padding: .2rem .3rem; border: 1px solid var(--line); text-align: center; }
.settings-travel-table thead th { color: var(--muted); font-size: .59rem; font-weight: 720; white-space: nowrap; }
.settings-travel-table thead th:first-child, .settings-travel-table tbody th { min-width: 8.5rem; text-align: left; color: var(--atlantic-dark); font-weight: 730; white-space: nowrap; }
.settings-travel-table td { min-width: 3.5rem; }
.settings-travel-table td.settings-travel-table__empty { background: color-mix(in srgb, var(--paper) 55%, transparent); }
.settings-travel-table td.settings-travel-table__same { color: var(--muted); font-weight: 700; }
.settings-travel-table input { width: 100%; min-width: 2.65rem; height: 1.55rem; padding: .15rem .25rem; border-radius: .35rem; text-align: center; font-variant-numeric: tabular-nums; }
.blackout-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; align-items: end; gap: .5rem; margin-bottom: .7rem; }
.blackout-row input, .blackout-row select { width: 100%; }
.discarded-film { border-bottom: 1px solid var(--line); padding: .8rem 0; font-size: .76rem; }
.discarded-film .text-button { text-align: left; color: var(--atlantic); font-size: .85rem; }
.discarded-film p { line-height: 1.5; color: var(--muted); }
.session-choice { justify-content: flex-start; text-align: left; }
.personal-blackout { padding: .2rem .5rem; overflow: hidden; font-size: .7rem; }

/* Programador: the alternate night workspace, inspired by the local reference. */
:root[data-theme="programador"] {
  color-scheme: dark;
  --paper: #0d0f14; --white: #151922; --ink: #f4f6fb; --muted: #a6b2c5;
  --line: #2a3140; --atlantic: #8bb8ff; --atlantic-dark: #e4edfc;
  --poster: #ff998b; --sky: #b9d8fb; --grid-surface: #101319; --grid-line: #252d3b;
}
[data-theme="programador"] body { font-family: "Archivo", system-ui, sans-serif; }
[data-theme="programador"] .masthead { min-height: 5.2rem; grid-template-columns: 5rem 1fr auto; background: #11141b; color: var(--ink); border-bottom: 1px solid var(--line); }
[data-theme="programador"] .edition { background: #1b2435; color: #d8b34a; font-size: 2.6rem; }
[data-theme="programador"] .masthead h1 { font-family: "Archivo", sans-serif; font-size: clamp(1.2rem, 2.5vw, 2rem); font-weight: 800; letter-spacing: -.03em; }
[data-theme="programador"] .masthead__copy { padding: 1rem 1.4rem; }
[data-theme="programador"] .masthead__summary { padding: .8rem 1.5rem; }
[data-theme="programador"] .masthead__summary strong { color: #d8b34a; font-size: 2rem; }
[data-theme="programador"] .toolbar { background: #0d0f14f5; }
[data-theme="programador"] .button, [data-theme="programador"] .quick-filters button { border-color: #3b4760; border-radius: 8px; background: #202634; color: #f4f6fb; }
[data-theme="programador"] .button:hover { background: #293348; }
[data-theme="programador"] .button--primary, [data-theme="programador"] .quick-filters button[aria-pressed="true"] { background: #3462a6; border-color: #759ddd; color: #fff; }
[data-theme="programador"] .button:disabled { background: #1b2029; color: #8d98aa; border-color: var(--line); }
[data-theme="programador"] .catalogue { background: #101319; }
[data-theme="programador"] .filters-panel { background: #101319; }
[data-theme="programador"] .filters-panel > summary { color: #b8d3ff; }
[data-theme="programador"] .catalogue__heading { border-bottom-width: 1px; }
[data-theme="programador"] .film-card { margin: .45rem; border: 1px solid var(--line); border-left: 4px solid var(--section-color); border-radius: 10px; padding: .75rem .65rem; gap: .5rem; }
[data-theme="programador"] .film-card:hover { background: #1b2230; }
[data-theme="programador"] .film-card.is-selected { background: linear-gradient(90deg,#16261e,#151922 85%); box-shadow: none; }
[data-theme="programador"] .film-card__rank { background: transparent; color: #edcf71; font-size: .95rem; }
[data-theme="programador"] .film-card.is-mandatory .film-card__rank { background: transparent; }
[data-theme="programador"] .film-card.is-selected .film-card__state { background: #183828; color: #b3ecc7; }
[data-theme="programador"] .film-card__state, [data-theme="programador"] .status[data-tone="error"], [data-theme="programador"] #settings-error { color: #f5aaa2; }
[data-theme="programador"] .film-card.is-locked { box-shadow: inset 3px 0 #d8b34a; }
[data-theme="programador"] .film-card__section { border-radius: 4px; }
[data-theme="programador"] .must-see.is-active { background: #402332; border-color: #e883a0; color: #ffc0d2; }
[data-theme="programador"] .must-see:disabled { opacity: .8; }
[data-theme="programador"] .proposal-report { background: #151922; }
[data-theme="programador"] .proposal-report ul { color: #e9bd82; }
[data-theme="programador"] .day-heading:last-child { background: #2b1c24; }
[data-theme="programador"] .day-column:nth-child(even) { background-color: #101319; background-blend-mode: normal; }
[data-theme="programador"] .blocked-time { background: repeating-linear-gradient(135deg,#271b22dd 0 8px,#381f29dd 8px 16px); color: #e1a1a9; }
[data-theme="programador"] .agenda-buffer { background: repeating-linear-gradient(135deg,transparent 0 4px,#7e94b744 4px 6px); }
[data-theme="programador"] .agenda-event { border: 1px solid #3c7959; border-radius: 8px; background: linear-gradient(180deg,#16291f,#151c23); color: #eef4fc; }
[data-theme="programador"] .agenda-event.is-press { border-color: #579bb0; background: linear-gradient(180deg,#142b31,#151c23); }
[data-theme="programador"] .agenda-event.is-mandatory { background: #302816; border-color: #d8b34a; }
[data-theme="programador"] .agenda-event.is-locked { box-shadow: inset 3px 0 #d8b34a; }
[data-theme="programador"] .agenda-event__rank { color: #edcf71; }
[data-theme="programador"] .agenda-event[data-state="bad"] { background: #321c22; border-color: #c04848; }
[data-theme="programador"] .agenda-event[data-state="warning"] { background: #302716; border-color: #c8922a; }
[data-theme="programador"] .drag-preview { background: #163724; color: #b6eccb; border-color: #60c08b; border-radius: 8px; }
[data-theme="programador"] .drag-preview[data-state="warning"] { background: #3b2e13; color: #f4d897; border-color: #dfb44e; }
[data-theme="programador"] .drag-preview[data-state="bad"] { background: #3c1b23; color: #ffb8bf; border-color: #e16a76; }
[data-theme="programador"] .modal { border: 1px solid var(--line); border-radius: 12px; }
[data-theme="programador"] .settings-travel-table td.settings-travel-table__empty { background: #101319; }
[data-theme="programador"] .settings-travel-table th, [data-theme="programador"] .settings-travel-table td { border-color: #2a3140; }
[data-theme="programador"] .modal__bar h2, [data-theme="programador"] .film-sheet h2 { font-family: "Archivo", sans-serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
[data-theme="programador"] .modal__notice { background: #30251c; color: #f5d3b1; }
[data-theme="programador"] .film-sheet__ranking { color: #cbd6e6; }
[data-theme="programador"] .film-sheet__visual, [data-theme="programador"] .film-sheet__visual figcaption { background: #151922; }
[data-theme="programador"] .warning-list li { background: #3b1e26; color: #ffb9b5; }
[data-theme="programador"] .warning-list .is-ok { background: #163525; color: #b4eccd; }
[data-theme="programador"] #save-indicator { color: #9cdfb7; }
[data-theme="programador"] #save-indicator[data-state="bad"] { color: #ffa7ac; }
[data-theme="programador"] .mobile-days button[aria-pressed="true"] { background: #244477; color: #fff; }
@media (max-width: 900px) {
  [data-theme="programador"] .masthead { grid-template-columns: 4rem 1fr; }
  .timeline-inner { min-width: 100%; }
}
@media (max-width: 520px) {
  .toolbar__actions { display: flex; }
  .toolbar__actions .button { flex: 1 1 auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .blackout-row { grid-template-columns: 1fr 1fr; }
  .settings-form { padding: 1rem; }
  .time-controls { margin-inline: 1rem; }
}

/* =========================================================================
   v4 · Taller compacto: cabecera de estadísticas, panel doble a pantalla
   completa, filtros por tipo y sección, y ajustes finos para móvil.
   Inspirado en el Programador SSIFF local.
   ========================================================================= */

:root {
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(8 37 78 / .06), 0 2px 8px rgb(8 37 78 / .06);
  --shadow-md: 0 6px 22px rgb(8 37 78 / .12);
  --surface-2: color-mix(in srgb, var(--white) 88%, var(--paper));
  --header-accent: var(--atlantic);
}
:root[data-theme="programador"] { --shadow-sm: 0 1px 2px #0006; --shadow-md: 0 10px 30px #0008; --surface-2: #12161e; }

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

/* ---------- app shell ---------- */
body { display: flex; flex-direction: column; min-height: 100dvh; }
@media (min-width: 901px) {
  body { height: 100dvh; overflow: hidden; }
  .planner { flex: 1 1 auto; min-height: 0; height: auto; overflow: hidden; }
  .catalogue { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .film-list { flex: 1 1 auto; max-height: none; min-height: 0; }
  .agenda { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding-bottom: 0; }
  .timeline-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
  .agenda footer { flex: 0 0 auto; }
}

/* ---------- cabecera compacta con estadísticas ---------- */
.masthead,
[data-theme="programador"] .masthead {
  display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) auto; align-items: center;
  min-height: 0; gap: 0;
}
.edition, [data-theme="programador"] .edition { font-size: 2.1rem; letter-spacing: -.06em; }
.masthead__copy, [data-theme="programador"] .masthead__copy { padding: .6rem clamp(.8rem, 1.6vw, 1.4rem); }
.masthead__copy p { margin: 0; font-size: .68rem; letter-spacing: .03em; opacity: .9; }
.masthead h1, [data-theme="programador"] .masthead h1 { font-size: clamp(1.15rem, 2.4vw, 1.9rem); line-height: 1.05; }

.stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; padding: .5rem clamp(.7rem, 1.6vw, 1.3rem); }
.stat {
  display: inline-flex; align-items: baseline; gap: .3rem; padding: .3rem .55rem;
  border: 1px solid rgb(255 255 255 / .28); border-radius: 999px;
  background: rgb(255 255 255 / .1); color: rgb(255 255 255 / .82);
  font-size: .66rem; font-weight: 600; white-space: nowrap;
}
.stat b { color: var(--white); font-size: .92rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.save { border-style: dashed; }
[data-theme="programador"] .stat { border-color: var(--line); background: #1b2029; color: var(--muted); }
[data-theme="programador"] .stat b { color: #f4f6fb; }
#save-indicator, [data-theme="programador"] #save-indicator { color: rgb(255 255 255 / .85); font-size: .66rem; }
[data-theme="programador"] #save-indicator { color: #9cdfb7; }
#save-indicator[data-state="bad"], [data-theme="programador"] #save-indicator[data-state="bad"] { border-color: #ff9a92; color: #ffd9d5; }

/* ---------- barra de herramientas ---------- */
.toolbar { min-height: 0; padding: .55rem clamp(.7rem, 1.8vw, 1.4rem); gap: .35rem .8rem; }
.toolbar__message strong { font-size: .8rem; }
.toolbar__actions { gap: .4rem; align-items: center; }
.button {
  min-height: 2.1rem; padding: .4rem .7rem; border-radius: var(--radius-sm);
  font-size: .73rem; box-shadow: var(--shadow-sm);
}
.button:hover { background: color-mix(in srgb, var(--atlantic) 10%, transparent); }
.button--primary:hover { background: var(--atlantic-dark); color: var(--white); }
.text-button { font-size: .72rem; }
.status { font-size: .72rem; }

/* menú desplegable de acciones secundarias */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; z-index: 60; top: calc(100% + .35rem); right: 0;
  display: grid; gap: .3rem; min-width: 12rem; padding: .45rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-md);
}
.menu__panel .button { justify-content: flex-start; width: 100%; box-shadow: none; }

/* ---------- pestañas de panel (móvil) ---------- */
.pane-tabs { display: none; }

/* ---------- catálogo ---------- */
.catalogue__heading { padding: .8rem 1rem .6rem; border-bottom-width: 3px; }
.catalogue h2 { font-size: 1.1rem; }
.catalogue__heading p { font-size: .7rem; }
.catalogue__tools { display: grid; gap: .5rem; padding: .6rem 1rem .7rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.search-field input {
  width: 100%; min-height: 2.4rem; padding: .5rem .7rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font-size: .8rem;
}
.quick-filters { gap: .3rem; padding: 0; border-bottom: 0; }
.quick-filters button, .chip {
  padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--muted); font-size: .68rem; font-weight: 600; cursor: pointer;
}
.quick-filters button[aria-pressed="true"] { background: var(--atlantic); border-color: var(--atlantic); color: #fff; }

.filters-panel { border-bottom: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.filters-panel > summary { padding: .5rem .7rem; font-size: .72rem; }
.filters { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; padding: 0 .7rem .7rem; background: transparent; }
.filters input, .filters select { min-height: 2.2rem; border-radius: var(--radius-sm); font-size: .74rem; }
.filters label span { font-weight: 650; }

.section-box { margin: 0 .7rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.section-box > summary { padding: .45rem .6rem; color: var(--atlantic); cursor: pointer; font-size: .72rem; font-weight: 700; list-style: none; }
.section-box > summary::-webkit-details-marker { display: none; }
.section-box > summary::before { content: "▸"; margin-right: .4rem; color: var(--muted); }
.section-box[open] > summary::before { content: "▾"; }
.section-box #section-count { margin-left: .3rem; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .28rem; max-height: 32vh; overflow: auto; padding: 0 .6rem .6rem; }
.chip { border-left: 4px solid var(--section-color, var(--line)); }
.chip[aria-pressed="true"] { background: var(--atlantic); border-color: var(--atlantic); color: #fff; }

/* ---------- fichas del catálogo ---------- */
.film-list { padding: .45rem; scrollbar-width: thin; }
.film-card {
  margin-bottom: .4rem; padding: .65rem .7rem; gap: .55rem;
  border: 1px solid var(--line); border-left: 4px solid var(--section-color, var(--line));
  border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm);
}
.film-card:hover { background: var(--surface-2); box-shadow: var(--shadow-md); }
.film-card__badges { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-bottom: .28rem; }
.film-card__section { margin-bottom: 0; border-radius: 999px; padding: .16rem .45rem; }
.film-card__type {
  margin-bottom: 0; padding: .16rem .45rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.film-card__rank { border-radius: var(--radius-sm); min-height: 1.8rem; }
.film-card h3 { font-size: .84rem; }
.film-card__screenings button { border-radius: var(--radius-sm); }
.must-see { width: 1.8rem; height: 1.8rem; }
.add-film { border-radius: var(--radius-sm); }

/* ---------- agenda ---------- */
.agenda { padding: .8rem clamp(.6rem, 1.6vw, 1.4rem) 1rem; }
.agenda__heading { margin-bottom: .6rem; align-items: center; }
.agenda h2 { font-size: 1.1rem; }
.agenda__heading p { font-size: .72rem; }
.timeline-scroll { border-radius: var(--radius); }
.agenda footer { display: flex; gap: 1rem; padding: .5rem .2rem .6rem; border-top: 1px solid var(--line); font-size: .65rem; }
.agenda footer p { margin: .1rem 0; }
.agenda-event { border-radius: var(--radius-sm); }
.day-heading strong { font-size: .85rem; }

/* barras de desplazamiento discretas */
.film-list::-webkit-scrollbar, .timeline-scroll::-webkit-scrollbar, .chips::-webkit-scrollbar, .agenda::-webkit-scrollbar { width: 9px; height: 9px; }
.film-list::-webkit-scrollbar-thumb, .timeline-scroll::-webkit-scrollbar-thumb, .chips::-webkit-scrollbar-thumb, .agenda::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: var(--line); background-clip: content-box; }

/* ---------- pantallas medianas ---------- */
@media (max-width: 1180px) and (min-width: 901px) {
  .planner { grid-template-columns: minmax(258px, 300px) minmax(0, 1fr); }
  .agenda__heading p { display: none; }
}

/* ---------- móvil y tableta ---------- */
@media (max-width: 900px) {
  .masthead, [data-theme="programador"] .masthead { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .edition, [data-theme="programador"] .edition { font-size: 1.7rem; }
  .stats { grid-column: 1 / -1; justify-content: flex-start; gap: .3rem; padding: 0 .7rem .55rem; }
  .stat { font-size: .62rem; }
  .stat--wide { display: none; }

  .toolbar { position: sticky; top: 0; }
  .toolbar__actions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .15rem; scrollbar-width: none; }
  .toolbar__actions::-webkit-scrollbar { display: none; }
  .toolbar__actions .button { flex: 0 0 auto; min-height: 2.4rem; }
  .menu__panel { right: auto; left: 0; }

  .pane-tabs {
    position: sticky; z-index: 30; top: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: .3rem;
    padding: .4rem clamp(.6rem, 3vw, 1rem); border-bottom: 1px solid var(--line); background: var(--paper);
  }
  .pane-tabs button {
    min-height: 2.6rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--white); color: var(--muted); font-size: .78rem; font-weight: 700; cursor: pointer;
  }
  .pane-tabs button[aria-pressed="true"] { background: var(--atlantic); border-color: var(--atlantic); color: #fff; }

  body[data-pane="agenda"] .catalogue { display: none; }
  body[data-pane="catalogue"] .agenda { display: none; }
  .planner { display: block; min-height: 0; }
  .catalogue { border-bottom: 0; }
  .film-list { max-height: none; overflow: visible; }
  .agenda { padding-inline: clamp(.6rem, 3vw, 1rem); }
  .timeline-scroll { max-height: 68vh; overflow: auto; }
  .mobile-days { margin-bottom: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
  .quick-filters button, .chip, .film-card__screenings button { min-height: 2.1rem; }
  .must-see, .add-film { min-height: 2.1rem; }
  .must-see { width: 2.1rem; height: 2.1rem; }
  .agenda footer { display: block; }
}

@media (max-width: 560px) {
  .masthead h1 { font-size: 1.3rem; }
  .masthead__copy p { font-size: .62rem; }
  .film-card { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .film-card__actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; align-items: center; gap: .4rem; }
  .add-film { min-width: 5.5rem; }
  .toolbar__actions { display: flex; }
}

@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 900px) { body { padding-bottom: env(safe-area-inset-bottom); } }
}

@media (prefers-reduced-motion: no-preference) {
  .film-card, .chip, .quick-filters button, .pane-tabs button, .stat { transition: background-color 140ms ease, border-color 140ms ease, box-shadow 160ms ease, color 140ms ease; }
}

/* ---------- ajustes del tema Programador para los bloques nuevos ---------- */
[data-theme="programador"] .catalogue__tools,
[data-theme="programador"] .section-box { background: #12161e; }
[data-theme="programador"] .filters-panel,
[data-theme="programador"] .menu__panel,
[data-theme="programador"] .search-field input,
[data-theme="programador"] .quick-filters button,
[data-theme="programador"] .chip { background: #0f131a; color: var(--muted); border-color: var(--line); }
[data-theme="programador"] .quick-filters button[aria-pressed="true"],
[data-theme="programador"] .chip[aria-pressed="true"],
[data-theme="programador"] .pane-tabs button[aria-pressed="true"] { background: #2c3a55; border-color: #44598a; color: #fff; }
[data-theme="programador"] .pane-tabs { background: var(--paper); }
[data-theme="programador"] .pane-tabs button { background: #151922; color: var(--muted); }
[data-theme="programador"] .film-card { background: var(--white); }
[data-theme="programador"] .film-card:hover { background: #1b2230; }

/* Los bloques de cabecera no deben encogerse dentro del shell flex. */
.masthead, .toolbar, .pane-tabs { flex: 0 0 auto; }

@media (min-width: 1100px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .toolbar__actions { justify-content: flex-end; }
}

@media (max-width: 900px) {
  .toolbar { position: static; }
  .stats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .masthead__copy { padding-block: .45rem; }
}
@media (max-width: 560px) {
  .masthead__copy p { display: none; }
}

@media (max-width: 900px) {
  .catalogue__tools { position: sticky; z-index: 25; top: 3.4rem; max-height: 62dvh; overflow: auto; box-shadow: 0 8px 14px -10px rgb(8 37 78 / .45); }
}

/* Aire para que la primera etiqueta horaria no quede bajo la cabecera. */
.timeline-body { padding-top: 9px; }

.status:empty { display: none; }

/* Aviso flotante: informa de una acción y se retira solo, sin ocupar la portada. */
.status {
  position: fixed; z-index: 120; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  max-width: min(30rem, calc(100vw - 2rem)); margin: 0; padding: .6rem .9rem;
  border: 1px solid var(--line); border-left: 4px solid var(--atlantic); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink); font-size: .76rem; line-height: 1.4;
  box-shadow: var(--shadow-md);
}
.status[hidden] { display: none; }
.status[data-tone="error"] { border-left-color: var(--poster); }

/* Franjas fijas del festival dentro de Ajustes: se muestran, no se editan. */
.blackout-fixed {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .5rem;
  margin-bottom: .5rem; padding: .5rem .7rem;
  border: 1px dashed var(--line); border-left: 4px solid var(--poster); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--poster) 7%, var(--white));
}
.blackout-fixed strong { color: var(--atlantic-dark); font-size: .78rem; }
.blackout-fixed__lock { grid-row: span 2; align-self: center; font-size: .9rem; }
.blackout-fixed__note { color: var(--muted); font-size: .7rem; line-height: 1.35; }
[data-theme="programador"] .blackout-fixed { background: #241a1e; border-color: #6b3a3a; border-left-color: #d8b34a; }

/* Menú «⋯ Más»: agrupa acciones de agenda y de Top 100. */
.menu__label {
  margin: .3rem .35rem .1rem; color: var(--muted);
  font-size: .6rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase;
}
.menu__label:first-child { margin-top: 0; }

/* =====================================================================
   Bordes rectos: la identidad del festival es tipográfica y de bloque,
   sin esquinas redondeadas en ninguna superficie ni control.
   ===================================================================== */
:root, :root[data-theme="programador"] { --radius: 0; --radius-sm: 0; }
.stat,
.button, .quick-filters button, .chip, .pane-tabs button,
.search-field input, .filters input, .filters select,
.film-card, .film-card__rank, .film-card__section, .film-card__type,
.film-card__screenings button, .must-see, .add-film,
.agenda-event, .drag-preview, .timeline-scroll, .mobile-days,
.menu__panel, .modal, .modal__close, .status,
.filters-panel, .section-box, .blackout-fixed,
.settings-form input, .settings-form select, .settings-travel-table input,
.time-option, .warning-list li, .film-pass, .personal-blackout {
  border-radius: 0;
}
[data-theme="programador"] .button,
[data-theme="programador"] .film-card,
[data-theme="programador"] .agenda-event,
[data-theme="programador"] .film-card__section,
[data-theme="programador"] .drag-preview,
[data-theme="programador"] .modal { border-radius: 0; }

/* Aviso de cálculo en curso: la propuesta se genera en un Worker y la página
   sigue siendo utilizable mientras tanto. */
.busy {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 .6rem; padding: .5rem .7rem;
  border: 1px dashed var(--atlantic); background: var(--white);
  color: var(--atlantic-dark); font-size: .75rem; font-weight: 650;
}
.busy[hidden] { display: none; }
.busy__spinner {
  width: .85rem; height: .85rem; flex: 0 0 auto;
  border: 2px solid var(--line); border-top-color: var(--atlantic);
  border-radius: 50%; animation: busy-spin 700ms linear infinite;
}
@media (prefers-reduced-motion: reduce) { .busy__spinner { animation: none; } }
@keyframes busy-spin { to { transform: rotate(360deg); } }
[data-theme="programador"] .busy { background: #101319; border-color: #44598a; color: #b8d3ff; }

.film-list__placeholder { padding: 1.2rem 1rem; color: var(--muted); font-size: .76rem; }

/* Franjas fijas del festival: ahora se pueden desactivar o ajustar. */
.blackout-fixed {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .6rem;
  margin-bottom: .6rem; padding: .6rem .7rem;
  border: 1px solid var(--line); border-left: 4px solid var(--poster);
  background: color-mix(in srgb, var(--poster) 6%, var(--white));
}
.blackout-fixed[data-off="true"] { border-left-color: var(--line); background: var(--white); opacity: .72; }
.blackout-fixed__switch { display: flex; align-items: center; gap: .45rem; font-size: .78rem; }
.blackout-fixed__switch input { width: 1rem; height: 1rem; accent-color: var(--atlantic); }
.blackout-fixed__switch strong { color: var(--atlantic-dark); font-weight: 700; }
.blackout-fixed__time input { width: 6.5rem; }
.blackout-fixed__note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.35; }
[data-theme="programador"] .blackout-fixed { background: #241a1e; border-color: #4a3138; border-left-color: #d8b34a; }
[data-theme="programador"] .blackout-fixed[data-off="true"] { background: #12161e; border-left-color: var(--line); }

/* =====================================================================
   Cuentas: pantalla de acceso y menú de sesión.
   ===================================================================== */
body[data-view="loading"] .toolbar,
body[data-view="loading"] .pane-tabs,
body[data-view="loading"] .planner,
body[data-view="auth"] .toolbar,
body[data-view="auth"] .pane-tabs,
body[data-view="auth"] .planner { display: none; }

.auth { display: grid; place-items: start center; padding: clamp(1.2rem, 5vw, 3rem) 1rem; }
.auth[hidden] { display: none; }
.auth__card {
  width: min(28rem, 100%); padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line); border-top: 4px solid var(--atlantic);
  background: var(--white); box-shadow: var(--shadow-md);
}
.auth__card h2 { margin: 0 0 .5rem; color: var(--atlantic-dark); font-family: "DM Serif Display", Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 400; line-height: 1; }
.auth__intro { margin: 0 0 1.2rem; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; margin-bottom: 1rem; }
.auth__tabs button {
  min-height: 2.4rem; border: 1px solid var(--line); background: var(--paper);
  color: var(--muted); font-size: .78rem; font-weight: 700; cursor: pointer;
}
.auth__tabs button[aria-selected="true"] { background: var(--atlantic); border-color: var(--atlantic); color: #fff; }
.auth__tabs button[hidden] { display: none; }
.auth__form { display: grid; gap: .7rem; }
.auth__form[hidden] { display: none; }
.auth__form label { display: grid; gap: .25rem; color: var(--muted); font-size: .72rem; font-weight: 650; }
.auth__form input {
  min-height: 2.5rem; padding: .5rem .6rem; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); font-size: .85rem;
}
.auth__form small { color: var(--muted); font-size: .66rem; font-weight: 500; }
.auth__form .button { margin-top: .3rem; min-height: 2.6rem; font-size: .82rem; }
.auth__error:empty { display: none; }
.auth__error { margin: .9rem 0 0; padding: .5rem .7rem; border-left: 4px solid var(--poster); background: color-mix(in srgb, var(--poster) 8%, var(--white)); color: #8a382e; font-size: .74rem; line-height: 1.4; }
.auth__note { margin: .9rem 0 0; color: var(--muted); font-size: .72rem; }
.auth__note[hidden] { display: none; }

#user-menu[hidden] { display: none; }
.menu__user { margin: 0 .35rem .3rem; color: var(--muted); font-size: .68rem; word-break: break-all; }
[data-theme="programador"] .auth__card { background: var(--white); }
[data-theme="programador"] .auth__form input,
[data-theme="programador"] .auth__tabs button { background: #0f131a; color: var(--ink); border-color: var(--line); }
[data-theme="programador"] .auth__tabs button[aria-selected="true"] { background: #2c3a55; border-color: #44598a; color: #fff; }
[data-theme="programador"] .auth__error { background: #241a1e; color: #f0b6ae; }

body[data-view="auth"] .stats,
body[data-view="loading"] .stats { display: none; }

/* =====================================================================
   Pases de la agenda: un solo botón de tres puntos y menú contextual
   (también con el botón derecho del ratón).
   ===================================================================== */
.agenda-event { padding: .3rem .5rem .4rem; }
.agenda-event__topline { padding-right: 1.2rem; }
.event-menu-button {
  position: absolute; top: .1rem; right: .1rem;
  display: grid; place-items: center; width: 1.2rem; height: 1.4rem;
  padding: 0; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1rem; line-height: 1; letter-spacing: -.05em;
}
.event-menu-button:hover, .event-menu-button[aria-expanded="true"] { background: color-mix(in srgb, var(--atlantic) 14%, transparent); color: var(--atlantic-dark); }

.event-menu {
  position: fixed; z-index: 200; min-width: 13rem; padding: .3rem;
  border: 1px solid var(--line); background: var(--white);
  box-shadow: var(--shadow-md); font-size: .76rem;
}
.event-menu[hidden] { display: none; }
.event-menu__title {
  margin: 0 0 .25rem; padding: .35rem .45rem; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .66rem; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18rem;
}
.event-menu__item {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  min-height: 2.2rem; padding: .35rem .45rem;
  border: 0; background: transparent; color: var(--ink);
  cursor: pointer; font-size: .76rem; text-align: left;
}
.event-menu__item:hover:not(:disabled), .event-menu__item:focus-visible { background: color-mix(in srgb, var(--atlantic) 12%, transparent); }
.event-menu__item:disabled { color: var(--muted); cursor: not-allowed; opacity: .65; }
.event-menu__item[data-danger="true"]:not(:disabled) { color: #8a382e; }
.event-menu__item[data-danger="true"]:hover:not(:disabled) { background: color-mix(in srgb, var(--poster) 14%, transparent); }
.event-menu__icon { width: 1.1rem; flex: 0 0 auto; text-align: center; }
[data-theme="programador"] .event-menu { background: var(--white); border-color: var(--line); }
[data-theme="programador"] .event-menu__item[data-danger="true"]:not(:disabled) { color: #f5aaa2; }
@media (max-width: 900px) {
  .event-menu-button { width: 1.6rem; height: 1.7rem; }
  .event-menu__item { min-height: 2.6rem; }
}

/* Diálogo de choque de horarios. */
#conflict-form { padding: 1.1rem 1.4rem 1.4rem; }
.conflict-list { display: grid; gap: .8rem; }
.conflict-item { margin: 0; padding: .7rem .9rem; border: 1px solid var(--line); background: var(--white); }
.conflict-item legend { padding: 0 .35rem; color: var(--atlantic-dark); font-size: .78rem; font-weight: 750; }
.conflict-item label { display: flex; align-items: flex-start; gap: .5rem; min-height: 2rem; padding: .2rem 0; font-size: .76rem; line-height: 1.35; cursor: pointer; }
.conflict-item input { margin-top: .15rem; width: 1rem; height: 1rem; flex: 0 0 auto; accent-color: var(--atlantic); }
#conflict-error:empty { display: none; }
#conflict-error { margin: .8rem 0 0; padding: .5rem .7rem; border-left: 4px solid var(--poster); background: color-mix(in srgb, var(--poster) 8%, var(--white)); color: #8a382e; font-size: .75rem; }
[data-theme="programador"] .conflict-item { background: #0f131a; }
[data-theme="programador"] #conflict-error { background: #241a1e; color: #f0b6ae; }

/* Arrastre: destino que choca con algo apartable. */
.drag-preview[data-state="swap"] { border-color: #2f6aa8; color: #143c63; background: #dceaf7; cursor: copy; }
[data-theme="programador"] .drag-preview[data-state="swap"] { background: #16283c; color: #a9cdf0; border-color: #4a7fd4; }
.agenda-event[data-state="swap"], .time-option[data-state="swap"] { border-left-color: #2f6aa8; }

/* Listado de otros pases: la hora en dos líneas y el estado «apartable». */
.time-option__time { display: grid; gap: .1rem; }
.time-option__time span { color: var(--muted); font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.time-option__time strong { font-size: .85rem; }
.warning-list .is-swap { background: #dceaf7; color: #143c63; }
[data-theme="programador"] .warning-list .is-swap { background: #16283c; color: #a9cdf0; }

/* =====================================================================
   Datos del Top 100 v3: nota de la crítica, base del puesto, festivales
   y premios. En el catálogo, píldoras; en la ficha, un bloque propio.
   ===================================================================== */
.film-card__basis, .film-card__awards {
  padding: .16rem .45rem; border: 1px solid var(--line);
  font-size: .58rem; font-weight: 750; letter-spacing: .02em; white-space: nowrap;
}
.film-card__basis[hidden], .film-card__awards[hidden] { display: none; }
.film-card__basis[data-basis="realidad"]    { color: #14396b; border-color: #93b4dd; background: #e6eefa; }
.film-card__basis[data-basis="expectativa"] { color: #5d4a75; border-color: #b7a4cd; background: #f0eaf7; }
.film-card__awards[data-kind="premio"]   { color: #7a5312; border-color: #d8b34a; background: #fbf3dc; }
.film-card__awards[data-kind="festival"] { color: var(--muted); }
[data-theme="programador"] .film-card__basis[data-basis="realidad"]    { color: #a9cdf0; border-color: #44598a; background: #16283c; }
[data-theme="programador"] .film-card__basis[data-basis="expectativa"] { color: #ccc0e4; border-color: #5a4a7a; background: #211c2e; }
[data-theme="programador"] .film-card__awards[data-kind="premio"] { color: #edcf71; border-color: #7d6a2a; background: #241f10; }

.film-sheet__track { margin-top: 1.4rem; padding: 1rem 1.1rem; border: 1px solid var(--line); background: var(--white); }
.film-sheet__track[hidden] { display: none; }
.film-sheet__track h3 { margin: 0 0 .7rem; }
.film-sheet__track h4 { margin: 1rem 0 .35rem; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.film-track__top { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.film-track__score { display: flex; align-items: baseline; gap: .3rem; padding: .45rem .7rem; border: 1px solid #7fb79a; background: #e6f3ec; color: #1d5c40; }
.film-track__score strong { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.film-track__score span { font-size: .66rem; font-weight: 650; }
.film-track__score[data-level="media"] { border-color: #d3b071; background: #fbf1dd; color: #7a5312; }
.film-track__score[data-level="baja"]  { border-color: #dda49b; background: #fbe8e5; color: #8a382e; }
.film-track__pending { margin: 0; color: var(--muted); font-size: .76rem; }
.film-track__basis { padding: .3rem .6rem; border: 1px solid #93b4dd; background: #e6eefa; color: #14396b; font-size: .68rem; font-weight: 750; }
.film-track__basis[data-basis="expectativa"] { border-color: #b7a4cd; background: #f0eaf7; color: #5d4a75; }
.film-sheet__track ul { margin: 0; padding-left: 1.1rem; color: var(--ink); font-size: .78rem; line-height: 1.55; }
.film-track__sources { margin-top: .6rem; color: var(--muted); font-size: .72rem; list-style: none; padding-left: 0; }
.film-track__sources li::before { content: "· "; }
.film-track__awards li strong { color: var(--atlantic-dark); }
.film-track__festivals li strong { color: var(--atlantic-dark); }
.film-track__foot { margin: .8rem 0 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.film-track__foot a { color: var(--atlantic); }
[data-theme="programador"] .film-track__score { border-color: #2f6a4d; background: #16261e; color: #9fe0bd; }
[data-theme="programador"] .film-track__score[data-level="media"] { border-color: #7a5f22; background: #2a2210; color: #e8cd8e; }
[data-theme="programador"] .film-track__score[data-level="baja"]  { border-color: #7a3535; background: #2a1414; color: #f0b6ae; }
[data-theme="programador"] .film-track__basis { border-color: #44598a; background: #16283c; color: #a9cdf0; }
[data-theme="programador"] .film-track__basis[data-basis="expectativa"] { border-color: #5a4a7a; background: #211c2e; color: #ccc0e4; }

/* Contador de películas con corazón y su listado. */
.stat--action { cursor: pointer; font: inherit; gap: .3rem; }
.stat--action:hover { background: rgb(255 255 255 / .2); }
.stat--action[data-missing="true"] { border-color: #ffb0a6; }
.stat--action[data-missing="true"] b { color: #ffd9d4; }
.stat__missing { color: #ffd9d4; font-weight: 700; }
.stat__missing[hidden] { display: none; }
[data-theme="programador"] .stat--action:hover { background: #232b38; }
[data-theme="programador"] .stat--action[data-missing="true"] { border-color: #7a3535; }
[data-theme="programador"] .stat--action[data-missing="true"] b,
[data-theme="programador"] .stat__missing { color: #f5aaa2; }

.wanted-summary {
  margin: 0 0 .2rem; padding: .55rem .7rem;
  border-left: 4px solid #2f9e6a; background: color-mix(in srgb, #2f9e6a 8%, var(--white));
  color: var(--ink); font-size: .8rem; font-weight: 700;
}
.wanted-summary[data-missing="true"] { border-left-color: var(--poster); background: color-mix(in srgb, var(--poster) 8%, var(--white)); }
.wanted-heading { margin: .8rem 0 0; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.wanted-row__mark { display: grid; place-items: center; font-size: 1.1rem; font-weight: 800; color: var(--poster); }
.wanted-row[data-state="ok"] .wanted-row__mark { color: #2f9e6a; }
[data-theme="programador"] .wanted-summary { background: #16261e; }
[data-theme="programador"] .wanted-summary[data-missing="true"] { background: #241a1e; }

/* =====================================================================
   Ficha del catálogo: la nota manda arriba, sobre el corazón, y el título
   es el acceso a la ficha (ya no hace falta el botón «i»).
   ===================================================================== */
.film-card__open {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.film-card__open:hover { text-decoration: underline; text-underline-offset: .18rem; }

.film-card__score {
  display: grid; justify-items: center; gap: 0;
  width: 100%; min-width: 3.1rem; padding: .3rem .2rem .25rem;
  border: 1px solid #7fb79a; background: #e6f3ec; color: #1d5c40;
  cursor: pointer;
}
.film-card__score[hidden] { display: none; }
.film-card__score strong { font-size: 1.35rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.film-card__score span { font-size: .5rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.film-card__score[data-level="media"] { border-color: #d3b071; background: #fbf1dd; color: #7a5312; }
.film-card__score[data-level="baja"]  { border-color: #dda49b; background: #fbe8e5; color: #8a382e; }
[data-theme="programador"] .film-card__score { border-color: #2f6a4d; background: #16261e; color: #9fe0bd; }
[data-theme="programador"] .film-card__score[data-level="media"] { border-color: #7a5f22; background: #2a2210; color: #e8cd8e; }
[data-theme="programador"] .film-card__score[data-level="baja"]  { border-color: #7a3535; background: #2a1414; color: #f0b6ae; }

.film-card__actions { gap: .4rem; align-content: start; }
@media (max-width: 560px) {
  .film-card__score { width: auto; padding-inline: .5rem; }
  .film-card__score strong { font-size: 1.15rem; }
}
