/* Стиль у дусі oleksandryaremko.com: General Sans (+ Onest для кирилиці),
   гострі кути, тонкі лінії, щільні великі заголовки, салатовий акцент. */
:root {
  --bg: #f7f7f5;
  --surface: #fbfbf9;
  --ink: #171917;
  --text-2: #3d413b;
  --muted: #686c66;
  --line: #d9ddd5;
  --line-2: #e9ebe5;
  --accent: #d5f353;
  --accent-ink: #171917;
  --blue: #4b58f9;
  --red: #f94b4b;
  --red-text: #d93636;
  --hover: #eeefea;
  --logo-stroke: #171917;
  --font: "General Sans", "Onest", Arial, Helvetica, sans-serif;
  --pad: clamp(20px, 3.2vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151715; --surface: #1a1c1a; --ink: #f3f4ef; --text-2: #d3d6ce; --muted: #afb3aa;
    --line: #3c4039; --line-2: #2a2d29; --hover: #20231f; --red-text: #ff7070; --blue: #7a84ff;
    --logo-stroke: #151715; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151715; --surface: #1a1c1a; --ink: #f3f4ef; --text-2: #d3d6ce; --muted: #afb3aa;
  --line: #3c4039; --line-2: #2a2d29; --hover: #20231f; --red-text: #ff7070; --blue: #7a84ff;
  --logo-stroke: #151715; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 500; margin: 0; }
h1 { font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 1; letter-spacing: -0.05em; }
h1.display { font-size: clamp(2.6rem, 5.4vw, 5.2rem); letter-spacing: -0.055em; line-height: 0.98; }
h1 span, h1.display span { color: var(--muted); }
h3 { font-size: 1.05rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.i { flex-shrink: 0; vertical-align: -0.15em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; letter-spacing: -0.04em; font-weight: 500; color: var(--ink); }
.sidebar .brand { padding: 22px 22px; border-bottom: 1px solid var(--line); }
.brand-sep { width: 1.5px; height: 22px; background: var(--ink); }
.brand-light { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; flex: 1; padding: 14px 0; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 22px;
  color: var(--muted); font-size: 1rem; transition: color .15s, background .15s;
}
.side-nav a:hover { color: var(--ink); background: var(--hover); }
.side-nav a.on { color: var(--ink); }
.side-nav a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--accent); }
.side-nav a span { flex: 1; }
.side-nav em {
  font-style: normal; font-size: 0.78rem; font-weight: 500; min-width: 24px; text-align: center;
  padding: 1px 6px; background: var(--accent); color: var(--accent-ink);
}
.nav-label { font-size: 0.8rem; color: var(--muted); padding: 22px 22px 8px; border-top: 1px solid var(--line); margin-top: 14px; }
.side-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding: 12px 14px; }
.side-foot .me { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0; }
.side-foot .me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .me:hover, .side-foot .me.on { background: var(--hover); }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 0.85rem;
}
.avatar.lg { width: 48px; height: 48px; font-size: 1.2rem; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0; flex-shrink: 0;
  background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line); background: none; }
.icon-btn.round { border-radius: 50%; border-color: var(--line); color: var(--ink); }

