:root {
  color-scheme: dark;
  --bg: #101316;
  --panel: #191e22;
  --line: #2a3238;
  --text: #eef2f1;
  --muted: #a3afb4;
  --accent: #a9f0d2;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, .button, select { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: #20262a; border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px; white-space: nowrap; }
button:hover, .button:hover { background: #2d363b; }
button:disabled { opacity: .6; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { color: #10281e; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.primary:hover { background: #c9f9e5; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #15191d; padding: 26px 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 11px; background: var(--accent); color: #10281e; font-weight: 800; font-size: 20px; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
nav { display: grid; gap: 5px; margin-top: 47px; }
nav a { display: flex; gap: 12px; align-items: center; border-radius: 8px; padding: 10px 12px; color: var(--muted); font-weight: 600; }
nav a span { font-size: 18px; width: 20px; text-align: center; }
nav a:hover { background: #222a2d; color: var(--text); }
nav a[aria-current] { background: #23342f; color: var(--accent); }
.sidebar footer { margin-top: auto; border-top: 1px solid var(--line); padding: 15px 8px 0; }
.local-indicator { color: var(--muted); font-size: 12px; }
main#workspace { margin-left: 232px; }
.top { min-height: 67px; display: flex; align-items: center; justify-content: space-between; padding: 12px clamp(20px, 4vw, 60px); border-bottom: 1px solid var(--line); color: var(--muted); }
.content { max-width: 1360px; margin: auto; padding: 38px clamp(20px, 4vw, 60px) 65px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { letter-spacing: -.055em; font-size: clamp(36px, 5vw, 58px); line-height: 1.05; }
h2 { font-size: 17px; letter-spacing: -.015em; }
p, small { color: var(--muted); }
.page-title p { margin-top: 10px; max-width: 65ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.stat-icon, .domain-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; font-size: 17px; }
.stat div span { color: var(--muted); display: block; font-size: 12px; }
.stat strong { display: block; font-size: 27px; line-height: 1.25; }
.mint { color: #a9f0d2; background: #223c33; }
.blue { color: #a8d6ff; background: #253746; }
.lilac { color: #d7c4ff; background: #352c48; }
.amber { color: #f2ce8e; background: #403420; }
.rose { color: #ffb9b9; background: #482b30; }
.muted { color: #c6d0d5; background: #30373c; }
.filters { display: flex; gap: 9px; margin-bottom: 26px; }
.search { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; padding: 0 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.search span { font-size: 23px; line-height: 1; }
.search input { border: 0; outline: 0; width: 100%; background: transparent; padding: 8px 0; }
.search:focus-within { border-color: var(--accent); }
.group { margin-bottom: 24px; }
.group header, .detail-section header { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.domain-icon { width: 25px; height: 25px; border-radius: 6px; font-size: 12px; }
.count { font-size: 12px; color: var(--muted); padding: 1px 7px; background: #22282c; border-radius: 20px; font-weight: 500; }
.rows, .empty { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; min-height: 63px; padding: 11px 15px; }
.row + .row { border-top: 1px solid var(--line); }
a.row:hover { background: #232b2f; }
.row-title { min-width: 0; flex: 1; }
.row-title strong, .row-title small { display: block; }
.row-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-count, .arrow { color: var(--muted); white-space: nowrap; }
.arrow { font-size: 24px; line-height: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.task-title { display: block; text-align: left; white-space: normal; border: 0; background: transparent; padding: 0; }
.task-title:hover { background: transparent; color: var(--accent); }
.task-title.done strong { text-decoration: line-through; color: var(--muted); }
.check { width: 23px; height: 23px; padding: 0; flex: 0 0 23px; }
.check[aria-checked=true] { color: var(--accent); border-color: var(--accent); }
.empty { padding: 19px 15px; color: var(--muted); }
.back { color: var(--accent); display: inline-block; margin-bottom: 24px; }
.detail-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); }
.detail-section { margin-top: 28px; }
.detail-section header { justify-content: space-between; }
.provenance { margin: -13px 0 18px; font-size: 13px; }
dialog { width: min(550px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 23px; }
dialog::backdrop { background: #070a0cbc; }
.dialog-title, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-actions { justify-content: flex-end; }
.quiet { background: transparent; border: 0; }
#fields label { display: grid; gap: 5px; margin-top: 13px; font-weight: 600; }
#fields input, #fields textarea, #fields select { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; width: 100%; font-weight: 400; }
#fields textarea { resize: vertical; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
#form-error { color: #ffb9b9; min-height: 23px; margin: 8px 0; }
.login { display: grid; place-items: center; padding: 20px; }
.login main { width: min(100%, 450px); padding: 34px; display: grid; justify-items: start; gap: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
@media (max-width: 880px) {
  .sidebar { width: 168px; padding-inline: 12px; }
  main#workspace { margin-left: 168px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .sidebar { position: relative; width: 100%; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  nav { display: flex; margin-top: 12px; }
  nav a { padding: 5px 8px; gap: 5px; }
  .sidebar footer { position: absolute; top: 14px; right: 10px; border: 0; padding: 0; }
  main#workspace { margin-left: 0; }
  .top { min-height: 54px; padding: 8px 16px; }
  .content { padding: 25px 16px 45px; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .search { grid-column: 1 / -1; }
  .row { padding-inline: 10px; gap: 8px; }
  .task-count { display: none; }
  .page-title { flex-wrap: wrap; }
}
