@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #E4E7EB;
  --column: #D6DBE1;
  --surface: #FFFFFF;
  --ink: #1D2025;
  --muted: #58606B;
  --line: #C6CCD3;
  --tile: #2B3038;
  --tile-quiet: #6E7680;
  --red: #BA0013;
  --red-dark: #8F000F;
  --red-wash: #FBE6E8;
  --focus: #0B5FD6;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

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

/* Georgia plates: square, left-aligned, one plate per line, as in the reels. */
.plates { font: 400 16px/1.9 var(--serif); letter-spacing: -0.005em; }
.plates span {
  background: #fff;
  color: #000;
  padding: 0.2em 0.4em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.plates-large { font-size: 30px; line-height: 1.85; }

/* ---- controls ---- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0;
  font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { border-color: var(--ink); }
.button-primary { background: var(--red); border-color: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button:disabled, .step:disabled, .chip:disabled { opacity: .6; cursor: progress; }

.link-button {
  padding: 0; background: none; border: 0; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-button:hover { color: var(--ink); }
.link-danger { color: var(--red); }
.link-danger:hover { color: var(--red-dark); }

input:not([type=checkbox]), select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }

.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }

.error { color: var(--red); }
.hint { color: var(--muted); font-size: 13px; }

/* ---- login ---- */

.login { min-height: 100vh; max-width: 420px; margin: 0 auto; padding: 18vh 16px 48px; }
.login-form { display: grid; gap: 10px; margin-top: 36px; }
.login-form label { font-weight: 550; }
.login-form .button { justify-self: start; }

/* ---- top bar ---- */

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  max-width: 1440px; margin: 0 auto; padding: 18px 16px 10px;
}
.topbar-title { font: 400 22px/1.2 var(--serif); margin-right: auto; }

