:root {
  --bg: #f6f7f9; --card: #fff; --text: #16181d; --muted: #5d6573; --line: #e2e5ea;
  --accent: #3b5bdb; --accent-text: #fff; --ok: #2b8a3e; --warn: #c7700a; --bad: #c92a2a; --info: #1c7ed6;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --card: #1a1d23; --text: #e8eaee; --muted: #9aa3b2; --line: #2b3039;
    --accent: #748ffc; --accent-text: #0b0d12; --ok: #69db7c; --warn: #ffa94d; --bad: #ff6b6b; --info: #74c0fc;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
h2.inline { display: inline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.hidden { display: none; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; margin: .25rem 0; }

.shell { max-width: 820px; margin: 0 auto; padding: 0 16px 32px; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.brand { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.logo { color: var(--accent); }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tab { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.foot { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 24px; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card.narrow { width: 100%; max-width: 420px; }
.card.notice { border-color: var(--info); }
.card.drop { border-left: 4px solid var(--warn); }
.card.drop.done { border-left-color: var(--ok); }
.card.danger { border-color: var(--bad); }
details > summary { cursor: pointer; }

label { display: block; margin: 10px 0; font-weight: 500; }
label small { display: block; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 4px 0; }
label.check input { width: auto; margin: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.status.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row > input { flex: 1 1 180px; width: auto; margin: 0; }
.back { display: inline-block; margin-top: 8px; text-decoration: none; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.item:first-child { border-top: 0; }
.item:hover .item-name { text-decoration: underline; }
.item-name { flex: 1; min-width: 0; }
.due { color: var(--warn); font-size: .85rem; }

.prio { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.prio.p1 { background: var(--bad); } .prio.p2 { background: var(--warn); } .prio.p3 { background: var(--muted); }
.legend { font-size: .8rem; }

.pill { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; }
.pill.not_started { color: var(--muted); }
.pill.not_listed, .pill.removed { color: var(--ok); }
.pill.found { color: var(--bad); }
.pill.submitted { color: var(--info); }

.badges, .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.chip { font: inherit; font-size: .85rem; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: inherit; cursor: copy; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { padding-left: 1.25rem; }
.steps li { margin: 4px 0; overflow-wrap: anywhere; }
.history { font-size: .85rem; color: var(--muted); }

.filters { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.filters > * { margin: 0; }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }

.progress { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress .bar { height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.stat strong { display: block; font-size: 1.3rem; }
.stat span { font-size: .8rem; color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; transition: all .2s; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 560px) {
  .brand { flex: 1; }
  .tabs { order: 3; flex-basis: 100%; }
  .tab { flex: 1; text-align: center; }
}
