/* Планировщик ресурсов. Цвета — в переменных ниже: меняйте под свой фирменный стиль. */
:root {
  --plum: #B34A43; --plum-d: #9E403A; --lavender: #B8B6E7; --bluegrey: #AFC4C8; --cream: #E4E1CB;
  --lightblue: #D4E2E4; --lemon: #F9FFAE;
  --bg-lav: #F4F4F4; --bg-blue: #F0F0F0; --bg-cream: #FFFFFF; --bg-lemon: #FDFFE0;
  --ink: #1A1A1A; --muted: #626262; --line: #D9D9D9; --white: #fff;
  --red: #B03030; --red-bg: #FBE3E3; --green: #2E7D32;
  --c-paid: #A9D3F0; --c-unpaid: #EDE27A; --c-tent: #D5D3F3; --c-fact: #5F3950;
  --s-part: #AFC4C8; --s-full: #6FA58A; --s-over: #D05050;
  --font: "Helvetica Neue", Helvetica, Inter, Arial, sans-serif;
  /* Объём: свет сверху, тень снизу. Кнопка стоит на «ножке» в 2 px и при нажатии на неё садится. */
  --brand: #B34A43; --plum-hi: #B34A43; --plum-edge: #883731; --edge: #CFCFCF; --edge-line: #C7C7C7;
  --lift: 0 2px 0 #E6E6E6, 0 8px 18px rgba(0,0,0,.07);
  --top-h: 50px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg-cream); font-size: 14px; line-height: 1.45; }
