/* Ресурсы Friends. Стиль — из презентационного шаблона агентства: серо-голубой фон, крупный гротеск,
   монохром и сливовый акцент. Прямые углы, без теней: всё разделяется линиями и сменой фона. */
@font-face { font-family: Inter; font-weight: 400 800; font-display: swap; src: url(/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-weight: 400 800; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 600; font-display: swap; src: url(/fonts/jbmono-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 600; font-display: swap; src: url(/fonts/jbmono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #E1E9EB; --paper: #fff; --ink: #141414; --plum: #674258; --plum-d: #4A2F3F;
  --sec: #7A9099; --muted: #5E747C; --nav-off: #93A6AD; --dark: #3A4448;
  --line-g: #B9C9CF; --line: #CBD8DC; --line-w: #DCE4E7; --fill: #C5D3D8; --wkend: #D5DFE2; --yellow: #F5F599;
  /* слои графиков: в тех же цветах, что режим «оплата» в расписании */
  --c-paid: #7A9099; --c-unpaid: #F5F599; --c-tent: #B9C9CF; --c-fact: #141414;
  --font: Inter, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --b: 1.5px solid var(--ink);
  --top-h: 78px;
}
* { box-sizing: border-box; border-radius: 0; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; min-width: 1280px; }
body:has(main.view-project), body:has(main.view-settings) { background: var(--paper); --bg-track: var(--bg); --row-line: var(--line-w); }
a { color: var(--ink); }
h1 { font-size: 72px; font-weight: 800; line-height: .95; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
h1 small { display: block; font-size: inherit; color: var(--sec); }
h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 40px 0 16px; padding-bottom: 10px; border-bottom: var(--b); }
h3 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
h4 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 28px 0 14px; padding-bottom: 8px; border-bottom: var(--b); }
small { font-size: 12px; }
[hidden] { display: none !important; }
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.hint { font-size: 15px; color: var(--muted); margin: 0 0 20px; max-width: 900px; }
.neg { color: var(--plum); font-weight: 600; }
.pos, .warn-t { color: var(--ink); }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 1px; }

/* шапка */
header.top { display: grid; grid-template-columns: 240px 1fr auto; align-items: center; padding: 24px 40px; border-bottom: 1px solid var(--row-line, var(--line)); }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 29px; }
.brand { display: inline-flex; align-items: baseline; height: 29px; white-space: nowrap; }
.brand span { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.nav { display: flex; gap: 32px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 16px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.user { position: relative; display: flex; align-items: center; }
.user-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.user-btn:hover { color: var(--ink); }
.caret { margin-left: 5px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--paper); border: var(--b); padding: 0; min-width: 190px; z-index: 30; }
.user-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; padding: 11px 14px; cursor: pointer; color: var(--ink); }
.user-menu button + button { border-top: 1px solid var(--line-w); }
.user-menu button:hover { background: var(--bg); }
main { padding: 32px 40px 60px; }
.crumbs { margin-bottom: 20px; font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

/* кнопки и поля */
.btn { background: var(--plum); color: #fff; border: 1.5px solid var(--plum); padding: 9px 14px; font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background-color .12s; }
.btn:hover:not(:disabled) { background: var(--plum-d); border-color: var(--plum-d); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.5); border-color: var(--ink); }
.btn.sm { padding: 9px 14px; }
.btn.dark { background: var(--ink); border-color: var(--ink); }
.btn.danger.ghost { background: none; border-color: transparent; color: var(--plum); padding-left: 0; }
.btn.danger.ghost:hover:not(:disabled) { background: none; border-color: transparent; text-decoration: underline; }
.btn.left { margin-right: auto; }
.toolbar > .btn.danger.ghost { margin-left: 16px; }
.icon-btn { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 3px 7px; }
.icon-btn:hover:not(:disabled) { color: var(--plum); }
.icon-btn:disabled { opacity: .3; cursor: default; }
input, select, textarea { font: 400 15px var(--font); padding: 0 12px; height: 40px; border: var(--b); background: var(--paper); color: var(--ink); max-width: 100%; }
textarea { height: auto; padding: 10px 12px; width: 100%; resize: vertical; }
select { padding-right: 30px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=date], input[type=number], .cell-in { font-family: var(--mono); font-weight: 500; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: inset 0 0 0 1px var(--plum); }
input[type=checkbox] { appearance: none; width: 20px; height: 20px; padding: 0; margin: 0; flex: none; border: var(--b); background: var(--paper); cursor: pointer; display: inline-grid; place-items: center; }
input[type=checkbox]:checked { background: var(--ink); }
input[type=checkbox]:checked::after { content: "✓"; color: #fff; font: 700 13px/1 var(--font); }
input[type=checkbox]:focus { box-shadow: none; border-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); border-color: var(--line-g); cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field > input, .field > select, .field > textarea { width: 100%; }
.field > input, .field > select { height: 44px; }
.field-label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; margin-bottom: 18px; }
.cell-in { width: 64px; height: 36px; text-align: center; padding: 0 4px; background: var(--yellow); border: 1px solid var(--line-g); }
.cell-in.wide { width: 130px; text-align: right; padding-right: 10px; }
.cell-in::placeholder { color: var(--sec); }
.inline-in { width: 100%; height: 36px; border-color: transparent; background: transparent; padding: 0 8px; }
.inline-in:hover, .inline-in:focus { border-color: var(--line-g); background: var(--paper); box-shadow: none; }

/* Панель контролов. Каждый контрол — отдельная «кнопка»: белая плашка, рамка и жёсткая тень
   без размытия, как у полиграфической плашки. Под курсором приподнимается, при нажатии садится. */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; font-size: 14px; }
