/* ================= Úkolovník – vzhled ================= */
:root {
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #1d2126;
  --ink-2: #454b54;
  --muted: #7a808a;
  --line: #e6e3dc;
  --line-2: #efede8;
  --hover: #efede7;
  --accent: #3b5bdb;
  --accent-ink: #2f4ac0;
  --accent-soft: #e8edff;
  --done: #2b8a3e;
  --danger: #c92a2a;
  --danger-soft: #fff0f0;
  --warn: #d9480f;
  --warn-soft: #fff3e8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 8px 24px rgba(20, 20, 30, .08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); cursor: pointer; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn .ico { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13.5px; }
.btn.wide { width: 100%; justify-content: center; height: 42px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; }
.link-btn:disabled { color: var(--muted); cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Načítání ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Přihlášení ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; margin: 22px 0 6px; letter-spacing: -.01em; }
.auth-card p { margin: 0 0 20px; }
.auth-form, .form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label, .form label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.auth-form input, .form input, .share input {
  height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
.auth-form input:focus, .form input:focus, .share input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-form .btn { margin-top: 14px; }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark .ico { stroke-width: 2.8; width: 18px; height: 18px; }

/* ---------- Rozvržení ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-right: 1px solid var(--line);
}
.main { flex: 1; min-width: 0; background: var(--panel); }
.topbar { display: none; }
.view { padding: 40px 48px 80px; }
.page { max-width: 820px; margin: 0 auto; }

/* ---------- Postranní menu ---------- */
.sb-top { padding: 20px 20px 12px; }
.sb-search { padding: 0 10px 8px; }
.sb-search .search-input { background: #fff; }
.sb-noresult { padding: 10px; }
.nav-new.install-btn { margin-top: 0; padding: 10px 20px; border-top: 1px solid var(--line); border-radius: 0; }
.install-help ol { margin: 0 0 12px; padding-left: 20px; line-height: 1.9; }
.ico.inline { width: 17px; height: 17px; vertical-align: -3px; color: var(--accent); }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-item, .nav-new {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--ink-2); cursor: pointer; text-align: left; font-size: 14.5px;
}
.nav-item:hover, .nav-new:hover { background: var(--hover); color: var(--ink); }
.nav-item.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--line); }
.nav-ico { width: 17px; height: 17px; color: var(--muted); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; color: var(--muted); }
.nav-badge { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.nav-item.my { margin-bottom: 6px; }
/* Řádek úkolovníku se špendlíkem vpravo */
.nav-row { position: relative; }
.nav-row .nav-item { padding-right: 38px; }
.nav-row:hover .nav-item:not(.active) { background: var(--hover); color: var(--ink); }
.nav-pin {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
  opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.nav-pin .ico { width: 16px; height: 16px; transform: rotate(35deg); transition: transform .15s; }
.nav-row:hover .nav-pin, .nav-pin:focus-visible { opacity: 1; }
.nav-pin:hover { background: rgba(0, 0, 0, .07); color: var(--ink); }
.nav-pin.on { opacity: 1; color: var(--accent); }
.nav-pin.on .ico { transform: none; }
.nav-pin.on .pin-head { fill: currentColor; }
@media (hover: none) {
  /* dotykové displeje nemají najetí myší – prázdný světle šedý špendlík je vidět vždy */
  .nav-pin { opacity: 1; color: #c9c5bc; }
  .nav-pin.on { color: var(--accent); }
}
.sb-section { margin: 16px 10px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sb-empty { padding: 4px 10px; font-size: 13px; color: var(--muted); }
.nav-new { margin-top: 14px; color: var(--accent); font-weight: 500; }
.nav-new .nav-ico { color: var(--accent); }
.sb-user { display: flex; align-items: center; gap: 8px; padding: 12px 12px 14px 16px; border-top: 1px solid var(--line); }
.sb-user-text { flex: 1; min-width: 0; }
.sb-user-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-mail { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Avatary ---------- */
.avatar {
  --av: var(--accent);
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--av); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.xs { width: 18px; height: 18px; font-size: 8.5px; }
.avatar.ghost { background: var(--line-2); color: var(--muted); }
.avatar.ghost .ico { width: 16px; height: 16px; }
.avatar.more { background: var(--line); color: var(--ink-2); }

/* ---------- Hlavička úkolovníku ---------- */
.list-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.list-head-main { flex: 1; min-width: 0; }
.list-title, .page-title {
  width: 100%; margin: 0; padding: 2px 6px; margin-left: -6px;
  border: 0; border-radius: 6px; background: transparent; outline: none;
  font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25;
}
.list-title:hover { background: var(--line-2); }
.list-title:focus { background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line); }
.list-sub { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.list-actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.members-btn { display: flex; border: 0; background: none; cursor: pointer; padding: 2px; margin-right: 4px; }
.members-btn .avatar { box-shadow: 0 0 0 2px #fff; }
.members-btn .avatar + .avatar { margin-left: -7px; }

/* ---------- Filtry ---------- */
.filter-wrap { margin: -8px 0 12px; }
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.filter-status { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.filter-status[hidden] { display: none; }
.filter-btn { position: relative; }
.filter-btn.open { background: var(--hover); }
.filter-btn.active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.filter-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.search { position: relative; flex: 1 1 170px; display: flex; align-items: center; }
.search .ico { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%; height: 34px; padding: 0 10px 0 32px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 6px 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13.5px; cursor: pointer;
}
.filter:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-label { color: var(--muted); white-space: nowrap; }
.filter-select { max-width: 140px; border: 0; background: transparent; outline: none; font-weight: 500; cursor: pointer; }
.filter.on { border-color: var(--accent); background: var(--accent-soft); }
.filter.on .filter-select, .filter.on .filter-label { color: var(--accent-ink); }
.filter-check { gap: 7px; padding: 0 10px; color: var(--ink-2); user-select: none; }
.filter-check input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.filter-clear { font-size: 13.5px; padding: 0 4px; }
.filter-status .filter-clear { font-size: 12.5px; padding: 0; }

/* ---------- Úkoly ---------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 8px; margin: 0 -8px; border-radius: 8px;
  border-bottom: 1px solid var(--line-2);
  transition: opacity .25s, transform .25s, background .12s;
}
.task:hover { background: #fbfaf7; }
.task.leaving { opacity: .35; transform: translateY(4px); }
.check {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid #c5c1b8; border-radius: 6px; background: #fff;
  display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent;
  transition: background .15s, border-color .15s;
}
.check .ico { width: 15px; height: 15px; stroke-width: 3; }
.check:hover { border-color: var(--done); color: rgba(43,138,62,.35); }
.task.done .check { background: var(--done); border-color: var(--done); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { cursor: text; padding: 1px 4px; margin-left: -4px; border-radius: 5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.task-title:hover { background: var(--line-2); }
.task.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: #b9b5ac; }
.task-edit {
  width: 100%; resize: none; overflow: hidden; padding: 1px 4px; margin-left: -4px;
  border: 0; border-radius: 5px; outline: none; background: var(--accent-soft); line-height: 1.5; display: block;
}
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.task .del { opacity: 0; width: 30px; height: 30px; }
.task:hover .del, .task:focus-within .del { opacity: 1; }
.task .del:hover { color: var(--danger); background: var(--danger-soft); }
.empty { padding: 14px 0; color: var(--muted); border-bottom: 1px solid var(--line-2); }

/* ---------- Štítky (chips) ---------- */
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12.5px; line-height: 1; white-space: nowrap; max-width: 100%;
  background: var(--line-2); color: var(--ink-2); border: 1px solid transparent; cursor: pointer;
}
.chip .ico { width: 14px; height: 14px; }
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip.stamp { cursor: default; background: transparent; border-color: var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.ghost { background: transparent; color: var(--muted); border: 1px dashed transparent; }
.task:not(:hover):not(:focus-within) .chip.ghost { opacity: 0; }
.new-task .chip.ghost, .task .chip.ghost:hover { border-color: var(--line); }
.chip:not(.stamp):hover { border-color: #d3cfc5; }
.chip.assigned { background: #eef1f6; color: var(--ink); }
.chip.assigned.me { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.chip.overdue { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.chip.today { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.chip.list-link { background: #fff; border-color: var(--line); color: var(--ink-2); font-weight: 500; }
.chip.list-link:hover { border-color: var(--accent); color: var(--accent); }
.chip-select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 14px; }
.chip-x { display: inline-grid; place-items: center; margin-right: -4px; border-radius: 50%; width: 16px; height: 16px; }
.chip-x .ico { width: 11px; height: 11px; stroke-width: 2.4; }
.chip-x:hover { background: rgba(0,0,0,.08); }
.task.done .chip.assigned, .task.done .chip.date-chip { opacity: .7; }

.chip.picker-open { opacity: 1 !important; border-color: var(--accent) !important; }

/* Nevyplněné štítky u úkolu jen jako ikona */
.chip.icon-only { width: 26px; padding: 0; justify-content: center; }
.chip.icon-only .ico { width: 15px; height: 15px; }
.task:not(:hover):not(:focus-within) .chip.ghost.icon-only { opacity: .5; }
.task .chip.ghost.icon-only:hover { color: var(--ink); background: var(--line-2); }
/* Přiřazený člověk u úkolu jen jako kolečko s iniciálami */
.chip.avatar-only { width: 26px; padding: 0; justify-content: center; background: none; border-color: transparent; }
.chip.avatar-only .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.chip.avatar-only:hover .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent); }
.task.done .chip.avatar-only { opacity: .7; }

/* ---------- Komentáře ---------- */
.chip.comment-btn.has { background: var(--line-2); color: var(--ink-2); font-weight: 600; }
.comments { margin-top: 6px; }
.comments:empty { display: none; }
.comments-toggle {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; margin-left: -2px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.comments-toggle:hover { background: var(--line-2); color: var(--ink-2); }
.comments-toggle .caret { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
.comments.collapsed .comments-toggle .caret { transform: none; }
.comments.collapsed .comment-list { display: none; }
.comment-list { list-style: none; margin: 4px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); }
.comment { padding: 4px 0 6px; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--ink); cursor: text; padding: 0 4px; margin-left: -4px; border-radius: 5px; }
.comment-body:hover { background: var(--line-2); }
.comment > .comment-input { margin: 2px 0 0 -4px; width: calc(100% + 4px); font-size: 14px; }
.comment-meta { display: flex; align-items: center; gap: 6px; margin-top: 1px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment-del { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.comment-del .ico { width: 11px; height: 11px; stroke-width: 2.4; }
.comment:hover .comment-del, .comment-del:focus-visible { opacity: 1; }
.comment-del:hover { background: var(--danger-soft); color: var(--danger); }
.comment-composer { margin-top: 6px; }
.comment-input {
  display: block; width: 100%; min-height: 36px; resize: none; overflow: hidden; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; line-height: 1.45;
}
.comment-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.task.done .comment-body { color: var(--ink-2); }

/* Odkaz u úkolu */
.chip.link-chip { cursor: default; padding-right: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.chip-link { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: inherit; font-weight: 500; }
.chip-link > span { overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.chip-link:hover > span { text-decoration: underline; }
.chip.link-chip .chip-x { cursor: pointer; }
.chip.link-chip .chip-x .ico { width: 12px; height: 12px; stroke-width: 2; }
.chip-slot { display: contents; }
.btn.danger-btn { color: var(--danger); }
.btn.danger-btn:hover { background: var(--danger-soft); border-color: #f1c0c0; }
.foot-right { display: flex; gap: 8px; margin-left: auto; }

/* ---------- Výběr: úkolovník, nebo stránka ---------- */
.kind-choice { display: grid; gap: 10px; }
.kind-btn {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 14px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.kind-btn:hover, .kind-btn:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.kind-btn strong { display: block; font-size: 15.5px; margin-bottom: 2px; }
.kind-btn .muted { display: block; line-height: 1.4; }
.kind-ico { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.kind-ico .ico { width: 22px; height: 22px; }
.kind-btn:hover .kind-ico { background: #fff; }

/* ---------- Stránka s poznámkami ---------- */
.save-status { margin-left: 8px; font-size: 12.5px; color: var(--muted); }
.save-status:not(:empty)::before { content: '· '; }
.save-status.ok { color: var(--done); }
.save-status.err { color: var(--danger); }
.page-toolbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 5px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.tb-btn {
  min-width: 32px; height: 32px; padding: 0 6px; display: inline-grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; font-size: 15px;
}
.tb-btn:hover { background: var(--hover); color: var(--ink); }
.tb-btn .ico { width: 18px; height: 18px; }
.tb-select { height: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; font-weight: 500; }
.tb-select:hover { background: var(--hover); }
.tb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }
.page-editor {
  min-height: 60vh; padding: 14px 2px 40px; outline: none;
  font-size: 16px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere;
}
.page-editor.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.page-editor > :first-child { margin-top: 0; }
.page-editor p { margin: 0 0 .7em; }
.page-editor h1 { font-size: 26px; line-height: 1.3; margin: 1.1em 0 .4em; letter-spacing: -.01em; }
.page-editor h2 { font-size: 21px; line-height: 1.3; margin: 1em 0 .35em; }
.page-editor h3, .page-editor h4 { font-size: 17px; margin: .9em 0 .3em; }
.page-editor ul, .page-editor ol { margin: 0 0 .7em; padding-left: 26px; }
.page-editor li { margin: .15em 0; }
.page-editor li > p { margin: 0; }
.page-editor a { color: var(--accent); text-decoration: underline; }
.page-editor blockquote { margin: 0 0 .7em; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: var(--ink-2); }
.page-editor pre { padding: 10px 12px; border-radius: 8px; background: var(--line-2); white-space: pre-wrap; font-size: 14px; }
.page-editor hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.page-editor table { border-collapse: collapse; margin: 0 0 .7em; }
.page-editor td, .page-editor th { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; }

/* ---------- Výběr termínu ---------- */
.ico.flip { transform: rotate(180deg); }
.datepop { width: 280px; padding: 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-weight: 600; font-size: 14.5px; }
.dp-nav { width: 30px; height: 30px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px 0; }
.dp-day {
  height: 34px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.dp-day:hover { background: var(--hover); }
.dp-day.out { color: #b9b5ac; }
.dp-day.today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent); }
.dp-day.sel, .dp-day.sel:hover { background: var(--accent); color: #fff; box-shadow: none; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.dp-quick button {
  height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer; font-size: 12.5px; color: var(--ink-2);
}
.dp-quick button:hover { border-color: var(--accent); color: var(--accent); }
.dp-quick button.danger { color: var(--danger); }
.dp-quick button.danger:hover { border-color: var(--danger); background: var(--danger-soft); }

/* ---------- Nový úkol ---------- */
.new-task { display: flex; gap: 12px; padding: 12px 0 6px; align-items: flex-start; }
.new-plus { width: 22px; height: 22px; margin-top: 9px; flex: none; display: grid; place-items: center; color: var(--muted); }
.new-body { flex: 1; min-width: 0; }
.new-input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none;
}
.new-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.new-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.new-meta .btn { margin-left: auto; }

/* ---------- Splněné ---------- */
.done-section { margin-top: 28px; }
.done-section summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 6px; margin-left: -6px; border-radius: 8px;
  font-weight: 600; color: var(--ink-2); font-size: 14px; user-select: none;
}
.done-section summary::-webkit-details-marker { display: none; }
.done-section summary:hover { background: var(--hover); }
.done-section .caret { width: 16px; height: 16px; transition: transform .15s; }
.done-section[open] .caret { transform: rotate(90deg); }
.done-section .tasks { margin-top: 6px; }

/* ---------- Moje úkoly ---------- */
.group + .group { margin-top: 22px; }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }
.group-title.warn { color: var(--danger); }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .big { width: 40px; height: 40px; stroke-width: 1.4; margin-bottom: 8px; }

/* ---------- Popover ---------- */
.popover {
  position: absolute; z-index: 40; min-width: 210px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.pop-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.pop-item:hover { background: var(--hover); }
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: var(--danger-soft); }

/* ---------- Modální okna ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(25, 25, 30, .35); display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.modal { width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px 22px; }
.modal.wide { max-width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-foot.split { justify-content: space-between; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

.share-form { display: flex; gap: 8px; }
.combo { position: relative; flex: 1; }
.combo input { width: 100%; }
.share .btn.primary[type=submit] { height: 42px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  list-style: none; margin: 0; padding: 4px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto;
}
.suggest-item { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.suggest-item:hover, .suggest-item.hi { background: var(--accent-soft); }
.share > p { margin: 8px 0 0; }
.members-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 6px; }
.members { list-style: none; margin: 0; padding: 0; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.member-text { flex: 1; min-width: 0; }
.member-text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); font-weight: 600; }

/* ---------- Oznámení ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #23262b; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; animation: rise .2s; transition: opacity .3s; }
.toast.error { background: var(--danger); }
.toast.ok { background: #1f6f36; }
.toast.out { opacity: 0; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Mobil ---------- */
.scrim { display: none; }
@media (max-width: 820px) {
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; height: auto;
    transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.25); }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20;
    height: 52px; padding: 0 10px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .topbar-title { font-weight: 700; }
  .view { padding: 20px 16px 80px; }
  .list-head { flex-direction: column; gap: 10px; }
  .list-title, .page-title { font-size: 24px; }
  .task .del { opacity: 1; }
  .task:not(:hover):not(:focus-within) .chip.ghost { opacity: 1; }
  .task:not(:hover):not(:focus-within) .chip.ghost.icon-only { opacity: .7; }
  .comment-del { opacity: .6; }
  .new-meta .btn { margin-left: 0; }
  .filter { flex: 1 1 140px; }
  .list-actions { flex-wrap: wrap; }
  .filter-select { max-width: none; flex: 1; min-width: 0; }
  .page-toolbar { top: 52px; } /* pod horní lištou */
  .page-editor { min-height: 50vh; }
}

/* Notifikace */
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-top .bell-btn { margin-right: -8px; }
.topbar .bell-btn { margin-left: auto; }
.bell-btn.on { color: var(--accent); }
.bell-btn.on .ico { fill: var(--accent-soft); }
.notif-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.notif-status > .ico { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--muted); }
.notif-status.on { border-color: var(--accent); background: var(--accent-soft); }
.notif-status.on > .ico { color: var(--accent); }
.notif-status strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.notif-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.notif-device > .btn { margin-top: 10px; }
.notif-section { margin: 20px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.notif-pref { display: flex; gap: 12px; align-items: flex-start; padding: 9px 2px; cursor: pointer; border-top: 1px solid var(--line); }
.notif-pref:first-child { border-top: 0; }
.notif-pref input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.notif-pref strong { display: block; font-weight: 500; font-size: 14.5px; }
.notif-pref .muted { display: block; margin-top: 1px; }
.notif-note { margin: 12px 0 0; }

/* ---------- Domovská stránka ---------- */
.brand-link { color: inherit; border-radius: 8px; }
.page.home { max-width: 1040px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile-wrap { position: relative; }
.tile {
  display: flex; flex-direction: column; gap: 10px; width: 100%; height: 100%; min-height: 136px; padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.tile:hover, .tile:focus-visible { border-color: #cfd6f3; box-shadow: 0 4px 16px rgba(30, 40, 90, .08); transform: translateY(-1px); }
.tile-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile-ico .ico { width: 20px; height: 20px; }
.tile.page .tile-ico { background: #fff4e6; color: #d9480f; }
.tile-title {
  flex: 1; font-weight: 600; font-size: 15.5px; line-height: 1.3; padding-right: 26px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.tile-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; min-height: 26px; }
.tile-members { display: flex; }
.tile-members .avatar { box-shadow: 0 0 0 2px #fff; }
.tile-members .avatar + .avatar { margin-left: -4px; }
.tile-private { font-size: 12.5px; color: var(--muted); }
.tile-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tile-pin {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s;
}
.tile-pin .ico { width: 16px; height: 16px; transform: rotate(35deg); transition: transform .15s; }
.tile-wrap:hover .tile-pin, .tile-pin:focus-visible { opacity: 1; }
.tile-pin:hover { background: var(--hover); color: var(--ink); }
.tile-pin.on { opacity: 1; color: var(--accent); }
.tile-pin.on .ico { transform: none; }
.tile-pin.on .pin-head { fill: currentColor; }
@media (hover: none) { .tile-pin { opacity: 1; color: #c9c5bc; } .tile-pin.on { color: var(--accent); } }
.my-tile { background: var(--accent); border-color: var(--accent); color: #fff; }
.my-tile:hover, .my-tile:focus-visible { border-color: var(--accent-ink); background: var(--accent-ink); }
.my-tile .tile-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.tile-count { font-size: 13px; opacity: .9; white-space: nowrap; }
.tile-flag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #fff; white-space: nowrap; }
.tile-flag.warn { color: var(--danger); }
.tile-flag.today { color: var(--warn); }
.tile-new { border-style: dashed; background: transparent; color: var(--accent); justify-content: center; align-items: center; text-align: center; }
.tile-new .tile-title { flex: none; padding: 0; font-weight: 500; }
.tile-new:hover { background: var(--accent-soft); }
.home-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.home-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 820px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tile { min-height: 120px; padding: 12px; }
}
