:root {
  --bg: #f6f4f0; --panel: #ffffff; --lane: #ece8e1; --ink: #1f1d1a; --muted: #6b665e; --line: #d9d3c8;
  --accent: #b3261e; --accent-ink: #fff; --ok: #2e7d4f; --doing: #b7791f; --todo: #6b665e; --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15130f; --panel: #211e19; --lane: #1b1915; --ink: #f1ede6; --muted: #a39d92; --line: #36322a;
  --accent: #e0564d; --ok: #5fbf85; --doing: #e0a84a; --todo: #a39d92; --focus: #6aa6ee; --shadow: none; } }
:root[data-theme="dark"] {
  --bg: #15130f; --panel: #211e19; --lane: #1b1915; --ink: #f1ede6; --muted: #a39d92; --line: #36322a;
  --accent: #e0564d; --ok: #5fbf85; --doing: #e0a84a; --todo: #a39d92; --focus: #6aa6ee; --shadow: none; }
* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; } :root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.top { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; padding: 20px 16px 8px; max-width: 1200px; margin: 0 auto; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.title p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who label { font-weight: 600; font-size: .85rem; }
.who input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); min-width: 190px; font: inherit; }
.who input.need { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.intro, .bar { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.intro p { margin: 8px 0; }
.hint { color: var(--muted); font-size: .9rem; }
.bar { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; align-items: center; margin-top: 10px; margin-bottom: 10px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.stat b { font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 12px; align-items: center; }
.chk { display: flex; gap: 6px; align-items: center; font-size: .9rem; cursor: pointer; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; min-height: 36px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: .85rem; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; align-items: start; }
.lane { background: var(--lane); border-radius: 12px; padding: 10px; min-height: 120px; border: 2px solid transparent; }
.lane.over { border-color: var(--accent); }
.lane-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; padding: 2px 4px 10px; }
.lane-head .n { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: .8rem; }
.lane[data-status="todo"] .lane-head { color: var(--todo); } .lane[data-status="doing"] .lane-head { color: var(--doing); } .lane[data-status="done"] .lane-head { color: var(--ok); }
.empty { color: var(--muted); font-size: .85rem; padding: 6px 4px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; }
.card:hover { border-color: var(--muted); }
.card.dragging { opacity: .5; }
.card h3 { margin: 0 0 4px; font-size: 1rem; line-height: 1.3; }
.code { font-size: .75rem; font-weight: 700; color: var(--accent); margin-right: 6px; }
.card p { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.prog { height: 6px; background: var(--lane); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.prog i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.owner { font-weight: 600; color: var(--ink); }
.owner.free { color: var(--muted); font-weight: 400; font-style: italic; }
.acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; justify-content: center; align-items: flex-start; padding: 4vh 12px; overflow-y: auto; z-index: 10; }
.modal[hidden], .toast[hidden] { display: none; }
.card-modal { background: var(--panel); border-radius: 14px; width: min(720px, 100%); padding: 18px 18px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.card-modal h2 { margin: 0 0 4px; font-size: 1.25rem; }
.card-modal .close { float: right; }
.warn { background: color-mix(in srgb, var(--doing) 15%, transparent); border-left: 3px solid var(--doing); padding: 8px 10px; border-radius: 6px; font-size: .88rem; margin: 10px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; min-height: 36px; }
.subs { list-style: none; margin: 8px 0 0; padding: 0; }
.sub { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-top: 1px solid var(--line); }
.sub input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ok); cursor: pointer; }
.sub .t { flex: 1; min-width: 0; }
.sub.done .t span { text-decoration: line-through; color: var(--muted); }
.sub small { display: block; color: var(--muted); font-size: .78rem; }
.hist { list-style: none; margin: 10px 0 0; padding: 0; font-size: .85rem; }
.hist li { padding: 6px 0; border-top: 1px solid var(--line); }
.hist time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
h4 { margin: 18px 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; font-size: .9rem; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } .who input { min-width: 0; flex: 1; } .who { width: 100%; } }

.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-width: 1200px; margin: 10px auto 0; padding: 0 16px; }
.tile { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tile:hover { border-color: var(--muted); }
.tile.sel { border-color: var(--accent); }
.tile h3 { margin: 0 0 4px; font-size: .92rem; line-height: 1.25; }
.tile .ref { font-size: .82rem; margin: 4px 0; }
.tile .ref b { color: var(--ink); } .tile .ref.free { color: var(--muted); font-style: italic; }
.tile .acts { margin-top: 6px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-right: 6px; color: #fff; background: var(--accent); }
.card .text { margin: 6px 0 8px; font-size: .92rem; line-height: 1.35; }
.card .rep { font-size: .8rem; color: var(--muted); margin: 2px 0; }
.card .rep b { color: var(--ink); }
.card.done .text { text-decoration: line-through; color: var(--muted); }
.small{font-size:.8rem}.muted{color:var(--muted)}