.main { padding: 48px var(--pad) 96px; max-width: 1120px; width: 100%; margin: 0 auto; }
.main.wide { max-width: 1400px; }
.mobile-top, .tabbar { display: none; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--line);
}
.sub { color: var(--muted); margin: 12px 0 0; font-size: 1rem; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.back:hover { color: var(--ink); }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.layout-2 > aside { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 16px; }
.layout-2 > aside:empty { display: none; }

/* ---------- кнопки і форми ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.95rem; font-weight: 500;
  padding: 10px 18px; border: 1px solid var(--ink); border-radius: 0; cursor: pointer;
  background: var(--ink); color: var(--bg); transition: background .15s, color .15s, border-color .15s;
}
button:hover, .btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.accent:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.block { width: 100%; padding: 13px; }
button.sm, .btn.sm { padding: 6px 12px; font-size: 0.85rem; }
.ghost, button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ghost:hover, button.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
button.ghost.sm { padding: 4px 10px; }
.danger-link { background: none; border: 0; color: var(--red-text); padding: 12px 0; font-weight: 400; }
.danger-link:hover { background: none; color: var(--red-text); text-decoration: underline; }

.field { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 0;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: var(--bg); color: var(--ink); }
textarea { resize: vertical; min-height: 46px; }
input[type=date], input[type=time] { min-height: 44px; }
::placeholder { color: var(--muted); opacity: .8; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 16px; }
.check-field { display: flex; align-items: center; gap: 10px; color: var(--text-2); margin-bottom: 16px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.form-group-title { font-size: 0.85rem; color: var(--muted); margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }

.card { background: var(--surface); border: 1px solid var(--line); padding: 22px; }
.form-card { margin-bottom: 28px; }
.form-card.narrow { max-width: 460px; }
.card-summary { list-style: none; display: flex; align-items: center; gap: 8px; font-size: 1.1rem; letter-spacing: -0.02em; font-weight: 500; cursor: pointer; }
.card-summary::-webkit-details-marker { display: none; }
details[open] > .card-summary { margin-bottom: 20px; }
.toggle-panel:not([open]) { display: none; }
.flash { border: 1px solid var(--ink); border-left: 6px solid var(--accent); padding: 12px 16px; margin-bottom: 20px; }

/* ---------- швидке додавання ---------- */
.quick-add { padding: 6px 6px 6px 16px; margin-bottom: 36px; background: var(--surface); }
.quick-add:focus-within { border-color: var(--ink); }
.quick-row { display: flex; align-items: center; gap: 8px; }
.quick-icon { color: var(--muted); display: grid; }
.quick-row input[name=title] { flex: 1; border: 0; margin: 0; padding: 12px 4px; font-size: 1.1rem; letter-spacing: -0.01em; }
.quick-row .quick-time { width: 128px; margin: 0; }
.quick-row button { align-self: stretch; }
.quick-more { margin: 2px 10px 10px 30px; }
.quick-more summary { font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.quick-more[open] summary { margin-bottom: 14px; }

/* ---------- завдання ---------- */
.section { margin-bottom: 44px; }
.section-title {
  display: flex; align-items: baseline; gap: 10px; font-size: 1.45rem; font-weight: 500;
  letter-spacing: -0.04em; margin: 0 0 14px; color: var(--ink);
}
.section-title .i { align-self: center; color: var(--muted); }
.section-title.red, .section-title.red .i { color: var(--red-text); }
.section-title.muted { color: var(--muted); }
.count { font-size: 0.95rem; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.count::before { content: "("; }
.count::after { content: ")"; }

ul.tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.task {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 6px 16px 4px; border-bottom: 1px solid var(--line); transition: background .15s;
}
.task:hover { background: var(--hover); }
.task.prio-1::before, .task.prio-2::before { content: ""; position: absolute; left: -14px; top: 22px; width: 6px; height: 6px; }
.task.prio-1::before { background: var(--blue); }
.task.prio-2::before { background: var(--red); }
.check {
  width: 22px; height: 22px; padding: 0; margin-top: 2px;
  background: transparent; border: 1.5px solid var(--muted); color: transparent;
}
.check:hover { border-color: var(--ink); background: var(--accent); color: var(--accent-ink); }
.prio-2 .check { border-color: var(--red); }
.prio-1 .check { border-color: var(--blue); }
.task.done .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 1.08rem; letter-spacing: -0.015em; color: var(--ink); word-break: break-word; }
.task-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-notes { font-size: 0.9rem; color: var(--muted); margin-top: 6px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.84rem; color: var(--muted); }
.chip.red { color: var(--red-text); }
.chip.amber { color: var(--blue); }
.chip.doing { color: var(--ink); background: var(--accent); color: var(--accent-ink); padding: 0 6px; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; align-self: center; }
.task.compact { padding: 10px 2px; gap: 10px; }
.task.compact .check { width: 18px; height: 18px; margin-top: 1px; }
.task.compact .task-title { font-size: 0.92rem; }
.task.compact.prio-1::before, .task.compact.prio-2::before { left: -8px; top: 16px; width: 4px; height: 4px; }

.empty { padding: 48px 20px; text-align: center; color: var(--text-2); border: 1px dashed var(--line); }
.empty p { margin: 4px 0; }
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; background: var(--accent); color: var(--accent-ink); margin-bottom: 14px; }

/* ---------- прогрес ---------- */
.ring { position: relative; width: 96px; height: 96px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.2; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-width: 3.4; stroke-dasharray: var(--p) 100; }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring b { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.05em; }
.ring span { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* ---------- бокові картки ---------- */
.deadline-list { list-style: none; padding: 0; margin: 0 0 14px; border-top: 1px solid var(--line); }
.deadline-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.deadline-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline-list a:hover { text-decoration: underline; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; }
.more-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 0.8rem; padding: 2px 8px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.pill.red { border-color: var(--red); color: var(--red-text); }
.pill.amber { border-color: var(--blue); color: var(--blue); }
dl.info { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: 0.95rem; border-top: 1px solid var(--line); }
dl.info dt, dl.info dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.info dt { color: var(--muted); padding-right: 18px; }
dl.info dd { word-break: break-word; }
dl.info a { text-decoration: underline; text-underline-offset: 3px; }
.notes-text { white-space: pre-wrap; margin: 0; color: var(--text-2); }

/* ---------- сегменти/фільтри ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; padding: 8px 14px; color: var(--muted); font-size: 0.92rem; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a:hover { color: var(--ink); background: var(--hover); }
.seg a.on { background: var(--ink); color: var(--bg); }
.seg.filters { margin-bottom: 24px; }

/* ---------- тиждень ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); }
.day { padding: 14px 12px 12px; min-height: 280px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); }
.day:first-child { border-left: 0; }
.day.is-past { background: color-mix(in srgb, var(--line) 18%, transparent); }
.day.is-past .day-name, .day.is-past .day-date { color: var(--muted); }
.day.is-today { box-shadow: inset 0 4px 0 var(--accent); background: var(--surface); }
.day-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.day-name { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.04em; }
.day-date { color: var(--muted); font-size: 0.85rem; flex: 1; }
.day-count { font-size: 0.8rem; color: var(--muted); }
.day-count::before { content: "("; }
.day-count::after { content: ")"; }
.day ul.tasks { flex: 1; border-top: 0; }
.day .task { border-bottom: 1px solid var(--line-2); }
.day-add input { margin: 0; padding: 8px 4px; font-size: 0.9rem; border: 0; border-bottom: 1px dashed var(--line); }
.day-add input:focus { border-bottom: 1px solid var(--ink); }

/* ---------- проєкти ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border: 1px solid var(--line); margin-bottom: 32px; }
.stat { padding: 18px 20px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.stat-value { font-size: clamp(1.8rem, 2.6vw, 2.5rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.stat-value small { font-size: 0.95rem; color: var(--muted); letter-spacing: 0; }
.stat-value.green { color: var(--ink); box-shadow: inset 0 -0.32em 0 var(--accent); }
.stat-value.red { color: var(--red-text); }
.stat-note { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.project-card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .15s;
}
.project-card:hover { background: var(--surface); }
.project-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.project-card.status-paid, .project-card.status-cancelled { color: var(--muted); }
.project-card h3 { font-size: 1.5rem; letter-spacing: -0.045em; line-height: 1.08; margin: 4px 0 0; }
.pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-client { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 0.95rem; }
.pc-money { margin-top: 10px; }
.pc-money b { font-size: 2rem; font-weight: 500; letter-spacing: -0.05em; }
.pc-money span { color: var(--muted); font-size: 0.9rem; }
.pc-money small { color: var(--muted); font-size: 0.85rem; }
.bar { height: 4px; background: var(--line); margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.pc-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.source { font-size: 0.82rem; color: var(--muted); }
.source::before { content: "/ "; }
.badge { font-size: 0.8rem; padding: 2px 8px; border: 1px solid var(--line); color: var(--text-2); }
.badge.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge.delivered { border-color: var(--blue); color: var(--blue); }
.badge.paid { border-color: var(--ink); color: var(--ink); }
.badge.cancelled { color: var(--muted); text-decoration: line-through; }

/* ---------- люди ---------- */
.people { border-top: 1px solid var(--line); }
.people .card.person { background: none; border: 0; border-bottom: 1px solid var(--line); padding: 18px 0; }
.person-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.person-head > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-head b { font-weight: 500; font-size: 1.1rem; letter-spacing: -0.02em; }
.person-more { margin-top: 12px; }
.person-more summary { font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }
.inline-form input { margin: 0; max-width: 280px; }

/* ---------- вхід ---------- */
.auth { min-height: 100vh; display: grid; place-content: center; padding: 20px; position: relative; }
.auth-theme { position: absolute; top: 20px; right: 20px; }
.auth-card { width: min(440px, calc(100vw - 32px)); }
.auth-card .brand { margin-bottom: 48px; }
.auth-card h1 { font-size: clamp(2.6rem, 6vw, 3.6rem); letter-spacing: -0.055em; }
.auth-card .sub { margin-bottom: 32px; }
.only-mobile { display: none; }

/* ---------- дім, ще ---------- */
.chip.home { color: var(--ink); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.presets-box > summary { cursor: pointer; list-style: none; }
.presets-box > summary::-webkit-details-marker { display: none; }
.presets-box:not([open]) > summary { font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.presets button { font-weight: 400; }
.more-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.more-list a, .more-btn {
  display: flex; align-items: center; gap: 14px; padding: 16px 4px; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink);
  font-size: 1.1rem; font-weight: 400; justify-content: flex-start;
}
.more-btn:hover { background: var(--hover); color: var(--ink); }
.btn.accent-btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.accent-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-count { font-size: 0.8rem; opacity: .7; }
.btn-count::before { content: "("; }
.btn-count::after { content: ")"; }

/* ---------- список дошок ---------- */
.new-board { display: flex; gap: 8px; }
.new-board input { margin: 0; width: 240px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.board-card { display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .15s; }
.board-card:hover { background: var(--surface); }
.board-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.board-cover { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); }
.board-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.empty-cover {
  display: grid; place-items: center; color: var(--muted);
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px;
}
.board-card-body { padding: 16px 18px 18px; }
.board-card-body h3 { font-size: 1.3rem; letter-spacing: -0.04em; margin: 0 0 4px; }
.board-card-body .muted { font-size: 0.88rem; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- дошка ---------- */
.main.board-main { max-width: none; padding: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.board-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px var(--pad) 16px; border-bottom: 1px solid var(--line);
}
.board-head .back { margin-bottom: 6px; }
.board-head h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.title-input { border: 0 !important; padding: 0 !important; margin: 0 !important; font-size: clamp(1.8rem, 3vw, 2.6rem) !important; font-weight: 500; letter-spacing: -0.05em; line-height: 1; background: none !important; }
.title-input:focus { box-shadow: inset 0 -2px 0 var(--accent); }
.quick-note {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 520px; min-width: 240px;
  border: 1px solid var(--line); padding: 0 0 0 12px; color: var(--muted); background: var(--surface);
}
.quick-note:focus-within { border-color: var(--ink); }
.quick-note input { border: 0; margin: 0; padding: 11px 12px 11px 0; }
.board-tools {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px var(--pad); border-bottom: 1px solid var(--line); background: var(--bg);
}
.board-tools .icon-btn { width: 32px; height: 32px; }
.tool-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.zoom-label { font-size: 0.85rem; color: var(--muted); min-width: 44px; text-align: center; }
.board-status { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.board-tools form { margin: 0; }
.danger-link.sm { padding: 4px 0 4px 12px; font-size: 0.85rem; }
.swatches { display: inline-flex; gap: 4px; }
.swatch { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); }
.swatch:disabled { opacity: .35; cursor: default; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.swatch:hover:not(:disabled) { border-color: var(--ink); }

.board {
  position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; user-select: none;
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 45%, transparent) 1px, transparent 1.2px);
}
.board.panning { cursor: grabbing; }
.board.dropping { box-shadow: inset 0 0 0 3px var(--accent); }
.board-world { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.board-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); pointer-events: none;
  font-size: 0.8rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 4px 10px; white-space: nowrap;
}
.item { position: absolute; border: 1px solid var(--line); cursor: move; }
.item.selected { outline: 2px solid var(--ink); outline-offset: 2px; }
.item-note { display: flex; flex-direction: column; box-shadow: 0 2px 0 rgba(0, 0, 0, .06); }
.item-grip { height: 14px; flex-shrink: 0; cursor: move; }
.item-note textarea {
  flex: 1; border: 0 !important; margin: 0 !important; padding: 0 14px 14px !important; resize: none; background: none !important;
  font-size: 1rem; line-height: 1.4; color: inherit !important; cursor: text; box-shadow: none !important;
}
.item-note textarea::placeholder { color: inherit; opacity: .45; }
.c-paper { background: var(--surface); color: var(--ink); }
.c-lime { background: #dcfb49; color: #171917; border-color: #c4e23a; }
.c-blue { background: #4b58f9; color: #ffffff; border-color: #3d49de; }
.c-red { background: #f94b4b; color: #ffffff; border-color: #e03b3b; }
.c-gray { background: #3c4039; color: #f3f4ef; border-color: #2c2f2a; }
.item-image { background: var(--surface); }
.item-image img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.item-del {
  position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  font-size: 16px; line-height: 1; display: none; background: var(--ink); color: var(--bg); border: 0;
}
.item-del:hover { background: var(--red); color: #fff; }
.item-resize {
  position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; cursor: nwse-resize;
  background: var(--accent); border: 1px solid var(--ink); display: none;
}
.item:hover .item-del, .item.selected .item-del, .item:hover .item-resize, .item.selected .item-resize { display: block; }
.item.removing { opacity: .3; }
.board-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.board-tools > * { flex-shrink: 0; }
.danger-icon { width: 32px; height: 32px; }
.board-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.board-tools .icon-btn:disabled:hover { border-color: transparent; color: var(--muted); }
.danger-icon:hover { color: var(--red-text); border-color: var(--red); }

/* малюнки ручкою */
.modes { display: inline-flex; border: 1px solid var(--line); }
.modes .mode { width: 34px; height: 32px; border: 0; color: var(--muted); }
.modes .mode + .mode { border-left: 1px solid var(--line); }
.modes .mode.on { background: var(--ink); color: var(--bg); }
.pen-options { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.pen-color { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid var(--bg); background: currentColor; box-shadow: 0 0 0 1px var(--line); }
.pen-color.on { box-shadow: 0 0 0 2px var(--ink); }
.pen-color:hover { background: currentColor; border-color: var(--bg); }
.pen-width { width: 28px; height: 28px; padding: 0; background: none; border: 1px solid transparent; display: grid; place-items: center; }
.pen-width i { display: block; border-radius: 50%; background: var(--ink); }
.pen-width.on, .pen-width:hover { border-color: var(--ink); background: none; }
.d-ink { color: var(--ink); }
.d-lime { color: #b9d62c; }
.d-blue { color: #4b58f9; }
.d-red { color: #f94b4b; }
.d-gray { color: #8a8f86; }
.item-drawing { border: 0; background: none; pointer-events: none; }
.item-drawing svg { display: block; width: 100%; height: 100%; overflow: visible; }
.item-drawing .hit { pointer-events: stroke; cursor: move; }
.item-drawing .line { pointer-events: none; }
.item-drawing .item-del, .item-drawing .item-resize { pointer-events: auto; }
.item-drawing.selected { outline: 1px dashed var(--ink); outline-offset: 4px; }
.live-stroke { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.board.mode-pen, .board.mode-pen * { cursor: crosshair !important; }
.board.mode-eraser, .board.mode-eraser * { cursor: cell !important; }
.board.mode-eraser .item-drawing:hover .line { opacity: .35; }
.board.space-pan, .board.space-pan * { cursor: grab !important; }

/* текст, стікери, вибір кількох */
.board-wrap { position: relative; flex: 1; display: flex; min-height: 0; }
.board-wrap .board { flex: 1; }
.item-text { border: 0; background: none; }
.item-text .item-grip { height: 10px; }
.item-text textarea {
  flex: 1; border: 0 !important; margin: 0 !important; padding: 0 6px !important; resize: none; background: none !important;
  font-size: 30px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; color: currentColor !important;
  cursor: text; box-shadow: none !important;
}
.item-text { display: flex; flex-direction: column; }
.item-text:hover, .item-text.selected { outline: 1px dashed var(--line); }
.item-text.selected { outline-color: var(--ink); }
.item-sticker { border: 0; background: none; display: grid; place-items: center; }
.sticker-glyph { line-height: 1; pointer-events: none; user-select: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .15)); }
.item-sticker.selected { outline: 1px dashed var(--ink); }
.item-task {
  position: absolute; left: 0; bottom: -30px; display: none; padding: 3px 9px; font-size: 0.78rem; font-weight: 500;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); white-space: nowrap;
}
.item-task:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.item-task.done { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.item.selected .item-task, .item:hover .item-task { display: inline-flex; }
.board.multi .item-task, .board.multi .item-resize { display: none !important; }
.select-band { position: absolute; border: 1px solid var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); pointer-events: none; z-index: 5; }
.sel-count { font-size: 0.85rem; padding: 2px 8px; background: var(--accent); color: var(--accent-ink); margin-left: 6px; }
.task-link { font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; margin-left: 8px; white-space: nowrap; }
.sticker-pop {
  position: absolute; top: 10px; left: var(--pad); z-index: 20; display: grid; grid-template-columns: repeat(8, 40px); gap: 4px;
  padding: 10px; background: var(--bg); border: 1px solid var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.sticker-pop button { width: 40px; height: 40px; padding: 0; font-size: 24px; background: none; border: 1px solid transparent; color: inherit; }
.sticker-pop button:hover { background: var(--hover); border-color: var(--line); }
.board-help { position: absolute; top: 10px; right: var(--pad); z-index: 20; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 20px); overflow: auto; background: var(--bg); border-color: var(--ink); }
.help-head { display: flex; justify-content: space-between; align-items: center; }
.help-head h3 { margin: 0; }
.board-help dl { display: grid; grid-template-columns: auto 1fr; gap: 0 16px; margin: 12px 0 0; font-size: 0.9rem; }
.board-help dt, .board-help dd { margin: 0; padding: 6px 0; border-top: 1px solid var(--line); }
.board-help dt { font-weight: 500; white-space: nowrap; }
.board-help dd { color: var(--muted); }

/* пошук Ctrl+K */
.search-btn {
  display: flex; align-items: center; gap: 10px; margin: 14px 14px 0; padding: 9px 10px; background: none;
  border: 1px solid var(--line); color: var(--muted); font-weight: 400; justify-content: flex-start;
}
.search-btn:hover { border-color: var(--ink); color: var(--ink); background: none; }
.search-btn span { flex: 1; text-align: left; }
.search-btn kbd, .palette-foot span { font: inherit; font-size: 0.75rem; color: var(--muted); }
.search-btn kbd { border: 1px solid var(--line); padding: 0 5px; }
.mobile-actions { display: flex; gap: 6px; }
.palette {
  position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, #000 35%, transparent);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
}
.palette-box { width: min(620px, 100%); background: var(--bg); border: 1px solid var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.palette-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-field input { border: 0; margin: 0; padding: 18px 0; font-size: 1.2rem; letter-spacing: -0.02em; }
.palette-list { list-style: none; margin: 0; padding: 6px 0; max-height: 52vh; overflow: auto; }
.palette-item { display: grid; grid-template-columns: 90px 1fr; gap: 0 12px; padding: 10px 18px; cursor: pointer; }
.palette-item.on { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.palette-kind { grid-row: span 2; font-size: 0.78rem; color: var(--muted); padding-top: 3px; }
.palette-title { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 18px; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); }

/* розумне додавання, перетягування в тижні */
.smart-hint { color: var(--muted); font-size: 0.82rem; }
.smart-hint i { font-style: normal; color: var(--text-2); background: var(--hover); padding: 0 4px; }
.task[draggable="true"] { cursor: grab; }
.task.dragging { opacity: .4; }
.day.drop-target { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- адаптив ---------- */
@media (min-width: 1700px) {
  body { font-size: 17px; }
  .app { grid-template-columns: 290px 1fr; }
  .main { max-width: 1240px; padding-top: 64px; }
  .main.wide { max-width: 1560px; }
  .layout-2 { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1240px) {
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .day:nth-child(5) { border-left: 0; }
  .day:nth-child(n+5) { border-top: 1px solid var(--line); }
}
@media (max-width: 1000px) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .layout-2 > aside { position: static; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { display: none; }
  .main { padding: 0 16px calc(90px + env(safe-area-inset-bottom)); }
  .mobile-top {
    display: flex; justify-content: space-between; align-items: center;
    margin: 0 -16px 24px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  }
  .page-head { padding-bottom: 20px; margin-bottom: 24px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--muted); font-size: 0.7rem; position: relative; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on::before { content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; background: var(--accent); }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .day:first-child { border-top: 0; }
  .day.is-past:not(.is-today) { display: none; }
  .ring { width: 72px; height: 72px; }
  .ring b { font-size: 1.15rem; }
  .quick-row { flex-wrap: wrap; }
  .quick-row input[name=title] { flex-basis: calc(100% - 40px); }
  .quick-row .quick-time { flex: 1; }
  .quick-more { margin-left: 0; }
  .task { flex-wrap: wrap; }
  .task-actions { width: 100%; padding-left: 36px; }
  .task.prio-1::before, .task.prio-2::before { left: -10px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .only-mobile { display: block; margin-top: 20px; }
  .inline-form { flex-wrap: wrap; }
  .main.board-main { padding: 0; height: calc(100dvh - 62px - env(safe-area-inset-bottom)); }
  .board-main .mobile-top { margin: 0; }
  .board-head { padding: 14px 16px 12px; }
  .board-head .back { display: none; }
  .quick-note { min-width: 0; max-width: none; flex-basis: 100%; }
  .board-tools { padding: 6px 16px; overflow-x: auto; flex-wrap: nowrap; }
  .board-hint { display: none; }
  .sticker-pop { left: 8px; grid-template-columns: repeat(6, 40px); }
  .smart-hint { display: none; }
  .palette { padding-top: 8vh; }
  .board-status { margin-left: 8px; white-space: nowrap; }
  .item-del, .item-resize { display: block; }
  .new-board { width: 100%; }
  .new-board input { width: auto; flex: 1; }
}