a { color: var(--plum); }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
h2 { font-size: 13px; margin: 24px 0 10px; color: var(--plum); letter-spacing: .04em; text-transform: uppercase; }
h3 { font-size: 17px; margin: 0; }
h4 { font-size: 13px; margin: 0 0 6px; color: var(--plum); letter-spacing: .04em; text-transform: uppercase; }
small { font-size: 11.5px; }
[hidden] { display: none !important; }
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 14px; max-width: 900px; }
.neg { color: var(--red); font-weight: 700; }
.pos { color: var(--green); font-weight: 700; }
.warn-t { color: #9A6A00; font-weight: 700; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 1px; border-radius: 4px; }

/* шапка */
header.top { min-height: var(--top-h); height: auto; background: #B34A43; box-shadow: 0 2px 10px rgba(0,0,0,.28); color: #fff; display: flex; align-items: stretch; gap: 22px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.brand span { font-weight: 400; opacity: .7; font-size: 13px; }
.nav { display: flex; align-items: flex-end; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { color: #fff; text-decoration: none; padding: 9px 16px; font-size: 13.5px; border-radius: 7px 7px 0 0; background: rgba(255,255,255,.1); white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.2); }
.nav a.on { background: var(--bg-cream); color: var(--plum); font-weight: 700; box-shadow: inset 0 1px 0 #fff; }
.nav a:focus-visible { outline-color: var(--lemon); outline-offset: -3px; }
.user { position: relative; display: flex; align-items: center; }
.user-btn { background: none; border: 0; color: #fff; font: inherit; font-size: 13px; cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.caret { opacity: .7; margin-left: 5px; }
.user-menu { position: absolute; right: 0; top: calc(100% - 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 5px; min-width: 180px; z-index: 30; }
.user-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; padding: 8px 12px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.user-menu button:hover { background: var(--bg-lav); }
main { padding: 18px 24px 70px; max-width: 1560px; margin: 0 auto; }
.crumbs { margin-bottom: 8px; font-size: 13px; }

/* кнопки и поля */
.btn { background: linear-gradient(180deg, #B34A43, #9E403A); color: #fff; border: 1px solid var(--plum-d); padding: 8px 16px; border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 2px 0 var(--plum-edge), 0 5px 10px rgba(0,0,0,.22);
  text-shadow: 0 1px 0 rgba(0,0,0,.18); transition: transform .06s ease, box-shadow .06s ease, filter .12s ease; }
.btn:hover:not(:disabled) { filter: none; background: linear-gradient(180deg, #9E403A, #883731); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 3px rgba(0,0,0,.22), 0 0 0 var(--plum-edge), 0 1px 2px rgba(0,0,0,.2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: linear-gradient(180deg, #fff, #F4F4F4); color: var(--plum); border-color: var(--edge-line); text-shadow: none;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--edge), 0 4px 8px rgba(0,0,0,.09); }
.btn.ghost:hover:not(:disabled) { filter: none; background: linear-gradient(180deg, #fff, var(--bg-lav)); border-color: #A6A6A6; }
.btn.ghost:active:not(:disabled) { box-shadow: inset 0 2px 3px rgba(0,0,0,.16), 0 0 0 var(--edge); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { background: linear-gradient(180deg, #C54A4A, var(--red)); border-color: #8A2323;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 0 #741C1C, 0 5px 10px rgba(116,28,28,.2); }
.btn.danger.ghost { background: linear-gradient(180deg, #fff, #FBEDED); color: var(--red); border-color: #E2B9B9;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #E5C6C6, 0 4px 8px rgba(116,28,28,.07); }
.btn.danger.ghost:hover:not(:disabled) { background: linear-gradient(180deg, #fff, var(--red-bg)); border-color: #D49C9C; }
.btn.left { margin-right: auto; }
.icon-btn { background: none; border: 0; font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; padding: 3px 7px; border-radius: 5px; }
.icon-btn:hover:not(:disabled) { color: var(--red); background: var(--red-bg); }
.icon-btn:disabled { opacity: .3; cursor: default; }
input, select, textarea { font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1px solid #C6C6C6; border-radius: 7px; background: #fff; color: var(--ink); max-width: 100%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.09); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: inset 0 1px 2px rgba(0,0,0,.09), 0 0 0 3px rgba(179,74,67,.14); }
input[type=checkbox], input[type=checkbox]:focus { box-shadow: none; }
input[type=checkbox] { width: 15px; height: 15px; padding: 0; accent-color: var(--plum); margin: 0; flex: none; }
textarea { width: 100%; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-cream); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > input, .field > select, .field > textarea { width: 100%; }
.field-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field-hint { font-size: 11.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; margin-bottom: 12px; }
.toolbar .check { margin-bottom: 0; }
.cell-in { width: 58px; text-align: center; padding: 5px 3px; background: var(--bg-lemon); }
.cell-in.wide { width: 110px; text-align: right; padding-right: 8px; }
.cell-in::placeholder { color: #707070; }
.inline-in { width: 100%; border-color: transparent; background: transparent; box-shadow: none; }
.inline-in:hover, .inline-in:focus { border-color: var(--line); background: #fff; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.tool-group { display: flex; gap: 4px; }
.tool-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.push { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--edge-line); border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #fff, #F4F4F4);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--edge), 0 4px 8px rgba(0,0,0,.08); }
.seg button { background: transparent; border: 0; font: inherit; font-size: 12.5px; padding: 5px 11px; cursor: pointer; color: var(--plum); }
.seg button:hover:not(.on) { background: var(--bg-lav); }
.seg button + button { border-left: 1px solid #D2D2D2; }
.seg button.on { background: linear-gradient(180deg, #B34A43, #9E403A); color: #fff; box-shadow: inset 0 2px 3px rgba(0,0,0,.28); text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--plum); margin: 18px 0 14px; }
.tabs.top { margin-top: 0; }
.tabs button { background: linear-gradient(180deg, #fff, #F4F4F4); border: 0; font: inherit; font-size: 13px; padding: 8px 16px; cursor: pointer; border-radius: 8px 8px 0 0; color: var(--plum); box-shadow: inset 0 1px 0 #fff; }
.tabs button:hover:not(.on) { background: linear-gradient(180deg, #fff, #ECECEC); }
.tabs button.on { background: linear-gradient(180deg, #B34A43, #9E403A); color: #fff; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.24); text-shadow: 0 1px 0 rgba(0,0,0,.18); }

/* карточки, таблицы */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; box-shadow: var(--lift); }
.card .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card .val { font-size: 24px; font-weight: 700; color: var(--plum); margin-top: 4px; font-variant-numeric: tabular-nums; }
.card .note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card.hi { background: linear-gradient(180deg, #FEFFEE, var(--bg-lemon)); }
.card.lav { background: linear-gradient(180deg, #FAFAFA, var(--bg-lav)); }
.card.bad { background: linear-gradient(180deg, #FDEEEE, var(--red-bg)); border-color: #E9BDBD; }
.card.bad .val { color: var(--red); }
.card-lines { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.card-lines b { color: var(--ink); font-variant-numeric: tabular-nums; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; box-shadow: var(--lift); }
.panel h2 { margin-top: 0; }
.block { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.empty { padding: 34px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 10px; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--lift); }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
.tbl th { background: linear-gradient(180deg, #B34A43, #9E403A); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 9px; text-align: left; font-weight: 700; white-space: nowrap; }
.tbl td { border-top: 1px solid var(--line); padding: 6px 9px; vertical-align: middle; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { background: var(--bg-lav); font-weight: 700; }
.tbl tfoot tr.sub td { background: #fff; font-weight: 400; color: var(--muted); }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover td, .tbl.tree tbody tr:hover td { background: var(--bg-lemon); }
.tbl tr.archived td { color: var(--muted); }
.tbl tr.grp td { background: var(--bg-blue); cursor: pointer; }
.tbl tr.grp.static td { cursor: default; }
.tbl tr.sub1 { cursor: pointer; }
.tbl tr.sub1 td:first-child { padding-left: 26px; }
.tbl tr.sub2 td { background: var(--bg-cream); font-size: 12.5px; }
.tbl tr.sub2 td:first-child { padding-left: 52px; }
.tbl tr.add td { background: var(--bg-cream); }
.tbl tr.total td { border-top: 2px solid var(--plum); }
.tbl tr.th-groups th { background: var(--plum-d); text-align: center; font-size: 10.5px; padding: 5px 9px; border-left: 1px solid rgba(255,255,255,.25); }
.tbl tr.th-groups th:first-child { border-left: 0; }
.tbl td.grp-start { border-left: 2px solid var(--line); }
.margin { display: inline-block; min-width: 44px; text-align: center; padding: 1px 7px; border-radius: 20px; background: var(--bg-blue); }
.margin.neg { background: var(--red-bg); }
.margin.pos { background: #DDEBDD; }
.margin.warn-t { background: #FFE9C4; }
.margin + small { display: block; line-height: 1.2; }
.tbl.compact td { padding: 4px 8px; }
.tbl.narrow { max-width: 760px; border: 1px solid var(--line); }
.tw { display: inline-block; width: 16px; font-style: normal; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; border: 1px solid rgba(0,0,0,.12); }
.dot.lg { width: 16px; height: 16px; border-radius: 4px; margin-right: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--bg-blue); color: var(--plum); margin-left: 6px; white-space: nowrap; }
td > .pill:first-child, .toolbar > .pill { margin-left: 0; }
.pill.st-confirmed { background: var(--lavender); }
.pill.st-tentative { background: #fff; border: 1px dashed var(--plum); }
.pill.st-completed { background: #DDEBDD; color: #245C28; }
.pill.st-cancelled { background: #E9E9E9; color: var(--muted); }
.pill.unpaid { background: var(--lemon); color: #5B5A12; }
.pill.warn-p { background: #FFE9C4; color: #7A4B00; }
.util { display: inline-block; min-width: 46px; text-align: center; padding: 2px 7px; border-radius: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.08); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.util small { font-weight: 400; }
.u0 { background: transparent; color: var(--muted); box-shadow: none; }
.u1 { background: var(--bg-blue); color: #4E5E62; }
.u2 { background: var(--bluegrey); color: #24383C; }
.u3 { background: var(--lavender); color: #33235A; }
.u4 { background: #F0A8A8; color: #7A1616; }
.sync { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--bg-lav); color: var(--plum); white-space: nowrap; }
.sync.ok { background: var(--lightblue); }
.sync.warn { background: var(--red-bg); color: var(--red); font-weight: 700; }
.heat td.hc { font-size: 12px; font-weight: 700; border-left: 2px solid #fff; border-top: 2px solid #fff; min-width: 56px; }

/* бюджет */
.budget { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; margin-bottom: 4px; box-shadow: var(--lift); }
.budget-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.budget-head span { color: var(--muted); }
.budget-bar { position: relative; height: 14px; background: var(--bg-blue); border-radius: 7px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.16); }
.budget-bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.bb-plan { background: var(--lavender); }
.bb-plan.over { background: #F0A8A8; }
.bb-fact { background: var(--plum); height: 5px; top: auto !important; }
.bb-limit { left: 66.666% !important; width: 2px; background: var(--ink); }

/* графики */
.chart-scroll { overflow-x: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.chart .now { fill: var(--bg-lemon); }
.chart .cap-line { fill: none; stroke-width: 2; stroke-dasharray: 5 3; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-legend i.ln { height: 0; border-top: 2px dashed; border-radius: 0; vertical-align: 4px; width: 16px; }

/* окна */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 2px 0 rgba(255,255,255,.6) inset, 0 24px 70px rgba(0,0,0,.38), 0 4px 12px rgba(0,0,0,.18); }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.modal-body { padding: 10px 20px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line); margin-top: 8px; background: linear-gradient(180deg, #FAFAFA, #F2F2F2); border-radius: 0 0 14px 14px; }
.confirm-text { margin: 4px 0 12px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 80vw; }
.toast.err { background: var(--red); }
.ed-tabs { margin-bottom: 14px; }
.ed-info { font-size: 12.5px; color: var(--muted); min-height: 18px; margin-bottom: 4px; }
.ed-info.warn { color: var(--red); font-weight: 700; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--plum); outline-offset: 2px; }
.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; }
.phase-row .check { margin: 0; font-size: 12px; }
.phase-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--plum); margin-top: 8px; }
.phase-list .toolbar { margin: 6px 0 0; }
.nowrap { white-space: nowrap; }
.team-chips { display: flex; flex-direction: column; gap: 6px; }
.team-dep { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.team-dep-name { width: 84px; flex: none; font-size: 11.5px; color: var(--muted); }
.chip { background: linear-gradient(180deg, #fff, #F4F4F4); border: 1px solid var(--edge-line); border-radius: 20px; padding: 3px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 1.5px 0 var(--edge); transition: transform .06s ease, box-shadow .06s ease; }
.chip:hover { border-color: var(--plum); }
.chip:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0,0,0,.18); }
.chip.on { background: linear-gradient(180deg, #B34A43, #9E403A); border-color: var(--plum-d); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 1.5px 0 var(--plum-edge); }
.team-plan-box:not(:empty) { background: var(--bg-cream); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.team-plan-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; }
.team-plan-head label, .team-plan-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.team-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 5px 14px; }
.team-plan-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl { margin-bottom: 16px; }
.tpl .toolbar > input { font-weight: 700; min-width: 240px; }
.tpl-foot { margin: 10px 0 0; }
.tpl .tbl td:nth-child(3) { min-width: 360px; }
.tpl .tbl td:nth-child(4) { min-width: 250px; }
.days { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 5px; }
.check.day { margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 12px; }

/* вход */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 35%, #B34A43, #9E403A 55%, #883731); }
.auth-card { background: #fff; border-radius: 16px; padding: 28px 30px 32px; width: 100%; max-width: 400px; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.auth-card h2 { font-size: 20px; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin: 4px 0 6px; }
.auth-brand { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--plum); font-weight: 700; }
.auth-error { color: var(--red); font-size: 13px; min-height: 20px; margin-bottom: 6px; }

/* расписание */
.view-schedule { display: flex; flex-direction: column; height: calc(100vh - var(--header-h, var(--top-h))); max-width: none; padding: 12px 16px 8px; }
.view-schedule .toolbar { margin-bottom: 10px; }
.view-schedule .toolbar input[type=search] { width: 150px; }
.sch-wrap { --left: 250px; flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--lift); }
.sch-inner { position: relative; min-width: 100%; }
.sch-head { display: flex; position: sticky; top: 0; z-index: 8; background: #fff; border-bottom: 1px solid var(--line); }
.sch-corner { position: sticky; left: 0; z-index: 9; width: var(--left); flex: none; background: #fff; border-right: 1px solid var(--line); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; }
.sch-corner b { font-size: 12.5px; }
.sch-corner small { color: var(--muted); font-size: 10.5px; }
.sch-timeline { position: relative; flex: none; }
.sch-months, .sch-ticks { display: flex; }
.sch-month { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--plum); padding: 5px 6px 1px; border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.sch-tick { flex: none; font-size: 11px; text-align: center; color: var(--ink); padding: 1px 0 5px; line-height: 1.2; overflow: hidden; white-space: nowrap; }
.sch-tick small { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.sch-tick.off { color: var(--muted); }
.sch-tick.week { border-left: 1px solid var(--line); color: var(--muted); font-size: 10.5px; padding-top: 3px; }
.sch-tick.today { background: var(--lemon); font-weight: 700; color: var(--ink); border-radius: 4px 4px 0 0; }
.sch-band { position: absolute; bottom: -1px; height: 3px; background: var(--plum); border-radius: 2px; }
.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: #F3F0E6; pointer-events: none; }
.shade.hol { background: repeating-linear-gradient(135deg, #E4E1CB 0 5px, #F3F0E6 5px 10px); }
.shade.own { z-index: 0; background: var(--bg-blue); }
.today-line { position: absolute; top: 0; bottom: 0; background: rgba(249,255,174,.55); border-left: 2px solid #C9D04A; }
.sch-row { display: flex; border-bottom: 1px solid var(--line); }
.sch-left { position: sticky; left: 0; z-index: 5; width: var(--left); flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 4px 10px; min-width: 0; }
.sch-left.group { background: var(--bg-blue); cursor: pointer; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }
.sch-row.team .sch-left.group { background: var(--bg-lav); cursor: default; }
.grp-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-name small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-lav); color: var(--plum); font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar.ph { background: #fff; border: 1.5px dashed var(--muted); color: var(--muted); }
.who { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.25; }
.who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { 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: auto; }
.sch-track[data-person] { cursor: crosshair; }
.sch-track.hot { background-color: var(--bg-lemon); }
.sch-track.group { height: 32px; background-color: var(--bg-cream); cursor: default; }
.wk { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.08); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1px solid #fff; box-sizing: border-box; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; z-index: 3; }
.bar { position: absolute; z-index: 1; border-radius: 5px; border: 1.5px solid; padding: 0 6px; font-size: 11px; line-height: 1.2; overflow: hidden; white-space: nowrap; cursor: grab; display: flex; gap: 6px; align-items: center; color: var(--ink); user-select: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(0,0,0,.16); }
.bar b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.bar span { opacity: 1; overflow: hidden; text-overflow: ellipsis; }
.bar em { margin-left: auto; font-style: normal; font-weight: 700; opacity: 1; 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.tent { border-style: dashed; background: rgba(255,255,255,.7) !important; box-shadow: none; }
.bar.dim { opacity: 1; background-image: linear-gradient(rgba(255,255,255,.65), rgba(255,255,255,.65)); }
.bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dotted; }
.bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dotted; }
.bar.dragging { z-index: 12; opacity: .88; box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: grabbing; }
.drag-ghost { position: absolute; top: 4px; bottom: 10px; background: rgba(184,182,231,.45); border: 1.5px dashed var(--plum); border-radius: 5px; z-index: 4; pointer-events: none; }
.off { position: absolute; top: 0; bottom: 6px; z-index: 3; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(98,98,98,.2) 0 4px, rgba(98,98,98,.07) 4px 8px); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.off.part { background: repeating-linear-gradient(135deg, rgba(98,98,98,.1) 0 4px, transparent 4px 8px); }
.off-chip { pointer-events: auto; cursor: pointer; background: #fff; border: 1px solid var(--muted); color: var(--muted); font-size: 10px; font-weight: 700; border-radius: 10px; padding: 0 6px; margin-bottom: 3px; white-space: nowrap; }
.off-chip:hover { color: var(--plum); border-color: var(--plum); }
.strip { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 3; pointer-events: none; }
.over-mark { position: absolute; bottom: 7px; z-index: 4; font-size: 9.5px; font-weight: 700; color: var(--red); text-align: center; pointer-events: auto; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.sch-empty { margin: 30px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 7px 4px 0; align-items: center; }
.lg { display: inline-block; width: 22px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg.bar-solid { background: var(--lavender); }
.lg.bar-tent { border: 1.5px dashed var(--plum); }
.lg.bar-off { background: repeating-linear-gradient(135deg, rgba(98,98,98,.3) 0 3px, rgba(98,98,98,.08) 3px 6px); }
.lg.strip-part, .lg.strip-full, .lg.strip-over { width: 12px; height: 6px; margin-right: 2px; border-radius: 0; }
.lg.strip-part { background: var(--s-part); } .lg.strip-full { background: var(--s-full); } .lg.strip-over { background: var(--s-over); margin-right: 5px; }

/* табель */
.tbl.ts td { padding: 4px 6px; }
.tbl.ts .ts-cell { text-align: right; }
.tbl.ts .ts-cell.off { background: var(--bg-cream); }
.tbl.ts .ts-cell.off .cell-in { background: #fff; }
.tbl.ts .ts-cell.today, .tbl.ts th.today { box-shadow: inset 0 0 0 9999px rgba(249,255,174,.35); }
.tbl.ts th.today { color: var(--lemon); }

@media (max-width: 760px) {
  main { padding: 14px 12px 60px; }
  header.top { padding: 0 12px; gap: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .sch-wrap { --left: 150px; }
  .avatar { display: none; }
}
@media print {
  header.top, .toolbar, .tabs, .legend { display: none; }
  body { background: #fff; }
}

/* Каркас демосборки по принятой docs/reference-transition/ui-spec.md. */
:root { color-scheme: light; }
.brand-block { display: flex; flex-direction: column; justify-content: center; flex: none; }
.brand { height: 28px; }
.brand img { display: block; flex: none; object-fit: contain; }
.demo-mark { font-size: 11.5px; line-height: 14px; white-space: nowrap; }
.demo-short, .user-compact { display: none; }
.nav { min-width: 0; }
.nav a { flex: none; }
.user-btn { display: flex; align-items: center; min-width: 0; }
.user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { display: block; flex: none; width: 132px; height: auto; object-fit: contain; }
.auth-card > .demo-mark { color: var(--muted); margin: 4px 0 8px; }
.tabs { overflow-x: auto; }
.tabs button { flex: none; white-space: nowrap; }
.scroll, .chart-scroll, .sch-wrap { max-width: 100%; }
.phase-row input:not([type=checkbox]), .copy-row input { min-width: 0; }
.modal:focus { outline: none; }
.modal-foot { flex-wrap: wrap; }
@media (max-width: 760px) {
  .user { flex: none; }
  .user-name { display: none; }
  .user-compact { display: inline; }
  .user-btn { min-width: 32px; justify-content: center; }
  .demo-full { display: none; }
  .demo-short { display: inline; }
  .auth-card .demo-full { display: inline; }
  .auth-card .demo-short { display: none; }
  .tool-group { max-width: 100%; }
  .toolbar > input, .toolbar > select { min-width: 0; max-width: 100%; }
}

/* Семантическая палитра данных остаётся исходной, отдельно от бренда. */
.pill { color: var(--ink); }
.bb-fact { background: var(--c-fact); }
.nav a { background: rgba(0,0,0,.08); }
.nav a:hover { background: rgba(0,0,0,.16); }
.brand span { opacity: 1; }
.row-action { appearance: none; border: 0; padding: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
a.row-action { text-decoration: none; }
.row-action:hover { text-decoration: underline; }
button.tw { appearance: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
button.tw:focus-visible { outline-offset: 1px; }
.sch-left[role=button]:focus-visible { outline-offset: -3px; }

input[type=checkbox]:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }

.modal-body { overflow-x: auto; }

/* Точные токены и локальные исключения E1–E4 принятой спецификации. */
a, h2, h4, .card .val, .sync, .avatar, .phase-group, .sch-month { color: var(--plum-d); }
a { text-decoration: underline; }
.brand { color: #fff; text-decoration: none; height: auto; font-size: 13px; }
.brand img { height: 18px; width: auto; }
.brand-block { width: 160px; gap: 1px; }
.demo-mark { font-size: 10.5px; line-height: 1.45; }
.demo-full { display: inline; }
.demo-short { display: none; }
.brand span, .caret { opacity: 1; }
.user { flex: none; max-width: 140px; }
.user-btn { max-width: 140px; }
.user-name { white-space: nowrap; }
.caret { flex: none; }
input, select, textarea { border-color: #8C8C8C; }
.icon-btn { border: 1px solid #8C8C8C; min-width: 24px; min-height: 24px; }
:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
input[type=checkbox]:focus-visible { outline: 2px solid #1A1A1A; outline-offset: 2px; }
.nav a:focus-visible, .seg button:focus-visible, .tabs button:focus-visible { outline-color: #1A1A1A; outline-offset: -4px; box-shadow: inset 0 0 0 2px #fff; }
.btn:focus-visible { box-shadow: 0 0 0 2px #fff, inset 0 1px 0 rgba(255,255,255,.24), 0 2px 0 var(--plum-edge), 0 5px 10px rgba(0,0,0,.22); }
.btn.ghost:focus-visible { box-shadow: 0 0 0 2px #fff, inset 0 1px 0 #fff, 0 2px 0 var(--edge), 0 4px 8px rgba(0,0,0,.09); }
.btn:active:not(:disabled), .tabs button.on:active, .seg button.on:active, .chip.on:active { background: #883731; }
.btn.ghost, .seg button, .tabs button:not(.on) { color: #9E403A; }
.btn.ghost:hover:not(:disabled), .tabs button:hover:not(.on), .seg button:hover:not(.on) { background: linear-gradient(180deg, #fff, #ECECEC); }
.btn.ghost:active:not(:disabled) { background: #ECECEC; }
.tabs button.on:hover, .seg button.on:hover, .chip.on:hover { background: linear-gradient(180deg, #9E403A, #883731); }
.btn.danger:hover:not(:disabled) { background: linear-gradient(180deg, #B03030, #8A2323); }
.btn.danger:active:not(:disabled) { background: #8A2323; }
.btn.danger.ghost { color: #B03030; }
.btn.danger.ghost:hover:not(:disabled) { background: linear-gradient(180deg, #fff, #FBE3E3); }
.btn.danger.ghost:active:not(:disabled) { background: #FBE3E3; }
.tbl.hover tbody tr:hover td, .tbl.tree tbody tr:hover td { background: #F4F4F4; }
.tabs { min-width: 0; max-width: 100%; }
.tabs button { scroll-margin: 8px; }
.scroll:focus-visible, .chart-scroll:focus-visible, .sch-wrap:focus-visible { outline-offset: -3px; }
.auth-brand { color: #9E403A; }
.auth-brand span { min-width: 0; overflow-wrap: anywhere; }
.modal-head { gap: 8px; }
.modal-head h3, h1 { overflow-wrap: anywhere; }
.modal-foot, .tool-group { flex-wrap: wrap; }
.modal-foot .btn { max-width: 100%; white-space: normal; }
.toast, .empty, .hint { overflow-wrap: anywhere; }
.read-error, .form-error { color: var(--red); background: var(--red-bg); border: 1px solid var(--red); border-radius: 8px; padding: 12px; margin: 8px 0; overflow-wrap: anywhere; }
.read-error p { margin: 6px 0 10px; }
.loading-state { color: var(--muted); padding: 8px 0; }
.sync.warn { max-width: 100%; white-space: normal; }
.sync-error { display: block; overflow-wrap: anywhere; font-weight: 400; margin-top: 4px; }
.tbl.ts th.today { background: #9E403A; color: #fff; box-shadow: inset 0 -3px 0 #fff; }
.tbl.ts .ts-cell.off { position: static; display: table-cell; pointer-events: auto; }
.nav a.on { color: #9E403A; }
.nav a.on:hover { background: #fff; color: #9E403A; }
.brand-block { flex-shrink: 0; }
.brand { gap: 8px; }
.tabs, .seg { flex-shrink: 0; }
.tabs { flex-shrink: 1; }
main, .modal-body, .panel { min-width: 0; }
.bar:focus-visible { outline-offset: 1px; }
.bar.dragging { opacity: 1; }
.sch-track { touch-action: pan-x pan-y; }
.icon-btn { flex-shrink: 0; }
@media (max-width: 760px) {
  .scroll > table, .chart-scroll > table { min-width: max-content; }
  .modal-body > table { display: block; max-width: 100%; overflow-x: auto; }
  .user, .user-btn { width: 36px; min-width: 36px; max-width: 36px; }
  .user-btn { padding-left: 0; padding-right: 0; }
  .demo-full { display: inline; }
  .demo-short { display: none; }
}
@media (max-width: 360px) {
  header.top { gap: 8px; }
  .brand-block { width: 140px; }
  .brand-block .demo-mark { white-space: normal; }
}

/* Same-origin static help; scoped additions preserve the working planner layout. */
.help-button { flex: none; min-width: 44px; min-height: 44px; }
.help-menu-link { display: block; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.guide { max-width: 960px; padding-top: 24px; }
.guide h1 { display: block; }
.guide h2 { scroll-margin-top: 16px; font-size: 18px; text-transform: none; letter-spacing: 0; }
.guide-table { width: 100%; border-collapse: collapse; font-size: inherit; }
.guide-table th, .guide-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 130px; }
.guide-table th { background: var(--bg-cream); }
.guide details { padding: 8px 0; }
.guide li { margin-bottom: 6px; }
.guide code { white-space: normal; overflow-wrap: anywhere; }
.guide-row { overflow-wrap: anywhere; }
@media (max-width: 760px) { .guide { font-size: 16px; } }

@media (max-width: 760px) { .financial-tabs { padding-bottom: 14px; } }

/* Accepted layout r2. Semantic data colors remain defined in app.css. */
@font-face { font-family: Montserrat; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/Montserrat-Variable.ttf') format('truetype'); }
:root { --font: Montserrat, 'Helvetica Neue', Helvetica, Arial, sans-serif; --ink: #272525; --muted: #665E5A; --line: #DEDAD7; --lift: 0 2px 0 #DEDAD7, 0 8px 18px rgba(39,37,37,.06); }
html { color-scheme: light; }
body { font-family: var(--font); font-synthesis: none; font-size: 14px; line-height: 1.45; background: #F7F6F5; font-weight: 400; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 650; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; text-transform: none; letter-spacing: 0; }
h3 { font-size: 15px; font-weight: 600; } strong, b { font-weight: 650; }
header.top { min-height: 50px; height: auto; padding: 0 24px; }
.brand-block { width: 160px; } .brand { min-height: 50px; } .brand span { font-size: 13px; }
.nav { min-width: 0; scrollbar-width: thin; } .nav a { min-height: 36px; font-size: 14px; } .user-btn { min-height: 36px; }
.demo-strip { padding: 5px 24px; background: #FFF; color: var(--muted); border-bottom: 1px solid var(--line); }
.demo-strip .demo-mark { font-size: 12px; line-height: 1.45; } .demo-full { display: inline; } .demo-short { display: none; }
main { max-width: 1440px; padding: 32px 24px 40px; }
main.view-schedule { max-width: 1440px; height: calc(100dvh - var(--shell-h, 78px)); min-height: 480px; padding: 24px 24px 16px; }
.toolbar { align-items: flex-end; gap: 16px; margin-bottom: 20px; } .toolbar h1 { margin-right: auto; align-self: center; }
.tool-group { gap: 8px; flex-wrap: wrap; }
.tool-label, .filter-field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); font-weight: 550; }
.filter-field { flex: 1 1 160px; max-width: 300px; } .filter-field input, .filter-field select { width: 100%; } .filter-search { flex-basis: 220px; }
.filter-bar .check { min-height: 44px; align-items: center; }
.field { gap: 6px; margin-bottom: 16px; } .field-label { font-size: 12px; font-weight: 550; line-height: 1.5; text-transform: none; letter-spacing: 0; }
.field-hint, .hint, .card .note { font-size: 12px; } .grid2 { gap: 0 16px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { min-height: 44px; padding: 10px 12px; font-size: 14px; border-radius: 8px; }
.btn { min-height: 44px; font-size: 14px; font-weight: 550; white-space: normal; } .btn.sm { min-height: 36px; font-size: 14px; }
.toolbar > .btn, .modal-foot .btn, form > .toolbar .btn { min-height: 44px; }
.tabs, .seg { max-width: 100%; } .tabs button, .seg button { min-height: 44px; font-size: 14px; font-weight: 550; } .tabs { gap: 8px; }
.icon-btn { min-height: 36px; min-width: 36px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .cards.hours-layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 16px; min-width: 0; } .card .lbl { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 550; } .card .val { font-weight: 650; overflow-wrap: anywhere; }
.panel, .scroll, .card { border-radius: 11px; } .panel { margin-bottom: 20px; padding: 20px; }
.tbl, .tbl tr.sub2 td { font-size: 14px; }
.tbl th, .tbl tr.th-groups th, .guide-table th { background: #EEECEA; color: #665E5A; font-size: 12px; line-height: 1.5; font-weight: 550; text-transform: none; letter-spacing: 0; padding: 16px; }
.tbl td { padding: 16px; } .tbl.compact td, .financial-comparison .tbl td, .view-timesheet .tbl td { padding: 10px 12px; }
.tbl .num, .card .val { font-variant-numeric: tabular-nums; } .tbl .num { text-align: right; } .tbl .cell-in, .tbl .inline-in { min-height: 36px; }
.modal { max-width: 620px; border-radius: 11px; } .modal.wide { max-width: 720px; } .modal-foot { gap: 16px; } .modal-body { min-width: 0; }
.auth-card { width: min(460px, 100%); } .auth-card h2 { font-size: 18px; } .help-btn { min-width: 44px; min-height: 44px; }
.schedule-options { margin: 0 0 16px; border: 1px solid var(--line); background: #FFF; border-radius: 11px; }
.schedule-options > summary, .extra-project-data > summary { padding: 12px; gap: 8px; cursor: pointer; font-weight: 550; } .schedule-options > .toolbar { padding: 16px; }
.extra-project-data { margin-top: 24px; } .financial-comparison { margin-top: 32px; } .form-error { scroll-margin-top: var(--shell-h, 78px); } .form-error .btn { text-align: left; }
.guide { font-size: 14px; line-height: 1.65; } .guide h2 { font-size: 18px; } .guide-table { font-size: 14px; }
@media (max-width: 1100px) { main { padding: 28px 16px 40px; } main.view-schedule { padding: 20px 16px 12px; } }
@media (max-width: 760px) {
  header.top { padding: 0 12px; gap: 8px; } .brand-block { width: 130px; } .user-btn { width: 36px; min-width: 36px; height: 36px; }
  .demo-strip { padding: 5px 12px; } main { padding: 24px 12px 32px; } main.view-schedule { padding: 24px 12px 12px; height: auto; min-height: 0; }
  .view-schedule .sch-wrap { flex: none; height: min(65dvh, 640px); min-height: 280px; --left: 140px; } h1 { font-size: 23px; }
  .toolbar.filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; } .filter-field { max-width: none; }
  .filter-search, .filter-bar > h1, .filter-bar > .tool-group, .filter-bar > .seg, .filter-bar > .push, .filter-bar > .filter-reset { grid-column: 1 / -1; }
  .filter-bar .push { margin-left: 0; } .tool-label { align-items: stretch; } .cards, .cards.hours-layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl td, .tbl th { padding: 14px 12px; }
  .view-timesheet .tbl th:first-child, .view-timesheet .tbl td:first-child { max-width: 140px; min-width: 140px; width: 140px; white-space: normal; background-color: #FFF; }
  .view-timesheet .tbl th:first-child { background-color: #EEECEA; } .tbl .inline-in { min-width: 70px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; } .modal-back { padding: 16px 12px; } .panel { padding: 16px; } .guide { font-size: 14px; }
}
@media (max-width: 360px) { .toolbar.filter-bar, .cards, .cards.hours-layers { grid-template-columns: minmax(0, 1fr); } .filter-bar > * { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Общая поправка выпадающих полей для финансового r2.
   Передача разработчику; в рабочее приложение дизайнером НЕ установлена.
   Подключать после app.css. Функциональность native select сохраняется. */
select:not([multiple]):not([size]),
select[size="1"]:not([multiple]) {
  --select-arrow-color: #666666;
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--select-arrow-color) 50%),
    linear-gradient(135deg, var(--select-arrow-color) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
/* Нет второй стрелки: отключается системное оформление, не HTML-контрол.
   Высота, шрифт, фон disabled, радиус и обработчики остаются исходными.
   size>1/multiple — открытые списки без искусственной стрелки. */
@media (forced-colors: active) {
  select:not([multiple]):not([size]),
  select[size="1"]:not([multiple]) {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
  }
}
/* Для RTL применяется системная стрелка; продукт сейчас русскоязычный. */
select:dir(rtl) {
  appearance: auto;
  -webkit-appearance: auto;
  background-image: none;
}
/* Disclosures have their own 36px target, independent of the native select reserve. */
button.tw { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #FFF; font-size: 0; cursor: pointer; }
button.tw::before, .sch-left[aria-expanded] .tw::before { content: ''; display: inline-block; width: 12px; height: 8px; background: var(--muted); clip-path: polygon(0 0, 100% 0, 50% 100%); transform: rotate(-90deg); }
button.tw[aria-expanded=true]::before, .sch-left[aria-expanded=true] .tw::before { transform: none; }
.sch-left[aria-expanded] .tw { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; font-size: 0; }
.sch-left.group { padding: 12px; gap: 8px; } .sch-track.group { min-height: 60px; }
.sch-corner b, .who b, .grp-name, .bar, .wk { font-size: 14px; }
.sch-month, .sch-tick, .sch-corner small { font-size: 12px; }
.tbl.ts th.today { color: var(--ink); }
.auth-error, .confirm-text { font-size: 14px; }
.tabs button.on, .auth-brand, .nav a.on, .brand { font-weight: 650; }
@media print { .demo-strip, .schedule-options { display: none; } }
.project-options { margin: 0 0 20px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.project-options > summary { cursor: pointer; padding: 12px; font-weight: 550; }
.project-options[open] > summary { margin-bottom: 16px; }
.extra-project-data summary, .project-options summary, .schedule-options summary { overflow-wrap: anywhere; }
.field-hint { line-height: 1.5; }

/* Native details keep their keyboard behavior; only the disclosure drawing is replaced. */
summary { display: flex; align-items: center; min-height: 44px; gap: 8px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ''; flex: none; width: 12px; height: 8px; background: var(--muted); clip-path: polygon(0 0, 100% 0, 50% 100%); transform: rotate(-90deg); }
details[open] > summary::before { transform: none; }

.check { font-size: 14px; min-height: 36px; }
.sync, .sync-error { font-size: 14px; }
.legend { font-size: 12px; line-height: 1.5; }
.chart text { font-family: var(--font); font-size: 12px; }

/* Clean design delta, 2026-10-05. Append after ownapp77 app.css
   SHA256 90764f2e4c216de1c0f845df32b1d525f82677b00fc131725e59dfc8054d3059.
   Requires patches/markup.patch for help placement and settings-name-table.
   Keeps Montserrat, brand, native select 12/36, financial data and actions. */
body { font-size: 14px; line-height: 1.45; }
h1 { font-size: 22px; line-height: 1.3; font-weight: 600; }
h2 { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--ink); }
h3 { font-size: 15px; line-height: 1.45; font-weight: 600; }
.auth-card h2, .guide h2 { font-size: 18px; }
.toolbar { gap: 12px; margin-bottom: 16px; }
.tool-group { gap: 8px; }
.title-with-help { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.title-with-help > h1 { display: block; flex: 0 1 auto; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.toolbar > .title-with-help { margin-right: auto; align-self: center; }
main > .title-with-help { margin-bottom: 16px; }
.help-button, .toolbar > .help-button {
  flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; min-height: 36px;
  padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #8C8C8C; background: #FFF; box-shadow: none;
  color: #9E403A; font: inherit; font-size: 14px; font-weight: 600; text-shadow: none;
  border-radius: 8px; cursor: pointer;
}
.help-button:hover:not(:disabled) { background: #EEECEA; filter: none; }
.help-button:active:not(:disabled) { background: #DEDAD7; transform: none; box-shadow: none; }
.help-button:focus-visible { outline: 2px solid #1A1A1A; outline-offset: 2px; box-shadow: none; }
.help-button:disabled { opacity: .5; cursor: default; }
.modal-head { justify-content: flex-start; align-items: flex-start; gap: 8px; }
.modal-head > h3 { flex: 0 1 auto; min-width: 0; padding-block: 7px; margin: 0; }
.modal-head > .help-button { flex: 0 0 36px; }
.modal-head > .icon-btn:last-child { flex: none; margin-left: auto; }
.cards { gap: 12px; }
.card { padding: 16px; }
.card, .panel, .scroll { box-shadow: 0 1px 3px rgba(39,37,37,.06); }
.card .val { font-size: 20px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.card.bad .val, .card .val.neg { color: var(--red); }
.card .val.pos { color: var(--green); }
.card .lbl, .field-label { font-size: 12px; line-height: 1.5; font-weight: 500; }
.card .note, .hint, .field-hint { font-size: 12px; line-height: 1.5; }
.pill, .util, span.sync:not(.warn) {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  min-height: 24px; padding: 3px 8px; border: 1px solid transparent;
  font-size: 12px; line-height: 1.4; font-weight: 500; letter-spacing: 0;
  max-width: 100%; box-shadow: none;
}
.pill.st-tentative { border-color: var(--plum); border-style: dashed; }
.pill.warn-p, .util.u4, span.sync.warn { font-weight: 600; }
span.sync.ok { color: var(--ink); }
.sync-error { font-size: 14px; line-height: 1.45; white-space: normal; }
span.sync.warn { display: block; font-size: 12px; line-height: 1.5; padding: 8px 12px; }
.tbl th { padding: 12px 14px; }
.tbl td { padding: 12px 14px; }
.tbl.compact td, .financial-comparison .tbl td, .view-timesheet .tbl td { padding: 10px 12px; }
.row-action { font-weight: 600; }
/* Today is a temporal marker, not a warning. Keep the date readable. */
.tbl.ts th.today { background: #F3E3E1; color: var(--ink); box-shadow: inset 0 -2px 0 #B34A43; }
.view-people > .toolbar:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.view-people > .toolbar:first-child > .title-with-help { grid-column: 1; grid-row: 1; margin: 0; }
.view-people > .toolbar:first-child > .btn.push { grid-column: 2; grid-row: 1; margin-left: 0; }
.view-people > .toolbar:first-child > .filter-field { grid-column: 1; grid-row: 2; width: min(100%, 300px); }
.view-people > .toolbar:first-child > .check { grid-column: 2; grid-row: 2; margin: 0; }
.view-timesheet > .toolbar:first-child > .title-with-help { flex: 1 1 100%; margin: 0; }
.view-timesheet > .toolbar:first-child > b { display: flex; align-items: center; min-height: 44px; }
.view-timesheet > .toolbar:first-child > span.sync { align-self: center; width: fit-content; justify-self: start; }
.view-timesheet > .toolbar:first-child > span.sync.warn { flex: 1 1 100%; grid-column: 1 / -1; width: 100%; }
.view-timesheet > .scroll + .toolbar { margin-top: 16px; }
.tabs button:not(.on) { background: #FFF; box-shadow: none; }
.legend, .chart-legend { gap: 8px 16px; }
@media (max-width: 760px) {
  h1 { font-size: 20px; }
  .toolbar.filter-bar > .title-with-help { grid-column: 1 / -1; }
  .view-people > .toolbar:first-child > .title-with-help { grid-column: 1; }
  .view-people > .toolbar:first-child > .filter-field { grid-column: 1 / -1; max-width: none; width: 100%; }
  .view-people > .toolbar:first-child > .check { grid-column: 1 / -1; grid-row: 3; }
  .view-people > .toolbar:first-child > .btn.push { grid-column: 2; }
  .view-timesheet > .toolbar:first-child > .title-with-help { grid-column: 1 / -1; }
  .view-timesheet .cards > .card:nth-child(3):last-child { grid-column: 1 / -1; }
  .card .val { font-size: 20px; }
  .tbl th, .tbl td { padding: 12px; }
  /* Narrow editable directories only; financial tables still scroll locally. */
  .view-settings .settings-name-table { display: block; width: 100%; min-width: 0; max-width: 100%; }
  .view-settings .settings-name-table tbody { display: block; width: 100%; }
  .view-settings .settings-name-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 12px; border-top: 1px solid var(--line); }
  .view-settings .settings-name-table tr:first-child { border-top: 0; }
  .view-settings .settings-name-table td { padding: 0; border: 0; min-width: 0; }
  .view-settings .settings-name-table td:first-child { grid-column: 1 / -1; }
  .view-settings .settings-name-table td:nth-child(2) { grid-column: 1; align-self: center; text-align: left; }
  .view-settings .settings-name-table td:last-child { grid-column: 2; justify-self: end; }
  .view-settings .settings-name-table .inline-in { width: 100%; min-width: 0; }
  .view-settings .settings-name-table tr.add td:first-child { grid-column: 1; }
  .view-settings .settings-name-table tr.add td:nth-child(2) { display: none; }
  .view-settings .settings-name-table tr.add td:last-child { grid-column: 2; }
  .view-settings .settings-name-table tr.add input { width: 100%; }
  .view-settings .settings-name-table tr.add .btn { min-height: 44px; }
}
@media (max-width: 360px) {
  .view-people > .toolbar:first-child { grid-template-columns: minmax(0, 1fr) auto; }
  .view-people > .toolbar:first-child > .title-with-help { grid-column: 1; }
  .view-people > .toolbar:first-child > .btn.push { grid-column: 2; }
}

/* Append after installed clean-design on app79.
   Installed app.css SHA91db2bf3e9600a126223e0e52473964fbfadc1096a3c28e5ce8d06cc6a832af6.
   Cosmetic follow-up only; no handlers, fields, financial logic or queue changes. */
.view-people > .toolbar:first-child {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) auto;
}
.view-people > .toolbar:first-child > .title-with-help { grid-column: 1 / 3; }
.view-people > .toolbar:first-child > .btn.push { grid-column: 3; justify-self: end; }
.view-people > .toolbar:first-child > .check {
  grid-column: 2 / 4; justify-self: start; align-self: end; min-height: 44px;
}
.view-timesheet > .toolbar:first-child > span.sync:not(.warn) {
  align-self: flex-end; margin-bottom: 10px;
}
/* Hide the caption with its already hidden select, never an available field. */
.view-timesheet .filter-field:has(> select[hidden]) { display: none; }
@media (max-width: 760px) {
  .view-people > .toolbar:first-child { grid-template-columns: minmax(0, 1fr) auto; }
  .view-people > .toolbar:first-child > .title-with-help { grid-column: 1; }
  .view-people > .toolbar:first-child > .btn.push { grid-column: 2; }
  .view-people > .toolbar:first-child > .check { grid-column: 1 / -1; }
  .view-timesheet > .toolbar:first-child > span.sync:not(.warn) {
    align-self: start; margin-bottom: 0;
  }
}

/* Compact density, 2026-10-05. Append AFTER current clean + alignment app79.
   Required base app.css SHA e3b662fa3eb2f3cd37ec17b55a1f85a4b265f6f5eb08d80a48ea86172bd099db.
   Pair with patches/schedule.patch; no business values or request handlers change. */
body { font-size: 14px; line-height: 1.45; }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 14px; line-height: 1.4; }
main { padding: 18px 24px 40px; }
main.view-schedule { padding: 12px 16px 8px; }
.toolbar { gap: 8px 10px; margin-bottom: 12px; }
.tool-group { gap: 6px; }
.tool-label, .filter-field { gap: 4px; }
.field { gap: 4px; margin-bottom: 12px; }
.grid2 { column-gap: 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  min-height: 34px; padding: 6px 8px; font-size: 13.5px; line-height: 1.45;
}
/* Preserve the accepted 12px arrow inset and 36px text reserve. */
select:not([multiple]):not([size]), select[size="1"]:not([multiple]) { padding-inline-end: 36px; }
.btn { min-height: 34px; font-size: 13.5px; padding: 6px 12px; }
.btn.sm { min-height: 32px; font-size: 13px; padding: 5px 10px; }
.toolbar > .btn, .modal-foot .btn, form > .toolbar .btn { min-height: 34px; }
.tabs { gap: 4px; margin-bottom: 12px; }
.tabs button, .seg button { min-height: 34px; font-size: 13px; padding: 6px 12px; }
.icon-btn { min-width: 32px; min-height: 32px; padding: 3px 7px; }
.help-button, .toolbar > .help-button, .modal-head > .help-button {
  flex: 0 0 32px; width: 32px; min-width: 32px; height: 32px; min-height: 32px;
}
.modal-head > h3 { padding-block: 5px; }
.check, .filter-bar .check, .view-people > .toolbar:first-child > .check { min-height: 34px; font-size: 13px; }
.view-timesheet > .toolbar:first-child > b { min-height: 34px; }
.view-timesheet > .toolbar:first-child > span.sync:not(.warn) { margin-bottom: 5px; }
main > .title-with-help { margin-bottom: 12px; }
.card { padding: 12px 14px; }
.card .val { font-size: 18px; line-height: 1.35; }
.panel { padding: 14px 16px; margin-bottom: 14px; }
.tbl, .tbl tr.sub2 td { font-size: 13px; }
.tbl th { padding: 8px 9px; }
.tbl td { padding: 6px 9px; }
.tbl.compact td, .financial-comparison .tbl td, .view-timesheet .tbl td { padding: 4px 8px; }
.tbl .cell-in, .tbl .inline-in { min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.modal { max-width: 520px; }
.modal.wide { max-width: 720px; }
.modal-foot { gap: 8px; }
.schedule-options { margin-bottom: 10px; }
.schedule-options > summary, .extra-project-data > summary, .project-options > summary { padding: 8px 12px; }
.schedule-options > .toolbar { padding: 12px; }
summary { min-height: 34px; font-size: 13px; }
button.tw { width: 32px; min-width: 32px; height: 32px; }
/* Restore reference-like schedule density. Actual hour-scaled heights stay in JS. */
.sch-left.group { padding: 3px 10px; gap: 6px; }
.sch-track.group { height: 32px; min-height: 32px; }
.sch-left[aria-expanded] .tw { min-width: 24px; height: 24px; }
.sch-corner b, .who b, .grp-name { font-size: 13px; }
.bar { font-size: 11.5px; line-height: 1.2; gap: 4px; padding-inline: 6px; }
.bar b, .bar em { font-weight: 600; }
.wk { font-size: 11.5px; font-weight: 600; }
.sch-month, .sch-tick, .sch-corner small { font-size: 11px; }
@media (max-width: 1100px) {
  main { padding: 18px 16px 40px; }
  main.view-schedule { padding: 12px 16px 8px; }
}
@media (max-width: 760px) {
  h1 { font-size: 18px; }
  main { padding: 14px 12px 32px; }
  main.view-schedule { padding: 12px 12px 8px; }
  /* Keep small-screen forms reachable; schedule bars retain their hour scale. */
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { min-height: 36px; }
  .btn, .btn.sm, .toolbar > .btn, .modal-foot .btn, form > .toolbar .btn,
  .tabs button, .seg button, .check, .filter-bar .check,
  .view-people > .toolbar:first-child > .check { min-height: 36px; }
  .tbl .cell-in, .tbl .inline-in { min-height: 36px; }
  .tbl th { padding: 8px; }
  .tbl td { padding: 6px 8px; }
  .tbl.compact td, .financial-comparison .tbl td, .view-timesheet .tbl td { padding: 4px 8px; }
  .view-timesheet > .toolbar:first-child > span.sync:not(.warn) { margin-bottom: 0; }
  .view-settings .settings-name-table td { padding: 0; }
  .view-settings .settings-name-table tr { padding: 8px; }
  .view-settings .settings-name-table tr.add .btn { min-height: 36px; }
}
/* Larger form targets for touch; do not inflate the calendar time visualization. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea,
  .btn, .btn.sm, .toolbar > .btn, .modal-foot .btn, form > .toolbar .btn,
  .tabs button, .seg button, .check, .filter-bar .check,
  .view-people > .toolbar:first-child > .check,
  .view-timesheet > .toolbar:first-child > b,
  .tbl .cell-in, .tbl .inline-in, .view-settings .settings-name-table tr.add .btn { min-height: 44px; }
  .view-timesheet > .toolbar:first-child > span.sync:not(.warn) { margin-bottom: 10px; }
}
@media (max-width: 760px) and (pointer: coarse) {
  .view-timesheet > .toolbar:first-child > span.sync:not(.warn) { margin-bottom: 0; }
}

/* Narrow financial-form footer alignment. Append after compact app.css
   SHA cd10e0a4506d5269008e854117166bb00b5c0ab664c185734dc8bedad6041764.
   editForm actual structure is .modal-body > form > .toolbar:last-child.
   Keep DOM order, submit type, handlers, unknown-operation controls and guards. */
.modal-body > form > .toolbar:last-child {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* Schedule-only restoration. Append after current app79 CSS bab9bb0e….
   Pair with patches/schedule.patch. Original registered reference: 50335f2e…/21ee316c….
   No global typography, financial editor, API or other section changes. */
main.view-schedule {
  max-width: none; display: flex; flex-direction: column;
  height: calc(100vh - var(--shell-h, 78px));
  height: calc(100dvh - var(--shell-h, 78px));
  min-height: 0; padding: 12px 16px 8px;
}
.view-schedule .schedule-toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px; margin: 0 0 10px; flex: none;
}
.view-schedule .schedule-toolbar .tool-group { gap: 4px; flex-wrap: nowrap; }
.view-schedule .schedule-toolbar .tool-label {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  min-width: 0; max-width: 100%; font-size: 12px; font-weight: 500;
}
.view-schedule .schedule-filter { display: flex; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.view-schedule .schedule-filter-department { width: 140px; }
.view-schedule .schedule-filter-project { width: 240px; }
.view-schedule .schedule-filter-search { width: 150px; }
.view-schedule .schedule-filter > input, .view-schedule .schedule-filter > select { width: 100%; min-width: 0; }
.view-schedule .schedule-toolbar input[type=search], .view-schedule .schedule-toolbar select {
  min-height: 32px; padding: 6px 8px; font-size: 13.5px; line-height: 1.45;
}
/* Keep the accepted arrow inset: 12px; reserve 36px so text cannot collide. */
.view-schedule .schedule-toolbar select { padding-inline-end: 36px; }
.view-schedule .schedule-insight > select { width: 160px; min-width: 0; }
.view-schedule .schedule-sort > select { width: 200px; min-width: 0; }
.view-schedule .schedule-toolbar .btn.sm, .view-schedule .schedule-toolbar .seg button {
  min-height: 30px; font-size: 12.5px; line-height: 1.45; padding: 5px 11px;
}
.view-schedule .schedule-toolbar .help-button {
  min-height: 32px; height: 32px; width: 32px; min-width: 32px; flex: 0 0 32px; padding: 0;
}
.view-schedule .schedule-toolbar > .push { margin-left: auto; }
.view-schedule .schedule-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.view-schedule .sch-wrap {
  --left: 250px; flex: 1 1 0; height: auto; min-height: 160px;
  overflow: auto; border-radius: 10px; background: #fff;
  box-shadow: 0 2px 0 #E6E6E6, 0 5px 12px rgba(0,0,0,.05);
}
.view-schedule .sch-corner { padding: 6px 10px; }
.view-schedule .sch-corner b { font-size: 12.5px; }
.view-schedule .sch-corner small { font-size: 10.5px; }
.view-schedule .sch-month { font-size: 10.5px; padding: 5px 6px 1px; }
.view-schedule .sch-tick { font-size: 11px; padding: 1px 0 5px; line-height: 1.2; }
.view-schedule .sch-tick small { font-size: 9.5px; }
.view-schedule .sch-tick.week { font-size: 10.5px; padding-top: 3px; }
.view-schedule .sch-left { padding: 4px 10px; gap: 8px; }
.view-schedule .sch-left.group { background: #E1EAEC; padding: 6px 10px; gap: 8px; }
.view-schedule .sch-row.team .sch-left.group { background: #E6E5F9; }
.view-schedule .grp-name, .view-schedule .who b { font-size: 13px; }
.view-schedule .grp-name { min-width: 0; }
.view-schedule .who { line-height: 1.25; }
.view-schedule .who small { font-size: 11.5px; }
.view-schedule .avatar { width: 28px; height: 28px; font-size: 10.5px; background: #E6E5F9; }
.view-schedule .avatar.ph { background: #fff; }
/* The entire department header is the interactive target; glyph stays compact. */
.view-schedule .sch-left[aria-expanded] .tw { min-width: 16px; width: 16px; height: 16px; }
.view-schedule .sch-left[aria-expanded] .tw::before { width: 8px; height: 6px; }
.view-schedule .sch-track.group { height: 32px; min-height: 32px; background-color: #F6F4EC; }
.view-schedule .shade.own { background: #E1EAEC; }
.view-schedule .util {
  display: inline-block; min-width: 46px; min-height: 0; padding: 2px 7px;
  border: 0; font-size: 11.5px; line-height: 1.45; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.08);
}
.view-schedule .u0 { background: transparent; color: var(--muted); box-shadow: none; }
.view-schedule .u1 { background: #E1EAEC; color: #4E5E62; }
.view-schedule .u2 { background: #AFC4C8; color: #24383C; }
.view-schedule .u3 { background: #B8B6E7; color: #33235A; }
.view-schedule .u4 { background: #F0A8A8; color: #7A1616; }
.view-schedule .wk { top: 4px; bottom: 4px; font-size: 11px; font-weight: 600; border-radius: 6px; }
.view-schedule .bar {
  border-width: 1.5px; border-radius: 5px; padding: 0 6px;
  font-size: 11px; line-height: 1.2; gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(0,0,0,.16);
}
.view-schedule .bar b, .view-schedule .bar em { font-weight: 600; }
/* Keep readable labels instead of reinstating the original faded text. */
.view-schedule .bar span, .view-schedule .bar em { opacity: 1; }
.view-schedule .bar.tent { box-shadow: none; }
.view-schedule .bar.dragging { box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.view-schedule .legend { gap: 18px; padding: 7px 4px 0; font-size: 11.5px; line-height: 1.45; flex: none; }
@media (max-width: 760px) {
  main.view-schedule { padding: 12px 16px 8px; }
  .view-schedule .sch-wrap { --left: 150px; flex: 1 1 0; height: auto; min-height: 160px; }
  .view-schedule .avatar { display: none; }
  .view-schedule .schedule-filter-project { flex: 1 1 200px; }
  .view-schedule .schedule-filter-department { flex: 1 1 140px; }
  .view-schedule .schedule-filter-search { flex: 1 1 150px; }
}
/* Restore reference density for mouse/keyboard; retain larger toolbar targets on touch. */
@media (pointer: coarse) {
  .view-schedule .schedule-toolbar input[type=search], .view-schedule .schedule-toolbar select,
  .view-schedule .schedule-toolbar .btn.sm, .view-schedule .schedule-toolbar .seg button,
  .view-schedule .schedule-toolbar .help-button { min-height: 44px; }
  .view-schedule .schedule-toolbar .help-button { height: 44px; width: 44px; min-width: 44px; flex-basis: 44px; }
}
@media print { main.view-schedule { height: auto; } .view-schedule .sch-wrap { min-height: 0; } }

/* The separated period preview remains identifiable before admission and above dialogs. */
:root { --preview-h: 28px; }
body { padding-top: var(--preview-h); }
.preview-banner { position: fixed; inset: 0 0 auto; min-height: var(--preview-h); display: flex; align-items: center; justify-content: center; padding: 3px 12px; background: #FFF3CF; border-bottom: 1px solid #CCAE68; color: #4C3A12; font-size: 12px; line-height: 20px; z-index: 1000; }
header.top { top: var(--preview-h); }
main.view-schedule { height: calc(100dvh - var(--shell-h, 78px) - var(--preview-h)); }
.period-pane fieldset { min-width: 0; margin: 16px 0; }
.period-pane legend { font-weight: 600; }
.period-filters .field { min-width: 0; flex: 1 1 240px; }
.period-pane .tabs, .period-pane .toolbar { flex-wrap: wrap; }

/* Four equal period hour layers; leave other summary cards unchanged. */
.period-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 361px) and (max-width: 1100px) { .period-hours { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .period-hours { grid-template-columns: minmax(0, 1fr); } }

/* Schedule-only narrow controls. Append after exact r2 app.css 04e42e14….
   No bar/row/hour geometry, context, handlers, global fields or desktop changes. */
@media screen and (max-width: 480px) {
  .view-schedule > .period-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 8px 10px;
    margin-bottom: 8px;
    flex: none;
  }
  .view-schedule > .period-filters > .field {
    min-width: 0;
    margin-bottom: 0;
  }
  .view-schedule > .period-filters > .field > select {
    width: 100%;
    min-width: 0;
  }
  .view-schedule .schedule-toolbar .schedule-filter-department,
  .view-schedule .schedule-toolbar .schedule-filter-project {
    flex: 1 1 calc((100% - 10px) / 2);
    width: auto;
    max-width: calc((100% - 10px) / 2);
    min-width: 0;
  }
  .view-schedule .schedule-toolbar .schedule-insight,
  .view-schedule .schedule-toolbar .schedule-sort {
    flex: 1 1 calc((100% - 10px) / 2);
    max-width: calc((100% - 10px) / 2);
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .view-schedule .schedule-toolbar .schedule-insight > select,
  .view-schedule .schedule-toolbar .schedule-sort > select {
    width: 100%;
    min-width: 0;
  }
}
