/* tasks.css — Úkoly (TASKS lane): list, filter panel, bulk bar, task page and its tabs, calendar.
   Builds on app.css tokens; own tokens are --tk-*. TaskPark's status colours are kept in spirit but
   darkened where its originals fall under 4.5:1 (blue title, orange pill, faded "čekající"). */
:root {
  --tk-blue: #0b6f9c;          /* status 1 title: TaskPark #00A0DC, darkened to 5.3:1 */
  --tk-blue-line: #8dd9f4;
  --tk-done-bg: #ccf1de;
  --tk-done-fg: #1f5c3a;
  --tk-closed-bg: #e1e1e1;
  --tk-orange: #f7941d;
  --tk-orange-fg: #231f20;
  --tk-check: #3f9b35;
  --tk-unav-bg: #fcdcdc;
  --tk-unav-fg: #8f1d1d;
  --tk-ev-bg: #efefef;
  --tk-ev-hover: #e4e4e4;
  --tk-today: #fff7d6;
  --tk-green: #3f8f2f;
  --tk-cal-h: 150px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tk-blue: #5cc6ef;
    --tk-blue-line: #2f6f87;
    --tk-done-bg: #1f3a2b;
    --tk-done-fg: #bfe8cf;
    --tk-closed-bg: #333336;
    --tk-orange-fg: #161617;
    --tk-check: #6cc35f;
    --tk-unav-bg: #4a2224;
    --tk-unav-fg: #ffd2d2;
    --tk-ev-bg: #262629;
    --tk-ev-hover: #313134;
    --tk-today: #2e2a18;
    --tk-green: #4fa83e;
  }
}

/* ---------------------------------------------------------------- header row: h1 · tabs · tools */
.tk-head { display: flex; align-items: flex-end; gap: 8px 24px; flex-wrap: wrap; margin: 24px 0 0; border-bottom: 1px solid var(--hair); }
.tk-head h1 { margin: 0 8px 10px 0; }
.tk-tabs { display: flex; }
.tk-tabs a { padding: 10px 22px; text-decoration: none; color: var(--text-2); border: 1px solid transparent; border-bottom: 0;
             margin-bottom: -1px; background: transparent; }
.tk-tabs a.on { color: var(--text); background: var(--bg); border-color: var(--hair); border-bottom: 1px solid var(--bg); }
.tk-tabs a:hover { color: var(--text); }
.tk-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; padding-bottom: 8px; }
.tk-tools input[type=search] { width: 260px; min-height: 32px; }
.tk-filterlink { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-s); color: var(--text); text-decoration: none; white-space: nowrap; }
.tk-filterlink.on, .tk-filterlink:hover { text-decoration: underline; }
.tk-lock { margin: 0; }
.tk-iconbtn { background: none; border: 1px solid transparent; color: var(--text-2); cursor: pointer; padding: 4px; border-radius: var(--radius); line-height: 0; }
.tk-iconbtn:hover { border-color: var(--hair); color: var(--text); }
.tk-iconbtn.on { color: var(--text); border-color: var(--hair-strong); }

/* the "Filtr:" panel */
.tk-panel { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; padding: 14px 16px; background: var(--bg-soft);
            border: 1px solid var(--hair); border-top: 0; margin: 0 0 12px; }
.tk-panel-h { font-weight: var(--w-med); padding-top: 22px; }
.tk-cells { display: flex; flex-wrap: wrap; gap: 10px 14px; flex: 1 1 600px; }
.tk-cell { display: flex; flex-direction: column; gap: 4px; min-width: 170px; flex: 1 1 170px; font-size: var(--fs-xs); color: var(--text-2); }
.tk-cell select, .tk-cell input { min-height: 34px; font-size: var(--fs-s); color: var(--text); }
.tk-cell select.multi { min-height: 84px; }
.tk-cell .check { padding-top: 6px; font-size: var(--fs-s); color: var(--text); }
.tk-panel-btns { display: flex; gap: 8px; align-items: center; padding-top: 18px; }

