:root { --ink: #171A23; --quiet: #5B6070; --line: #E3E5EA; --edge: #C9CDD8; --ground: #F6F7F9; --card: #FFFFFF;
  --accent: #3446B8; --accent-dark: #22308A; --accent-soft: #E9ECFB; --good: #17663A; --bad: #B42318; --warn: #7A4200; --warn-soft: #FFF1D6; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 Inter, system-ui, sans-serif; }
h1 { margin: 0; font: 600 28px "Space Grotesk", Inter, sans-serif; overflow-wrap: anywhere; }
h2 { margin: 20px 0 8px; font-size: 14px; }
h2.late, .late { color: var(--bad); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
button, .button, input, select, textarea, summary { min-height: 44px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--edge); border-radius: 8px; padding: 0 14px; }
textarea { padding: 10px 14px; }
input[type=checkbox] { min-height: 18px; width: 18px; height: 18px; padding: 0; }
input[type=file] { padding: 8px; max-width: 100%; }
button, .button, summary { display: inline-flex; align-items: center; justify-content: center; font-weight: 500; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.success { background: var(--good); border-color: var(--good); color: #fff; font-weight: 600; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link { border: 0; background: none; padding: 0 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 0 0 232px; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; background: var(--card); border-right: 1px solid var(--line); }
.side a { padding: 11px 12px; border-radius: 8px; color: var(--ink); }
.side a[aria-current=page] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.org { padding: 8px 12px 16px; font-weight: 600; }
.grow { flex-grow: 1; }
.shell > main { flex: 1 1 0; min-width: 0; padding: 28px 32px 48px; }
@media (max-width: 760px) {
  .side { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .shell { align-content: flex-start; }
  .shell > main { flex-basis: 100%; padding: 20px 16px 40px; }
}
.narrow { max-width: 420px; margin: 0 auto; padding: 56px 16px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.head p { margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.meta { color: var(--quiet); font-size: 13px; }
.back { display: inline-block; padding: 8px 0; }
.empty { padding: 32px; text-align: center; color: var(--quiet); }
.notice, .problem { padding: 12px 16px; margin-bottom: 16px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); }
.problem { background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.quick, .fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick { padding: 8px; background: var(--card); border: 1px solid var(--edge); border-radius: 12px; }
.quick input[name=title], .wide { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.row, .line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 8px; padding: 8px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
a.row { color: var(--ink); }
.row .title { flex: 1 1 240px; font-weight: 500; overflow-wrap: anywhere; }
.row.done .title { text-decoration: line-through; color: var(--quiet); }
.line .fields { flex: 1; }
.tag { padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 600; }
.tag.high { background: var(--warn-soft); color: var(--warn); }
.facts { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 0 0 16px; }
.facts dt { color: var(--quiet); font-size: 12px; }
.facts dd { margin: 4px 0 0; font-weight: 500; }
.text { white-space: pre-line; overflow-wrap: anywhere; }
.done-box { padding: 4px 20px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--good); border-radius: 12px; }
.done-box h2 { color: var(--good); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 20px 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 11px 14px; color: var(--quiet); border-bottom: 3px solid transparent; }
.tabs a[aria-current=page] { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }
.add { margin-top: 16px; }
.comment { padding: 12px 16px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.comment.ai { background: var(--accent-soft); }
.comment p { margin: 6px 0 0; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; background: var(--card);
  border: 2px dashed #8A90A0; border-radius: 12px; text-align: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.menu { position: relative; margin-left: 12px; }
.menu summary { list-style: none; font-size: 20px; }
.menu summary::-webkit-details-marker { display: none; }
.menu > div { position: absolute; right: 0; top: 50px; z-index: 2; display: flex; flex-direction: column; width: 200px; padding: 6px;
  background: var(--card); border: 1px solid var(--edge); border-radius: 10px; box-shadow: 0 8px 24px rgba(23,26,35,.14); }
.menu > div a, .menu > div button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 44px; padding: 0 12px; border: 0; color: var(--ink); }
.menu > div .danger-text { color: var(--bad); }
dialog { width: min(520px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 14px; color: var(--ink); }
dialog::backdrop { background: rgba(23,26,35,.45); }
dialog h2 { margin-top: 0; font-size: 18px; }
dialog form, .stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; }
label.check { flex-direction: row; align-items: center; min-height: 44px; }
fieldset { display: flex; flex-wrap: wrap; gap: 0 20px; border: 1px solid var(--line); border-radius: 8px; }
.inline-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.inline-edit label { gap: 4px; }
.inline-edit .caption, .inline-edit label > span { color: var(--quiet); font-size: 12px; }
.picker { position: relative; display: flex; flex-direction: column; gap: 4px; }
.picker summary { justify-content: space-between; gap: 12px; min-width: 220px; list-style: none; }
.picker summary::after { content: "▾"; color: var(--quiet); }
.picker summary::-webkit-details-marker { display: none; }
.picker > div { position: absolute; left: 0; top: 100%; z-index: 2; display: flex; flex-direction: column; min-width: 100%; max-height: 320px;
  overflow-y: auto; margin-top: 4px; padding: 6px 12px 12px; background: var(--card); border: 1px solid var(--edge); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(23,26,35,.14); white-space: nowrap; }
.picker-field { display: flex; flex-direction: column; gap: 4px; }
.side-title { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.side .side-title a { padding: 8px 12px; color: var(--quiet); font-size: 12px; font-weight: 600; }
.side-title button { min-width: 44px; border: 0; font-size: 20px; }
.side a.ws { font-weight: 600; overflow-wrap: anywhere; }
.side a.project { padding-left: 28px; overflow-wrap: anywhere; }
body.moving-todo [data-project] { outline: 2px dashed var(--accent); outline-offset: -2px; }
body.moving-todo [data-project].target { background: var(--accent); color: #fff; }
body.moving-todo [data-project].target * { color: #fff; }
