[hidden] { display: none !important; }
:root {
  --bg: #F3F4F6; --card: #FFFFFF; --ink: #14171B; --ink2: #3A424C; --muted: #5A626C; --line: #D5D9DE; --line2: #E8EAED; --field: #FFFFFF;
  --accent: #C2410C; --accent-ink: #FFFFFF; --ok: #2F6B45; --ok-bg: #E6F2EA; --wait: #8A2B0A; --wait-bg: #FDEBDD; --err: #9F1D1D; --soft: #F6F7F8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1114; --card: #181B20; --ink: #ECEEF1; --ink2: #C5CAD1; --muted: #8E96A0; --line: #2C3138; --line2: #23272D; --field: #111316;
    --accent: #E2582A; --ok: #4FA36E; --ok-bg: #16281D; --wait: #F0A27E; --wait-bg: #2C1A12; --err: #F08A8A; --soft: #1D2026; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1114; --card: #181B20; --ink: #ECEEF1; --ink2: #C5CAD1; --muted: #8E96A0; --line: #2C3138; --line2: #23272D; --field: #111316;
  --accent: #E2582A; --ok: #4FA36E; --ok-bg: #16281D; --wait: #F0A27E; --wait-bg: #2C1A12; --err: #F08A8A; --soft: #1D2026; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #14171B; color: #FFFFFF; border-bottom: 1px solid #2C3138; }
/* В тёмной теме шапка тоже тёмная, иначе белый текст пропадает */
:root[data-theme="dark"] .top { background: #000000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top { background: #000000; } }
.brand { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .04em; text-decoration: none; color: #FFFFFF; }
.who { font-size: 13px; color: #C9CED4; display: flex; gap: 10px; align-items: center; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button { background: transparent; border: 1px solid #4A525C; color: #E6E8EB; border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.pad { padding: 24px 0; }
h1 { font-family: 'Unbounded', sans-serif; font-size: 24px; margin: 0; line-height: 1.2; }
h2 { font-size: 17px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
input, select, textarea { min-height: 42px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); font-size: 15px; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.icon { width: 34px; height: 34px; min-height: 34px; padding: 0; font-size: 18px; color: var(--muted); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tab { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; text-decoration: none; }
.tab[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line2); font-size: 12px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.wait { background: var(--wait-bg); color: var(--wait); border-color: transparent; }
.err { color: var(--err); font-size: 13px; }
.note { background: var(--soft); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--ink2); }
.note.warn { background: var(--wait-bg); color: var(--wait); border-color: transparent; }
.list { display: flex; flex-direction: column; }
.list > * { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.list > *:last-child { border-bottom: none; }
.proj { text-decoration: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.proj:hover { border-color: var(--ink2); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; position: sticky; top: 0; }
td { padding: 4px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
td input, td select { min-height: 36px; padding: 5px 7px; font-size: 14px; border-color: var(--line2); }
td .en { font-size: 11px; color: var(--muted); padding: 2px 4px 0; white-space: nowrap; }
.mono { font-family: 'JetBrains Mono', monospace; }
.out { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: #1D2126; color: #E6E8EB; border-radius: 10px; padding: 14px; max-height: 480px; overflow: auto; user-select: text; }
.dept { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 0 4px; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 118px 150px 34px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.entry .who2 { min-width: 0; }
.entry .who2 div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm { min-height: 36px; width: 100%; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; }
.confirm.ok { background: var(--ok); color: #FFFFFF; }
.confirm.wait { background: var(--wait-bg); color: var(--wait); border-color: var(--wait-bg); }
.confirm:disabled { cursor: default; opacity: 1; }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.task.done .t { text-decoration: line-through; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); z-index: 20; }
.toast.on { opacity: 1; }
.code { font-family: 'JetBrains Mono', monospace; font-size: 22px; letter-spacing: .3em; text-align: center; }
.hide-sm { }
@media (max-width: 640px) {
  .wrap { padding: 12px; }
  h1 { font-size: 20px; }
  .entry { grid-template-columns: minmax(0, 1fr) 112px 34px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .entry .confirm { grid-column: 1 / -1; }
  .hide-sm { display: none; }
}

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--field); }
.seg button { min-height: 40px; padding: 6px 16px; border: none; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink2); }
.seg button.on { background: var(--ink); color: var(--bg); }
.at { display: flex; align-items: center; border: 1px solid var(--line2); border-radius: 9px; background: var(--field); }
.at span { padding-left: 8px; color: var(--muted); font-weight: 600; }
.at input { border: none; padding-left: 2px; min-width: 0; }
.at:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.at input:focus { outline: none; }
td select { max-width: 230px; }
label.f .seg, .f > .seg { align-self: flex-start; }
div.f { display: flex; flex-direction: column; gap: 5px; }

/* ---------- Подготовка ---------- */
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.note.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.warnt { color: var(--wait); font-weight: 600; }
.chip { min-height: 34px; padding: 4px 10px; border-radius: 8px; border: 1px dashed var(--line); background: var(--field); font-size: 13px; font-weight: 600; color: var(--ink2); cursor: pointer; white-space: nowrap; }
.chip.on { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); }
.chip.ok { border: 1px solid var(--ok); background: var(--ok-bg); color: var(--ok); }
.chip:disabled { cursor: default; }
.badge.t-v { background: #E4ECF7; color: #1E3A6B; border-color: transparent; }
.badge.t-p { background: #E3F1E8; color: #14532D; border-color: transparent; }
.badge.t-a { background: #F7E4DA; color: #6B2208; border-color: transparent; }
.badge.t-o { background: var(--soft); }
.specg { display: flex; flex-direction: column; gap: 8px; }
.msrow { display: grid; grid-template-columns: minmax(150px, 1.2fr) 150px 150px minmax(120px, 1fr) 34px; gap: 8px; align-items: center; }
.dl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.dl.late { border-color: #E5A3A3; }
.dl.done { opacity: .65; }
.dl.done .dlt { text-decoration: line-through; }
details summary { cursor: pointer; color: var(--ink2); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
/* Таймлайн-диаграмма: подпись слева, полоса справа */
.gantt { display: flex; flex-direction: column; overflow-x: auto; }
.grow { display: grid; grid-template-columns: 210px minmax(420px, 1fr); gap: 10px; align-items: center; min-height: 38px; border-bottom: 1px solid var(--line2); }
.glabel { min-width: 0; padding: 4px 0; }
.glabel .gt1 { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbar { position: relative; height: 22px; }
.gticks { height: 18px; }
.gt { position: absolute; top: 0; font-size: 11px; color: var(--muted); white-space: nowrap; transform: translateX(-50%); }
.gb { position: absolute; top: 3px; height: 16px; min-width: 6px; border-radius: 5px; }
.gtoday { position: absolute; top: -9px; bottom: -9px; width: 2px; background: var(--accent); opacity: .7; }
.glane { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 0 4px; }
:root[data-theme="dark"] .badge.t-v, :root[data-theme="dark"] .badge.t-p, :root[data-theme="dark"] .badge.t-a { filter: brightness(.85); }
@media (max-width: 640px) {
  .msrow { grid-template-columns: 1fr 1fr 34px; grid-template-areas: "n n x" "a b b" "c c c"; row-gap: 6px; }
  .msrow > :nth-child(1) { grid-area: n; } .msrow > :nth-child(2) { grid-area: a; } .msrow > :nth-child(3) { grid-area: b; }
  .msrow > :nth-child(4) { grid-area: c; } .msrow > :nth-child(5) { grid-area: x; }
  .grow { grid-template-columns: 130px minmax(300px, 1fr); }
}
.card > .seg { align-self: flex-start; max-width: 100%; }

/* ---------- Люди и оценки ---------- */
.topb { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; background: #F4E6B8; color: #6B4E00; font-size: 11px; font-weight: 800; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }
:root[data-theme="dark"] .topb { background: #3A3015; color: #F2D27A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topb { background: #3A3015; color: #F2D27A; } }
.rate { display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.st { color: #B7791F; letter-spacing: 1px; }
.st.big { font-size: 22px; }
.stars { display: flex; gap: 4px; }
.stars button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); font-size: 22px; color: var(--line); cursor: pointer; }
.stars button.on { color: #B7791F; border-color: #E8C77A; background: #FFF8E6; }
:root[data-theme="dark"] .stars button.on { background: #2E2614; border-color: #6B5520; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stars button.on { background: #2E2614; border-color: #6B5520; } }
.ratelist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ratecard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rev { display: flex; flex-direction: column; gap: 6px; }
.replyq { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.tiny { font-size: 11px; }
.vend { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.vend.red { border-color: #E5A3A3; background: var(--soft); }
.badge.bad { background: #FDECEC; color: #9F1D1D; border-color: transparent; }
:root[data-theme="dark"] .badge.bad { background: #3A1616; color: #F08A8A; }
.prodr { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; flex-wrap: wrap; justify-content: flex-end; }
.endbox { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line2); padding-top: 12px; }
.endbox > div { flex: 1 1 260px; }
details.card > summary { font-size: 17px; font-weight: 700; color: var(--ink); }
input:disabled, textarea:disabled, select:disabled { background: var(--soft); color: var(--ink2); border-color: var(--line2); }
.seg button:disabled { cursor: default; }
.pendbox { border-color: #E8B48F; }
.proj.shift-empty { border-style: dashed; background: var(--soft); }

/* ---------- Шотлист, КПП, встречи ---------- */
.shot { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.shotf { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpp { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kpprow { display: grid; grid-template-columns: 150px 112px minmax(0, 1fr) 90px 110px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line2); background: var(--card); }
.kpprow:last-child { border-bottom: none; }
.kpprow.k-motor, .kpprow.k-stop { background: var(--soft); }
.kt { font-size: 13px; font-weight: 600; }
.kb { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--ink2); }
.kb.k-motor { background: #C2410C; color: #FFFFFF; }
.kb.k-stop { background: #14171B; color: #FFFFFF; }
.kb.k-scene { background: #E4ECF7; color: #1E3A6B; }
.kb.k-lunch { background: #E3F1E8; color: #14532D; }
.kb.k-prep, .kb.k-wrap { background: #E8ECF2; color: #2E3A4D; }
:root[data-theme="dark"] .kb.k-stop { background: #ECEEF1; color: #14171B; }
.kmin { width: 90px; }
.kstats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ppl { display: grid; gap: 2px 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: 320px; overflow: auto; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; }
button.tab { cursor: pointer; color: inherit; }
@media (max-width: 640px) {
  .kpprow { grid-template-columns: 1fr auto; grid-template-areas: "t b" "m m" "n x"; row-gap: 6px; }
  .kpprow > :nth-child(1) { grid-area: t; } .kpprow > :nth-child(2) { grid-area: b; justify-self: end; }
  .kpprow > :nth-child(3) { grid-area: m; } .kpprow > :nth-child(4) { grid-area: n; } .kpprow > :nth-child(5) { grid-area: x; justify-self: end; }
}

/* Всплывающее окно (правила отзывов) */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-card { max-width: 720px; width: 100%; margin: 24px 0; }
.modal-top { position: sticky; top: -16px; background: inherit; padding: 8px 0; z-index: 1; }

.btn.danger { background: #b42318; color: #fff; border-color: #b42318; }
.proj.off { opacity: .7; }

/* Вызывной в виде листа продакшна (как Google Таблица) */
.csheet-wrap { display: flex; flex-direction: column; gap: 12px; }
.csheet-page { width: 1000px; }
.csheet { width: 1000px; font-family: 'Golos Text', Arial, sans-serif; color: #000; background: #fff; }
.csheet-t { width: 100%; border-collapse: collapse; table-layout: fixed; }
.csheet-block + .csheet-block { margin-top: -1px; }
.csheet-block, .csheet tr { break-inside: avoid; page-break-inside: avoid; }
.csheet td { border: 1px solid #000; padding: 4px 8px; vertical-align: middle; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.csheet td.logo { text-align: center; }
.csheet td.logo img { max-height: 60px; max-width: 60%; vertical-align: middle; }
.csheet td.map { padding: 0; background: #fff; }
.csheet td.map img { display: block; width: 100%; height: auto; }
.csheet a { color: #1155cc; }
@media print {
  body.sheet-mode header.top, body.sheet-mode .noprint, body.sheet-mode #toast { display: none !important; }
  body.sheet-mode, body.sheet-mode .wrap { background: #fff; }
  body.sheet-mode .wrap { padding: 0; max-width: none; }
  body.sheet-mode .csheet td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.sheet-mode .csheet-page { zoom: 1 !important; width: 100%; } body.sheet-mode .csheet { width: 100%; }
  @page { size: A4; margin: 8mm; }
}

/* Тритмент и мудборды */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip { flex: none; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-n { min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: 12px; background: var(--soft); color: var(--ink2); }
.chip.on .chip-n { background: rgba(127,127,127,.35); color: inherit; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bgrid.contain .bthumb img { object-fit: contain; }
.bitem { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); min-width: 0; }
.bitem.pending { border-style: dashed; border-color: var(--wait); background: var(--wait-bg); }
.bthumb { display: block; padding: 0; border: 0; background: var(--soft); border-radius: 8px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; width: 100%; }
.bthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blink { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 10px; min-height: 110px; border-radius: 8px; background: var(--soft); color: var(--ink); text-decoration: none; }
.lbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,9,11,.92); display: flex; align-items: center; justify-content: center; padding: 48px 12px 56px; }
.lbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lbox-cap { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #E6E8EB; font-size: 14px; padding: 0 16px; }
.lbox-x { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; cursor: pointer; }
.lbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; font-size: 32px; cursor: pointer; }
.lbox-nav.prev { left: 8px; } .lbox-nav.next { right: 8px; }
.shot-img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; cursor: zoom-in; }