/* saved filters */
.userfilter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; min-height: 30px; }
.tk-uf { display: inline-flex; align-items: center; border-radius: var(--radius); overflow: hidden; font-size: var(--fs-s); background: #a39c9b; }
.tk-uf a, .tk-uf button { color: #fff; text-decoration: none; padding: 4px 10px; background: transparent; border: 0; cursor: pointer; font: inherit; }
.tk-uf button { padding: 4px 8px; border-left: 1px solid rgba(255, 255, 255, .35); }
.tk-uf.ca39c9b { background: #6f6867; } .tk-uf.c7bd148 { background: #3f7a1c; } .tk-uf.c749a25 { background: #4c6618; }
.tk-uf.c30a4ca { background: #1d6f8c; } .tk-uf.c003471 { background: #003471; } .tk-uf.cecb380 { background: #9a5b1f; }
.tk-uf.cff887c { background: #b23a2e; } .tk-uf.cf06eaa { background: #a8306b; }
.tk-addfilter { position: relative; }
.tk-addfilter summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: var(--fs-s); color: var(--text-2); }
.tk-addfilter summary::-webkit-details-marker { display: none; }
.tk-addpop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; background: var(--pop-bg); border: 1px solid var(--hair);
             box-shadow: var(--shadow); padding: 14px; width: 280px; }
.tk-addpop form { display: flex; flex-direction: column; gap: 10px; }
.tk-addpop label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-s); }

/* ---------------------------------------------------------------- the list */
.tk-table { border: 1px solid var(--hair); background: var(--bg); margin: 0 0 14px; overflow-x: auto; }
.tk-list { width: 100%; border-collapse: collapse; }
.tk-list th { text-align: left; font-size: var(--fs-s); font-weight: var(--w-bold); padding: 12px 8px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tk-list td { padding: 9px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tk-list tbody tr:last-child td { border-bottom: 0; }
.tk-list tbody tr:hover td { background: var(--bg-soft); }
.tk-list .sel { width: 34px; padding-left: 14px; }
.tk-list .av { width: 40px; }
.tk-list .ttl { min-width: 260px; }
.tk-list .nw { width: 34px; }
.tk-list .who { color: var(--text-2); font-size: var(--fs-s); }
.tk-list .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: var(--fs-s); }
.tk-list th.num { text-align: right; }
.tk-list .pr { width: 28px; text-align: center; }
.tk-list .due { white-space: nowrap; font-size: var(--fs-s); }
.tk-list .menu { width: 44px; text-align: right; padding-right: 10px; }
.tk-list tr.none td { color: var(--text-2); padding: 28px 16px; }
.tk-title { color: var(--text); text-decoration: none; font-weight: var(--w-reg); }
.viewed_0 .tk-title { font-weight: var(--w-bold); }
.tk-title:hover { text-decoration: underline; }
.tk-ctx { color: var(--text-2); font-size: var(--fs-xs); margin-left: 6px; }
.tk-newwin { color: var(--text-2); display: inline-flex; padding: 5px; border: 1px solid var(--hair); border-radius: var(--radius); }
.tk-newwin:hover { color: var(--text); border-color: var(--hair-strong); }
.ttl .ic { margin-right: 6px; vertical-align: -2px; }
.tk-ic-check { color: var(--tk-check); }

/* statuses (SPEC_00 §2) */
.status_1 .tk-title, .status_1 .tk-ctx { color: var(--tk-blue); }
.status_3 .tk-title { color: var(--text-2); text-decoration: line-through; }
.status_4 .tk-title { color: var(--text-2); text-decoration: line-through; }
.status_4 .avatar { opacity: .7; }
.status_5 .tk-title, .status_6 .tk-title { color: var(--text-2); }
.tk-st { display: inline-flex; flex-direction: column; gap: 3px; font-size: var(--fs-s); white-space: nowrap; border: 1px solid var(--hair);
         padding: 3px 9px; border-radius: var(--radius); background: var(--bg); color: var(--text); }
.tk-st.s1 { border-color: var(--tk-blue-line); }
.tk-st.s3 { background: var(--tk-done-bg); color: var(--tk-done-fg); border-color: transparent; }
.tk-st.s4 { background: var(--tk-closed-bg); border-color: transparent; }
.tk-st.s5, .tk-st.s6 { color: var(--text-2); }
.tk-st.s7 { background: var(--tk-orange); color: var(--tk-orange-fg); border-color: transparent; }
.tk-st progress { appearance: none; -webkit-appearance: none; width: 100%; height: 3px; border: 0; background: var(--hair); display: block; }
.tk-st progress::-webkit-progress-bar { background: var(--hair); }
.tk-st progress::-webkit-progress-value { background: var(--tk-check); }
.tk-st progress::-moz-progress-bar { background: var(--tk-check); }
.tk-prio { font-weight: var(--w-bold); font-size: 15px; }
.tk-prio.p1 { color: var(--text-2); }
.tk-prio.p3 { color: var(--err-fg); }
.tk-prio.p4 { color: var(--err-fg); }

/* row ▾ menu */
.tk-rowmenu { position: relative; display: inline-block; }
.tk-rowmenu summary { list-style: none; cursor: pointer; display: inline-flex; padding: 5px; border: 1px solid var(--hair); border-radius: var(--radius);
                      color: var(--text-2); }
.tk-rowmenu summary::-webkit-details-marker { display: none; }
.tk-rowmenu[open] summary, .tk-rowmenu summary:hover { color: var(--text); border-color: var(--hair-strong); }
.tk-rowpop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 250px; background: var(--pop-bg); border: 1px solid var(--hair);
             box-shadow: var(--shadow); padding: 6px 0; text-align: left; }
.tk-rowpop button, .tk-rowpop a { display: block; width: 100%; text-align: left; padding: 7px 14px; background: none; border: 0; font: inherit;
                                  font-size: var(--fs-s); color: var(--text); cursor: pointer; text-decoration: none; }
.tk-rowpop button:hover, .tk-rowpop a:hover { background: var(--bg-soft); }

/* paging + bulk */
.tk-foot { display: flex; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; margin: 0 0 24px; }
.tk-foot-l { display: flex; align-items: center; gap: 14px; }
.tk-count { font-size: var(--fs-s); color: var(--text-2); }
.tk-more { font-size: 16px; padding: 8px 20px; }
.tk-all { margin-left: auto; font-size: var(--fs-s); }
.tk-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-s); }
.tk-bulk select, .tk-bulk input { min-height: 32px; width: auto; font-size: var(--fs-s); }
.tk-bulk select:not(.multi) { max-width: 260px; }
.tk-bulk select.multi { min-height: 70px; }
.tk-next { display: inline-flex; }
.js .tk-next { display: none; }
.js .tk-next.on { display: inline-flex; }
.tk-tariffs { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 12px; }
.tk-tariffs label { display: flex; align-items: center; gap: 6px; }
.tk-tariffs input { width: 80px; }
.tk-ok { min-height: 32px; padding: 4px 16px; background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }

