/* Projekt- & ToDo-Verwaltung */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --ink: #1d2430;
  --ink-2: #4b5563;
  --muted: #8a8f98;
  --line: #e4e1da;
  --side: #1f2a37;
  --side-ink: #c9d1dc;
  --accent: #0f766e;
  --accent-soft: #e2f1ef;
  --alert: #c2410c;
  --alert-soft: #fdeee6;
  --today: #b45309;
  --high: #be123c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 31, .05), 0 2px 8px rgba(20, 24, 31, .04);
  --tabbar-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2028;
    --surface-2: #161b22;
    --ink: #e7eaee;
    --ink-2: #b4bcc6;
    --muted: #7d8794;
    --line: #2a323d;
    --side: #0d1116;
    --side-ink: #a8b2bf;
    --accent: #2dd4bf;
    --accent-soft: #123532;
    --alert: #fb923c;
    --alert-soft: #3a2116;
    --today: #fbbf24;
    --high: #fb7185;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 228px;
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 20px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #fff; padding: 0 10px 22px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 16px;
}
.sidebar nav, .sidebar-foot { display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot { margin-top: auto; }
.sidebar a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: var(--side-ink); font-weight: 500;
}
.sidebar a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar a.active { background: rgba(255,255,255,.1); color: #fff; }

.main { margin-left: 228px; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 32px 10px; max-width: 1180px;
}
.topbar h1 { font-size: 24px; letter-spacing: -.01em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 8px 32px 48px; max-width: 1180px; }
.mobile-only { display: none !important; }
.tabbar { display: none; }

/* ---------- Timer-Leiste ---------- */
.timerbar {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 32px 10px; max-width: 1116px; padding: 10px 12px 10px 16px;
  background: var(--accent); color: #fff; border-radius: var(--radius);
}
.timer-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.timer-info span { font-size: 13px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-clock { font-variant-numeric: tabular-nums; font-size: 18px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.btn-stop { background: #fff !important; color: var(--accent) !important; border: 0 !important; }
@media (prefers-color-scheme: dark) { .timerbar { color: #06201d; } .pulse { background: #06201d; } .btn-stop { background: #06201d !important; color: var(--accent) !important; } }

.flash {
  margin: 6px 32px 6px; max-width: 1116px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--ink); font-weight: 500;
  animation: fadeout 4s forwards 3s;
}
@keyframes fadeout { to { opacity: 0; height: 0; padding: 0; margin: 0; } }

/* ---------- Bausteine ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=date] { min-height: 40px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); white-space: nowrap; min-height: 40px;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06201d; } }
.btn-block { width: 100%; }
.btn-small { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn-danger-ghost { color: var(--alert); background: transparent; border-color: transparent; }
.btn-danger-ghost:hover { background: var(--alert-soft); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--accent); text-decoration: none; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .ic { width: 17px; height: 17px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.flip .ic { transform: rotate(180deg); }

.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.tag-high { background: color-mix(in srgb, var(--high) 14%, transparent); color: var(--high); }
.tag-live { background: var(--accent-soft); color: var(--accent); }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; margin-left: 4px; vertical-align: 2px; }
.empty { color: var(--muted); padding: 14px 2px; margin: 0; }
.empty.big { padding: 40px 0; text-align: center; font-size: 16px; }
.alert { background: var(--alert-soft); color: var(--alert); padding: 10px 12px; border-radius: 9px; font-weight: 500; }

.due { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.due.is-overdue { color: var(--alert); }
.due.is-today { color: var(--today); }

/* ---------- Dashboard ---------- */
.greeting { margin: 0 0 14px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; color: var(--ink);
}
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat strong { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat strong .ic { width: 26px; height: 26px; color: var(--accent); }
.stat span { font-size: 13px; color: var(--muted); }
.stat-alert { background: var(--alert-soft); border-color: transparent; }
.stat-alert strong { color: var(--alert); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 8px; }
.dash-side { display: flex; flex-direction: column; gap: 18px; }
.dash-side .time-forms { grid-template-columns: 1fr; }

.block { margin: 0 0 20px; }
.block h2, .section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 8px 2px; font-weight: 700; }
.block.is-alert h2 { color: var(--alert); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 8px; }
.section-head h2 { margin: 0; }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); }
.row-link:hover { background: var(--surface-2); text-decoration: none; }
.row-link > span:first-child, .row-link .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.row-link small { font-weight: 400; font-size: 12.5px; }
.row-link .right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }

/* ToDos */
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 10px 10px 10px 12px; }
.todo-check { flex: none; }
.check {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 1px; transition: .15s;
}
.check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.check:hover { border-color: var(--accent); }
.check:hover svg { opacity: .35; stroke: var(--accent); }
.is-high .check { border-color: color-mix(in srgb, var(--high) 55%, var(--line)); }
.is-done .check { background: var(--accent); border-color: var(--accent); }
.is-done .check svg { opacity: 1; stroke: #fff; }
.todo-body { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.todo-title { font-weight: 500; overflow-wrap: anywhere; }
.is-done .todo-title { color: var(--muted); text-decoration: line-through; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.todo-meta:empty { display: none; }
.todo-meta .proj { color: var(--muted); }
.todo-meta .proj:hover { color: var(--accent); }
.has-details { font-weight: 700; }
.todo-play { flex: none; opacity: .45; transition: opacity .15s; }
.todo:hover .todo-play { opacity: 1; }
.todo.is-leaving { opacity: .4; transition: opacity .3s; }

.quickadd { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.quickadd > input[name=title] { border: 0; font-size: 16px; padding: 8px 8px; }
.quickadd > input[name=title]:focus { outline: none; }
.quickadd-row { display: flex; gap: 8px; }
.quickadd-row select[name=project_id] { flex: 1.6; }
.quickadd-row input[type=date] { flex: 1; }
.quickadd-row select[name=priority] { flex: .8; }
.quickadd:not(:focus-within) .quickadd-row { display: none; }
.quickadd:has(input[name=title]:not(:placeholder-shown)) .quickadd-row { display: flex; }

.done-list { margin-top: 16px; }
.done-list summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 2px; }
.done-list .list { margin-top: 6px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.active { background: var(--ink); color: var(--surface); }
.filters { display: flex; gap: 8px; flex: 1; justify-content: flex-end; max-width: 520px; }
.filters select, .filters input { max-width: 260px; }

/* Projekte */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.project-card { display: flex; flex-direction: column; gap: 8px; color: var(--ink); border-left: 4px solid var(--accent); }
.project-card:hover { text-decoration: none; border-color: var(--line); border-left-color: var(--accent); transform: translateY(-1px); }
.project-card h3 { font-size: 16.5px; }
.project-card.status-wartet { border-left-color: var(--today); }
.project-card.status-pausiert { border-left-color: var(--muted); }
.project-card.status-abgeschlossen { border-left-color: var(--line); opacity: .75; }
.pc-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pc-customer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { white-space: nowrap; }
.pc-meta { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress.warn span { background: var(--today); }
.progress.over span { background: var(--alert); }

.project-head, .customer-head { margin-bottom: 16px; display: flex; flex-direction: column; gap: 14px; }
.ph-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ph-customer { font-weight: 600; }
.ph-desc { margin: 6px 0 0; color: var(--ink-2); white-space: normal; }
.ph-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.fact { display: flex; flex-direction: column; gap: 1px; }
.fact small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.fact strong { font-size: 17px; }
.fact .muted { font-size: 12.5px; }
.status-select { width: auto; padding: 5px 9px; font-weight: 600; font-size: 14px; }
.contact-lines { display: flex; flex-direction: column; gap: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Zeiten */
.time-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.time-forms .card { display: flex; flex-direction: column; gap: 9px; }
.time-forms h3 { font-size: 15px; }
.times > li { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; }
.t-date { width: 70px; flex: none; font-size: 13px; color: var(--muted); font-weight: 600; }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-main small { font-size: 12.5px; }
.t-dur { font-weight: 700; font-variant-numeric: tabular-nums; }
.month-nav { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.month-nav h2 { font-size: 20px; min-width: 170px; text-align: center; }
.bars > li { padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr 60px; align-items: center; gap: 14px; padding: 10px 14px; color: var(--ink); }
.bar-row:hover { background: var(--surface-2); text-decoration: none; }
.bar-label { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.bar-label small { font-weight: 400; font-size: 12px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Notizen & Dateien */
.note { margin-top: 12px; }
.note-view { white-space: normal; overflow-wrap: anywhere; }
.note footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.note footer > span { display: flex; gap: 4px; align-items: center; }
.upload { margin-bottom: 14px; padding: 0; }
.dropzone { flex-direction: row; align-items: center; gap: 12px; padding: 22px; cursor: pointer; border: 2px dashed var(--line); border-radius: var(--radius); margin: 6px; font-size: 15px; color: var(--ink); justify-content: center; flex-wrap: wrap; }
.dropzone:hover { border-color: var(--accent); }
.dropzone input { display: none; }
.dropzone .ic { color: var(--accent); width: 24px; height: 24px; }
.files > li { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; }
.file-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; border: 1px solid var(--line); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .ext { font-size: 11px; font-weight: 700; color: var(--muted); }
.file-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.file-name small { font-weight: 400; }

/* Formulare */
.form-narrow { max-width: 620px; }
.form-actions { display: flex; gap: 8px; }
.danger-zone { margin-top: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.settings { display: flex; flex-direction: column; gap: 14px; }
.settings h2 { font-size: 16px; }

/* Bottom-Sheet-Dialog */
dialog.sheet {
  border: 0; border-radius: 16px; padding: 20px; width: min(520px, calc(100% - 24px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog.sheet::backdrop { background: rgba(15, 20, 28, .45); }
dialog.sheet h2 { font-size: 18px; }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn-danger-ghost { margin-left: auto; }

/* Login */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.auth-card { width: min(380px, 100%); background: var(--surface); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card .brand { color: var(--ink); padding: 0; }
.auth-card h1 { font-size: 22px; }
.auth-card p { margin: 0; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar {
    position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }
  .topbar h1 { font-size: 21px; }
  .content { padding: 6px 16px 28px; }
  .timerbar, .flash { margin-left: 16px; margin-right: 16px; }
  .mobile-only { display: inline-grid !important; }
  .btn.mobile-only { display: inline-flex !important; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .ic { width: 23px; height: 23px; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat strong { font-size: 22px; }
  .dash-grid { grid-template-columns: 1fr; gap: 6px; }
  .time-forms { grid-template-columns: 1fr; }
  .quickadd-row { flex-wrap: wrap; }
  .quickadd-row select[name=project_id] { flex: 1 1 100%; }
  .quickadd-row .btn span { display: none; }
  .toolbar .btn span { display: none; }
  .ph-top .btn span { display: none; }
  .filters { max-width: none; }
  .filters select, .filters input { max-width: none; }
  .todo-play { opacity: 1; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 70px 52px; gap: 10px; }
  input, select, textarea { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
  dialog.sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .seg { align-self: flex-start; }
}

/* ---------- Unteraufgaben ---------- */
.subcount { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--ink-2); }
.subcount svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.subcount.is-complete { color: var(--accent); }
.is-done .subcount { color: var(--muted); }

.subtasks { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.subtasks-head { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 12px 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.subtask-list { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.subtask { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 12px; border-top: 1px solid var(--line); }
.subtask:first-child { border-top: 0; }
.subtask input, .subtask-add input { border: 0; background: transparent; padding: 9px 2px; border-radius: 6px; font-size: 15px; }
.subtask input:focus, .subtask-add input:focus { outline: none; background: var(--surface); }
.subtask.is-done input { color: var(--muted); text-decoration: line-through; }
.check.small { width: 20px; height: 20px; flex: none; margin: 0; }
.check.small svg { width: 12px; height: 12px; }
.subtask.is-done .check { background: var(--accent); border-color: var(--accent); }
.subtask.is-done .check svg { opacity: 1; stroke: #fff; }
.sub-del { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; opacity: .6; }
.sub-del:hover { color: var(--alert); background: var(--alert-soft); opacity: 1; }
.subtask-add { display: flex; align-items: center; gap: 8px; padding: 2px 12px; border-top: 1px solid var(--line); }
.sub-plus { width: 20px; text-align: center; color: var(--accent); font-size: 20px; font-weight: 600; flex: none; }
@media (max-width: 860px) {
  .subtask input, .subtask-add input { font-size: 16px; }
  .sub-del { opacity: 1; }
  dialog.sheet { max-height: 92vh; overflow-y: auto; }
}
