:root {
  color-scheme: light;
  --bg: #f3f4f7; --card: #ffffff; --ink: #1b2130; --muted: #5d6577; --line: #dde0e8; --field: #f7f8fa;
  --accent: #c9861a; --accent-ink: #1b2130; --accent-soft: #f7ead3;
  --good: #2f7d4f; --good-soft: #e2f2e8; --warn: #a4561a; --warn-soft: #f9e8da; --info: #2d5ea8; --info-soft: #e2ebf8;
  --bad: #b3261e;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12151d; --card: #1b1f2a; --ink: #e8eaf0; --muted: #9aa1b2; --line: #2c3242; --field: #151922;
    --accent: #e2a23a; --accent-ink: #12151d; --accent-soft: #3a2f1c;
    --good: #6cc28f; --good-soft: #1d3327; --warn: #e59a5c; --warn-soft: #3a2a1d; --info: #86aee8; --info-soft: #1e2a3d;
    --bad: #f2837a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-weight: 600; font-size: 15px; }
.topbar nav a { text-decoration: none; }
.brand { font: 700 24px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; text-decoration: none; }
.brand span, .kiosk-brand span, .accent { color: var(--accent); }
.brand.big { font-size: 44px; margin: 0 0 8px; }

.wrap { max-width: 780px; margin: 0 auto; padding: 16px 16px calc(56px + env(safe-area-inset-bottom, 0px)); }
h1 { font: 700 34px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 8px 0 6px; text-wrap: balance; }
h2 { font: 700 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 26px 0 10px; }
h3 { margin: 0; font: 700 19px/1.15 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font: 500 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.crumbs { margin: 0; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stack { display: grid; gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
input, select, textarea {
  font: 16px var(--body); color: var(--ink); background: var(--field); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; width: 100%; max-width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); border-radius: 8px; padding: 9px 14px; font: 600 15px var(--body); cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 6px 10px; font-size: 14px; }
.btn.big { padding: 14px; font-size: 18px; }
.btn.danger, .linkbtn.danger { color: var(--bad); }
.btn:disabled { opacity: .7; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.msg { margin: 8px 0; font-size: 15px; }
.msg.bad, .save-state.bad { color: var(--bad); }
.msg.good { color: var(--good); }
form.inline { display: inline; }
details > summary { cursor: pointer; font-weight: 700; }
.add { margin-top: 20px; }
.add .stack { margin-top: 10px; }
.add details { margin-top: 14px; }

/* Login */
.login { max-width: 420px; margin: 12vh auto 0; }
.otp { font: 600 28px var(--mono); letter-spacing: .3em; text-align: center; }

/* Festivals */
.festlist, .rows, .people, .team { list-style: none; padding: 0; margin: 0; }
.festlist { display: grid; gap: 10px; }
.fest-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.fest-name { font: 700 22px/1.1 var(--display); text-transform: uppercase; text-decoration: none; }
.chips, .filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filters { position: sticky; top: var(--topbar-h, calc(49px + env(safe-area-inset-top, 0px))); z-index: 5; background: var(--bg); padding: 8px 0; margin: 8px 0 0; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 6px 12px; font: 600 14px var(--body); cursor: pointer; text-decoration: none;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.ghost { color: var(--muted); }
.rows li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }

/* Schedule */
.day { color: var(--muted); margin-top: 30px; }
.slot { margin-bottom: 14px; }
.slot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }

.film { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; display: grid; gap: 10px; scroll-margin-top: calc(var(--topbar-h, 49px) + 61px); }
.film.seen { border-left: 4px solid var(--good); }
.film-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.film-title { font-weight: 700; font-size: 18px; line-height: 1.2; text-decoration: none; }
.meta { display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--muted); font-size: 14px; }
.also { margin: 0; font-size: 14px; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tog {
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px;
  padding: 5px 11px; font: 600 14px var(--body); cursor: pointer; white-space: nowrap;
}
.seen-tog[aria-pressed="true"] { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.follow-tog[aria-pressed="true"] { background: var(--accent-soft); color: var(--warn); border-color: var(--accent); }
.stars { display: flex; }
.star { border: 0; background: none; font-size: 26px; line-height: 1; padding: 2px 3px; cursor: pointer; color: var(--line); }
.star.on { color: var(--accent); }
.ff-select { width: auto; flex: 1 1 180px; }
.badge { font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.ff-submitted { background: var(--good-soft); border-color: var(--good); }
.ff-not { background: var(--warn-soft); border-color: var(--warn); }
.ff-invite, .ff-invited { background: var(--info-soft); border-color: var(--info); }
.contact-line { margin: 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.on-file { font-size: 13px; font-weight: 600; }
.on-file.yes { color: var(--good); }
.on-file.no { color: var(--muted); font-weight: 400; }
.invite-done { margin: 0; font-size: 14px; font-weight: 600; color: var(--info); }
.invite-done.stage-submitted { color: var(--good); }
.invite-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.invite-row { display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; align-items: flex-start; }
.invite-main { display: grid; gap: 4px; min-width: 0; flex: 1 1 260px; }
.invite-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.invite-row .ok { color: var(--good); font-weight: 600; }
.invite-row.stage-declined { opacity: .75; }
.invite-done.stage-declined { color: var(--muted); }
#kiosk-nocontact { white-space: normal; }
.save-state { margin: -6px 0 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.team { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 8px; }
.team li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; font-size: 15px; }
.team p { margin: 2px 0 0; white-space: pre-wrap; }
.who { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--warn); display: grid; place-items: center; font: 700 12px var(--body); }

/* FilmFreeway history */
.ffhist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.ffhist li { padding-left: 10px; border-left: 3px solid var(--line); }
.ffhist .js-not-selected { border-color: var(--bad); }
.ffhist .js-selected { border-color: var(--good); }
.ffhist .js-award-winner { border-color: var(--good); font-weight: 600; }
.ffhist .js-withdrawn { border-color: var(--warn); }
.picked, .withdrawn-flag { display: inline-block; margin: 4px 4px 0 0; font-size: 14px; color: var(--good); background: var(--good-soft); border: 1px solid var(--good); border-radius: 6px; padding: 3px 8px; }
.withdrawn-flag { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); }
.ffhist .js-undecided, .ffhist .js-in-consideration { border-color: var(--info); }
.cycles { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.cycles li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Import review */
.tablewrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.review { border-collapse: collapse; min-width: 1100px; width: 100%; }
.review th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.review td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.review input { padding: 6px 7px; font-size: 14px; }
.review input[type="checkbox"] { width: 20px; height: 20px; margin-top: 6px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font: 400 15px/1.4 var(--body); text-transform: none; letter-spacing: normal; color: var(--ink); }
label.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.review .num { width: 60px; } .review .kind { width: 100px; }
.match { display: inline-block; margin-top: 3px; font-size: 12px; color: var(--info); font-weight: 600; }

/* People */
.people { display: grid; gap: 8px; margin-top: 16px; }
.people li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.people li.off { opacity: .6; }

/* Filmmaker contact form: covers everything */
body.kiosk-on { overflow: hidden; }
body.kiosk-on main, body.kiosk-on .topbar { visibility: hidden; }
.kiosk {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg); overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.kiosk-inner { max-width: 440px; margin: 0 auto; display: grid; gap: 18px; min-height: 100%; align-content: start; }
.kiosk-brand { font: 700 20px var(--display); text-transform: uppercase; letter-spacing: .04em; margin: 0; color: var(--muted); }
.kiosk h2 { font-size: 30px; margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-family: var(--body); }
.kiosk-lead { margin: 0 0 8px; color: var(--muted); font-size: 17px; }
.kiosk input { font-size: 18px; padding: 12px; }
.hold {
  position: relative; overflow: hidden; margin-top: 24px; border: 1px dashed var(--line); background: transparent;
  color: var(--muted); border-radius: 8px; padding: 12px; font: 600 14px var(--body); cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.hold-fill { position: absolute; inset: 0; width: 0; background: var(--accent-soft); }
.hold-label { position: relative; }
.hold.holding .hold-fill { width: 100%; transition: width 2s linear; }

@media (max-width: 420px) { .two { grid-template-columns: 1fr; } h1 { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { .hold.holding .hold-fill { transition: none; } }