/* ---------------------------------------------------------------- task page */
.tk-top { margin: 24px 0 18px; }
.tk-top.static .tk-proj { color: var(--text-2); font-size: var(--fs-s); margin: 0 0 6px; }
.tk-projrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.tk-projrow select { width: auto; max-width: 420px; min-height: 32px; font-size: var(--fs-s); }
.tk-iconlink { display: inline-flex; align-items: center; color: var(--text-2); background: none; border: 0; padding: 3px; cursor: pointer; }
.tk-iconlink:hover { color: var(--text); }
.tk-titlerow { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.tk-namebox { flex: 1 1 420px; max-width: 760px; }
.tk-name { font-size: 24px; min-height: 48px !important; padding: 6px 12px !important; }
.tk-namebox.has-err .tk-name { border-color: var(--err-fg); }
.tk-h1 { margin: 0; font-size: var(--fs-h1); }
.tk-prio-r { margin-left: auto; font-size: var(--fs-s); color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.tk-titlerow > select { width: auto; min-height: 32px; font-size: var(--fs-s); }
.tk-tags { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.tk-tagbox { position: relative; }
.tk-tagbox summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); font-size: var(--fs-s);
                     padding: 4px 6px; border: 1px solid transparent; border-radius: var(--radius); }
.tk-tagbox summary::-webkit-details-marker { display: none; }
.tk-tagbox summary:hover, .tk-tagbox[open] summary { border-color: var(--hair); }
.tk-tagpop { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: 340px; background: var(--pop-bg); border: 1px solid var(--hair);
             box-shadow: var(--shadow); padding: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tk-tagpick { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tk-tagpick input { margin: 0; }
.tk-tagpick:not(:has(input:checked)) .tag { opacity: .55; }
.tk-newtag { display: flex; flex-direction: column; gap: 4px; width: 100%; font-size: var(--fs-xs); color: var(--text-2); margin-top: 6px; }

.tk-edit .tabs { margin: 0; }
.tk-tabbody { border: 1px solid var(--hair); border-top: 0; padding: 20px 20px 24px; background: var(--bg); margin: 0 0 18px; }
.tk-tabbody .field { grid-template-columns: 150px minmax(0, 1fr); }
.tk-desc { margin: 0 0 22px; }
.msg-info { background: var(--bg-soft); border: 1px solid var(--hair); padding: 12px 16px; color: var(--text-2); margin: 0; }
.tk-inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-inline input[type=date], .tk-inline input[type=time] { width: auto; }
.tk-note { display: inline-flex; align-items: center; gap: 6px; }
.tk-note summary { list-style: none; cursor: pointer; color: var(--text-2); padding: 4px; }
.tk-note summary::-webkit-details-marker { display: none; }
.tk-note[open] { display: inline-flex; }
.tk-note input { width: 260px; min-height: 32px; }
.tk-done { display: inline-flex; align-items: center; gap: 12px; }
.tk-done input[type=range] { width: 220px; accent-color: var(--btn-bg); }
.tk-done output { min-width: 48px; font-variant-numeric: tabular-nums; }
.tk-remain { display: inline-flex; align-items: center; margin-left: 10px; font-size: var(--fs-s); padding: 0 8px; border: 1px solid var(--hair); background: var(--bg-soft); }
.tk-unav { margin: 6px 0 0; color: var(--tk-unav-fg); background: var(--tk-unav-bg); padding: 4px 8px; font-size: var(--fs-s); display: inline-block; }
.tk-people { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.tk-person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--hair); border-radius: 999px;
             cursor: pointer; font-size: var(--fs-s); color: var(--text-2); }
.tk-person input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tk-person:has(input:checked) { border-color: var(--hair-strong); color: var(--text); background: var(--bg-soft); font-weight: var(--w-med); }
.tk-person:has(input:checked) .avatar { background: var(--btn-bg); color: var(--btn-fg); }
.tk-person:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tk-moreopts { margin: 18px 0 0; border: 1px solid var(--hair); background: var(--bg-soft); }
.tk-moreopts > summary { list-style: none; cursor: pointer; text-align: center; padding: 12px; font-size: var(--fs-s); }
.tk-moreopts > summary::-webkit-details-marker { display: none; }
.tk-moreopts .tk-hide, .tk-moreopts[open] .tk-show { display: none; }
.tk-moreopts[open] .tk-hide { display: inline; }
.tk-moreopts > summary::after { content: " ⌄"; }
.tk-moreopts[open] > summary::after { content: " ⌃"; }
.tk-morebody { padding: 18px 18px 6px; background: var(--bg); border-top: 1px solid var(--hair); }
.tk-price { display: flex; flex-direction: column; gap: 4px; }
.tk-price input[type=text] { width: 140px; min-height: 32px; }
.tk-extras { border-collapse: collapse; }
.tk-extras th { font-weight: var(--w-reg); font-size: var(--fs-s); color: var(--text-2); text-align: left; padding: 0 6px 4px 0; }
.tk-extras td { padding: 0 6px 6px 0; }
.tk-extras input[type=text] { min-height: 32px; width: 120px; }
.tk-extras td:nth-child(3) input { width: 260px; }
.tk-total { display: inline-block; padding-top: 8px; font-variant-numeric: tabular-nums; font-weight: var(--w-med); }
.tk-savebar { display: flex; justify-content: flex-end; align-items: center; gap: 12px 24px; flex-wrap: wrap; margin: 0 0 24px; }
.tk-savebar .check { padding-top: 0; }
.tk-savebar .btn.primary { font-size: 17px; padding: 10px 26px; }
.tk-savebar .tk-delete { color: var(--err-fg); margin-right: auto; }
.tk-delbox { max-width: 70ch; }
.tk-delbox ul { margin: 0 0 12px; padding-left: 20px; }
.tk-delbtns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* rich text */
.tk-rte { border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--input-bg); }
.tk-rte-src { border: 0 !important; min-height: 220px; }
.tk-rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--hair); background: var(--bg-soft); }
.tk-rte-bar button, .tk-rte-bar select { min-height: 30px; min-width: 32px; border: 1px solid transparent; background: transparent; color: var(--text);
                                          border-radius: var(--radius); cursor: pointer; font-size: var(--fs-s); padding: 2px 8px; width: auto; }
