:root {
  color-scheme: dark;
  --bg: #0d0f12; --card: #171a1f; --card-2: #1f2329; --text: #eef0f3; --muted: #9aa3b0; --line: #2a2f37;
  --accent: #ffb224; --accent-hover: #ffc252; --accent-text: #1c1403; --accent-soft: rgba(255, 178, 36, .13);
  --link: #ffc76a; --ok: #55d98f; --bad: #ff8078; --warn-bg: #33270e; --warn-line: #6b4f14;
  --ok-bg: #12301f; --bad-bg: #3a1a1a;
  --font-display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --topbar: 56px; --radius: 12px; --radius-sm: 9px;
}

* { box-sizing: border-box; }
body {
  margin: 0; padding-bottom: 96px; color: var(--text); font: 16px/1.45 var(--font-body);
  background: radial-gradient(900px 420px at 72% -140px, rgba(255, 178, 36, .11), transparent 70%) no-repeat fixed, var(--bg);
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 1.55rem; margin: 2px 0 16px; }
h2 { font-size: 1.1rem; margin: 24px 0 10px; }
main { max-width: 1120px; margin: 0 auto; padding: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic { width: 1.3em; height: 1.3em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Верхняя панель и навигация */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; height: var(--topbar); padding: 0 16px; background: rgba(13, 15, 18, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand, .brand:hover { display: flex; align-items: center; gap: 9px; color: var(--text); font: 600 1.05rem var(--font-display); letter-spacing: .02em; }
.brand .ic { color: var(--accent); width: 1.5em; height: 1.5em; }
.topbar form { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.linkbtn { background: none; border: 0; color: var(--link); font: inherit; padding: 4px; cursor: pointer; min-height: 0; width: auto; }
.linkbtn:hover { background: none; color: var(--accent-hover); border-color: transparent; }

.bottom { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr); background: rgba(23, 26, 31, .96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; color: var(--muted); font-size: .76rem; transition: color .15s; }
.bottom a:hover { color: var(--text); }
.bottom a.on { color: var(--accent); font-weight: 600; }
.bottom a.main-action { margin: -14px 5px 6px; padding: 11px 2px 9px; border-radius: 14px; color: var(--accent-text); background: var(--accent); font-weight: 700; box-shadow: 0 6px 20px rgba(255, 178, 36, .3); }
.bottom a.main-action:hover { background: var(--accent-hover); color: var(--accent-text); }
.bottom a.desk-only { display: none; }

/* Карточки и показатели */
.card, .stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card { padding: 14px 16px; margin-bottom: 12px; }
.card:has(> form[method="post"]) { max-width: 680px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { padding: 13px 14px; }
.stat small { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 3px; }
.stat b { font: 600 clamp(1.08rem, 4.6vw, 1.42rem)/1.2 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-hero { position: relative; grid-column: 1 / -1; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 18px; border-color: var(--warn-line); background: linear-gradient(125deg, #2b2110, var(--card) 62%); }
.stat-hero small { font-size: .9rem; }
.stat-hero > b { font-size: clamp(2rem, 9vw, 3.1rem); }
.hero-split { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px solid rgba(255, 178, 36, .2); color: var(--muted); font-size: .9rem; }
.hero-split b { color: var(--text); font-size: 1.15rem; }

.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.actions a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 3px; text-align: center; line-height: 1.15; color: var(--text); font-size: .79rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, background .15s; }
.actions a .ic { color: var(--accent); width: 22px; height: 22px; }
.actions a:hover { background: var(--card-2); border-color: var(--accent); color: var(--text); }

.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }

/* Кнопки и формы */
a.btn, button { display: block; text-align: center; padding: 12px; min-height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; cursor: pointer; transition: background .15s, border-color .15s, transform .08s; }
a.btn:hover, button:hover { border-color: var(--accent); color: var(--text); }
a.btn:active, button:active { transform: translateY(1px); }
a.btn.primary, button.primary { width: 100%; margin-bottom: 12px; color: var(--accent-text); background: var(--accent); border-color: var(--accent); font-weight: 700; }
a.btn.primary:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
button.small, a.small { display: inline-block; width: auto; padding: 5px 10px; min-height: 0; font-size: .85rem; }
label { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: 16px var(--font-body); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #3c434d; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: #737c89; }
input[type=radio], input[type=checkbox] { display: inline-block; width: auto; margin: 0 7px 0 0; accent-color: var(--accent); box-shadow: none; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
form.row > button { grid-column: 1 / -1; margin-bottom: 12px; }
.line { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px; margin-bottom: 10px; background: rgba(255, 255, 255, .018); }
.line .hint { font-size: .82rem; color: var(--muted); margin: -6px 0 8px; min-height: 1em; }
.line label { margin-bottom: 8px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font: 600 1.2rem var(--font-display); margin: 14px 0; font-variant-numeric: tabular-nums; }
.total span:last-child { color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
fieldset label { color: var(--text); font-size: 1rem; margin: 6px 0; }

/* Сообщения */
.flash, .notice { padding: 11px 13px; border-radius: var(--radius-sm); margin-bottom: 12px; border-left: 3px solid transparent; }
.flash.ok { background: var(--ok-bg); border-left-color: var(--ok); }
.flash.error { background: var(--bad-bg); border-left-color: var(--bad); }
.notice { background: var(--warn-bg); border-left-color: var(--accent); }

/* Списки и таблицы */
.muted { color: var(--muted); font-size: .86rem; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.item { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item > div:last-child { text-align: right; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.cancelled { opacity: .55; text-decoration: line-through; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; scrollbar-width: none; }
.chips a { padding: 6px 13px; border: 1px solid var(--line); border-radius: 16px; white-space: nowrap; color: var(--text); background: var(--card); font-size: .88rem; transition: border-color .15s; }
.chips a:hover { border-color: var(--accent); color: var(--text); }
.chips a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 9px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
th { color: var(--muted); font-weight: 500; font-size: .84rem; }
tr.strong td { font-weight: 700; background: rgba(255, 255, 255, .025); }
.pill { font-size: .75rem; padding: 2px 8px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ok); }
.pill.low { color: var(--bad); }

/* Вход */
.auth { max-width: 380px; margin: 9vh auto 40px; padding: 26px 24px 16px; border-color: var(--warn-line); background: linear-gradient(160deg, #2b2110, var(--card) 45%); }
.auth h1 { margin-bottom: 18px; }
button.tg-login { width: 100%; margin-bottom: 8px; font-weight: 600; }
.auth-link { display: block; padding: 4px 0 8px; text-align: center; font-size: .92rem; }
.auth p code { padding: 1px 5px; color: var(--text); background: var(--card-2); border-radius: 5px; }
.invite { display: block; padding: 9px 10px; overflow-wrap: anywhere; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.auth-logo { display: block; width: 44px; height: 44px; margin-bottom: 10px; color: var(--accent); }
.inline-form { display: inline; }
.stack > * + * { margin-top: 8px; }

/* Работы и календарь */
.jobs-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.jobs-head h1 { margin: 2px 0; }
.jobs-head a.btn.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; margin: 0; padding: 10px 16px; }
.stat-wage { border-color: var(--warn-line); background: linear-gradient(125deg, #2b2110, var(--card) 70%); }
.stat-wage b { color: var(--accent); }
.jobs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.jobs-side h2 { margin-top: 10px; }
.cal { padding: 14px 12px 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { margin: 0; font-size: 1.2rem; }
.cal-nav { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; font-size: 1.5rem; line-height: 1; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s; }
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays { margin-bottom: 4px; text-align: center; color: var(--muted); font-size: .76rem; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 6px 2px 4px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--bg); transition: border-color .15s, background .15s; }
a.cal-day:hover { border-color: var(--accent); color: var(--text); }
.cal-day.out { border-color: transparent; background: none; color: #4c535e; }
.cal-day.future { color: #6f7884; }
.cal-num { font: 600 .95rem var(--font-display); font-variant-numeric: tabular-nums; }
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-today .cal-num { color: var(--accent); }
.cal-day.has-jobs { background: var(--accent-soft); border-color: var(--warn-line); }
.cal-day.selected, a.cal-day.selected:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.cal-day.selected .cal-num { color: var(--accent-text); }
.cal-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: .7rem; font-weight: 700; }
.cal-day.selected .cal-count { background: var(--accent-text); color: var(--accent); }
.cal-sum { display: none; font-size: .73rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-day.selected .cal-sum { color: var(--accent-text); }
.cal-hint { margin: 10px 2px 4px; font-size: .78rem; }
.jobs-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.job { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job-main .muted { margin-top: 3px; }
.job-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; margin: 0; }
.job-money div { display: flex; justify-content: space-between; gap: 8px; }
.job-money dt { color: var(--muted); font-size: .84rem; }
.job-money dd { margin: 0; font-size: .92rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.job-cancel { justify-self: end; }
.job-items { margin: 7px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.job-items li::before { content: "• "; color: var(--accent); }
.grid-jobs .stat-wage { grid-column: 1 / -1; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.segmented span { display: block; padding: 9px; text-align: center; border-radius: 6px; color: var(--muted); font-size: .95rem; transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.total span:first-child { min-width: 0; }

/* Выплаты мастерам */
.master-total { margin-bottom: 4px; }
.master-row, .master-row:hover { color: var(--text); }
.master-row { margin: 0 -8px; padding: 11px 8px; border-radius: 8px; transition: background .15s; }
.master-row:hover { background: var(--card-2); }
.master-row.selected { background: var(--accent-soft); }
.master-row.selected b { color: var(--accent); }
.side-link { margin-bottom: 12px; font-size: .92rem; }

.stat-hero::after { content: ""; position: absolute; right: -70px; top: -90px; width: 280px; height: 240px; background: radial-gradient(closest-side, rgba(255, 178, 36, .2), transparent); pointer-events: none; }

/* Дождь из долларов при переходе в «Деньги» */
.money-rain { position: fixed; inset: 0; z-index: 1000; overflow: hidden; pointer-events: none; }
.money-rain span { position: absolute; top: -70px; line-height: 1; animation: money-fall linear both; will-change: transform; }
@keyframes money-fall { from { transform: translate3d(0, 0, 0) rotate(0); } 50% { transform: translate3d(var(--sway), 55vh, 0) rotate(calc(var(--spin) / 2)); } to { transform: translate3d(calc(var(--sway) * -.4), calc(100vh + 90px), 0) rotate(var(--spin)); } }

/* Лёха: мини-сценка в шапке */
.topbar { flex-wrap: wrap; height: auto; min-height: var(--topbar); padding-top: 8px; padding-bottom: 0; }
.lekha { position: relative; z-index: 1; order: 3; flex: 0 0 calc(100% + 32px); margin: 0 -16px; height: 46px; overflow: hidden; pointer-events: none; }
.lk-man, .lk-car { pointer-events: auto; }
.lk-yard { position: absolute; inset: 0; opacity: .8; pointer-events: none; }
.lk-yard::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #30343b; }
.lk-street { position: absolute; bottom: 0; height: 8px; background: repeating-linear-gradient(90deg, #8b919b 0 8px, transparent 8px 16px) center 3px / 100% 1.5px no-repeat, #2a2e34; }
.lk-garage { position: absolute; bottom: 3px; width: 44px; height: 31px; padding: 5px 4px 0; background: #5d5448; border-top: 3px solid #2b2d31; }
.lk-door { height: 100%; font: 700 9px/23px var(--font-display); text-align: center; color: #e0dac8; background: linear-gradient(90deg, transparent 49%, rgba(0, 0, 0, .55) 49% 51%, transparent 51%), #3e5a4a; transition: background .15s; }
.lk-door-1 { background-color: #6a4a32; }
.lk-door-2 { background-color: #44566b; }
.lk-door-3 { background-color: #5a5d63; }
.lk-door.open { color: transparent; background: #08090b; }
.lk { position: absolute; left: 0; bottom: 3px; will-change: transform; }
.lk-figure { display: block; width: 100%; height: 100%; }
.lk-flip { transform: scaleX(-1); }
.lk-man { width: 30px; height: 40px; cursor: pointer; }
.lk-man.lk-hidden { visibility: hidden; }
.lk-man .lk-figure path, .lk-worker .lk-figure path { fill: none; stroke: #eef0f3; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lk-man .lk-figure path[fill], .lk-worker .lk-figure path[fill] { stroke: none; }
.lk-man .lk-figure path[fill="#3a2a1c"] { fill: #3a2a1c; }
.lk-worker .lk-figure path[fill="#2f63c4"] { fill: #2f63c4; }
.lk-leg { transform-box: fill-box; transform-origin: 50% 0; }
.lk-running .lk-leg-a { animation: lk-step .32s ease-in-out infinite alternate; }
.lk-running .lk-leg-b { animation: lk-step .32s ease-in-out infinite alternate-reverse; }
.lk-arm { transform-box: fill-box; transform-origin: 50% 0; }
.lk-running .lk-arm { animation: lk-step .32s ease-in-out infinite alternate-reverse; }
.lk-running .lk-arm-b { animation-direction: alternate; }
@keyframes lk-step { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
.lk-phone { position: absolute; top: -2px; right: -8px; display: none; font-size: 13px; }
.lk-ringing .lk-phone { display: block; animation: lk-ring .16s linear infinite alternate; }
@keyframes lk-ring { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
.lk-man.lk-jump { bottom: 3px; }
.lk-man.lk-jump .lk-figure { animation: lk-hop .4s ease-out; }
@keyframes lk-hop { 40% { translate: 0 -9px; } }
.lk-worker { width: 30px; height: 40px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.lk-worker.on { opacity: 1; }
.lk-visitor-car { display: none; width: 88px; height: 36px; pointer-events: none; }
.lk-visitor-car.on { display: block; }
.lk-client .lk-figure path[fill="#6b4a2c"] { fill: #6b4a2c; }
.lk-egor .lk-figure path[fill="#d6453d"] { fill: #d6453d; }
.lk-painter .lk-figure path[fill="#d7dade"] { fill: #d7dade; }
.lk-bubble.egor { background: #c3e88d; }
.lk-bubble.painter { background: #d9c8ff; }
.lk-trailer { display: none; width: 68px; height: 32px; }
.lk-trailer.on { display: block; }
.lk-gone-1 .lk-load-1, .lk-gone-2 .lk-load-2, .lk-gone-3 .lk-load-3 { display: none; }
.lk-pile { display: none; font-size: 13px; letter-spacing: -3px; white-space: nowrap; }
.lk-pile.on { display: block; }
.lk-stove { display: none; width: 30px; height: 40px; }
.lk-stove.on { display: block; }
.lk-fire { animation: lk-fire .3s ease-in-out infinite alternate; }
.lk-stoked .lk-fire { fill: #ffd34d; filter: drop-shadow(0 0 5px #ff8a1e); }
@keyframes lk-fire { from { opacity: .65; } to { opacity: 1; } }
.lk-log { position: absolute; left: 0; bottom: 14px; font-size: 14px; }
.lk-log span { display: block; animation: lk-log .65s ease-in both; }
@keyframes lk-log { 50% { translate: calc(var(--dx) * .5) -14px; rotate: 180deg; } 100% { translate: var(--dx) 2px; rotate: 360deg; opacity: .4; } }
.lk-car { width: 96px; height: 42px; display: none; cursor: pointer; }
.lk-car.on { display: block; }
.lk-beep { position: absolute; top: -3px; left: 30px; display: none; padding: 0 4px; font-size: 10px; font-weight: 800; color: var(--accent-text); background: var(--accent); border-radius: 4px; }
.lk-honk .lk-beep { display: block; }
.lk-puff { position: absolute; left: 0; bottom: 8px; font-size: 18px; }
.lk-puff span { display: block; animation: lk-puff 1.3s ease-out both; }
@keyframes lk-puff { 0% { opacity: 0; scale: .5; } 20% { opacity: 1; } 100% { opacity: 0; scale: 1.7; translate: -8px -12px; } }
.lk-toilet { display: none; width: 30px; height: 40px; font-size: 27px; line-height: 40px; text-align: center; }
.lk-toilet.on { display: block; }
.lk-toilet.lk-busy { animation: lk-ring .14s linear infinite alternate; }
.lk-laughing .lk-figure { animation: lk-laugh .22s ease-in-out infinite alternate; }
@keyframes lk-laugh { from { translate: 0 0; rotate: -5deg; } to { translate: 0 -4px; rotate: 5deg; } }
.lk-bubble { position: absolute; top: 3px; left: 0; display: none; padding: 2px 7px; font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; border-radius: 9px; color: #17191d; background: #eef0f3; pointer-events: none; }
.lk-bubble.on { display: block; }
.lk-bubble.client { background: #ffcf73; }
.lk-bubble.worker { background: #a9c6ff; }
.lk-bubble.wife { background: #ffb3c7; }
@media (min-width: 960px) {
  .topbar { flex-wrap: nowrap; height: var(--topbar); padding-top: 0; }
  .lekha { order: 0; flex: 1 1 0; min-width: 0; margin: 0 20px; height: 100%; }
}

/* Заголовок сайта */
.site-title span { display: inline-block; margin-right: .3em; animation: word-in .55s both; transition: color .15s, transform .15s; }
.site-title span:last-child { margin-right: 0; }
.site-title span:nth-child(2) { animation-delay: .12s; }
.site-title span:nth-child(3) { animation-delay: .24s; }
.site-title span:hover { color: var(--accent); transform: translateY(-1px); }
@keyframes word-in { from { transform: translateY(5px); } to { transform: none; } }

/* Дальний свет: фара дважды моргает и подсвечивает одно слово */
.brand { position: relative; }
.site-title { position: relative; z-index: 1; }
.site-title span.lit { animation: word-flash .8s ease-out both; }
.ic.high-beam { animation: icon-flash .8s ease-out both; }
.beam { position: absolute; top: 50%; height: 46px; opacity: 0; pointer-events: none; transform: translateY(-50%); clip-path: polygon(0 38%, 100% 0, 100% 100%, 0 62%); background: linear-gradient(90deg, rgba(255, 244, 200, .85), rgba(255, 226, 150, .22)); }
.beam.on { animation: beam-flash .8s ease-out both; }
@keyframes beam-flash { 0%, 100% { opacity: 0; } 12% { opacity: 1; } 28% { opacity: .1; } 44% { opacity: 1; } 75% { opacity: .55; } }
@keyframes icon-flash { 0%, 100% { color: var(--accent); filter: none; } 12%, 44% { color: #fff; filter: drop-shadow(0 0 7px #fff) drop-shadow(0 0 16px var(--accent)); } 28% { color: var(--accent); filter: none; } 75% { color: #fff4c8; filter: drop-shadow(0 0 6px var(--accent)); } }
@keyframes word-flash { 0%, 100% { color: inherit; text-shadow: none; } 12%, 44% { color: #fff; text-shadow: 0 0 6px #fff, 0 0 16px #ffe6a3, 0 0 32px var(--accent); } 28% { color: inherit; text-shadow: none; } 75% { color: #fff8e0; text-shadow: 0 0 10px var(--accent); } }

/* Запись клиентов */
.head-actions, .day-actions, .booking-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head-actions a.btn { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 10px 14px; }
.day-actions { margin-bottom: 10px; }
.day-actions a.btn.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; margin: 0; padding: 10px 14px; }
.day-actions button { padding: 10px 14px; }
.flash.warn { background: var(--warn-bg); border-left-color: var(--accent); }
.load-bar { display: block; width: 100%; height: 5px; margin-top: 3px; border-radius: 3px; overflow: hidden; background: var(--line); }
.load-bar span { display: block; height: 100%; background: var(--ok); }
.load-00 { width: 0; } .load-10 { width: 10%; } .load-20 { width: 20%; } .load-30 { width: 30%; } .load-40 { width: 40%; } .load-50 { width: 50%; }
.load-60 { width: 60%; } .load-70 { width: 70%; } .load-80 { width: 80%; } .load-90 { width: 90%; } .load-100 { width: 100%; }
.cal-day.load-mid .load-bar span { background: var(--accent); }
.cal-day.load-high .load-bar span, .cal-day.load-over .load-bar span { background: var(--bad); }
.cal-day.load-low { border-color: rgba(85, 217, 143, .35); }
.cal-day.load-mid { border-color: var(--warn-line); background: var(--accent-soft); }
.cal-day.load-high { border-color: rgba(255, 128, 120, .5); background: rgba(255, 128, 120, .1); }
.cal-day.load-over { border-color: var(--bad); background: var(--bad-bg); }
.cal-day.load-off { background: repeating-linear-gradient(135deg, var(--bg), var(--bg) 6px, var(--card-2) 6px, var(--card-2) 12px); color: var(--muted); }
.cal-free { font-size: .72rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-day.load-over .cal-free { color: var(--bad); font-weight: 700; }
.cal-day.selected .cal-free { color: var(--accent-text); }
.cal-day.selected .load-bar span { background: var(--accent-text); }
.cal-warn { margin-left: 2px; color: var(--bad); font-weight: 800; }
.legend::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 3px 0 4px; border-radius: 2px; background: var(--ok); }
.legend.mid::before { background: var(--accent); } .legend.high::before { background: var(--bad); } .legend.over::before { background: var(--bad-bg); outline: 1px solid var(--bad); }
.booking { padding: 13px 0; border-bottom: 1px solid var(--line); }
.booking:last-child { border-bottom: 0; }
.booking-head { display: flex; justify-content: space-between; gap: 12px; }
.booking-sum { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.booking-goods { margin-top: 5px; }
.booking .flash { margin: 7px 0 0; padding: 7px 10px; font-size: .88rem; }
.booking > .muted:last-of-type { margin-top: 5px; }
.booking-actions { margin-top: 10px; }
a.btn.small.primary-small { color: var(--accent-text); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.fit { min-height: 1.3em; margin: -6px 0 6px; font-size: .9rem; color: var(--muted); }
.fit.ok { color: var(--ok); } .fit.bad { color: var(--bad); }
.fit-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fit-days:empty { display: none; }
.fit-days button { min-height: 0; padding: 5px 10px; font-size: .84rem; border-radius: 14px; }
.service-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 10px; }
.service-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.service-row:last-child { border-bottom: 0; }

/* Компьютер: нижняя панель становится боковым меню */
@media (min-width: 960px) {
  body { padding-bottom: 28px; }
  body.signed-in main { margin-left: max(236px, calc((100vw - 1120px) / 2 + 118px)); margin-right: auto; padding: 24px; }
  .bottom { top: var(--topbar); inset: var(--topbar) auto 0 0; width: 220px; display: flex; flex-direction: column; gap: 3px; padding: 16px 12px; background: var(--card); border-top: 0; border-right: 1px solid var(--line); }
  .bottom a, .bottom a.desk-only { display: flex; flex-direction: row; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .95rem; }
  .bottom a:hover { background: var(--card-2); }
  .bottom a.on { background: var(--accent-soft); }
  .bottom a.main-action { order: -1; margin: 0 0 10px; padding: 11px 12px; box-shadow: none; }
  .bottom a.main-action:hover { background: var(--accent-hover); }
  .grid-home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-home .stat-hero { grid-column: span 2; grid-row: span 2; }
  .actions { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .columns.two { grid-template-columns: minmax(0, 1fr) 320px; }
  .columns.two .col-side { grid-column: 2; grid-row: 1; }
  .columns.two .col-main { grid-column: 1; grid-row: 1; }
  .columns h2 { margin-top: 8px; }
  .service-form { grid-template-columns: minmax(0, 1fr) 110px 130px auto; align-items: end; }
  .service-form button { margin-bottom: 12px; width: auto; }
  .cal-free { margin-top: auto; font-size: .8rem; }
  .grid-jobs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid-jobs .stat-wage { grid-column: auto; }
  .jobs-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .jobs-side h2 { margin-top: 0; }
  .cal { padding: 18px; }
  .cal-grid { gap: 6px; }
  .cal-day { align-items: flex-start; min-height: 84px; padding: 8px; }
  .cal-count { position: absolute; top: 7px; right: 7px; }
  .cal-sum { display: block; margin-top: auto; }
  .job { grid-template-columns: minmax(0, 1fr) 380px auto; align-items: center; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