.views { display: inline-flex; border: 1px solid var(--line); background: var(--surface); }
.view-button { min-height: 36px; padding: 0 16px; background: none; border: 0; border-radius: 0; font-weight: 550; cursor: pointer; }
.view-button + .view-button { border-left: 1px solid var(--line); }
.view-button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.whoami { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.whoami select { width: auto; min-width: 130px; color: var(--ink); }

.notice {
  max-width: 1408px; margin: 0 16px 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.notice-error { border-color: var(--red); color: var(--red); font-weight: 550; }
.notice button { margin-left: 8px; }
@media (min-width: 1440px) { .notice { margin-left: auto; margin-right: auto; } }

/* ---- layout ---- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 1440px; margin: 0 auto; padding: 4px 16px 96px; }
.work, .ideas, .team { min-width: 0; }
@media (min-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; column-gap: 28px; align-items: start; }
  .work { grid-column: 1; grid-row: 1; }
  .ideas { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
  .team { grid-column: 1; grid-row: 2; }
  .jump { display: none; }
}

.section-title { font-size: 20px; font-weight: 600; }
.subhead { font-size: 15px; font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.filter select { width: auto; color: var(--ink); }
.jump { color: var(--muted); text-underline-offset: 3px; }

/* ---- board ---- */

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (max-width: 859px) {
  .board {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  }
  .column { scroll-snap-align: start; }
}

.column { min-height: 420px; padding: 10px; background: var(--column); }
.column.drop-over { background: #C7CED6; outline: 2px dashed var(--ink); outline-offset: -2px; }
.column-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 10px; }
.column-title { font-size: 15px; font-weight: 600; }
.column-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.column-empty { padding: 14px 4px; color: var(--muted); font-size: 13px; }
.cards { display: grid; gap: 10px; }

.card { position: relative; display: grid; gap: 10px; padding: 12px; background: var(--tile); color: #fff; }
.card-posted { background: var(--tile-quiet); }
.card.drop-over { outline: 3px solid var(--red); outline-offset: 2px; }
.card-open { position: absolute; inset: 0; z-index: 0; background: none; border: 0; cursor: pointer; }
.card-open:hover ~ .card-plates span { background: #EEF0F2; }
.card-open:focus-visible { outline-offset: -3px; outline-color: #fff; }
.card > :not(.card-open) { position: relative; z-index: 1; pointer-events: none; }
.card > .steps, .card-link { pointer-events: auto; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; min-height: 22px; font-size: 12px; color: rgba(255,255,255,.72); }
.card-link { padding: 1px 6px; background: #fff; color: #000; font-weight: 600; text-decoration: none; }
.card-link:hover { background: var(--page); }
.card-nolink { color: #FFD1D6; }
.card-plates { font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.card-hook { font: italic 13px/1.4 var(--serif); color: rgba(255,255,255,.82); }

.card-dates { display: grid; gap: 1px; margin: 0; font-size: 12px; color: rgba(255,255,255,.82); }
.card-dates div { display: flex; gap: 6px; }
.card-dates dt { min-width: 50px; color: rgba(255,255,255,.58); }
.card-dates dd { margin: 0; }

.crew-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.crew-tag { padding: 0 5px; border: 1px solid rgba(255,255,255,.45); font-size: 11px; line-height: 18px; }

/* Film, edit, post: a three-part progress bar that doubles as the switches. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.step {
  min-height: 30px; padding: 0 2px;
  background: transparent; border: 1px solid rgba(255,255,255,.4); border-radius: 0;
  color: rgba(255,255,255,.82); font-size: 12px; font-weight: 550; cursor: pointer;
}
.step:hover { border-color: #fff; color: #fff; }
.step[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.steps-large { margin: 20px 0 6px; }
.steps-large .step { min-height: 40px; border-color: var(--line); color: var(--ink); font-size: 14px; }
.steps-large .step:hover { border-color: var(--ink); color: var(--ink); }
.steps-large .step[aria-pressed="true"] { color: #fff; border-color: var(--red); }

/* ---- calendar ---- */

.calendar { margin-top: 16px; }
.month-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.month-nav { display: flex; gap: 6px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0; }
.legend .event { width: auto; cursor: default; }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.weekday { padding: 6px 8px; background: var(--page); color: var(--muted); font-size: 12px; font-weight: 600; }
.day { display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 6px; background: var(--surface); }
.day-events { display: grid; gap: 3px; }
.day-out { background: #F2F4F6; }
.day-out .day-num { color: var(--muted); }
.day.drop-over { background: var(--red-wash); box-shadow: inset 0 0 0 2px var(--red); }
.day-label { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day-today .day-num { padding: 0 6px; background: var(--red); color: #fff; }
.day-long { display: none; }

.event {
  display: block; width: 100%; padding: 3px 6px;
  border: 0; border-radius: 0; text-align: left;
  font-size: 12px; line-height: 1.35; cursor: grab;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-kind { font-weight: 650; }
.event-film { background: var(--tile); color: #fff; }
.event-due { background: var(--surface); color: var(--red-dark); box-shadow: inset 0 0 0 1px var(--red); }
.event-post { background: var(--red); color: #fff; }
.event-done { opacity: .55; }
.event.drop-over { outline: 2px solid var(--ink); outline-offset: 1px; }

@media (max-width: 759px) {
  .month { grid-template-columns: minmax(0, 1fr); }
  .weekday, .day.day-out { display: none; }
  .day { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 8px; min-height: 0; padding: 7px 8px; }
  .day-label { padding-top: 2px; }
  .day-num { display: none; }
  .day-long { display: inline; }
  .day-empty .day-label { color: var(--muted); font-weight: 400; }
  .day-today .day-long { padding: 0 6px; background: var(--red); color: #fff; }
}

.undated { margin-top: 20px; padding: 14px; background: var(--column); }
.undated.drop-over { background: #C7CED6; outline: 2px dashed var(--ink); outline-offset: -2px; }
.undated-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini { max-width: 240px; padding: 10px 12px 12px; background: var(--tile); border: 0; border-radius: 0; text-align: left; cursor: grab; }
.mini .plates { font-size: 14px; line-height: 1.95; }
.mini.drop-over { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---- dragging ---- */

[data-drag] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dragging, .dragging * { cursor: grabbing !important; }
.drag-source { opacity: .4; }
.ghost {
  position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none;
  max-width: 260px; padding: 7px 11px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 8px 20px rgba(29, 32, 37, .28);
}

.choose {
  position: fixed; z-index: 900; width: max-content; max-width: calc(100vw - 16px);
  padding: 12px; background: var(--surface); border: 1px solid var(--ink);
  box-shadow: 0 10px 28px rgba(29, 32, 37, .22);
}
.choose-title { margin-bottom: 10px; font-weight: 600; }
.choose-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.choose-buttons .link-button { margin-left: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 16px; z-index: 950; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 16px;
  width: max-content; max-width: calc(100vw - 32px); padding: 11px 16px;
  background: var(--ink); color: #fff;
}
.toast .link-button { color: #fff; font-weight: 600; }

/* ---- ideas and team ---- */

.panel { padding: 20px; background: var(--surface); }
.panel-hint { margin-top: 4px; color: var(--muted); font-size: 13px; }

.idea-form { display: grid; gap: 8px; margin: 14px 0; }
.idea-form .button { justify-self: start; }
.idea-list { margin: 0; padding: 0; list-style: none; }
.idea { padding: 12px 0; border-top: 1px solid var(--page); }
.idea-draggable { cursor: grab; }
.idea-draggable:hover .idea-text { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.idea-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.idea-meta .link-button { font-size: 13px; }
.idea-list-empty { padding: 12px 0; color: var(--muted); }

.team-grid { display: grid; gap: 28px; margin-top: 14px; }
@media (min-width: 760px) { .team-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
.people { display: grid; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.person { display: flex; align-items: center; gap: 10px; }
.person input:not([type=checkbox]) { flex: 1; }
.person-away input:not([type=checkbox]) { color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.team > .link-button { margin-top: 28px; font-size: 13px; }

.tally { width: 100%; margin-top: 10px; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
.tally th, .tally td { padding: 8px 10px; border-bottom: 1px solid var(--page); text-align: left; }
.tally thead th { font-size: 13px; font-weight: 600; }
.tally td, .tally thead th:not(:first-child) { text-align: right; }
.tally-wrap { overflow-x: auto; }

/* ---- video drawer ---- */

.drawer {
  width: 100%; max-width: 560px; height: 100%; max-height: none;
  margin: 0 0 0 auto; padding: 0; border: 0;
  background: var(--surface); color: var(--ink);
}
.drawer::backdrop { background: rgba(29, 32, 37, .45); }
.drawer[open] { animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }

.drawer-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--page);
}
.saved { color: var(--muted); font-size: 13px; }
.saved-error { color: var(--red); }
.drawer-body { padding: 18px 16px 40px; }
@media (min-width: 600px) { .drawer-body { padding: 22px 28px 48px; } }

.title-input {
  width: calc(100% + 16px); min-height: 0; margin-left: -8px; padding: 6px 8px;
  border-color: transparent; font: 400 26px/1.3 var(--serif); resize: none;
}
.title-input:hover { border-color: var(--line); }

.field { display: grid; gap: 4px; margin-top: 14px; }
.field label, .crew-picker legend { font-size: 13px; font-weight: 600; }
.field-grid { display: grid; gap: 0 14px; }
@media (min-width: 480px) { .field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.link-field { margin-top: 16px; padding: 14px; background: var(--page); }
.link-field label { font-size: 14px; }
.link-row { display: flex; gap: 8px; }
.player { display: grid; gap: 8px; margin-top: 12px; }
.player video { display: block; width: auto; max-width: 100%; max-height: 70vh; background: #000; }
.player-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.player-pick select { width: auto; max-width: 100%; }

.crew-picker { margin: 22px 0 0; padding: 0; border: 0; }
.crew-row { display: grid; gap: 6px; margin-top: 10px; }
@media (min-width: 480px) { .crew-row { grid-template-columns: 96px 1fr; align-items: baseline; } }
.crew-role { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 32px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.video-ideas { margin-top: 28px; }
.video-ideas .idea-list { margin-top: 6px; }

.drawer-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--page); }