.tk-rte-bar button:hover { border-color: var(--hair); background: var(--bg); }
.tk-rte-bar button[data-cmd=bold] { font-weight: 700; } .tk-rte-bar button[data-cmd=italic] { font-style: italic; }
.tk-rte-bar button[data-cmd=underline] { text-decoration: underline; }
.tk-rte-ed { min-height: 240px; max-height: 60vh; overflow: auto; padding: 12px 14px; outline: none; line-height: 1.5; }
.tk-rte-ed:focus { box-shadow: inset 0 0 0 2px var(--focus); }
.tk-rte-ed p, .tk-c-body p { margin: 0 0 10px; }

/* Diskuze / Poznámky */
.tk-c-new, .tk-noteform { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.tk-c-tools, .tk-c-btns { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.tk-c-tools .btn.primary, .tk-c-btns .btn.primary { margin-left: auto; }
.tk-green.btn.primary { background: var(--tk-green); border-color: var(--tk-green); color: #fff; }
.tk-file { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-s); position: relative; }
.tk-file input[type=file] { font-size: var(--fs-xs); max-width: 230px; }
.tk-c { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair); }
.tk-c.reply { border-top: 0; padding: 10px 0 0 0; }
.tk-c-main { flex: 1; min-width: 0; }
.tk-c-head { margin: 0 0 4px; font-size: var(--fs-s); color: var(--text-2); }
.tk-c-head b { color: var(--text); font-weight: var(--w-med); }
.tk-c-body { overflow-wrap: anywhere; }
.tk-c-acts { display: flex; gap: 14px; align-items: flex-start; font-size: var(--fs-s); margin-top: 6px; flex-wrap: wrap; }
.tk-c-files { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-s); }
.tk-reply summary { cursor: pointer; text-decoration: underline; list-style: none; }
.tk-reply summary::-webkit-details-marker { display: none; }
.tk-reply[open] { flex-basis: 100%; }
.tk-c-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.tk-inline-form { margin: 0; display: inline; }
.tk-linkbtn { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }
.tk-muted { color: var(--text-2); }
.tk-note-item { border-top: 1px solid var(--hair); padding: 14px 0; }
.tk-note-item h3 { margin: 0 0 4px; font-size: var(--fs); font-weight: var(--w-med); }
.tk-notevis { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; font-size: var(--fs-s); }
.tk-notevis select { width: auto; min-width: 180px; }
.js .tk-notevis .tk-vis-role, .js .tk-notevis .tk-vis-user { display: none; }
.js .tk-notevis.role .tk-vis-role, .js .tk-notevis.user .tk-vis-user { display: block; }