.toolbar > * { margin: 0; }
.toolbar > select, .toolbar > input, .toolbar > .btn, .toolbar > .tool-group .btn { height: 40px; padding-top: 0; padding-bottom: 0; }
.toolbar > .tool-label, .toolbar > .check { height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border: var(--b); white-space: nowrap; }
.toolbar > b, .toolbar > .muted, .toolbar > .sync { height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
.toolbar > b { font: 600 14px var(--mono); }
.toolbar > select { max-width: 230px; }
.toolbar > .check { gap: 9px; cursor: pointer; }
.toolbar > select, .toolbar > input:not([type=checkbox]), .toolbar > .tool-label, .toolbar > .check, .toolbar > .seg,
.toolbar > .tool-group, .toolbar > .btn, .tabs {
  background-color: var(--paper); box-shadow: 2px 2px 0 var(--ink); transition: transform .08s, box-shadow .08s, background-color .12s; }
.toolbar > .btn:not(.ghost) { background-color: var(--plum); }
.toolbar > .btn:not(.ghost):hover:not(:disabled) { background-color: var(--plum-d); }
.toolbar > .btn.danger.ghost { background: none; box-shadow: none; }
.toolbar > select:hover, .toolbar > .btn:hover:not(:disabled), .toolbar > .check:hover {
  transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.toolbar > select:active, .toolbar > .btn:active:not(:disabled), .toolbar > .check:active, .tool-group .btn:active, .seg button:active, .tabs button:active {
  transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.toolbar > input:not([type=checkbox]):focus { box-shadow: 2px 2px 0 var(--plum); border-color: var(--plum); }
.toolbar:has(> h1) { align-items: flex-end; margin-bottom: 32px; }
.toolbar > h1 { margin: 0 auto 0 0; padding-right: 22px; }
.toolbar > .push { margin-left: auto; }
.toolbar > h1 ~ .push { margin-left: 0; }
.toolbar.tool-row { margin: 0 0 0 auto !important; justify-content: flex-end; max-width: 72%; box-shadow: none; }
.date-pair { display: flex; align-items: center; gap: 8px; }
.date-pair input { flex: 1; min-width: 0; height: 44px; }
.tool-group { display: flex; }
.tool-group .btn { box-shadow: none; background: transparent; }
.tool-group .btn:hover:not(:disabled) { background: var(--bg); }
.tool-group .btn + .btn { margin-left: -1.5px; }
.tool-label { gap: 8px; color: var(--muted); padding-right: 0 !important; }
.tool-label select { border: 0; height: 37px; box-shadow: none; background-color: transparent; }
.tool-label .seg { border: 0; border-left: var(--b); height: 37px; box-shadow: none; }
.push { margin-left: auto; }
.seg, .tabs { display: inline-flex; border: var(--b); }
.seg button, .tabs button { background: transparent; border: 0; font: 500 14px var(--font); padding: 0 14px; height: 37px; cursor: pointer; color: var(--muted); white-space: nowrap; transition: background-color .12s; }
.seg button + button, .tabs button + button { border-left: var(--b); }
.seg button:hover:not(.on), .tabs button:hover:not(.on) { color: var(--ink); background: var(--bg); }
.seg button.on, .tabs button.on { background: var(--ink); color: #fff; }
.tabs { margin: 0 0 24px; }
.tabs:not(.top) { margin-top: 36px; }

/* показатели, таблицы */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; border-top: var(--b); padding-top: 18px; margin: 0 0 36px; clear: both; }
.card .lbl { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card .val { font-size: clamp(24px, 2.3vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; white-space: nowrap; }
.view-project .card .val { font-size: 40px; }
.card .note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.card.hi .val, .card.bad .val, .card.lav .val { color: var(--plum); }
.card-lines { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dark); margin-top: 12px; border-top: 1px solid var(--line-w); padding-top: 10px; }
.card-lines span { display: flex; justify-content: space-between; gap: 12px; }
.card-lines b { font: 600 13px var(--mono); white-space: nowrap; }
.card-lines span:last-child b, .card-lines span:last-child b * { color: var(--plum); }
.panel { margin-bottom: 8px; }
.panel h2 { margin-top: 0; }
.block { border-top: 1px solid var(--line-g); margin-top: 8px; padding-top: 14px; }
.empty { padding: 28px 0; font-size: 15px; color: var(--muted); clear: both; }
.scroll { overflow-x: auto; clear: both; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tbl th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px 10px 0; text-align: left; white-space: nowrap; border-bottom: var(--b); vertical-align: bottom; }
.tbl td { border-bottom: 1px solid var(--row-line, var(--line-g)); padding: 14px 14px 14px 0; vertical-align: middle; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl td b { font-weight: 600; }
.tbl td small { color: var(--muted); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl td.num { font: 500 14px var(--mono); }
.tbl tfoot td { font-weight: 700; border-top: var(--b); border-bottom: 0; }
.tbl tfoot tr.sub td { font-weight: 400; color: var(--muted); border-top: 0; padding-top: 0; }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover td, .tbl.tree tbody tr:hover td { background: rgba(255,255,255,.4); }
.tbl.hover td:first-child b { font-size: 17px; font-weight: 700; }
.tbl td.name { min-width: 240px; }
.tbl td.name small { display: block; font-size: 13px; margin: 2px 0 0 22px; }
.tbl tr.archived td { color: var(--muted); }
.tbl tr.grp td { cursor: pointer; padding-top: 22px; }
.tbl tr.grp td:first-child { font-size: 16px; font-weight: 800; }
.view-people .tbl tr.grp td:first-child, .view-people .tbl tr.grp td:first-child b { font-size: 24px; letter-spacing: -.02em; }
.tbl tr.grp.static td { cursor: default; }
.tbl tr.sub1 { cursor: pointer; }
.tbl tr.sub1 td:first-child { padding-left: 16px; }
.tbl tr.sub2 td { font-size: 13px; color: var(--dark); padding-top: 8px; padding-bottom: 8px; }
.tbl tr.sub2 td:first-child { padding-left: 36px; }
.tbl tr.add td { border-bottom: var(--b); }
.tbl tr.total td { border-top: var(--b); font-weight: 700; }
.tbl tr.th-groups th { color: var(--ink); border-bottom: var(--b); padding-bottom: 8px; }
.tbl tr.th-groups + tr th { border-bottom: 1px solid var(--line-g); }
.tbl tr.th-groups th + th, .tbl td.grp-start, .tbl th.grp-start { padding-left: 20px; }
.margin + small { display: block; line-height: 1.2; font: 400 11px var(--font); color: var(--muted); }
.tbl.compact td { padding: 8px 12px 8px 0; }
.tbl.narrow { max-width: 760px; }
.tbl.narrow td:first-child { font-weight: 600; font-size: 17px; }
.tw { display: inline-block; width: 18px; font-style: normal; }
.dot { display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px; }
.dot.lg { width: 16px; height: 16px; margin-right: 0; }
.pill { display: inline-block; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; border: var(--b); margin-left: 8px; white-space: nowrap; vertical-align: middle; }
td > .pill:first-child, .toolbar > .pill { margin-left: 0; }
.pill.st-confirmed { background: var(--ink); color: #fff; }
.pill.st-tentative { border-style: dashed; }
.pill.st-completed { border-color: var(--sec); color: var(--muted); }
.pill.st-cancelled { border-color: var(--line-g); color: var(--nav-off); }
.pill.unpaid { font-size: 10px; padding: 2px 6px; border: 1px dashed var(--plum); color: var(--plum); }
.pill.pitch { font-size: 10px; padding: 2px 6px; border: 1px solid var(--plum); background: var(--plum); color: #fff; }
.pill.warn-p { font-size: 10px; padding: 2px 6px; border: 1px solid var(--plum); color: var(--plum); }
.util { display: inline-block; min-width: 48px; text-align: center; padding: 3px 8px; font: 600 14px var(--mono); white-space: nowrap; }
.util small { font-weight: 400; font-size: 12px; }
.u0, .u1 { background: transparent; color: var(--muted); }
.u2 { background: var(--fill); color: var(--ink); }
.u3 { background: var(--sec); color: #fff; }
.u4 { background: var(--plum); color: #fff; }
.sync { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.sync.warn { color: var(--plum); font-weight: 600; }
.heat th { text-align: center; }
.heat th:first-child { text-align: left; }
.heat td { border-bottom: 0; padding: 2px; }
.heat td:first-child { font-weight: 600; font-size: 15px; padding-right: 14px; }
.heat td.hc { height: 44px; min-width: 60px; text-align: center; font: 600 14px var(--mono); border: 2px solid var(--bg); }
.heat tfoot td { border-top: 0; }

/* страница проекта */
.toolbar.head { align-items: center; margin-bottom: 28px; }
.toolbar.head .crumbs { margin: 0 auto 0 0; }
.toolbar.head .pill { margin-right: 12px; font-size: 13px; }
.proj-title { font-size: 80px; max-width: 1200px; }
.proj-sub { font-size: 24px; font-weight: 500; color: var(--sec); margin: 14px 0 36px; display: flex; align-items: center; gap: 12px; }

/* бюджет */
.budget { margin: 0 0 8px; clear: both; }
.budget-head { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.budget-head b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.budget-head span { color: var(--muted); font-size: 14px; }
.budget-bar { position: relative; height: 16px; background: var(--bg-track, #D1DCDF); overflow: hidden; }
.budget-bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.bb-plan { background: var(--sec); }
.bb-plan.over { background: repeating-linear-gradient(135deg, var(--plum) 0 2px, var(--sec) 2px 7px); }
.bb-fact { background: var(--ink); }
.bb-limit { left: 66.666% !important; width: 2px; background: var(--plum); }

/* графики */
.chart-scroll { overflow-x: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font: 500 12px var(--mono); fill: var(--muted); }
.chart .now { fill: rgba(103,66,88,.12); }
.chart .cap-line { fill: none; stroke-width: 2; }
.chart-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--dark); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }
.chart-legend i.ln { height: 0; border-top: 2px solid; vertical-align: 4px; width: 16px; }

/* окна — панель справа */
.modal-back { position: fixed; inset: 0; background: rgba(20,20,20,.35); z-index: 50; display: flex; justify-content: flex-end; }
.modal { background: var(--paper); width: 600px; max-width: 100vw; height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--ink); }
.modal.wide { width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 32px 18px; border-bottom: var(--b); }
.modal-head .icon-btn { font-size: 28px; color: var(--ink); padding: 0 4px; }
.modal-body { padding: 24px 32px; flex: 1; overflow-y: auto; }
.modal-body .hint { font-size: 13px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 32px; border-top: var(--b); }
.modal-foot .btn { padding: 12px 18px; }
.confirm-text { margin: 4px 0 12px; font-size: 16px; }
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; font-size: 14px; max-width: 420px; }
.toast.err { background: var(--plum); }
.ed-tabs { margin-bottom: 22px; }
.ed-info { font-size: 12px; color: var(--muted); min-height: 18px; margin-bottom: 8px; }
.ed-info.warn { background: rgba(103,66,88,.08); border-left: 3px solid var(--plum); color: var(--plum); font-weight: 600; font-size: 14px; padding: 10px 12px; margin-bottom: 18px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border: 1px solid rgba(20,20,20,.15); cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.color-cell { width: 44px; }
.color-pick { position: relative; display: inline-block; }
.color-pick > .swatch { width: 24px; height: 24px; display: block; }
.color-pop { position: absolute; left: 0; top: 30px; z-index: 20; background: var(--paper); border: var(--b); padding: 8px; display: grid; grid-template-columns: repeat(8, 26px); gap: 6px; }
.color-pop .swatch { width: 24px; height: 24px; }
.phase-list { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.phase-row { display: flex; gap: 8px; align-items: center; width: 100%; }
.phase-row input:not([type=checkbox]) { flex: 1; height: 36px; font-size: 14px; }
.phase-row .check { margin: 0; font-size: 12px; gap: 6px; }
.phase-group { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 12px; }
.phase-list .toolbar { margin: 10px 0 0; }
.nowrap { white-space: nowrap; }
.team-chips { display: flex; flex-direction: column; gap: 10px; }
.team-dep { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.team-dep-name { width: 92px; flex: none; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chip { background: transparent; border: var(--b); padding: 6px 10px; font: 500 13px var(--font); cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--bg); }
.chip.on { background: var(--ink); color: #fff; }
.team-plan-box:not(:empty) { background: var(--bg); padding: 12px 14px; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.team-plan-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; }
.team-plan-head label, .team-plan-row { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.team-plan-head input, .team-plan-row input { height: 34px; }
.team-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.team-plan-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl { margin-bottom: 40px; }
.tpl .toolbar > input { font-weight: 700; min-width: 280px; }
.tpl-foot { margin: 14px 0 0; }
.tpl .tbl td:nth-child(3) { min-width: 360px; }
.tpl .tbl td:nth-child(4) { min-width: 250px; }
.days { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.check.day { margin: 0; font: 500 13px var(--mono); text-transform: uppercase; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font: 500 12px var(--mono); }

/* вход */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--plum); }
.auth-card { background: var(--paper); padding: 40px; width: 100%; max-width: 460px; display: flex; flex-direction: column; }
.auth-card h2 { font-size: 40px; letter-spacing: -.03em; line-height: 1; border: 0; padding: 0; margin: 12px 0 14px; }
.auth-card .hint { font-size: 15px; color: var(--dark); }
.auth-card .field > input { height: 48px; }
.auth-card .btn { height: 52px; font-size: 16px; }
.pw { position: relative; display: block; }
.pw input { width: 100%; height: 44px; padding-right: 96px; }
.auth-card .pw input { height: 48px; }
.pw-eye { position: absolute; right: 0; top: 0; bottom: 0; padding: 0 14px; background: none; border: 0; cursor: pointer; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pw-eye:hover { color: var(--ink); }
.auth-google { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 8px; }
.auth-google + .auth-error { margin-top: 12px; }
.auth-alt { background: none; border: 0; padding: 0; margin-top: 4px; align-self: flex-start; cursor: pointer; font: 400 13px var(--font); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.auth-alt:hover { color: var(--ink); }
.auth-fallback { display: flex; flex-direction: column; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-w); }
.auth-card .auth-fallback .btn { height: 44px; font-size: 14px; }
.auth-brand { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--plum); }
.auth-error { color: var(--plum); font-size: 13px; min-height: 20px; margin-bottom: 6px; }

/* расписание */
.view-schedule { display: flex; flex-direction: column; height: calc(100vh - var(--top-h)); padding-bottom: 16px; }
.sch-top { display: flex; align-items: flex-end; gap: 32px; margin-bottom: 18px; }
.sch-top h1 { margin-right: auto; white-space: nowrap; }
.sch-top .toolbar { margin: 0; }
/* Под заголовком — фильтры слева и настройки вида справа, на всю ширину. */
.sch-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.sch-bar .toolbar { margin: 0; }
.sch-bar .toolbar:last-child { margin-left: auto; justify-content: flex-end; }
.sch-bar input[type=search] { width: 170px; }
.sch-bar .toolbar > select { max-width: 210px; }
.sch-bar .tool-label select { max-width: 170px; }
.sch-wrap { --left: 280px; flex: 1; min-height: 0; overflow: auto; }
.sch-inner { position: relative; min-width: 100%; }
.sch-head { display: flex; position: sticky; top: 0; z-index: 8; background: var(--bg); border-bottom: var(--b); }
.sch-corner { position: sticky; left: 0; z-index: 9; width: var(--left); flex: none; background: var(--bg); padding: 8px 16px 10px 0; display: flex; flex-direction: column; justify-content: flex-end; }
.sch-corner b { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sch-corner small { color: var(--muted); font-size: 11px; }
.sch-timeline { position: relative; flex: none; }
.sch-months, .sch-ticks { display: flex; }
.sch-month { flex: none; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 2px; overflow: hidden; white-space: nowrap; }
.sch-tick { flex: none; font: 600 14px var(--mono); text-align: center; padding: 2px 0 8px; line-height: 1.25; overflow: hidden; white-space: nowrap; }
.sch-tick small { display: block; font: 500 10px var(--mono); color: var(--muted); text-transform: uppercase; }
.sch-tick.off { background: var(--wkend); color: var(--muted); }
.sch-tick.week { text-align: left; padding: 4px 10px 8px; }
.sch-tick.today, .sch-tick.today small { background: var(--ink); color: #fff; }
.sch-band { position: absolute; bottom: -1.5px; height: 3px; background: var(--plum); }
.sch-rows { position: relative; }
.sch-shades { position: absolute; top: 0; bottom: 0; left: var(--left); z-index: 0; pointer-events: none; }
.shade { position: absolute; top: 0; bottom: 0; background: rgba(203,216,220,.45); pointer-events: none; }
.zoom-day .shade { background: var(--wkend); }
.shade.hol { background: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 6px), var(--wkend); }
.shade.own { z-index: 0; background: rgba(203,216,220,.45); }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px !important; background: var(--plum); z-index: 2; }
.sch-row { display: flex; border-bottom: 1px solid var(--line); }
.sch-row.group { border-bottom: 1px solid var(--line-g); }
.sch-row.team { border-bottom: var(--b); }
.sch-row:not(.group):hover .sch-left, .sch-row:not(.group):hover .sch-track { background-color: rgba(255,255,255,.35); }
.sch-left { position: sticky; left: 0; z-index: 5; width: var(--left); flex: none; background: var(--bg); display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 0; min-width: 0; }
.sch-row:not(.group):hover .sch-left { background: #ECF1F2; }
.sch-left.group { cursor: pointer; justify-content: space-between; align-items: baseline; padding: 18px 16px 10px 0; }
.sch-row.team .sch-left.group { cursor: default; padding: 8px 16px 8px 0; align-items: center; }
.grp-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-name small { color: var(--muted); font-weight: 400; font-size: 16px; margin-left: 8px; letter-spacing: 0; }
.sch-row.team .grp-name { font-size: 16px; }
.sch-left.group .util { background: none; padding: 0; min-width: 0; font-size: 15px; }
.sch-left.group .util.u4 { color: var(--plum); }
.sch-left.group .util.u3, .sch-left.group .util.u2 { color: var(--ink); }
.avatar { display: none; }
.who { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.who b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who:hover b { text-decoration: underline; }
.sch-track { position: relative; flex: none; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(var(--dw) * 7) 100%; touch-action: pan-y; }
.sch-track[data-person] { cursor: crosshair; }
.sch-track.hot { background-color: rgba(255,255,255,.6); }
.sch-track.group { height: 56px; cursor: default; background-image: none; }
.sch-row.team .sch-track.group { height: 44px; }
.wk { position: absolute; bottom: 10px; padding: 0 10px; font: 600 14px var(--mono); white-space: nowrap; overflow: hidden; z-index: 3; background: none !important; }
.wk.u4 { color: var(--plum); }
.wk.u3, .wk.u2 { color: var(--ink); }
.sch-row.team .wk { top: 8px; bottom: 8px; display: flex; align-items: center; justify-content: center; border-right: 2px solid var(--bg); box-sizing: border-box; }
.sch-row.team .wk.u4 { background: var(--plum) !important; color: #fff; }
.sch-row.team .wk.u3 { background: var(--sec) !important; color: #fff; }
.sch-row.team .wk.u2 { background: var(--fill) !important; }
.sch-row.team .wk.u1, .sch-row.team .wk.u0 { background: #F2F5F6 !important; }
.bar { position: absolute; z-index: 1; border: 1.5px solid transparent; padding: 0 10px; font-size: 12.5px; line-height: 1.2; overflow: hidden; white-space: nowrap; cursor: grab; display: flex; gap: 8px; align-items: center; user-select: none; }
.bar b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.bar span { opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.bar em { margin-left: auto; font: 500 12px var(--mono); opacity: .85; flex: none; }
.bar::before, .bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.bar::before { left: 0; } .bar::after { right: 0; }
.bar:hover, .bar.dragging { outline: 2px solid var(--ink); outline-offset: 1px; }
.bar.tent { border: 1.5px dashed var(--ink) !important; background: transparent !important; color: var(--ink) !important; }
.bar.dim { opacity: .25; }
.bar.cut-l { border-left: 0; }
.bar.cut-r { border-right: 0; }
.bar.dragging { z-index: 12; opacity: .9; cursor: grabbing; }
.drag-ghost { position: absolute; top: 10px; height: 26px; background: rgba(255,255,255,.5); border: 1.5px dashed var(--ink); z-index: 4; pointer-events: none; }
.sch-track > .off { position: absolute; top: 0; bottom: 0; z-index: 3; pointer-events: none; background: repeating-linear-gradient(135deg, var(--line-g) 0 1.5px, rgba(225,233,235,.6) 1.5px 7px); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.sch-track > .off.part { background: repeating-linear-gradient(135deg, var(--line-g) 0 1.5px, transparent 1.5px 7px); }
.off-chip { pointer-events: auto; cursor: pointer; background: var(--paper); border: 1px solid var(--ink); font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; margin-bottom: 6px; white-space: nowrap; }
.off-chip:hover { background: var(--ink); color: #fff; }
.over { position: absolute; bottom: 0; height: 18px; z-index: 4; border-top: 3px solid var(--plum); font: 600 10px var(--mono); color: var(--plum); padding: 2px 4px 0; white-space: nowrap; overflow: hidden; }
.sch-empty { margin: 30px 0; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--dark); padding: 14px 0 0; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; flex: none; }
.lg.bar-tent { border: 1.5px dashed var(--ink); }
.lg.bar-off { width: 22px; background: repeating-linear-gradient(135deg, var(--line-g) 0 1.5px, rgba(255,255,255,.5) 1.5px 5px); }
.lg.over-line { width: 22px; height: 0; border-top: 3px solid var(--plum); }

/* порядок в часах */
.nav a.nudge::after { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--plum); margin-left: 6px; vertical-align: 8px; }
.owe { display: flex; align-items: center; gap: 16px; }
.awards { margin-top: 56px; clear: both; }
.aw-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; }
.aw-streak { display: flex; align-items: flex-end; gap: 16px; }
.aw-streak b { font-size: 96px; font-weight: 800; letter-spacing: -.04em; line-height: .85; }
.aw-streak span { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.aw-streak small { display: block; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.aw-strip { display: flex; gap: 4px; margin: 24px 0 14px; }
.aw-wk { width: 30px; height: 30px; border: var(--b); }
.aw-wk.done { background: var(--ink); }
.aw-wk.done.late { background: var(--sec); border-color: var(--sec); }
.aw-wk.miss { border-color: var(--plum); background: repeating-linear-gradient(135deg, var(--plum) 0 2px, transparent 2px 7px); }
.aw-wk.free { border: 1px solid var(--line-g); background: repeating-linear-gradient(135deg, var(--line-g) 0 1.5px, transparent 1.5px 7px); }
.aw-wk.open { border-style: dashed; }
.aw-wk.none { border: 1px solid var(--line-g); }
.aw-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.aw-badge { border: 1.5px solid var(--line-g); padding: 12px 14px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.aw-badge b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.aw-badge small { font-size: 12px; }
.aw-badge em { font: 500 11px var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.aw-badge.got { background: var(--ink); border-color: var(--ink); color: #fff; }
.aw-badge.got em { color: var(--yellow); }
.aw-team { display: flex; align-items: baseline; gap: 12px; border-bottom: var(--b); padding-bottom: 10px; }
.aw-team b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.aw-team span { color: var(--muted); }
.awards .tbl tr.me td { font-weight: 700; }
.aw-owes { margin-top: 14px; color: var(--plum); }

/* табель */
.tbl.ts td { padding: 6px 8px 6px 0; }
.tbl.ts th.ts-cell, .tbl.ts .ts-cell { text-align: center; padding-left: 4px; padding-right: 4px; }
.tbl.ts .cell-in { background: var(--paper); height: 40px; }
.tbl.ts .cell-in:focus { box-shadow: inset 0 0 0 1px var(--plum); }
.tbl.ts .cell-in:disabled { background: transparent; border-style: dashed; cursor: not-allowed; }
.tbl.ts .ts-cell.off, .tbl.ts th.off { background: var(--wkend); }
.tbl.ts .ts-cell.today { background: rgba(103,66,88,.08); }
.tbl.ts th.today { background: var(--ink); color: #fff; }

@media print {
  header.top, .toolbar, .tabs, .legend, .sch-bar { display: none; }
  body { background: #fff; }
}
