/* Task Manager — «кишеньковий» інтерфейс: великі рядки, нижні вкладки на телефоні, жовтий «сьогодні». */
:root {
  color-scheme: dark;
  --bg: #151a2b; --surface: #1d2338; --surface-2: #262d47; --line: rgba(255,255,255,.08); --line-strong: rgba(255,255,255,.22);
  --text: #eef0f7; --text-2: #aab1c7; --muted: #7d859e;
  --accent: #f6c343; --accent-ink: #1d1704; --accent-soft: rgba(246,195,67,.14); --accent-text: #f6c343;
  --blue: #7ea6ff; --blue-soft: rgba(126,166,255,.14);
  --ok: #43c38a; --ok-soft: rgba(67,195,138,.15);
  --danger: #ff7a6e; --danger-soft: rgba(255,122,110,.14);
  --violet: #b59cff; --violet-soft: rgba(181,156,255,.15);
  --hover: rgba(255,255,255,.04); --press: rgba(255,255,255,.08);
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --tab-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f8; --surface: #ffffff; --surface-2: #eceef4; --line: rgba(20,24,44,.09); --line-strong: rgba(20,24,44,.25);
  --text: #171a26; --text-2: #4a5068; --muted: #6b7189;
  --accent: #f4b92b; --accent-ink: #1d1704; --accent-soft: rgba(244,185,43,.2); --accent-text: #8a5a00;
  --blue: #2f5bd8; --blue-soft: rgba(47,91,216,.1);
  --ok: #138050; --ok-soft: rgba(19,128,80,.1);
  --danger: #c8372d; --danger-soft: rgba(200,55,45,.09);
  --violet: #6a48d6; --violet-soft: rgba(106,72,214,.1);
  --hover: rgba(20,24,44,.035); --press: rgba(20,24,44,.07);
  --shadow: 0 10px 40px rgba(20,24,44,.18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px/22px Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "tnum"; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 24px; height: 24px; }
.small { font-size: 13px; line-height: 18px; color: var(--text-2); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- каркас ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; padding: 0 10px 14px; }
.brand b { width: 28px; height: 28px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.brand b .i { width: 16px; height: 16px; stroke-width: 2.6; }
.side .new { margin: 0 0 12px; justify-content: flex-start; }
.nav-i { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; width: 100%; text-align: left; }
.nav-i:hover { background: var(--hover); color: var(--text); }
.nav-i.on { background: var(--surface); color: var(--text); }
.nav-i.on .i { color: var(--accent); }
.nav-i .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav-i .dot { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.side .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.side .grow { flex: 1; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; color: var(--text-2); }
.main { flex: 1; min-width: 0; }
.page { max-width: 760px; margin: 0 auto; padding: 28px 24px 120px; }
.page.wide { max-width: none; }

/* верхня частина сторінки: великий заголовок як в iOS */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top h1 { font-size: 30px; line-height: 36px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.top h1 .i { width: 26px; height: 26px; color: var(--accent); }
.top h1 .i.star { fill: var(--accent); }
.top .sub { margin-top: 2px; color: var(--text-2); font-size: 14px; }
.top .acts { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-text); font-weight: 700; margin: -4px 0 8px -6px; height: 32px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 0; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { color: var(--text); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.flash { background: var(--accent-soft); color: var(--text); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; font-weight: 600; }

/* прогрес дня */
.day-progress { display: flex; align-items: center; gap: 12px; margin: -6px 0 20px; }
.day-progress .track { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.day-progress .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.day-progress span { font-size: 13px; color: var(--text-2); font-weight: 700; white-space: nowrap; }

/* сегменти (Усі / Олена / Я) і вкладки виглядів */
.seg { display: inline-flex; background: var(--surface); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { height: 32px; padding: 0 14px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-2); white-space: nowrap; background: none; border: 0; font-family: inherit; cursor: pointer; }
.seg a.on, .seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- кнопки, поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-md); border: 0; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ghost { background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.big { height: 52px; font-size: 16px; border-radius: 14px; flex: 1; min-width: 0; padding: 0 12px; }
.btn.block { width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
.in, input[type=text], input[type=date], input[type=datetime-local], input[type=number], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-weight: 500; }
textarea { resize: vertical; line-height: 22px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 13px; font-weight: 700; color: var(--text-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; }
.search { position: relative; flex: 1; min-width: 180px; }
.search .i { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search input { padding-left: 40px; }
.pill-select { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.pill-select.on { background: var(--accent-soft); color: var(--accent-text); }
.pill-select select { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }

/* ---------- списки задач ---------- */
.sec { margin-bottom: 26px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; }
.sec-h h2 { font-size: 17px; font-weight: 800; }
.sec-h .n { color: var(--muted); font-weight: 700; font-size: 14px; }
.sec-h .act { margin-left: auto; color: var(--accent-text); font-weight: 700; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 0; }
.sec.danger .sec-h h2 { color: var(--danger); }
.sec.returned .sec-h h2 { color: var(--violet); }
details.sec > summary { list-style: none; cursor: pointer; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .sec-h::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); margin-left: 6px; transition: transform .2s; align-self: center; }
details.sec[open] > summary .sec-h::after { transform: rotate(45deg); }
.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.task { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; position: relative; transition: opacity .3s, transform .3s; }
.task + .task::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line); }
.task:hover { background: var(--hover); }
.task .body { flex: 1; min-width: 0; }
.task .ttl { display: block; font-weight: 700; font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.task .ttl::after { content: ""; position: absolute; inset: 0; } /* весь рядок клікабельний */
.task .tick, .task .row-act { position: relative; z-index: 1; }
.task .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--muted); font-weight: 600; }
.task .meta > span { display: inline-flex; align-items: center; gap: 4px; }
.task .meta .i { width: 14px; height: 14px; }
.task .meta .late { color: var(--danger); }
.task .meta .today { color: var(--accent-text); }
.task .meta .high { color: var(--danger); }
.task .meta .rev { color: var(--violet); }
.task .meta .doing { color: var(--blue); }
.task .meta .proj::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.task.done .ttl { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task.leaving { opacity: 0; transform: translateX(24px); }
.task .row-acts { display: flex; gap: 8px; margin-top: 10px; }
.task .row-acts .btn:not(.ok) { background: var(--surface-2); }
.task .note { margin-top: 6px; font-size: 13px; color: var(--violet); font-weight: 600; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; margin-top: -1px; }
.avatar.me { background: var(--blue-soft); color: var(--blue); }
.kind { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); }

/* кружечок виконання (Todoist/Things): колір обідка = пріоритет */
.tick { width: 24px; height: 24px; margin-top: -1px; border-radius: 50%; border: 2px solid var(--line-strong); background: none; padding: 0; cursor: pointer; display: grid; place-items: center; color: transparent; flex-shrink: 0; transition: background .15s, border-color .15s; }
.tick .i { width: 14px; height: 14px; stroke-width: 3; }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.tick.high { border-color: var(--danger); background: var(--danger-soft); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick.rev { border-color: var(--violet); border-style: dashed; }
.tick:disabled { cursor: default; opacity: .6; }

.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty > .i { width: 44px; height: 44px; color: var(--accent); stroke-width: 1.6; margin-bottom: 10px; }
.empty h3 { font-size: 18px; margin-bottom: 4px; color: var(--text); }
.inline-empty { padding: 18px 16px; color: var(--muted); }

/* ---------- картка задачі ---------- */
.td-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.td-head .tick { width: 30px; height: 30px; margin-top: 6px; }
.td-head .tick .i { width: 17px; height: 17px; }
.td-title { flex: 1; font-size: 24px; line-height: 32px; font-weight: 800; letter-spacing: -.02em; background: none; border: 0; padding: 4px 0; resize: none; min-height: 0; overflow: hidden; }
.td-title:focus { border: 0; }
.td-notes { background: none; border: 0; padding: 0 0 0 44px; min-height: 0; color: var(--text-2); resize: none; overflow: hidden; }
.td-notes:focus { border: 0; color: var(--text); }
.banner { border-radius: var(--r-md); padding: 14px 16px; margin: 14px 0; font-weight: 600; }
.banner.rev { background: var(--violet-soft); }
.banner.rev b { color: var(--violet); }
.banner.ret { background: var(--violet-soft); color: var(--text); }
.banner .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.banner .row input { flex: 1; min-width: 180px; background: var(--surface); }
.props { background: var(--surface); border-radius: var(--r-lg); margin: 18px 0; overflow: hidden; }
.prop { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; position: relative; }
.prop + .prop::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 1px; background: var(--line); }
.prop > .i { color: var(--muted); }
.prop .k { color: var(--text-2); font-weight: 600; flex-shrink: 0; }
.prop .v { margin-left: auto; text-align: right; font-weight: 700; min-width: 0; display: flex; justify-content: flex-end; }
.prop .v select, .prop .v input { background: none; border: 0; min-height: 40px; padding: 0; text-align: right; text-align-last: right; width: auto; max-width: 220px; font-weight: 700; color: var(--text); cursor: pointer; }
.prop .v input[type=number] { width: 80px; }
.prop .v input[type=text] { width: 200px; }
.prop .v select:focus, .prop .v input:focus { color: var(--accent-text); }
.prop.toggle .v input { width: 22px; }
details.more-props > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; color: var(--accent-text); font-weight: 700; }
details.more-props > summary::-webkit-details-marker { display: none; }
details.more-props > summary { border-top: 1px solid var(--line); }

.ck-list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.ck { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; min-height: 48px; position: relative; }
.ck + .ck::before, .ck-add::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
.ck .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: none; padding: 0; cursor: pointer; flex-shrink: 0; }
.ck .box .i { width: 13px; height: 13px; stroke-width: 3.2; }
.ck.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.ck .txt { flex: 1; padding: 12px 0; }
.ck.done .txt { color: var(--muted); text-decoration: line-through; }
.ck .x { background: none; border: 0; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; opacity: 0; }
.ck:hover .x, .ck .x:focus { opacity: 1; }
@media (hover: none) { .ck .x { opacity: .7; } }
.ck-add { display: flex; align-items: center; gap: 12px; padding: 0 16px; position: relative; }
.ck-add .i { color: var(--muted); }
.ck-add input { background: none; border: 0; padding: 0; min-height: 48px; }
.blk-h { display: flex; align-items: baseline; gap: 8px; margin: 26px 4px 10px; }
.blk-h h2 { font-size: 17px; font-weight: 800; }
.blk-h .n { color: var(--muted); font-weight: 700; font-size: 14px; }

/* коментарі як месенджер */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; align-self: flex-start; background: var(--surface); border-radius: 18px 18px 18px 6px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent-soft); border-radius: 18px 18px 6px 18px; }
.msg .who { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.composer textarea { min-height: 46px; max-height: 160px; border-radius: 23px; padding: 11px 16px; resize: none; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 0; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.history { margin-top: 26px; }
.history summary { color: var(--muted); font-weight: 700; cursor: pointer; font-size: 13px; }
.history div { font-size: 13px; color: var(--text-2); padding: 3px 0; }

.actionbar { position: sticky; bottom: 16px; display: flex; gap: 10px; margin-top: 26px; padding: 10px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 20px; z-index: 5; }

/* ---------- нижні вкладки (мобільний) ---------- */
.tabbar { display: none; }
.fab { display: none; }

/* ---------- аркуш швидкого додавання ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(8,10,20,.55); opacity: 0; pointer-events: none; transition: opacity .18s; }
.sheet-wrap.open { opacity: 1; pointer-events: auto; }
.sheet { width: min(640px, calc(100% - 32px)); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 18px 14px; transform: translateY(-8px); transition: transform .2s; }
.sheet-wrap.open .sheet { transform: none; }
.sheet .grab { display: none; }
.qa-title { background: none !important; border: 0 !important; padding: 0 !important; font-size: 19px !important; font-weight: 700 !important; min-height: 32px !important; }
.qa-desc { background: none !important; border: 0 !important; padding: 2px 0 !important; min-height: 26px !important; resize: none; color: var(--text-2) !important; }
.qa-hints { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; margin: 4px 0; }
.qa-hints span { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); }
.qa-items { margin-top: 8px; background: var(--surface-2) !important; font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line-strong); background: none; color: var(--text-2); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.chip-btn .i { width: 15px; height: 15px; }
.chip-btn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.chips.parsed [data-due].on, .chips.parsed #qa-date-chip.on { background: none; border-color: var(--line-strong); color: var(--muted); text-decoration: line-through; }
.chip-btn.on.red { background: var(--danger-soft); color: var(--danger); }
.chip-btn.on.violet { background: var(--violet-soft); color: var(--violet); }
.chip-btn select, .chip-btn input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; width: 100%; padding: 0; }
.chip-btn input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.qa-foot { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.qa-foot .small { flex: 1; }

/* ---------- тост ---------- */
.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; max-width: 520px; bottom: 28px; transform: translateY(20px); z-index: 60; display: flex; align-items: center; gap: 14px; background: #f3f4f8; color: #171a26; padding: 12px 14px 12px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
:root[data-theme="light"] .toast { background: #22263a; color: #fff; }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
body.qa-open .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top, 0px)); }
.toast .t { flex: 1; min-width: 0; }
.toast a, .toast button { color: #8a5a00; background: none; border: 0; font-weight: 800; cursor: pointer; padding: 4px 6px; white-space: nowrap; }
:root[data-theme="light"] .toast a, :root[data-theme="light"] .toast button { color: var(--accent); }
.toast.err .t { color: #b3261e; }
:root[data-theme="light"] .toast.err .t { color: #ffb4ab; }

/* ---------- дошка ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.colm { background: var(--surface); border-radius: var(--r-lg); padding: 10px; min-height: 200px; scroll-snap-align: start; transition: background .15s; }
.colm.over { background: var(--accent-soft); }
.colm h3 { font-size: 15px; font-weight: 800; padding: 4px 6px 10px; display: flex; gap: 8px; align-items: center; }
.colm h3 .n { color: var(--muted); }
.colm h3 .dotc { width: 10px; height: 10px; border-radius: 50%; }
.bcard { display: block; background: var(--surface-2); border-radius: var(--r-md); padding: 12px; margin-bottom: 8px; cursor: grab; }
.bcard .ttl { font-weight: 700; display: block; margin-bottom: 6px; }
.bcard .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); font-weight: 700; align-items: center; }
.bcard .meta .late { color: var(--danger); }

/* ---------- календар ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dh { font-size: 12px; font-weight: 800; color: var(--muted); padding: 0 6px 4px; }
.cal .day { min-height: 108px; background: var(--surface); border-radius: var(--r-md); padding: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.cal .day.out { opacity: .4; }
.cal .day .dn { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--text-2); padding: 0 2px; }
.cal .day.now .dn span { background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 0 6px; }
.cal .day .add { width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; opacity: 0; }
.cal .day:hover .add { opacity: 1; }
.cal .ev { display: block; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 18px; }
.cal .ev.done { color: var(--muted); text-decoration: line-through; }
.cal .ev.overdue { background: var(--danger-soft); color: var(--danger); }
.cal .ev.review { background: var(--violet-soft); color: var(--violet); }

/* ---------- Гант ---------- */
.gwrap { overflow: auto; background: var(--surface); border-radius: var(--r-lg); max-height: calc(100vh - 230px); }
.gantt { position: relative; min-width: 100%; }
.g-head, .g-row { display: flex; }
.g-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
.g-label { width: 240px; flex-shrink: 0; padding: 0 12px; line-height: 36px; position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.g-head .g-label { background: var(--surface-2); z-index: 4; }
.g-days { position: relative; display: flex; }
.g-day { flex-shrink: 0; text-align: center; font-size: 11px; line-height: 18px; color: var(--text-2); padding-top: 2px; }
.g-day.we { background: var(--hover); }
.g-day.now { color: var(--accent-text); font-weight: 800; }
.g-row { border-bottom: 1px solid var(--line); height: 36px; }
.g-row.grp .g-label { font-weight: 800; background: var(--surface-2); }
.g-row.grp .g-track { background: var(--surface-2); }
.g-track { position: relative; flex-shrink: 0; }
.g-bar { position: absolute; top: 7px; height: 22px; border-radius: 7px; color: #fff; font-size: 11px; font-weight: 700; line-height: 22px; padding: 0 8px; overflow: hidden; white-space: nowrap; cursor: grab; user-select: none; touch-action: none; }
.g-bar .pct { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.25); }
.g-bar span { position: relative; }
.g-bar.late { box-shadow: 0 0 0 2px var(--danger); }
.g-bar.done { opacity: .5; }
.g-bar .rs { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; }

/* ---------- різне ---------- */
.menu { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px; }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 16px; width: 100%; background: none; border: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; text-align: left; position: relative; }
.menu a + a::before, .menu a + form::before, .menu form + a::before, .menu a + button::before, .menu button + a::before, .menu form + form::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
.menu form { position: relative; }
.menu .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.menu .ico .i { width: 17px; height: 17px; }
.menu .chev { margin-left: auto; color: var(--muted); }
.menu .sub { margin-left: auto; color: var(--muted); font-size: 13px; }
.kb-body { line-height: 26px; }
.kb-body h2, .kb-body h3, .kb-body h4 { margin: 22px 0 8px; }
.kb-body code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.kb-body ul { padding-left: 22px; }
.kb-body a { color: var(--accent-text); text-decoration: underline; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; padding: 10px 14px; }
table.tbl td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.stat b { display: block; font-size: 30px; line-height: 36px; font-weight: 800; }
.stat span { color: var(--text-2); font-size: 13px; font-weight: 600; }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; min-width: 64px; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(380px, 100%); }
.login .brand { justify-content: center; font-size: 22px; padding-bottom: 24px; }
.login .brand b { width: 40px; height: 40px; border-radius: 12px; }
.login .brand b .i { width: 22px; height: 22px; }
.acct { display: flex; align-items: center; gap: 14px; width: 100%; height: 64px; padding: 0 16px; border-radius: 16px; border: 0; background: var(--surface); cursor: pointer; font-weight: 700; margin-bottom: 10px; text-align: left; }
.acct:hover { background: var(--surface-2); }
.acct .avatar { width: 38px; height: 38px; font-size: 15px; }

/* ---------- телефон ---------- */
@media (max-width: 820px) {
  .side { display: none; }
  .page { padding: 18px 16px calc(var(--tab-h) + 96px + var(--safe-b)); }
  .top h1 { font-size: 28px; line-height: 34px; }
  .top { flex-wrap: wrap; }
  .top .acts { flex-shrink: 1; flex-wrap: wrap; }
  .prop .k { flex-shrink: 1; min-width: 0; line-height: 20px; padding: 8px 0; }
  .prop .v input[type=number] { width: 56px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; }
  .tabbar a .i { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .i { color: var(--accent); }
  .tabbar a.on .i.star { fill: var(--accent); }
  .tabbar a .dot { position: absolute; top: 8px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(var(--tab-h) + 16px + var(--safe-b)); z-index: 41; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor: pointer; }
  .fab .i { width: 28px; height: 28px; stroke-width: 2.6; }
  body.detail .tabbar, body.detail .fab { display: none; }
  body.detail .page { padding-bottom: 40px; }
  .sheet-wrap { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; border-radius: 22px 22px 0 0; padding: 8px 16px calc(14px + var(--safe-b)); transform: translateY(100%); }
  .sheet .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 12px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .qa-foot .small { display: none; }
  .qa-foot .btn { flex: 1; height: 48px; }
  .toast { bottom: calc(var(--tab-h) + 16px + var(--safe-b)); }
  body.detail .toast { bottom: 96px; }
  .row2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 84%); }
  .cal { gap: 2px; }
  .cal .day { min-height: 64px; padding: 4px; }
  .cal .ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; background: var(--accent); }
  .cal .ev.done { background: var(--muted); }
  .cal .ev.overdue { background: var(--danger); }
  .cal .day .add { display: none; }
  .g-label { width: 150px; }
  .prop .v input[type=text] { width: 150px; }
  .actionbar { bottom: calc(10px + var(--safe-b)); }
  .hide-m { display: none !important; }
}
@media (min-width: 821px) { .hide-d { display: none !important; } }

/* ---------- v3: час, блокування, команда ---------- */
.task .meta .blk { color: var(--danger); }
.task .meta .est { color: var(--text-2); }
.task .meta .timer { color: var(--blue); }
.task.blocked .ttl { opacity: .75; }
.banner.blk { background: var(--danger-soft); }
.banner.blk b { color: var(--danger); }
.timerbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 12px 16px; background: var(--surface); border-radius: var(--r-lg); }
.timerbar .t { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.timerbar .of { color: var(--muted); font-weight: 600; font-size: 13px; }
.timerbar .grow { flex: 1; }
.timerbar .bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.timerbar .bar i { display: block; height: 100%; background: var(--blue); }
.timerbar .bar i.over { background: var(--danger); }
.week-strip { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 4px 18px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.week-strip b { color: var(--text); }

.period { margin-bottom: 18px; }
.pcard { display: block; background: var(--surface); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
a.pcard:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pc-head .avatar { width: 38px; height: 38px; font-size: 16px; margin: 0; }
.pc-head h3 { font-size: 18px; font-weight: 800; }
.pc-head .sub { color: var(--muted); font-size: 13px; font-weight: 600; }
.score { margin-left: auto; text-align: center; min-width: 64px; padding: 6px 10px; border-radius: 14px; background: var(--surface-2); }
.score b { display: block; font-size: 24px; line-height: 28px; font-weight: 800; }
.score span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.score.good { background: var(--ok-soft); } .score.good b { color: var(--ok); }
.score.mid { background: var(--accent-soft); } .score.mid b { color: var(--accent-text); }
.score.bad { background: var(--danger-soft); } .score.bad b { color: var(--danger); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi b { display: block; font-size: 22px; line-height: 26px; font-weight: 800; }
.kpi b.good { color: var(--ok); } .kpi b.bad { color: var(--danger); }
.kpi span { display: block; font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 600; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-bottom: 12px; }
.spark i { flex: 1; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.spark i.z { background: var(--line-strong); height: 2px !important; opacity: .5; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.flag.red { background: var(--danger-soft); color: var(--danger); }
.flag.violet { background: var(--violet-soft); color: var(--violet); }
.flag.ok { background: var(--ok-soft); color: var(--ok); }
.flag .i { width: 13px; height: 13px; }
.load { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.load .d { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; }
.load .col { height: 44px; background: var(--surface-2); border-radius: 8px; position: relative; overflow: hidden; margin-bottom: 4px; }
.load .col i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--blue); opacity: .8; }
.load .col.over i { background: var(--danger); }
.load .col em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: var(--text); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 4px 0; line-height: 16px; }
.feed div { padding: 9px 4px; border-top: 1px solid var(--line); font-size: 13px; line-height: 18px; color: var(--text-2); }
.feed div:first-child { border-top: 0; }
.feed b { color: var(--text); font-weight: 700; }
.feed time { color: var(--muted); margin-right: 6px; }
table.tbl td.num, table.tbl th.num { text-align: right; }
.tbl-wrap { background: var(--surface); border-radius: var(--r-lg); overflow-x: auto; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 10px; margin-left: 6px; background: var(--surface-2); color: var(--text-2); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.addstaff { background: var(--surface); border-radius: var(--r-lg); padding: 4px 18px; margin: 26px 0 8px; }
.addstaff summary { cursor: pointer; font-weight: 800; min-height: 52px; display: flex; align-items: center; gap: 8px; }
.addstaff form { padding-bottom: 14px; }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- цілі ---------- */
.gcard { display: block; background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px; }
a.gcard:hover { background: color-mix(in srgb, var(--surface) 92%, var(--text)); }
.g-top { display: flex; align-items: baseline; gap: 10px; }
.g-t { font-weight: 800; font-size: 16px; line-height: 22px; flex: 1; min-width: 0; }
.g-pct { font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.gbar { height: 10px; border-radius: 5px; background: var(--surface-2); margin: 10px 0 8px; position: relative; }
.gbar i { display: block; height: 100%; border-radius: 5px; background: var(--blue); }
.gbar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); opacity: .7; text-decoration: none; }
.gcard.done .gbar i { background: var(--ok); } .gcard.behind .gbar i, .gcard.missed .gbar i { background: var(--danger); } .gcard.on .gbar i { background: var(--accent); }
.g-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.g-st.done { color: var(--ok); } .g-st.behind, .g-st.missed { color: var(--danger); } .g-st.on { color: var(--accent-text); }
.goalform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.goalform input { width: 120px; }

/* ---------- дашборд ---------- */
.dgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.dcard { background: var(--surface); border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.dcard .lbl { font-size: 13px; color: var(--text-2); font-weight: 700; }
.dcard b.big { display: block; font-size: 32px; line-height: 38px; font-weight: 800; margin: 2px 0; font-variant-numeric: tabular-nums; }
.dcard .was { font-size: 12px; color: var(--muted); font-weight: 600; }
.dl { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 10px; margin-left: 6px; background: var(--surface-2); color: var(--text-2); vertical-align: middle; }
.dl.up { background: var(--ok-soft); color: var(--ok); } .dl.down { background: var(--danger-soft); color: var(--danger); }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.panel h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.panel .cap { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols2 > .panel { margin-bottom: 0; }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 18px; }
.vbars .c { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.vbars .c i { width: 100%; background: var(--blue); opacity: .55; border-radius: 5px 5px 0 0; min-height: 2px; }
.vbars .c.now i { background: var(--accent); opacity: 1; }
.vbars .c.warn i { background: var(--danger); opacity: .8; }
.vbars .c em { font-style: normal; font-size: 11px; font-weight: 800; margin-bottom: 3px; color: var(--text); }
.vlabels { display: flex; gap: 6px; margin-top: 6px; }
.vlabels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); font-weight: 700; min-width: 0; }
.kindrow { display: grid; grid-template-columns: 160px 1fr 52px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kindrow:first-of-type { border-top: 0; }
.kindrow .nm { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.kindrow .nm i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.kindrow .tr { height: 12px; background: var(--surface-2); border-radius: 6px; position: relative; }
.kindrow .tr b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.kindrow .tr u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); opacity: .8; }
.kindrow .n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.kindrow .sub { grid-column: 2 / 4; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: -4px; }
.donutbox { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ""; position: absolute; inset: 30px; background: var(--surface); border-radius: 50%; }
.donut span { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; font-weight: 800; font-size: 24px; line-height: 24px; }
.donut small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.legend { flex: 1; min-width: 160px; }
.legend div { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; font-weight: 700; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend span { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend em { font-style: normal; color: var(--muted); width: 38px; text-align: right; font-weight: 600; }
.tbl.bench td, .tbl.bench th { padding: 10px 8px; font-size: 13px; }
.todaybar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; background: var(--surface); border-radius: var(--r-lg); padding: 14px 18px; }
.todaybar .track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.todaybar .track i { display: block; height: 100%; background: var(--ok); }
.todaybar b { font-weight: 800; white-space: nowrap; }
@media (max-width: 760px) { .dgrid { grid-template-columns: repeat(2, 1fr); } .cols2 { grid-template-columns: 1fr; } .cols2 > .panel { margin-bottom: 14px; } .kindrow { grid-template-columns: 90px 1fr 44px; } }

table.cmp td, table.cmp th { padding: 11px 12px; font-size: 13px; white-space: nowrap; }
table.cmp tr.lnk { cursor: pointer; } table.cmp tr.lnk:hover td { background: var(--hover); }
table.cmp tr.tot td { background: var(--surface-2); border-top: 2px solid var(--line-strong); }
table.cmp b.good { color: var(--ok); } table.cmp b.bad { color: var(--danger); }
.cols2g { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 22px; }
.cols2g .pcard { margin-bottom: 0; }
.cols2g .gcard { background: var(--surface-2); padding: 12px 14px; margin-bottom: 8px; }
.cmpbar { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; font-weight: 700; }
.cmpbar .tr { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.cmpbar .tr i { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.cmpbar .tr i.ok { background: var(--ok); } .cmpbar .tr i.bad { background: var(--danger); } .cmpbar .tr i.mid { background: var(--accent); }
.cmpbar span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