/* Výkazy / Přílohy / Historie tables */
.tk-tabhead { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.tk-rsort { display: flex; gap: 12px; font-size: var(--fs-s); color: var(--text-2); }
.tk-rsort a.on { color: var(--text); font-weight: var(--w-med); text-decoration: none; }
.tk-reports, .tk-att, .tk-hist { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.tk-reports th, .tk-att th, .tk-hist th { text-align: left; font-weight: var(--w-bold); padding: 9px 8px; border-bottom: 1px solid var(--hair-strong); white-space: nowrap; }
.tk-reports td, .tk-att td, .tk-hist td, .tk-reports tbody th { padding: 8px; border-bottom: 1px solid var(--hair); vertical-align: top; text-align: left; font-weight: var(--w-reg); }
.tk-reports tfoot th, .tk-reports tfoot td { border-bottom: 0; font-weight: var(--w-med); padding-top: 10px; }
.tk-reports .add-report th, .tk-reports .add-report td, .tk-reports tr.editing th, .tk-reports tr.editing td { background: var(--bg-soft); }
.tk-reports input, .tk-reports select, .tk-reports textarea { min-height: 30px; font-size: var(--fs-s); padding: 3px 6px; }
.tk-reports textarea { min-height: 30px; }
.tk-reports input[type=date] { width: 140px; }
.tk-hm { display: inline-flex; gap: 4px; }
.tk-hm input { width: 64px; }
.tk-reports .check { padding-top: 4px; white-space: nowrap; }
.tk-reports .acts, .tk-att .acts { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.tk-move { position: relative; display: inline-block; }
.tk-move summary { list-style: none; }
.tk-move summary::-webkit-details-marker { display: none; }
.tk-movepop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 290px; background: var(--pop-bg); border: 1px solid var(--hair);
              box-shadow: var(--shadow); padding: 12px; white-space: normal; }
.tk-movepop form { display: flex; flex-direction: column; gap: 8px; }
.tk-movepop label { display: flex; flex-direction: column; gap: 4px; }
.tk-movepop p { margin: 0; }
.tk-nofile { color: var(--text-2); }
.tk-nofile small { font-size: var(--fs-xs); font-style: italic; margin-left: 4px; }
.tk-tplpick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 20px 0 0; font-size: var(--fs-s); }
.tk-tplpick select { width: auto; max-width: 100%; min-height: 32px; font-size: var(--fs-s); }
.tk-tplpick .btn { min-height: 32px; padding: 2px 12px; }
.tk-budget summary { cursor: pointer; text-decoration: underline; font-size: var(--fs-s); padding-top: 8px; }
.tk-budget-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 8px; font-size: var(--fs-s); }
.tk-budget-body label { display: flex; flex-direction: column; gap: 4px; }
.tk-budget-body input { min-height: 32px; width: 140px; }
.tk-budget-body label:nth-child(2) input { width: 260px; max-width: 100%; }
.tk-budlist { margin: 8px 0 0; padding-left: 18px; font-size: var(--fs-s); color: var(--text-2); }
.tk-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.tk-drop { flex: 1 1 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; border: 1px dashed var(--input-border);
           color: var(--text-2); cursor: pointer; text-align: center; font-size: var(--fs-s); }
