:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1c2233;
  --muted: #5b6478;
  --line: #dfe3ec;
  --brand: #1f4fa3;
  --brand-ink: #ffffff;
  --accent: #f2b705;
  --good: #1f7a4d;
  --warn: #a14a00;
  --warn-bg: #fff3e5;
  --chip: #eef2fa;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151d;
    --surface: #1b2030;
    --text: #e8ebf3;
    --muted: #a3abbd;
    --line: #2d3446;
    --brand: #6f9be8;
    --brand-ink: #0d1424;
    --good: #5fcf95;
    --warn: #ffb36b;
    --warn-bg: #3a2a18;
    --chip: #252c3f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
h1 { margin: 0; font-size: 1.5rem; }
h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
h3 { margin: 0; font-size: 1rem; }
.top { background: var(--brand); color: var(--brand-ink); padding: 16px 0; }
.top-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.tag { margin: 2px 0 0; opacity: .9; font-size: .9rem; }
.tabs { display: flex; gap: 6px; }
.tabs button { background: transparent; color: var(--brand-ink); border: 1px solid currentColor; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; }
.tabs button[aria-selected="true"] { background: var(--brand-ink); color: var(--brand); }
.notice { font-size: .85rem; color: var(--muted); margin: 12px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.who { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
.who select { width: auto; max-width: 100%; }
label { display: block; font-size: .9rem; color: var(--muted); }
label input, label select { margin-top: 4px; color: var(--text); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); padding: 6px 10px; border-radius: 999px; color: var(--text); cursor: pointer; }
.chips input { width: auto; margin: 0; }
.avail-scroll { overflow-x: auto; }
.avail { border-collapse: collapse; font-size: .85rem; }
.avail th, .avail td { padding: 4px 6px; text-align: center; }
.avail input { width: 20px; height: 20px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.ghost { background: transparent; }
button.link { border: 0; background: none; color: var(--brand); padding: 0; text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 800px) { .dash { grid-template-columns: 1fr; } }
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 6px; }
.item.off { opacity: .75; }
.meta { font-size: .85rem; color: var(--muted); }
.reasons { margin: 0; padding-left: 18px; font-size: .85rem; }
.score { font-weight: 700; color: var(--good); white-space: nowrap; }
.pill { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--chip); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.muted { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 10px; }
.stats.big { margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { font-size: .8rem; color: var(--muted); }
.badges { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.badges li { background: var(--chip); border-left: 4px solid var(--accent); padding: 6px 10px; border-radius: 6px; font-size: .9rem; }
.bar { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--good); }
.bar.low > div { background: var(--warn); }
.suggest { background: var(--chip); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.suggest a { color: var(--brand); }
.form-error { color: var(--warn); min-height: 1em; margin: 6px 0; font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
