/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #1a1a1f;
  --bg-surface:  #222228;
  --bg-panel:    #2a2a32;
  --accent:      #e94560;
  --accent-dim:  #a3304a;
  --text:        #e0e0e4;
  --text-muted:  #7a7a88;
  --border:      #3a3a44;
  --radius:      6px;

  /* Badge saturation — controlled by slider (0% = grey, 100% = full color) */
  --badge-sat:   80%;

  /* Cue row colors */
  --row-blue:    #172340;
  --row-blue-fg: #7ec8e3;
  --row-red:     #3a1515;
  --row-red-fg:  #e38080;
  --row-green:   #153a15;
  --row-green-fg:#6fd86f;
  --row-yellow:  #3a3510;
  --row-yellow-fg:#e3d880;
  --row-orange:  #3a2210;
  --row-orange-fg:#e3a860;
  --row-purple:  #241540;
  --row-purple-fg:#c080e3;

  /* Tabular numeral font — matches Airtable's clean sans-serif number style */
  --font-mono: 'Inter', -apple-system, system-ui, sans-serif;
}

html { height: 100%; }
body {
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #e0e0e4;
  color: var(--text);
  background-color: #1a1a1f;
  background-color: var(--bg);
  min-height: 100vh;
}

a { color: var(--row-blue-fg); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Light mode override ──────────────────────────────────────────────────── */
html.light-mode {
  --bg:          #f5f5f7;
  --bg-surface:  #ffffff;
  --bg-panel:    #eaeaee;
  --text:        #1a1a1f;
  --text-muted:  #6a6a78;
  --border:      #d4d4dc;
}
html.light-mode .cue-table { background: #ffffff; }
html.light-mode .topbar { background: #ffffff; border-bottom-color: #d4d4dc; }
html.light-mode .topbar-brand { color: #1a1a1f; }
html.light-mode a { color: #2060c0; }
html.light-mode .approved-dot { background: #d4d4dc; }
html.light-mode .approved-dot--yes { background: #2aa52a; }
html.light-mode .act-break-row td { background: #eaeaee !important; }
html.light-mode .global-notes-row td { background: #eaeaee !important; }
html.light-mode .inline-cell-input { background: #fff; border-color: #2060c0; color: #1a1a1f; }
html.light-mode .inline-cell-select { background: #fff; border-color: #2060c0; color: #1a1a1f; }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  height: 48px; padding: 0 1.5rem;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-brand { font-weight: 700; font-size: 1rem; color: var(--text); white-space: nowrap; }
.topbar-nav { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; flex: 1; }
.topbar-nav a { color: var(--text-muted); }
.topbar-nav a:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; margin-left: auto; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font-size: 0.78rem; user-select: none;
}
.theme-toggle input { display: none; }
.theme-toggle-track {
  width: 32px; height: 18px; border-radius: 99px;
  background: var(--border); position: relative;
  transition: background 0.2s;
}
.theme-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.2s, background 0.2s;
}
.theme-toggle input:checked + .theme-toggle-track { background: #f0c040; }
.theme-toggle input:checked + .theme-toggle-track .theme-toggle-thumb {
  transform: translateX(14px); background: #fff;
}
.theme-toggle-label { color: var(--text-muted); }

/* ── Main content ─────────────────────────────────────────────────────────── */
.main-content { padding: 1.5rem; margin: 0 auto; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash-container { margin-bottom: 1rem; }
.flash {
  padding: 0.6rem 1rem; border-radius: var(--radius);
  margin-bottom: 0.4rem; font-size: 0.875rem;
}
.flash--success { background: #1a3d1a; color: #80e380; border: 1px solid #80e380; }
.flash--error   { background: #3d1a1a; color: #e38080; border: 1px solid #e38080; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.45rem 0.9rem; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  font-size: 0.85rem; font-weight: 500; white-space: nowrap;
  background: var(--bg-panel); color: var(--text);
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--ghost   { background: transparent; border-color: var(--border); }
.btn--danger  { background: #6b1a1a; color: #e38080; border-color: #e38080; }
.btn--warning { background: #3d2a00; color: #e3c080; border-color: #e3c080; }
.btn--sm      { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn--icon    { padding: 0.2rem 0.4rem; font-size: 0.75rem; background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--icon:hover { color: var(--accent); }

/* ── Page headers ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; }
.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Meta badge ───────────────────────────────────────────────────────────── */
.meta-badge {
  display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.5rem;
  border-radius: 99px; background: var(--bg-panel); color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Card grid ────────────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  overflow: hidden;
}
/* Poster tile on top of each project card — fixed 2:3 ratio, cropped to fill */
.card-poster {
  display: block; width: 100%; aspect-ratio: 2 / 3;
  background: var(--bg-panel); overflow: hidden;
}
.card-poster:hover { text-decoration: none; }
.card-poster img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-poster--empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; text-align: center;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg));
  color: var(--show-accent, #3ac5c9);
  font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em;
  text-transform: uppercase;
}
.card-body { padding: 1rem; flex: 1; }
.card-title { font-size: 1rem; margin-bottom: 0.4rem; }
.card-meta { color: var(--text-muted); font-size: 0.8rem; }
.card-footer {
  padding: 0.75rem 1rem; border-top: 1px solid var(--border);
  display: flex; gap: 0.4rem;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-surface); border-radius: var(--radius); overflow: hidden;
}
.data-table th, .data-table td {
  padding: 0.6rem 0.8rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.03); }
.td-mono {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.td-actions { display: flex; gap: 0.3rem; justify-content: flex-end; }

/* ── Version chips ────────────────────────────────────────────────────────── */
.version-chip {
  display: inline-block; padding: 0.2rem 0.5rem; border-radius: var(--radius);
  background: var(--bg-panel); border: 1px solid var(--border);
  font-size: 0.78rem; margin: 0.1rem;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-page { max-width: 560px; }
.form-page h1 { margin-bottom: 1.5rem; }
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.form-row label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.form-row input[type="text"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; font-size: 0.9rem; font-family: inherit;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237a7a88'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-row textarea { resize: vertical; min-height: 72px; }
.form-row--check { flex-direction: row; align-items: center; gap: 0.5rem; }
.form-row--check label { text-transform: none; font-size: 0.9rem; color: var(--text); }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.field-hint { font-size: 0.78rem; color: var(--text-muted); }
.optional { color: var(--text-muted); font-weight: normal; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted); border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── Two-col layout ───────────────────────────────────────────────────────── */
.two-col-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; align-items: start; }
.panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.panel h2 { font-size: 1rem; margin-bottom: 1rem; }

/* ── Composer list ────────────────────────────────────────────────────────── */
.composer-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.composer-item { display: flex; gap: 0.4rem; align-items: center; }
.inline-edit-form { display: flex; gap: 0.4rem; flex: 1; }
.inline-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.3rem 0.5rem; font-size: 0.875rem;
}

/* ── Info box ─────────────────────────────────────────────────────────────── */
.info-box {
  margin-top: 1.5rem; padding: 0.75rem 1rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.8rem; color: var(--text-muted);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   CUE LIST PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.cue-page { display: flex; flex-direction: column; height: calc(100vh - 48px - 3rem); min-height: 0; }

/* Show / Episode header */
.show-episode-header {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.show-name {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); cursor: pointer;
}
.show-name:hover { color: var(--show-accent, #3ac5c9); text-decoration: none; }
.episode-label {
  /* Match the header pages: their .ph-episode inherits letter-spacing computed
     from the 1.5rem title (-0.02em × 1.5rem = -0.03rem), so match that here. */
  font-size: 1rem; font-weight: 500; letter-spacing: -0.03rem; color: var(--show-accent, #3ac5c9);
}

.cue-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; gap: 1rem; flex-wrap: wrap;
}
.cue-toolbar-left { display: flex; align-items: center; gap: 0.75rem; }
.version-title {
  font-size: 0.85rem; font-weight: 400; letter-spacing: -0.01em;
  color: var(--text);
}
.version-label {
  color: var(--text-muted);
}
.cue-toolbar-right { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* Inline Edit toggle switch */
.inline-edit-toggle {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font-size: 0.8rem; margin-right: 0.5rem; user-select: none;
}
.inline-edit-toggle input { display: none; }
.toggle-slider {
  width: 32px; height: 18px; border-radius: 99px;
  background: var(--border); position: relative;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.2s, background 0.2s;
}
.inline-edit-toggle input:checked + .toggle-slider { background: var(--accent); }
.inline-edit-toggle input:checked + .toggle-slider::after {
  transform: translateX(14px); background: #fff;
}
.toggle-label { color: var(--text-muted); }
.inline-edit-toggle input:checked ~ .toggle-label { color: var(--text); }

/* Inline editable cells */
.cue-table.inline-mode td[data-field] {
  cursor: text; position: relative;
}
.cue-table.inline-mode td[data-field]:hover {
  outline: 1px solid var(--accent); outline-offset: -1px;
}
.inline-cell-input {
  width: 100%; background: var(--bg); border: 1px solid var(--accent);
  color: var(--text); border-radius: 3px; padding: 0.25rem 0.4rem;
  font-size: inherit; font-family: inherit;
  font-variant-numeric: tabular-nums lining-nums;
}
.inline-cell-select {
  width: 100%; background: var(--bg); border: 1px solid var(--accent);
  color: var(--text); border-radius: 3px; padding: 0.2rem 0.3rem;
  font-size: 0.78rem; font-family: inherit;
}

/* MAIN TOTALS bar */
.totals-bar {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  padding: 0.5rem 1rem; margin-bottom: 0.75rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.totals-group { display: flex; flex-direction: column; }
.totals-divider { width: 1px; background: var(--border); align-self: stretch; margin: 0.2rem 0; }
.totals-label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.06em; }

/* Filter input in totals bar */
.totals-filter { margin-left: auto; justify-content: center; }
.filter-input {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 0.3rem 0.6rem;
  font-size: 0.82rem; width: 180px; font-family: inherit;
}
.filter-input:focus { outline: none; border-color: var(--accent); }
.filter-input::placeholder { color: var(--text-muted); }

/* Saturation slider */
.totals-saturation { justify-content: center; }
.sat-slider {
  width: 80px; height: 4px; -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 2px; cursor: pointer;
}
.sat-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: var(--text); cursor: pointer;
}
.totals-value {
  font-size: 1rem; font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

/* Cue table */
.cue-table-wrapper { flex: 1; overflow: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.cue-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  background: #222228;
}
.cue-table thead { position: sticky; top: 0; z-index: 2; background: var(--bg-panel); }
.cue-table th {
  padding: 0.5rem 0.6rem; text-align: left;
  font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: relative;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column resize handle — sits just inside the column's right edge so it is
   never clipped by the th's overflow:hidden (Chrome clips a handle placed on
   or past the border, which hid the DELETE column's handle). */
.col-resize-handle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 8px; cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 5;
}
.cue-table thead:hover .col-resize-handle {
  background: var(--border);
}
.col-resize-handle:hover,
.cue-table thead .col-resize-handle:hover,
.col-resize-handle.active {
  background: var(--accent);
}
.cue-table td {
  padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.cue-table tr:last-child td { border-bottom: none; }

/* Column widths */
.col-select   { width: 32px; min-width: 32px; text-align: center; }
.col-cuenum   { width: 111px; min-width: 72px; }
.col-title    { width: 463px; min-width: 120px; }
.col-version  { width: 76px; min-width: 52px; color: var(--text-muted); font-size: 0.8rem; }
.col-usage    { width: 170px; min-width: 100px; }
.col-tc       { width: 108px; min-width: 90px; }
.col-dur      { width: 94px; min-width: 42px; }
.col-composer { width: 113px; min-width: 60px; }
.col-writtento { width: 235px; min-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.col-approved { width: 102px; min-width: 52px; text-align: center; }
.cue-table th.col-approved { text-align: center; }
.col-actions  { width: 76px; min-width: 60px; text-align: center; }
.cue-table th.col-actions { text-align: center; }
/* Trailing spacer column — flexible, absorbs leftover width so DELETE can be
   dragged left with the freed space landing here as harmless blank space. */
.col-spacer   { width: auto; min-width: 0; }

/* Row styling */
.cue-row { cursor: default; transition: background 0.1s; }
.cue-row:hover td { background: rgba(255,255,255,0.04); }

.cue-open-trigger { cursor: pointer; }
.cue-open-trigger:hover { text-decoration: underline; }

/* Offset preview highlight */
.tc-offset-preview { color: #e3c080; font-style: italic; }
.has-offset { outline: 1px solid #e3c08040; }

/* ── Act Break divider rows ───────────────────────────────────────────────── */
.act-break-row td { background: var(--bg-panel) !important; border-bottom: none; padding-top: 0.15rem; padding-bottom: 0.15rem; }
.act-break-row + tr td { border-top: 2px solid var(--border); }

/* ── Global notes row (always first) ─────────────────────────────────────── */
.global-notes-row td { background: var(--bg-panel) !important; border-bottom: 2px solid var(--show-accent, #3ac5c9); }
.global-notes-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8rem; }

.act-break-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  cursor: pointer;
}
.act-break-label:hover { color: var(--text); }

.act-break-rule { vertical-align: middle; padding: 0 0.6rem; }
.act-break-line {
  display: block; height: 1px;
  background: linear-gradient(to right, var(--border) 60%, transparent 100%);
}

/* Approved dot */
.approved-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; background: var(--border);
  cursor: pointer;
}
.approved-dot:hover { outline: 2px solid var(--text-muted); outline-offset: 1px; }
.approved-dot--yes { background: #80e380; }

/* Usage badges */
.usage-badge {
  display: inline-block; padding: 0.18rem 0.55rem; border-radius: var(--radius);
  font-size: 0.72rem; font-weight: 600; border: 1px solid transparent;
  white-space: nowrap; letter-spacing: 0.01em;
  background: transparent;
  width: 130px; text-align: center;
}

/* Songs — purple (matches Pro Tools marker color) */
.usage--licensed-song-bi  { background: hsl(280, var(--badge-sat), 15%); color: hsl(280, var(--badge-sat), 75%); }
.usage--licensed-song-bv  { background: hsl(280, var(--badge-sat), 15%); color: hsl(280, var(--badge-sat), 75%); }
.usage--licensed-song-vv  { background: hsl(280, var(--badge-sat), 15%); color: hsl(280, var(--badge-sat), 75%); }
.usage--licensed-song-vi  { background: hsl(280, var(--badge-sat), 15%); color: hsl(280, var(--badge-sat), 75%); }

/* Score To Write — red (needs to be written) */
.usage--score-to-write    { background: hsl(10, var(--badge-sat), 40%); color: hsl(0, 0%, 100%); }

/* Score Completed — green (done) */
.usage--score-completed   { background: hsl(130, var(--badge-sat), 18%); color: hsl(130, var(--badge-sat), 65%); }

/* Score To Revise — pink */
.usage--score-to-revise   { background: hsl(330, var(--badge-sat), 18%); color: hsl(330, var(--badge-sat), 70%); }

/* Editorial — blue */
.usage--editorial         { background: hsl(210, var(--badge-sat), 18%); color: hsl(210, var(--badge-sat), 68%); }

/* Editorial To Revise — warm orange */
.usage--editorial-to-revise { background: hsl(25, var(--badge-sat), 16%); color: hsl(25, var(--badge-sat), 65%); }

/* Omitted — grey */
.usage--omitted           { background: hsl(210, calc(var(--badge-sat) * 0.2), 18%); color: hsl(210, calc(var(--badge-sat) * 0.2), 58%); }

/* Logo — yellow */
.usage--logo              { background: hsl(50, var(--badge-sat), 15%); color: hsl(50, var(--badge-sat), 65%); }

/* TBD — cyan/teal */
.usage--tbd               { background: hsl(180, var(--badge-sat), 15%); color: hsl(180, var(--badge-sat), 65%); }

/* Act Break Divider */
.usage--act-break-divider { background: hsl(210, calc(var(--badge-sat) * 0.3), 18%); color: hsl(210, calc(var(--badge-sat) * 0.3), 55%); }

/* ══════════════════════════════════════════════════════════════════════════
   DRAWER
   ══════════════════════════════════════════════════════════════════════════ */
.drawer {
  display: none;
  position: fixed; inset: 0; z-index: 200;
}
.drawer--open { display: block; }

.drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}

.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(520px, 100vw);
  background: #222228; background: var(--bg-surface);
  border-left: 1px solid #3a3a44; border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: slideInRight 0.22s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* Sub-drawer (offset) — overlays on top of the main drawer */
.sub-drawer { z-index: 210; }
.sub-drawer .drawer-panel {
  width: min(420px, 90vw);
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--bg-panel); flex-shrink: 0;
}
.drawer-title { font-size: 1.1rem; font-weight: 600; }
.drawer-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: 0.2rem 0.5rem;
}
.drawer-close:hover { color: var(--text); }

/* Drawer prev/next navigation */
.drawer-nav { display: flex; flex-direction: column; gap: 2px; margin-left: auto; margin-right: 0.5rem; }
.drawer-nav-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 0.7rem; cursor: pointer; padding: 0.15rem 0.5rem;
  border-radius: var(--radius); line-height: 1;
}
.drawer-nav-btn:hover { color: var(--text); border-color: var(--text-muted); }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* Drawer field groups */
.drawer-section { display: flex; flex-direction: column; gap: 0.75rem; }
.drawer-section-title {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.drawer-row { display: flex; flex-direction: column; gap: 0.25rem; }
.drawer-row label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
}
/* Label row with an inline action (e.g. the bullet button) */
.drawer-label-row {
  display: flex; align-items: center; justify-content: space-between;
}
.bullet-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  width: 20px; height: 20px; line-height: 1; padding: 0;
  border-radius: var(--radius); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.bullet-btn:hover { color: var(--text); border-color: var(--text-muted); }
.drawer-row input,
.drawer-row select,
.drawer-row textarea {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.4rem 0.6rem; font-size: 0.875rem; font-family: inherit; width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.drawer-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237a7a88'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}
.drawer-row input:focus,
.drawer-row select:focus,
.drawer-row textarea:focus { outline: none; border-color: var(--accent); }
/* Duration is a computed, read-only value. It stays selectable/copyable, but
   is kept out of the tab order (tabindex="-1" in markup), shows no text caret,
   and never picks up the accent focus border — so it won't look editable even
   though you can click to highlight and copy it. */
#drawer-duration { cursor: default; caret-color: transparent; }
#drawer-duration:focus { border-color: var(--border); outline: none; }
/* Sustained invalid-timecode state. Deliberately a bright, saturated red with
   a background tint + glow so it reads clearly even against the reddish-pink
   --accent focus border (which is otherwise easy to confuse it with). */
.drawer-row input.tc-invalid,
.drawer-row input.tc-invalid:focus {
  border-color: #ff4d4d !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.45) !important;
  background: rgba(255, 77, 77, 0.10) !important;
}
.tc-invalid-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ff6b6b;
}
.drawer-row textarea { resize: vertical; min-height: 36px; }
.drawer-row textarea[rows="2"],
.drawer-row textarea[rows="3"] { min-height: 64px; }

.drawer-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.drawer-three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }

/* Offset panel in drawer */
.offset-panel {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem;
}
.offset-panel h3 { font-size: 0.8rem; margin-bottom: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.offset-preview-row {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem;
  font-size: 0.8rem;
}
.offset-preview-tc {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  color: #e3c080;
}

/* Drawer save bar — status pill only, no button */
.drawer-save-bar {
  padding: 0.6rem 1.25rem; border-top: 1px solid var(--border);
  flex-shrink: 0; min-height: 40px; display: flex; align-items: center;
}

.save-status-pill {
  font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 99px;
  transition: opacity 0.3s;
}
.save-status--saving { color: #e3c080; background: #3d2a00; }
.save-status--saved  { color: #80e380; background: #1a3d1a; }
.save-status--error  { color: #e38080; background: #3d1a1a; }

/* ══════════════════════════════════════════════════════════════════════════
   MODAL (Add Cue)
   ══════════════════════════════════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  align-items: center; justify-content: center;
}
.modal--open { display: flex; }
.modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
}
.modal-panel {
  position: relative; z-index: 1;
  width: min(400px, 90vw);
  background: #222228; background: var(--bg-surface);
  border: 1px solid #3a3a44; border: 1px solid var(--border);
  border-radius: 6px; border-radius: var(--radius);
  padding: 1.5rem;
}
.modal-panel h2 { margin-bottom: 1rem; font-size: 1rem; }

/* ══════════════════════════════════════════════════════════════════════════
   DROPDOWN
   ══════════════════════════════════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 110%;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 220px; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: block; padding: 0.5rem 0.9rem; font-size: 0.85rem; color: var(--text);
}
.dropdown-item:hover { background: var(--bg-panel); text-decoration: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* muted */
.muted { color: var(--text-muted); }


/* ══════════════════════════════════════════════════════════════════════════
   BOTTOM TAB BAR
   ══════════════════════════════════════════════════════════════════════════ */
.bottom-tabs {
  display: flex; gap: 0; flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 0;
}
.bottom-tab {
  flex: 0 0 auto; padding: 0.5rem 1.25rem;
  background: transparent; border: none;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; position: relative;
  transition: color 0.15s;
}
.bottom-tab:hover { color: var(--text); }
.bottom-tab--active {
  color: var(--text);
}
.bottom-tab--active::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0;
  height: 2px; background: var(--accent);
}

/* ── Tab view switching ───────────────────────────────────────────────────── */
.tab-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.tab-view--active { display: flex; }

/* ══════════════════════════════════════════════════════════════════════════
   PRODUCER PREVIEW
   ══════════════════════════════════════════════════════════════════════════ */
.producer-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 0 1rem; border-bottom: 3px solid var(--show-accent, #3ac5c9);
  margin-bottom: 1.5rem;
}
.producer-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.producer-title {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  display: flex; align-items: baseline; gap: 0.75rem;
}
/* Header title parts — match the Spotting page: show name and episode info
   both white; episode info smaller and lighter to recede. */
.producer-title .ph-show { color: var(--text); }
.producer-title .ph-episode { color: var(--show-accent, #3ac5c9); font-weight: 500; font-size: 1rem; letter-spacing: -0.03rem; }
/* Admin pages have no project accent — use the app accent instead */
.producer-title .ph-episode--global { color: var(--accent); }
.producer-subtitle {
  font-size: 1.1rem; font-weight: 600; color: var(--show-accent, #3ac5c9);
}
.producer-header-right { display: flex; align-items: center; gap: 1rem; }
/* Page label on the far right of Stats/Export headers */
.ph-page-label {
  font-size: 1.5rem; font-weight: 700; color: var(--text-muted);
}
.producer-show-title {
  font-size: 1.4rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text);
}

/* Producer table */
.producer-table-wrapper {
  flex: 1; overflow: auto;
}
.producer-table {
  width: 100%; border-collapse: collapse;
}
.producer-table thead th {
  padding: 0.7rem 0.8rem; text-align: left;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.producer-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.producer-table tbody tr:last-child {
  border-bottom: none;
}
.producer-table td {
  padding: 0.8rem 0.8rem;
  vertical-align: top; color: var(--text);
  font-size: 0.88rem;
}

/* Producer table columns */
.pt-col-cue   { width: 90px; }
.pt-col-title { width: auto; }
.pt-col-scene { width: 200px; }
.pt-col-tc    { width: 115px; }
.pt-col-dur   { width: 80px; }
.pt-col-kind  { width: 70px; }

.pt-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  font-weight: 500;
}

/* Title cell: main title + temp reference below */
.pt-title-main {
  display: block; font-weight: 500;
}
.pt-title-temp {
  display: block; margin-top: 0.25rem;
  font-size: 0.78rem; color: var(--text-muted);
}

/* Light mode adjustments for producer preview */
html.light-mode .producer-table { background: #fff; }
html.light-mode .producer-table td { color: #1a1a1f; }
html.light-mode .pt-title-temp { color: #6a6a78; }
html.light-mode .producer-title { color: #1a1a1f; }
html.light-mode .producer-show-title { color: #1a1a1f; }


/* Producer export PDF button */
.producer-export-btn { margin-right: 1rem; }


/* Producer filter toggle */
.producer-filter-toggle {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font-size: 0.8rem; margin-right: 0.75rem; user-select: none;
}
.producer-filter-toggle input { display: none; }
.producer-filter-toggle .toggle-slider {
  width: 32px; height: 18px; border-radius: 99px;
  background: var(--border); position: relative;
  transition: background 0.2s;
}
.producer-filter-toggle .toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted); transition: transform 0.2s, background 0.2s;
}
.producer-filter-toggle input:checked + .toggle-slider { background: var(--accent); }
.producer-filter-toggle input:checked + .toggle-slider::after {
  transform: translateX(14px); background: #fff;
}
.producer-filter-toggle .toggle-label { color: var(--text-muted); }
.producer-filter-toggle input:checked ~ .toggle-label { color: var(--text); }


/* ── Usage Colors Modal ───────────────────────────────────────────────────── */
.modal-panel--wide { width: min(380px, 90vw); }
.usage-colors-list {
  display: flex; flex-direction: column; gap: 0;
  margin: 1rem 0;
}
.usage-color-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
}
.usage-color-row:hover { background: var(--bg-panel); }
.usage-color-label {
  flex: 1; font-size: 0.85rem; color: var(--text);
}
.usage-color-swatch {
  width: 28px; height: 28px; border-radius: 4px;
  border: 1px solid var(--border); cursor: pointer;
  padding: 0; overflow: hidden; flex-shrink: 0;
}
.usage-color-swatch input[type="color"] {
  width: 44px; height: 44px; border: none; padding: 0;
  margin: -8px; cursor: pointer;
  background: none;
}


/* ── Select column toggle ─────────────────────────────────────────────────── */
.cue-table.select-hidden .col-select,
.producer-table.select-hidden .col-select { width: 0; padding: 0; overflow: hidden; border: none; }
.cue-table.select-hidden .col-select *,
.producer-table.select-hidden .col-select * { display: none; }


/* ── Limited viewer: hide composer column ─────────────────────────────────── */
.cue-table.limited-view .col-composer { display: none; }


/* ── Viewer mode (hide edit controls) ─────────────────────────────────────── */
.viewer-mode .cue-delete-btn { display: none; }
.viewer-mode .col-actions { visibility: hidden; }


/* ── Omitted cue strikethrough ────────────────────────────────────────────── */
.cue-row.usage-omitted .col-title .cue-title-text { text-decoration: line-through; color: var(--text-muted); }


/* ══════════════════════════════════════════════════════════════════════════
   STATS TAB
   ══════════════════════════════════════════════════════════════════════════ */
.stats-page { padding: 0; overflow-y: auto; }
/* Stats body: main content on the left, poster pinned right */
.stats-body { display: flex; gap: 3rem; align-items: stretch; }
/* Cap the stats content width so it doesn't stretch and push the poster
   rightward as the window grows. Extra width becomes empty far-right space. */
.stats-main { flex: 0 1 720px; min-width: 0; }
/* Poster sits just right of the stats content, top-aligned. The small top
   margin drops it to line up with the top of the Music Totals boxes rather
   than the section header above them. */
.stats-poster {
  flex: 0 0 auto;
  display: flex; align-items: flex-start; justify-content: flex-start;
}
.stats-poster img {
  width: 210px; max-width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  display: block; border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 1.7rem; /* aligns with the top of the totals boxes */
}
.stats-heading { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; }
.stats-section { margin-bottom: 2rem; }
.stats-section-title {
  font-size: 0.85rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.75rem;
}

/* Stats cards grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.75rem;
}
/* Collapse the totals to fewer columns only on genuinely narrow widths */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
.stats-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.stats-card-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.04em; }
.stats-card-value { font-size: 1.1rem; font-weight: 600; }
.stats-card-sub { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Composer bar chart */
.composer-chart { max-width: 800px; }
.composer-chart table { width: 100%; border-collapse: separate; border-spacing: 0 0.4rem; }
.composer-chart th {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 500; padding: 0 0.4rem 0.5rem;
  text-align: left; white-space: nowrap;
}
.composer-chart th.col-bar { width: 130px; }
.composer-chart th.col-num { width: 40px; text-align: center; }
.composer-chart th.col-time { width: 50px; text-align: center; }
.composer-chart th.col-name { width: 90px; }
.composer-chart th.col-divider { width: 1px; padding: 0 0.6rem; }
.composer-chart td { padding: 0.35rem 0.4rem; vertical-align: middle; }
.composer-chart td.col-name {
  font-size: 0.85rem; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.4rem 0.6rem;
  text-align: center;
}
.composer-chart td.col-num { font-size: 0.82rem; text-align: center; color: var(--text); }
.composer-chart td.col-time { font-size: 0.82rem; text-align: center; color: var(--text-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.composer-chart td.col-divider { width: 1px; padding: 0 0.6rem; }
.composer-chart td.col-divider::after { content: ''; display: block; width: 1px; height: 14px; background: var(--border); }
.composer-chart .bar-track {
  width: 100%; height: 14px; background: var(--bg-panel);
  border-radius: 3px; overflow: hidden;
}
.composer-chart .bar-fill {
  height: 100%; background: var(--show-accent, #3ac5c9);
  border-radius: 3px; transition: width 0.3s ease; opacity: 0.5;
}
.composer-chart .bar-fill-tbw {
  height: 100%; background: var(--show-accent, #3ac5c9);
  border-radius: 3px; transition: width 0.3s ease;
}


/* ── Pie chart ────────────────────────────────────────────────────────────── */
.pie-chart-container {
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.pie-chart {
  width: 180px; height: 180px; border-radius: 50%;
  flex-shrink: 0;
}
.pie-legend { display: flex; flex-direction: column; gap: 0.4rem; }
.pie-legend-item { display: flex; align-items: center; gap: 0.5rem; }
.pie-legend-swatch {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
}
.pie-legend-label { font-size: 0.85rem; }
.pie-legend-value { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }


/* ── Tools buttons in drawer ─────────────────────────────────────────────── */
#btn-open-offset-drawer,
#btn-merge-down,
#btn-split-cue,
#btn-renumber-cues { justify-content: center; }


/* ── Export options ───────────────────────────────────────────────────────── */
.export-options {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  padding: 0.75rem 1rem; margin-bottom: 1rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.export-option-group {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem;
}
/* Thin grey divider between groups, matching the Spotting totals bar */
.export-option-group + .export-option-group {
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}
.export-option-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 700;
}
/* buttons sit in a horizontal row beneath each label */
.export-option-buttons {
  display: flex; align-items: center; gap: 0.5rem;
}
.export-preview-note {
  font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.5rem;
  font-style: italic;
}

/* ── Date inputs (native picker) ──────────────────────────────────────────── */
.form-row input[type="date"] {
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; font-size: 0.9rem; font-family: inherit;
  width: 100%;
}
.form-row input[type="date"]:focus { outline: none; border-color: var(--accent); }
.form-row input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}
html.light-mode .form-row input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}


/* ── Key Dates card (Episode detail page) ─────────────────────────────────── */
.key-dates-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.key-dates-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.key-dates-title { font-size: 1rem; font-weight: 600; }
.key-dates-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.key-date-item { display: flex; flex-direction: column; gap: 0.2rem; }
.key-date-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.key-date-value { font-size: 0.95rem; font-weight: 500; }
.key-dates-empty { color: var(--text-muted); font-size: 0.85rem; }


/* ── Key Dates (Stats tab) — stacked, one per line ────────────────────────── */
.stats-key-dates {
  display: flex; flex-direction: column;
  max-width: 400px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.stats-key-date {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.6rem 1rem; font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.stats-key-date:last-child { border-bottom: none; }
.stats-key-date-label { color: var(--text-muted); }
.stats-key-date-value { font-weight: 500; white-space: nowrap; }

/* ── Mix Day rows (Episode Settings) ──────────────────────────────────────── */
.mix-day-row {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.5rem;
  position: relative;
}
/* Label + date together match the width of a single date field above.
   The fields group fills the form width; the remove button sits beyond it. */
.mix-day-fields {
  display: flex; gap: 0.6rem; width: 100%; min-width: 0;
}
.mix-day-remove {
  position: absolute; left: calc(100% + 0.6rem); top: 50%;
  transform: translateY(-50%);
}
.mix-day-label-input {
  flex: 1; min-width: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; font-size: 0.85rem; font-family: inherit;
}
.mix-day-label-input:focus { outline: none; border-color: var(--accent); }
.mix-day-label-input::placeholder { color: var(--text-muted); }
.mix-day-row input[type="date"] {
  flex: 1; min-width: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; font-size: 0.9rem; font-family: inherit;
}
.mix-day-row input[type="date"]:focus { outline: none; border-color: var(--accent); }
.mix-day-row input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6); cursor: pointer;
}
html.light-mode .mix-day-row input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}
.mix-day-remove {
  flex-shrink: 0; line-height: 1; font-size: 1rem;
  padding: 0.3rem 0.55rem; color: var(--text-muted);
}
.mix-day-remove:hover { color: var(--accent); }

/* ── Poster upload field (Project Settings) ───────────────────────────────── */
.poster-field { display: flex; gap: 1rem; align-items: flex-start; }
.poster-preview {
  width: 120px; aspect-ratio: 2 / 3; flex-shrink: 0;
  object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-panel);
}
.poster-preview--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.8rem;
}
.poster-controls { display: flex; flex-direction: column; gap: 0.5rem; }
.poster-controls input[type="file"] {
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; font-size: 0.85rem; max-width: 320px;
}
.poster-remove {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text-muted); text-transform: none; letter-spacing: normal;
}

/* ── Login screen (full-screen stripes background + title + floating card) ──── */
.login-screen {
  position: fixed; inset: 0; overflow: hidden;
  background: #1b3b3b;  /* matches the stripes art's dark teal, fills any gap */
}
/* Background and title are the SAME 1920x1080 canvas, sized and anchored
   identically so the title stays glued to the vertical part of the stripes
   regardless of window shape. Top-anchored so the title region is protected
   from cropping on short/wide windows. */
.login-bg,
.login-title {
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 28%;
}
.login-bg    { background-image: url("../img/login-stripes.jpg"); }
.login-title { background-image: url("../img/login-title.png"); }

/* The login card, floated in the lower-center over the open converging zone */
.login-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  /* nudge the card below the title (which sits in the upper third) */
  padding-top: 22vh;
}
.login-card {
  width: min(340px, 86vw);
  background: rgba(20, 32, 32, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 1.5rem 1.4rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.login-card .form-row label { color: #cfe3d8; }
.login-card .flash { margin-bottom: 0.75rem; }

/* On short/wide windows, ease the card up a touch so it doesn't crowd the fan */
@media (max-height: 640px) {
  .login-overlay { padding-top: 12vh; }
}

/* Copyright footer — pinned bottom-right, never crops (independent of the art) */
.login-footer {
  position: absolute; right: 1.5rem; bottom: 1.1rem;
  font-family: "Arial Narrow", "Futura", "Oswald", sans-serif;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #91bb62;  /* exact CUEMAP title green (sampled from login-title.png) */
  opacity: 0.9;
  /* Single soft drop shadow, same size as before but darker, for legibility
     over brighter stripes without a hard outline. */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;  /* decorative; set to auto if you later make it a link */
  user-select: none;
}