.tk-drop.over { border-color: var(--focus); background: var(--bg-soft); }
.tk-mini { border-collapse: collapse; margin: 6px 0; font-size: var(--fs-xs); }
.tk-mini th, .tk-mini td { border: 1px solid var(--hair); padding: 3px 6px; text-align: left; }
.tk-hdet summary { cursor: pointer; color: var(--link); text-decoration: underline; font-size: var(--fs-xs); }
.tk-hist td .tk-c-body { max-height: 260px; overflow: auto; border-left: 2px solid var(--hair); padding-left: 8px; margin-top: 6px; }

/* ---------------------------------------------------------------- calendar */
.tk-caltool { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; flex-wrap: wrap; }
.tk-calnav { display: flex; align-items: center; gap: 12px; }
.tk-calnav h2 { margin: 0; font-size: 20px; min-width: 14ch; text-align: center; }
.tk-calnav .btn, .tk-today { min-height: 30px; padding: 2px 12px; }
.tk-seg { display: inline-flex; border: 1px solid var(--input-border); border-radius: var(--radius); overflow: hidden; }
.tk-seg a { padding: 5px 14px; text-decoration: none; color: var(--text-2); font-size: var(--fs-s); }
.tk-seg a + a { border-left: 1px solid var(--input-border); }
.tk-seg a.on { background: var(--btn-bg); color: var(--btn-fg); }
.tk-cal { border: 1px solid var(--hair); background: var(--bg); margin: 0 0 24px; }
.tk-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tk-day { border-left: 1px solid var(--hair); min-height: 420px; }
.tk-day:first-child { border-left: 0; }
.tk-dh { font-size: var(--fs-s); font-weight: var(--w-med); padding: 8px; border-bottom: 1px solid var(--hair); background: var(--bg-soft); text-align: center; }
.tk-day.today .tk-dbody, .tk-mday.today { background: var(--tk-today); }
.tk-dbody { padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.tk-mhead, .tk-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tk-mh { text-align: center; font-size: var(--fs-s); font-weight: var(--w-med); padding: 7px; background: var(--bg-soft); border-bottom: 1px solid var(--hair); border-left: 1px solid var(--hair); }
.tk-mh:first-child { border-left: 0; }
.tk-mday { border-left: 1px solid var(--hair); border-bottom: 1px solid var(--hair); min-height: var(--tk-cal-h); }
.tk-mday:nth-child(7n+1) { border-left: 0; }
.tk-mday.other .tk-dn { color: var(--text-2); opacity: .7; }
.tk-dn { text-align: right; font-size: var(--fs-xs); padding: 3px 6px 0; color: var(--text-2); }
.tk-wd { display: none; }
.tk-ev { display: block; background: var(--tk-ev-bg); border-radius: var(--radius); padding: 3px 6px 4px; font-size: var(--fs-xs); line-height: 1.3;
         color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.tk-ev:hover { background: var(--tk-ev-hover); }
.tk-ev .n { display: block; font-size: 12.5px; }
.tk-ev small { display: block; color: var(--text-2); font-size: 11px; }
.tk-ev .ic { margin-right: 4px; vertical-align: -1px; }
.tk-ev .tk-prio { font-size: 12px; margin-right: 4px; }
.tk-ev.status_1 .n { color: var(--tk-blue); }
.tk-ev.status_3 .n, .tk-ev.status_3 small, .tk-ev.status_4 .n, .tk-ev.status_4 small { text-decoration: line-through; color: var(--text-2); }
.tk-ev.status_5 .n, .tk-ev.status_6 .n { color: var(--text-2); }
.tk-ev.status_7 { box-shadow: inset 3px 0 0 var(--tk-orange); }
.tk-ev.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tk-ev.more { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tk-ev.holiday, .tk-ev.unav { background: var(--tk-unav-bg); color: var(--tk-unav-fg); }
body.tk-win { display: block; min-height: 0; }
.tk-window { padding: 8px 12px; }

/* ---------------------------------------------------------------- narrow */
@media (max-width: 860px) {
  .tk-head { align-items: stretch; }
  .tk-tools { margin-left: 0; width: 100%; flex-wrap: wrap; order: 3; padding-top: 8px; }
  .tk-tools input[type=search] { flex: 1 1 200px; width: auto; }
  .tk-tabbody { padding: 14px 12px 18px; }
  .tk-tabbody .field { grid-template-columns: 1fr; }
  .tk-prio-r { margin-left: 0; }
  .tk-name { font-size: 20px; }
  .tk-projrow select { flex: 1 1 100%; max-width: 100%; min-width: 0; }
  .tk-namebox { flex: 1 1 100%; min-width: 0; }
  .tk-edit, .tk-tabbody, .tk-edit .tabs { min-width: 0; max-width: 100%; }
  .tk-week { grid-template-columns: 1fr; }
  .tk-day { border-left: 0; border-top: 1px solid var(--hair); min-height: 0; }
  .tk-day:first-child { border-top: 0; }
  .tk-dh { text-align: left; }
  .tk-mhead { display: none; }
  .tk-mgrid { grid-template-columns: 1fr; }
  .tk-mday { border-left: 0; min-height: 0; }
  .tk-mday.other { display: none; }
  .tk-mday .tk-dbody:empty { display: none; }
  .tk-dn { text-align: left; font-weight: var(--w-med); color: var(--text); padding: 6px 8px; background: var(--bg-soft); }
  .tk-wd { display: inline; }
  .tk-calnav h2 { min-width: 0; font-size: 17px; }
  .tk-tagpop { width: min(340px, calc(100vw - 32px)); }
  .tk-extras td:nth-child(3) input { width: 140px; }
}
@media (max-width: 600px) {
  .tk-table { border: 0; background: transparent; overflow: visible; }
  .tk-list, .tk-list tbody, .tk-list tr { display: block; width: 100%; }
  .tk-list thead { display: none; }
  .tk-list tr { position: relative; border: 1px solid var(--hair); background: var(--bg); margin: 0 0 10px; padding: 10px 12px 8px 44px;
                display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
  .tk-list td { display: block; border: 0; padding: 0; }
  .tk-list tbody tr:hover td { background: transparent; }
  .tk-list td.sel { position: absolute; left: 14px; top: 12px; padding: 0; width: auto; }
  .tk-list td.av, .tk-list td.nw { display: none; }
  .tk-list td.ttl { grid-column: 1 / -1; min-width: 0; }
  .tk-list td.who { grid-column: 1 / -1; }
  .tk-list td.who:empty { display: none; }
  .tk-list td.num { text-align: left; }
  .tk-list td.num::before { content: "Náročnost "; color: var(--text-2); }
  .tk-list td.st { grid-column: 1 / -1; }
  .tk-list td.pr:empty { display: none; }
  .tk-list td.due:not(:empty)::before { content: "Dokončit "; color: var(--text-2); }
  .tk-list td.menu { position: absolute; right: 8px; bottom: 8px; width: auto; }
  .tk-list tr.none { display: block; padding: 18px; }
  .tk-foot { flex-direction: column; }
  .tk-all { margin-left: 0; }
  .tk-bulk select:not(.multi) { max-width: 100%; }
  .tk-reports thead, .tk-att thead, .tk-hist thead { display: none; }
  .tk-reports, .tk-reports tbody, .tk-reports tfoot, .tk-reports tr, .tk-reports td, .tk-reports th,
  .tk-att, .tk-att tbody, .tk-att tr, .tk-att td, .tk-hist, .tk-hist tbody, .tk-hist tr, .tk-hist td { display: block; width: 100%; }
  .tk-reports tr, .tk-att tr, .tk-hist tr { border-bottom: 1px solid var(--hair); padding: 8px 0; }
  .tk-reports td, .tk-reports th, .tk-att td, .tk-hist td { border: 0; padding: 2px 0; }
  .tk-reports td[data-label]::before, .tk-att td[data-label]:not(.primary)::before, .tk-hist td[data-label]::before {
    content: attr(data-label) ": "; color: var(--text-2); font-size: var(--fs-xs); }
  .tk-reports textarea { width: 100%; }
  .tk-movepop { right: auto; left: 0; }
  .tk-c-tools .btn.primary, .tk-c-btns .btn.primary { margin-left: 0; width: 100%; }
  .tk-savebar { justify-content: stretch; }
  .tk-savebar .btn.primary { width: 100%; }
  .tk-note input { width: 200px; }
}
