/* Plan – dva vzhledy: výchozí (měkký, zelený) a „cronpad“ (technický, tenké linky, oranžový).
   Přechody podle receptů transitions.dev (tabs sliding, checkbox check, modal, page side-by-side, number subtle change). */
:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --field: #ecebe5;
  --hover: #efeee8;
  --line: #e4e2da;
  --line-strong: #d3d1c8;
  --text: #1b1b19;
  --muted: #86847c;
  --faint: #b9b7ae;
  --accent: #1f9d6b;
  --on-accent: #ffffff;
  --bad: #d64545;
  --r: 14px;
  --r-pill: 999px;
  --r-check: 7px;
  --r-av: 50%;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 6px 18px -8px rgb(0 0 0 / .10);
  --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .22);
  --sans: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: var(--sans);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="cronpad"] {
  --bg: #fafaf9;
  --surface: #ffffff;
  --field: #f3f3f0;
  --hover: #f4f4f2;
  --line: #e7e5e2;
  --line-strong: #d4d2ce;
  --text: #191817;
  --muted: #74716c;
  --faint: #a9a6a0;
  --accent: #f0571b;
  --on-accent: #ffffff;
  --r: 6px;
  --r-pill: 6px;
  --r-check: 4px;
  --r-av: 6px;
  --shadow: none;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: ui-monospace, "SF Mono", "Geist Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1f1f1d; --field: #2a2a27; --hover: #262624; --line: #2e2e2b; --line-strong: #3d3d39;
    --text: #edece8; --muted: #94928a; --faint: #5f5d57; --accent: #35b985; --on-accent: #08130e; --bad: #f07070;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .7);
  }
  :root[data-theme="cronpad"] {
    --bg: #0b0b0b; --surface: #111110; --field: #1a1a18; --hover: #181817; --line: #232321; --line-strong: #34332f;
    --text: #ecebe8; --muted: #8f8c86; --faint: #5b5954; --accent: #ff6a2c; --on-accent: #120a05; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { border: 0; background: none; outline: none; min-width: 0; }
::placeholder { color: var(--faint); opacity: 1; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline: none; }
svg { display: block; }

.shell { max-width: 720px; margin: 0 auto; padding: 20px 16px 80px; min-height: 100dvh; }

/* ── hlavička ───────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.tabs-wrap { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: -4px; padding: 4px; }
.tabs-wrap::-webkit-scrollbar { display: none; }

.t-tabs { position: relative; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: var(--r-pill); background: var(--field); }
.t-tab { position: relative; z-index: 1; height: 30px; padding: 0 13px; border-radius: var(--r-pill); color: var(--muted); font-weight: 550; font-size: 14px; white-space: nowrap; transition: color 250ms var(--ease); }
.t-tab:hover, .t-tab[aria-selected="true"] { color: var(--text); }
.t-tab.add { padding: 0 9px; }
.t-tab.add svg { width: 12px; height: 12px; }
.t-tabs-pill { position: absolute; top: 3px; left: 0; height: 30px; width: 0; border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .08); transition: transform 250ms var(--ease), width 250ms var(--ease); will-change: transform, width; pointer-events: none; }
.new-project { position: relative; z-index: 1; height: 30px; width: 0; padding: 0; font-size: 14px; font-weight: 550; transition: width 250ms var(--ease), padding 250ms var(--ease); }
.new-project.is-open { width: 130px; padding: 0 10px; }

.people { display: flex; align-items: center; gap: 2px; flex: none; }
.person { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 4px; border-radius: var(--r-pill); transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 150ms var(--ease); }
.person:hover { background: var(--hover); }
.person[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.person.me .name { color: var(--text); font-weight: 650; }
.name { font-weight: 550; font-size: 14px; color: var(--muted); transition: color 200ms var(--ease); }
.person:hover .name, .person[aria-pressed="true"] .name { color: var(--text); }
.count { position: relative; display: inline-block; min-width: 1ch; text-align: center; font: 650 14px var(--num); font-variant-numeric: tabular-nums; }
.count .n-old { position: absolute; inset: 0; }
.count .n-new { display: inline-block; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--muted); transition: background-color 150ms, color 150ms, transform 150ms var(--ease); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
button:active:not(.body) { transform: scale(.96); }

.av { display: block; width: 28px; height: 28px; border-radius: var(--r-av); overflow: hidden; flex: none; transition: border-radius 250ms var(--ease); }
.av { width: 30px; height: 30px; }
.av img, .av svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.av.s { width: 26px; height: 26px; }

/* ── nový úkol ──────────────────────────────────────────── */
.composer { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); transition: box-shadow 250ms var(--ease); }
.composer .line { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; }
.f-title { flex: 1; width: 100%; height: 50px; font-size: 16px; font-weight: 550; }
.send { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity 200ms var(--ease), transform 250ms var(--ease); }
.send svg { width: 15px; height: 15px; }
.composer.has-text .send { opacity: 1; transform: none; pointer-events: auto; }
.composer.has-text .send:active { transform: scale(.92); }
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 350ms var(--ease); }
.more > div { overflow: hidden; min-height: 0; opacity: 0; filter: blur(2px); transition: opacity 250ms var(--ease), filter 250ms var(--ease); }
.composer.open .more { grid-template-rows: 1fr; }
.composer.open .more > div { opacity: 1; filter: none; }
.more .pad { padding: 0 16px 14px; display: grid; gap: 12px; }
.f-desc { display: block; width: 100%; resize: none; field-sizing: content; min-height: 1.45em; max-height: 40vh; line-height: 1.45; color: var(--text); }
.f-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.slider { flex: 0 1 290px; margin-left: auto; display: flex; align-items: center; gap: 7px; height: 28px; outline: none; user-select: none; -webkit-user-select: none; }
.sl-icon { flex: none; color: var(--muted); }
.sl-icon svg { width: 15px; height: 15px; }
.sl-val { flex: none; width: 50px; font: 650 14px var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-track { position: relative; flex: 1; height: 28px; margin: 0 9px; cursor: grab; touch-action: none; }
.sl-track::before { content: ""; position: absolute; inset: -6px -9px; }
.sl-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; }
.sl-ticks i { width: 2px; height: calc(5px + var(--k, 0) * 9px); border-radius: 2px; background: var(--line-strong); transition: height 300ms var(--ease), background-color 200ms var(--ease); }
.sl-ticks i.on { background: var(--accent); }
.sl-thumb { position: absolute; top: 50%; left: calc(1px + var(--p, 0) * (100% - 2px)); width: 16px; height: 24px; margin: -12px 0 0 -8px; display: grid; place-items: center; border-radius: 7px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgb(0 0 0 / .16); transition: left 250ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.sl-thumb::after { content: ""; width: 2px; height: 10px; border-radius: 2px; background: var(--accent); }
.slider.drag .sl-track { cursor: grabbing; }
.slider.drag .sl-thumb { transform: scale(1.1); transition-duration: 120ms, 200ms, 200ms; box-shadow: 0 0 0 1px var(--line), 0 6px 16px rgb(0 0 0 / .22); }
.slider:focus-visible .sl-thumb { box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgb(0 0 0 / .16); }

.choice { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: var(--field); color: var(--muted); font: 550 13px var(--num); white-space: nowrap; transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 150ms var(--ease); }
.chip:hover { color: var(--text); }
.chip[aria-checked="true"] { background: var(--text); color: var(--bg); }
.chip.who { padding: 0 11px 0 3px; }
.chip.who img { width: 22px; height: 22px; border-radius: var(--r-av); object-fit: cover; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pick { width: 30px; height: 30px; border-radius: var(--r-av); opacity: .4; filter: grayscale(.6); transition: opacity 200ms var(--ease), filter 200ms var(--ease), box-shadow 200ms var(--ease), transform 150ms var(--ease); }
.pick img, .pick svg { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-av); }
.pick:hover { opacity: .8; }
.pick[aria-checked="true"] { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.pick.nobody { color: var(--muted); }

/* ── seznam ─────────────────────────────────────────────── */
.meta { height: 40px; display: flex; align-items: center; justify-content: flex-end; padding: 0 4px; color: var(--muted); font: 500 13px var(--num); font-variant-numeric: tabular-nums; }
.meta.sep { margin-top: 6px; }
.list { position: relative; list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin-bottom: 6px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); transition: opacity 300ms var(--ease), background-color 150ms; }
.task.done { opacity: .5; box-shadow: none; background: transparent; }
.task .body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px; text-align: left; cursor: pointer; border-radius: 6px; }
.title { flex: 1 1 60%; min-width: 0; font-weight: 550; overflow-wrap: anywhere; transition: color 300ms var(--ease); }
.task.done .title { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.tag { --c: var(--muted); flex: none; height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: var(--r-pill); background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 82%, var(--text)); font-size: 12px; font-weight: 650; white-space: nowrap; }
.est { flex: none; min-width: 62px; display: inline-flex; align-items: center; gap: 6px; color: var(--text); font: 650 13px var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pie { flex: none; width: 13px; height: 13px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), transparent 0); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.task.done .pie { filter: grayscale(1); }
.task > .av.none { display: none; }

