/* Same palette as the growth engine's dashboards. */
:root {
  --bg: #f6f7f5;
  --panel: #ffffff;
  --fg: #1c2330;
  --muted: #5e6776;
  --line: #e1e4e0;
  --accent: #2f6f62;
  --accent-fg: #ffffff;
  --accent-soft: #d7e8e3;
  --good: #23784f;
  --good-soft: #dff0e6;
  --bad: #b3412f;
  --bad-soft: #f8e3df;
  --warn: #9a6400;
  --warn-soft: #f6ead0;
  --tag: #eceeea;
  --shadow: 0 6px 20px rgb(20 30 40 / 0.12);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Georgia", serif;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --panel: #181e26;
    --fg: #e5e8ed;
    --muted: #98a1ae;
    --line: #2a323d;
    --accent: #6cbfa9;
    --accent-fg: #10231e;
    --accent-soft: #23423b;
    --good: #5fc28d;
    --good-soft: #1b3528;
    --bad: #ec7d69;
    --bad-soft: #3f231e;
    --warn: #e2b34f;
    --warn-soft: #3a2e14;
    --tag: #232a34;
    --shadow: 0 6px 20px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); }
a { color: inherit; text-underline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
h2 { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
b { font-weight: 600; }

button, .button {
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
button:hover, .button:hover { border-color: var(--muted); }
button:disabled { opacity: 0.6; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.quiet { background: none; border-color: transparent; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

input, select, textarea {
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}
textarea { width: 100%; resize: vertical; }

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
#tabs { display: flex; gap: 4px; }
.tab { background: none; border-color: transparent; color: var(--muted); }
.tab.on { color: var(--fg); background: var(--accent-soft); }
.bar-end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status { font-size: 0.85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.good::before { background: var(--good); }
.status.bad { color: var(--bad); }
.status.bad::before { background: var(--bad); }

main { max-width: 1000px; margin: 0 auto; padding: 20px 20px 60px; }
#notices { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.notice { margin-top: 14px; padding: 8px 12px; border-radius: 6px; background: var(--accent-soft); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.summary { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; text-wrap: pretty; }
.selected { margin-top: 2px; }
.muted { color: var(--muted); font-size: 0.875rem; }
.empty { color: var(--muted); padding: 4px 0; }
.intro { margin-bottom: 8px; }
.blocked { color: var(--warn); font-size: 0.875rem; }
.error { color: var(--bad); font-size: 0.875rem; min-height: 1em; }

section { margin-top: 26px; }
section > h2 { margin-bottom: 8px; }
.count { font-size: 0.8rem; font-weight: 500; color: var(--muted); background: var(--tag); border-radius: 10px; padding: 0 8px; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.row { display: flex; gap: 12px; padding: 12px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.rank { font-family: var(--serif); font-size: 1.15rem; color: var(--muted); min-width: 1.3em; text-align: right; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.row-title a { text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 6px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; }
.tag { font-size: 0.78rem; font-weight: 500; padding: 1px 7px; border-radius: 4px; background: var(--tag); color: var(--muted); white-space: nowrap; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.inline { font-size: 0.8rem; color: var(--muted); }
.inline select { font-size: 0.8rem; padding: 1px 4px; }

.others { margin-top: 26px; }
.others summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input { flex: 1; min-width: 200px; }
.objectives { min-height: 60vh; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

dialog { color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog h2 { margin-bottom: 12px; overflow-wrap: anywhere; display: block; }
dialog label { display: block; margin-top: 10px; font-size: 0.9rem; }
dialog input:not([type="radio"], [type="checkbox"]), dialog select, dialog textarea { display: block; width: 100%; margin-top: 3px; }
.choice { display: flex !important; gap: 8px; align-items: baseline; }
.choice.off { color: var(--muted); }

.login { max-width: 340px; margin: 14vh auto; display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; }

@media (max-width: 640px) {
  .bar { padding: 8px 16px; }
  .bar-end { margin-left: 0; width: 100%; }
  main { padding: 16px 16px 48px; }
  #notices { padding: 0 16px; }
  .row { flex-wrap: wrap; }
  .row-main { flex-basis: calc(100% - 3em); }
  .row-actions { width: 100%; justify-content: flex-start; }
}
