/* Дуэт — светлый минималистичный кабинет для двоих. Токены и решения описаны в DESIGN.md */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #1b1e24;
  --ink-2: #444a57;
  --muted: #7b8294;
  --line: #e4e7ec;
  --line-2: #eef0f4;
  --a: #3b6ff5;  --a-soft: #e8eefe; --a-ink: #2550c8;
  --b: #e09a2f;  --b-soft: #fcf0dc; --b-ink: #92590a;
  --both: #22a463; --both-soft: #dff4e8; --both-ink: #16764a;
  --danger: #d9443f; --danger-soft: #fdeceb;
  --busy: #e9ebef; --busy-ink: #6b7282;
  --focus: 0 0 0 3px rgba(59, 111, 245, .28);
  --r-lg: 14px; --r-md: 10px; --r-sm: 7px;
  --shadow-pop: 0 12px 32px rgba(27, 30, 36, .12), 0 2px 6px rgba(27, 30, 36, .06);
  --font: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--a-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- загрузка ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 28px; position: relative; }
.boot-mark::before, .boot-mark::after { content: ""; position: absolute; top: 0; width: 28px; height: 28px; border-radius: 50%; mix-blend-mode: multiply; animation: breathe 1.4s ease-in-out infinite alternate; }
.boot-mark::before { left: 0; background: var(--a); }
.boot-mark::after { right: 0; background: var(--b); animation-delay: .2s; }
@keyframes breathe { from { opacity: .35; } to { opacity: .9; } }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: #d6dae2; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c313b; border-color: #2c313b; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(27, 30, 36, .05); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #f4c7c4; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 14px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: rgba(27, 30, 36, .06); }
.icon-btn svg { width: 19px; height: 19px; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; line-height: 17px; text-align: center; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .textarea, .select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:hover, .textarea:hover, .select:hover { border-color: #d3d7df; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--a); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #a3a9b6; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form { display: grid; gap: 16px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 0; }
.hint { font-size: 13px; color: var(--muted); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--line-2); border-radius: var(--r-md); }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 30, 36, .1); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 40px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); cursor: pointer; font-weight: 500; color: var(--ink-2); }
.days button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }

