:root {
  --bg: #f6f7f9; --card: #fff; --ink: #14171c; --muted: #6a7280; --line: #e3e6eb;
  --accent: #2563eb; --accent-ink: #fff; --accent-soft: #e8efff;
  --free: #15803d; --free-soft: #e3f5e9; --busy: #6a7280; --busy-soft: #eceef2;
  --warn: #b45309; --warn-soft: #fdf1dc; --danger: #b91c1c; --danger-soft: #fde8e8;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216; --card: #181b21; --ink: #eceef2; --muted: #9aa3b2; --line: #2a2f38;
    --accent: #5b8def; --accent-ink: #0b1220; --accent-soft: #1b2a4a;
    --free: #5fd18a; --free-soft: #16301f; --busy: #9aa3b2; --busy-soft: #23272f;
    --warn: #f0b35a; --warn-soft: #3a2c12; --danger: #f08a8a; --danger-soft: #3a1717;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.pad { padding: 16px; }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
header#top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.bar { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; }
.who { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
nav { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; }
nav a { text-decoration: none; color: var(--ink); padding: 7px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
nav a.on { background: var(--accent-soft); color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.card.link { cursor: pointer; } .card.link:hover { border-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 200px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--busy-soft); color: var(--busy); white-space: nowrap; }
.badge.open { background: var(--accent-soft); color: var(--accent); }
.badge.taken, .badge.shot { background: var(--warn-soft); color: var(--warn); }
.badge.uploaded, .badge.editing, .badge.review { background: var(--accent-soft); color: var(--accent); }
.badge.sent { background: var(--free-soft); color: var(--free); }
.badge.cancelled { background: var(--danger-soft); color: var(--danger); }
.badge.free { background: var(--free-soft); color: var(--free); }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.radio { display: flex; gap: 16px; flex-wrap: wrap; } .radio label { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 4px 0; } .radio input { width: auto; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
dl.brief { margin: 0; } dl.brief dt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 12px; } dl.brief dd { margin: 3px 0 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .h { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cell { min-height: 78px; border: 1px solid var(--line); border-radius: 9px; padding: 5px; background: var(--card); cursor: pointer; font-size: 12px; position: relative; overflow: hidden; }
.cell .n { font-weight: 700; font-size: 13px; }
.cell.other { opacity: .45; } .cell.today .n { color: var(--accent); }
.cell.free { background: var(--free-soft); border-color: var(--free); }
.cell.busy { background: var(--busy-soft); }
.cell.locked { cursor: default; }
.cell .tag { display: block; margin-top: 3px; padding: 1px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.cell .tag.mine { background: var(--warn-soft); color: var(--warn); }
.cell .state { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cell.free .state { color: var(--free); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--line); }
.tablewrap { overflow-x: auto; }
table.team { border-collapse: separate; border-spacing: 3px; min-width: 860px; width: 100%; table-layout: fixed; }
table.team th.name, table.team td.name { width: 112px; }
table.team th { font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px; text-align: center; }
table.team th.name, table.team td.name { text-align: left; white-space: nowrap; font-weight: 600; padding-right: 10px; }
table.team td { height: 44px; border-radius: 8px; text-align: center; font-size: 11.5px; padding: 2px 4px; background: var(--card); border: 1px solid var(--line); vertical-align: middle; }
table.team td.free { background: var(--free-soft); color: var(--free); font-weight: 600; border-color: var(--free); }
table.team td.busy { background: var(--busy-soft); color: var(--busy); }
table.team td a { display: block; text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 8px; background: var(--busy-soft); border-radius: 9px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .15s; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.timeline { margin: 0; padding: 0; list-style: none; font-size: 13px; } .timeline li { padding: 5px 0; border-bottom: 1px solid var(--line); } .timeline li:last-child { border: 0; }
.hint { background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 9px 12px; font-weight: 500; margin-bottom: 12px; }
.hint.warn { background: var(--warn-soft); color: var(--warn); }
video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
.link-box { display: flex; gap: 8px; align-items: center; } .link-box input { font-size: 12px; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.err { background: var(--danger); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
@media (max-width: 560px) {
  main { padding: 12px; } .cell { min-height: 62px; padding: 3px; } .cell .tag { font-size: 10px; padding: 0 3px; } .cell .state { display: none; }
}

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.cands { display: grid; gap: 6px; }
.cand { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.cand.free { background: var(--free-soft); border-color: var(--free); }
.cand.busy { background: var(--busy-soft); }
table.team td.req { background: var(--warn-soft); border-color: var(--warn); }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--muted); padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.step i { font-style: normal; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--busy-soft); color: var(--busy); }
.step.done { color: var(--free); } .step.done i { background: var(--free-soft); color: var(--free); }
.step.now { color: var(--accent); border-color: var(--accent); font-weight: 600; } .step.now i { background: var(--accent); color: var(--accent-ink); }
.modal { position: fixed; inset: 0; background: rgba(10, 12, 16, .55); display: grid; place-items: center; padding: 16px; z-index: 30; overflow-y: auto; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(560px, 100%); max-height: 100%; overflow-y: auto; }
.guide { padding-left: 20px; margin: 0 0 8px; } .guide li { margin: 6px 0; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin-top: 12px; } label.check input { width: auto; margin-top: 3px; }
.rule { margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; } .rule.paid { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .step { flex-direction: row; text-align: left; } }

.fchip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--busy-soft); color: var(--ink); }
.fchip.reels { background: var(--accent-soft); color: var(--accent); }
select.fsel { width: auto; padding: 3px 6px; font-size: 13px; }
.vlist { display: grid; gap: 8px; margin-top: 10px; }
.vrow { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.drop.small { padding: 12px; margin-top: 8px; font-size: 13px; }
.player:empty { display: none; }
.player { margin-top: 8px; }
.player video { display: block; background: #000; border-radius: 10px; }
.player.reels video { aspect-ratio: 9 / 16; height: min(70vh, 640px); width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
.player.youtube video { aspect-ratio: 16 / 9; width: 100%; height: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.stats div, .tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stats span, .tile span { font-size: 12px; color: var(--muted); }
.stats strong { font-size: 16px; } .stats em { font-style: normal; font-size: 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); } .tile strong { font-size: 20px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.grid td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr.note td { border-top: 0; padding-top: 0; }