.t-check { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-check); box-shadow: inset 0 0 0 1.5px var(--faint); transition: background 150ms var(--ease), box-shadow 150ms var(--ease), transform 150ms var(--ease); }
.t-check:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
.t-check svg { width: 10px; height: 10px; fill: none; stroke: var(--on-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.t-check svg path { stroke-dasharray: 15; stroke-dashoffset: 15; transition: stroke-dashoffset 150ms var(--ease); }
.t-check[aria-checked="true"] { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.t-check[aria-checked="true"] svg path { stroke-dashoffset: 0; transition: stroke-dashoffset 350ms var(--ease); }

/* ── úprava úkolu ───────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .32); opacity: 0; transition: opacity 250ms var(--ease); }
.backdrop.is-open { opacity: 1; }
.t-modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; gap: 12px; padding: 8px 18px 16px; background: var(--surface); border-radius: calc(var(--r) + 4px); box-shadow: var(--shadow-lg); transform-origin: center; transform: scale(.96); opacity: 0; transition: transform 250ms var(--ease), opacity 250ms var(--ease); will-change: transform, opacity; }
.t-modal.is-open { transform: scale(1); opacity: 1; }
.t-modal.is-closing { transform: scale(.96); opacity: 0; transition-duration: 150ms; }
.t-modal .f-title { height: 44px; font-size: 17px; }
.t-modal .f-desc { min-height: 4.4em; }
.foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.btn { height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; transition: background-color 150ms, color 150ms, transform 150ms var(--ease); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.quiet { color: var(--muted); margin-left: -14px; }
.btn.quiet:hover, .btn.quiet.sure { color: var(--bad); }

/* ── vstup ──────────────────────────────────────────────── */
.login { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 26px; padding: 16px; }
.duo { display: flex; }
.duo .av { width: 72px; height: 72px; box-shadow: 0 0 0 4px var(--bg); }
.duo .av + .av { margin-left: -14px; }
.code { width: 220px; height: 46px; text-align: center; font-size: 17px; font-weight: 550; letter-spacing: .08em; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--shadow); }
.shake { animation: shake 360ms var(--ease); }
@keyframes shake { 0% { transform: none; } 20% { transform: translateX(-6px); } 42% { transform: translateX(6px); } 62% { transform: translateX(-4px); } 80% { transform: translateX(4px); } 100% { transform: none; } }

/* ── vzhled „cronpad“: sloupec s tenkými linkami ────────── */
[data-theme="cronpad"] .shell { max-width: 760px; padding: 0 0 80px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
[data-theme="cronpad"] .top { position: relative; margin: 0; padding: 0 12px 0 16px; height: 56px; border-bottom: 1px solid var(--line); }
[data-theme="cronpad"] .top::before, [data-theme="cronpad"] .top::after,
[data-theme="cronpad"] .composer::before, [data-theme="cronpad"] .composer::after {
  content: ""; position: absolute; bottom: -5px; width: 9px; height: 9px; z-index: 2; pointer-events: none;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 9px no-repeat, linear-gradient(var(--line-strong), var(--line-strong)) center / 9px 1px no-repeat;
}
[data-theme="cronpad"] .top::before, [data-theme="cronpad"] .composer::before { left: -5px; }
[data-theme="cronpad"] .top::after, [data-theme="cronpad"] .composer::after { right: -5px; }
[data-theme="cronpad"] .t-tabs { background: none; padding: 3px 0; }
[data-theme="cronpad"] .t-tabs-pill { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgb(0 0 0 / .04); }
[data-theme="cronpad"] .t-tab, [data-theme="cronpad"] .new-project { font: 500 12px var(--num); letter-spacing: .08em; text-transform: uppercase; }
[data-theme="cronpad"] .person[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--line-strong); }
[data-theme="cronpad"] .composer { position: relative; border-radius: 0; border-bottom: 1px solid var(--line); }
[data-theme="cronpad"] .f-title, [data-theme="cronpad"] .title { font-weight: 600; }
[data-theme="cronpad"] .chip { background: none; box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: 12px; }
[data-theme="cronpad"] .chip[aria-checked="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
[data-theme="cronpad"] .meta { height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
[data-theme="cronpad"] .task { margin: 0; padding: 14px 16px; border-radius: 0; border-bottom: 1px solid var(--line); }
[data-theme="cronpad"] .task:not(.done):hover { background: var(--hover); }
[data-theme="cronpad"] .task.done { background: var(--bg); }
[data-theme="cronpad"] .tag { height: 20px; padding: 0 7px; background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); font: 500 10.5px var(--num); letter-spacing: .08em; text-transform: uppercase; }
[data-theme="cronpad"] .est { font-weight: 500; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; min-width: 70px; }
[data-theme="cronpad"] .meta.sep { margin: 0; }
[data-theme="cronpad"] .name { font: 500 11.5px var(--num); letter-spacing: .08em; text-transform: uppercase; }
[data-theme="cronpad"] .sl-val { font-weight: 500; font-size: 12.5px; width: 54px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
[data-theme="cronpad"] .sl-ticks i { width: 1px; border-radius: 0; }
[data-theme="cronpad"] .sl-thumb { width: 14px; margin-left: -7px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-strong), 0 1px 2px rgb(0 0 0 / .06); }
[data-theme="cronpad"] .sl-thumb::after { width: 1px; }
[data-theme="cronpad"] .slider.drag .sl-thumb { box-shadow: inset 0 0 0 1px var(--accent), 0 4px 12px rgb(0 0 0 / .14); }
[data-theme="cronpad"] .t-modal { border-radius: 8px; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line-strong); }
[data-theme="cronpad"] .code { box-shadow: inset 0 0 0 1px var(--line-strong); font-family: var(--num); }
[data-theme="cronpad"] .send { border-radius: var(--r); }

@media (max-width: 560px) {
  .shell { padding: 12px 10px 60px; }
  .top { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
  .people { order: -1; width: 100%; justify-content: flex-end; }
  .tabs-wrap { flex-basis: 100%; }
  .est { min-width: 0; }
  .slider { flex: 1 1 100%; }
  [data-theme="cronpad"] .top { height: auto; padding: 8px 10px 8px 12px; }
  [data-theme="cronpad"] .est { min-width: 0; }
  .icon-btn { width: 28px; }
  .task { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