/* ---------- люди ---------- */
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; color: #fff; flex: none; }
.av.a { background: var(--a); } .av.b { background: var(--b); }
.av.both { background: linear-gradient(90deg, var(--a) 50%, var(--b) 50%); }
.av.lg { width: 34px; height: 34px; font-size: 13px; }
.av.xs { width: 20px; height: 20px; font-size: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.a { background: var(--a); } .dot.b { background: var(--b); } .dot.both { background: var(--both); }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand svg { width: 38px; height: 24px; flex: none; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.2; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: var(--r-md); color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav a svg { width: 19px; height: 19px; color: var(--muted); }
.nav a:hover { background: rgba(27, 30, 36, .05); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.nav a[aria-current="page"] svg { color: var(--ink); }
.nav .count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-md); }
.person .who { min-width: 0; line-height: 1.25; }
.person .who b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who span { font-size: 12.5px; color: var(--muted); }
.person.invite { border: 1px dashed #cfd4dd; color: var(--ink-2); cursor: pointer; background: transparent; text-align: left; width: 100%; }
.person.invite:hover { border-color: var(--a); color: var(--a-ink); }
.main { min-width: 0; padding: 22px 32px 64px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; min-height: 40px; }
.top h1 { font-size: 22px; }
.top .sub { color: var(--muted); font-size: 14px; }
.top .spacer { flex: 1; }
.tabbar, .fab { display: none; }

/* ---------- общие блоки ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.panel-head h2 { font-size: 15px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 10px 18px 16px; }
.empty { padding: 18px 0 6px; color: var(--muted); font-size: 14px; }
.empty b { color: var(--ink-2); font-weight: 500; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); min-height: 48px; }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .m { display: block; font-size: 13px; color: var(--muted); }
.li.clickable { cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: var(--r-sm); }
.li.clickable:hover { background: var(--surface-2); }
.time-col { width: 82px; flex: none; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 14px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip svg { width: 13px; height: 13px; }
.chip.late { background: var(--danger-soft); color: var(--danger); }
.chip.today { background: #fff3d6; color: #8a5a00; }
.chip.flag { background: transparent; color: var(--danger); padding: 0 2px; }
.chip.done { background: var(--both-soft); color: var(--both-ink); }

/* ---------- сводка ---------- */
.greet { margin: 4px 0 24px; }
.greet h1 { font-size: 28px; letter-spacing: -0.02em; }
.greet p { margin: 4px 0 0; color: var(--muted); }
.ov { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ov .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.windows .li { border-top-color: var(--line-2); }
.win-bar { width: 6px; align-self: stretch; border-radius: 3px; background: var(--both); flex: none; }
.strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; padding: 6px 0 2px; }
.strip button { border: 0; background: transparent; padding: 6px 0 8px; border-radius: var(--r-sm); cursor: pointer; display: grid; justify-items: center; gap: 4px; color: var(--ink-2); }
.strip button:hover { background: var(--surface-2); }
.strip .wd { font-size: 11.5px; color: var(--muted); }
.strip .dn { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.strip .is-today .dn { background: var(--ink); color: #fff; }
.strip .is-weekend .dn { color: var(--muted); }
.strip .marks { display: flex; gap: 3px; height: 6px; }
.strip .marks i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); }
.strip .marks i.late { background: var(--danger); }
.strip .marks i.ev { background: var(--both); }
.strip-sep { grid-column: 8; }
.feed .li { align-items: flex-start; }
.feed .li .t { white-space: normal; }
.feed q { quotes: "«" "»"; }

/* ---------- задачи ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); }
.search .input { padding-left: 34px; width: 220px; height: 38px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: rgba(27, 30, 36, .028); border-radius: var(--r-lg); padding: 10px; min-height: 160px; transition: background .15s, box-shadow .15s; }
.col.drop { background: var(--a-soft); box-shadow: inset 0 0 0 2px rgba(59, 111, 245, .35); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.col-head h2 { font-size: 14px; }
.col-head .n { color: var(--muted); font-size: 13px; font-weight: 500; }
.col-head .ring { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); }
.col-head .ring.doing { border-color: var(--a); border-right-color: transparent; }
.col-head .ring.done { border-color: var(--both); background: var(--both); }
.cards { display: grid; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 12px 10px; cursor: pointer; display: grid; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: #cfd4dd; box-shadow: 0 2px 8px rgba(27, 30, 36, .05); }
.card.dragging { opacity: .45; }
.card .title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.card.is-done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: #c5cad3; }
.card .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card .meta .spacer { flex: 1; }
.card .cm { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.card .cm svg { width: 14px; height: 14px; }
.quick { display: flex; gap: 6px; margin-bottom: 8px; }
.quick .input { height: 36px; background: var(--surface); }
.col-more { width: 100%; margin-top: 6px; }
.mobile-cols { display: none; margin-bottom: 12px; }

/* ---------- боковая панель и окна ---------- */
.scrim { position: fixed; inset: 0; background: rgba(27, 30, 36, .22); z-index: 40; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: slide .18s ease-out; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.drawer-head .spacer { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 24px; display: grid; gap: 18px; align-content: start; }
.title-edit { width: 100%; border: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; padding: 4px 6px; margin: -4px -6px; border-radius: var(--r-sm); resize: none; line-height: 1.3; background: transparent; overflow: hidden; }
.title-edit:hover { background: var(--surface-2); }
.title-edit:focus { outline: none; box-shadow: var(--focus); background: var(--surface); }
.props { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px 10px; align-items: center; }
.props > span { color: var(--muted); font-size: 14px; }
.props > .seg { justify-self: start; max-width: 100%; overflow-x: auto; }
.created { font-size: 13px; color: var(--muted); }
.comments { display: grid; gap: 14px; }
.comments h3 { font-size: 15px; }
.cmt { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.cmt .bubble { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px var(--r-md) var(--r-md) var(--r-md); padding: 8px 12px; }
.cmt .head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.cmt .head b { font-weight: 600; }
.cmt .head .acts { margin-left: auto; display: flex; gap: 2px; }
.cmt .head .acts button { border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 0 4px; }
.cmt .head .acts button:hover { color: var(--ink); }
.cmt .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.composer { display: grid; gap: 8px; position: sticky; bottom: -24px; background: var(--surface); padding: 6px 0 4px; }
.composer .textarea { min-height: 64px; }

.modal-wrap { position: fixed; inset: 0; z-index: 41; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { width: min(500px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); animation: rise .18s ease-out; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 18px 4px 22px; }
.modal-head h2 { font-size: 18px; flex: 1; }
.modal-body { padding: 12px 22px 8px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; }
.modal-foot .left { margin-right: auto; }

.pop { position: fixed; z-index: 42; width: min(380px, calc(100vw - 24px)); max-height: min(560px, 80vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 8px 16px 12px; animation: rise .15s ease-out; }
.pop h3 { font-size: 15px; padding: 8px 0 4px; }
.feed .new .t::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 7px; vertical-align: 2px; }

#toasts { position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-md); font-size: 14px; box-shadow: var(--shadow-pop); animation: rise .18s ease-out; pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast.err { background: var(--danger); }
.toast button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font-weight: 500; }

/* ---------- календарь ---------- */
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-range { font-weight: 600; font-size: 15px; min-width: 150px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: -6px 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 8px; border-radius: 3px; display: inline-block; }
.legend i.a { background: var(--a); opacity: .55; } .legend i.b { background: var(--b); opacity: .6; }
.legend i.both { background: var(--both); } .legend i.busy { background: repeating-linear-gradient(135deg, #cfd3db 0 2px, var(--busy) 2px 5px); }
.weeks { display: grid; gap: 14px; }
.week-label { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 6px 2px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.day { min-height: 150px; padding: 8px 8px 10px; border-left: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; transition: background .12s; }
.day:first-child { border-left: 0; }
.day:hover { background: var(--surface-2); }
.day.past { background: #fbfbfc; }
.day.past .day-items { opacity: .62; }
.day-head { display: flex; align-items: baseline; gap: 6px; }
.day-head .n { font-weight: 600; font-variant-numeric: tabular-nums; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin: -2px 0 0 -2px; }
.day-head .w { font-size: 12.5px; color: var(--muted); }
.day.today .day-head .n { background: var(--ink); color: #fff; }
.day.weekend .day-head .w { color: #b0b5c0; }
.day-items { display: grid; gap: 3px; min-width: 0; }
.it { display: flex; gap: 5px; align-items: baseline; font-size: 12.5px; line-height: 1.3; padding: 3px 6px; border-radius: 5px; min-width: 0; }
.it .tm { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 500; flex: none; }
.it .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.it.ev { background: var(--both-soft); color: var(--both-ink); }
.it.ev.a { background: var(--a-soft); color: var(--a-ink); }
.it.ev.b { background: var(--b-soft); color: var(--b-ink); }
.it.dl { background: transparent; padding-left: 4px; color: var(--ink-2); }
.it.dl::before { content: ""; width: 9px; height: 9px; border: 1.6px solid currentColor; border-radius: 3px; flex: none; translate: 0 1px; }
.it.dl.late { color: var(--danger); }
.it.dl.done { color: var(--muted); text-decoration: line-through; }
.it.more { color: var(--muted); padding-left: 6px; }
.ribbon { margin-top: auto; display: grid; gap: 2px; padding-top: 6px; position: relative; }
.ribbon .track { position: relative; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.ribbon .seg-a, .ribbon .seg-b, .ribbon .seg-x { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.ribbon .seg-a { background: var(--a); opacity: .5; }
.ribbon .seg-b { background: var(--b); opacity: .6; }
.ribbon .seg-x { background: var(--both); opacity: 1; }
.ribbon .both-line { position: absolute; left: 0; right: 0; top: 6px; height: 12px; pointer-events: none; }
.ribbon .both-line i { position: absolute; top: 0; bottom: 0; background: var(--both); border-radius: 3px; opacity: .18; }

/* неделя по часам */
.wk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.wk-scroll { overflow-x: auto; }
.wk-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(108px, 1fr)); min-width: 820px; }
.wk-hd { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 8px 6px; font-size: 13px; z-index: 2; min-height: 64px; border-left: 1px solid var(--line-2); }
.wk-hd b { font-size: 15px; font-weight: 600; margin-right: 4px; }
.wk-hd.today b { color: #fff; background: var(--ink); border-radius: 50%; display: inline-grid; place-items: center; width: 26px; height: 26px; }
.wk-hd .dls { display: grid; gap: 2px; margin-top: 4px; }
.wk-hours { position: relative; }
.wk-hours span { position: absolute; right: 8px; font-size: 11.5px; color: var(--muted); translate: 0 -50%; font-variant-numeric: tabular-nums; }
.wk-col { position: relative; border-left: 1px solid var(--line-2); cursor: crosshair; background-image: linear-gradient(var(--line-2) 1px, transparent 1px); }
.wk-col.past { background-color: #fbfbfc; }
.blk { position: absolute; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; min-height: 14px; }
.blk.free-a { background: var(--a-soft); box-shadow: inset 3px 0 0 var(--a); color: var(--a-ink); }
.blk.free-b { background: var(--b-soft); box-shadow: inset 3px 0 0 var(--b); color: var(--b-ink); }
.blk.both { background: var(--both-soft); box-shadow: inset 0 0 0 1.5px rgba(34, 164, 99, .55); color: var(--both-ink); font-weight: 500; }
.blk.busy { background: repeating-linear-gradient(135deg, #e3e6eb 0 2px, var(--busy) 2px 6px); color: var(--busy-ink); }
.blk.ev { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(27, 30, 36, .08), inset 3px 0 0 var(--both); color: var(--ink); z-index: 1; cursor: pointer; }
.blk.ev.a { box-shadow: 0 1px 3px rgba(27, 30, 36, .08), inset 3px 0 0 var(--a); }
.blk.ev.b { box-shadow: 0 1px 3px rgba(27, 30, 36, .08), inset 3px 0 0 var(--b); }
.blk .bt { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---------- время ---------- */
.tw { display: grid; gap: 6px; }
.tw-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.tw-row .wd { font-size: 13px; color: var(--muted); font-weight: 500; }
.tw-bar { position: relative; height: 30px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); overflow: hidden; }
.tw-bar .la, .tw-bar .lb { position: absolute; left: 0; right: 0; height: 50%; }
.tw-bar .la { top: 0; } .tw-bar .lb { bottom: 0; }
.tw-bar i { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; }
.tw-bar .la i { background: var(--a); opacity: .45; }
.tw-bar .lb i { background: var(--b); opacity: .55; }
.tw-bar .lx i { position: absolute; top: 0; bottom: 0; background: var(--both); opacity: .9; border-radius: 4px; }
.tw-bar .lx { position: absolute; inset: 0; }
.tw-scale { position: relative; height: 16px; margin-left: 44px; font-size: 11.5px; color: var(--muted); }
.tw-scale span { position: absolute; translate: -50% 0; font-variant-numeric: tabular-nums; }
.slots-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 2px 8px; border-radius: 6px; }
.kind.free { background: var(--both-soft); color: var(--both-ink); }
.kind.busy { background: var(--busy); color: var(--busy-ink); }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border-right: 1px solid var(--line); }
.auth-side .brand svg { width: 52px; height: 32px; }
.auth-side .brand b { font-size: 22px; }
.auth-art { width: min(420px, 100%); }
.auth-side h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; max-width: 440px; margin-top: 28px; }
.auth-side p { color: var(--muted); max-width: 400px; margin: 12px 0 0; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(380px, 100%); display: grid; gap: 18px; }
.auth-card h2 { font-size: 22px; }
.auth-card .lead { margin: -10px 0 0; color: var(--muted); }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw button { position: absolute; right: 4px; top: 2px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 1180px) {
  .ov { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 5px 0; font-size: 11.5px; color: var(--muted); font-weight: 500; text-decoration: none; border-radius: var(--r-md); }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; z-index: 31; box-shadow: 0 8px 20px rgba(27, 30, 36, .25); cursor: pointer; }
  .fab svg { width: 24px; height: 24px; }
  .top .desk { display: none; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board .col { display: none; }
  .board .col.on { display: block; }
  .mobile-cols { display: flex; }
  .slots-grid { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px 22px 8px; border: 0; background: transparent; }
  .auth-side .auth-art, .auth-side p.foot { display: none; }
  .auth-side h1 { font-size: 26px; margin-top: 18px; }
}
@media (max-width: 760px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; border-left: 0; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 10px; padding: 10px 12px; }
  .day:first-child { border-top: 0; }
  .day-head { flex-direction: column; align-items: flex-start; gap: 0; grid-row: span 2; }
  .day-items { grid-column: 2; }
  .day .ribbon { grid-column: 2; margin-top: 4px; }
  .day.empty-day .day-items:empty { display: none; }
  .top { flex-wrap: wrap; row-gap: 8px; margin-bottom: 16px; }
  .top h1 { font-size: 20px; }
  .cal-range { min-width: 0; font-size: 14px; }
  .toolbar .search .input { width: 100%; }
  .toolbar .search { flex: 1; }
  .greet h1 { font-size: 23px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .props { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .props > span { margin-top: 6px; }
  .drawer-body { padding: 16px; }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; width: 100%; max-height: 92vh; overflow-y: auto; }
  .strip { gap: 0; overflow-x: auto; }
  .strip button { padding: 4px 0 6px; }
  .strip .wd { font-size: 10.5px; }
  .strip .dn { width: 22px; height: 22px; font-size: 12px; }
  .li .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .panel-head { padding: 12px 12px 0; }
  .panel-body { padding: 8px 12px 12px; }
  .li.clickable { margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
}
