/* The Cost Saving Prodigy: a plain, money-green palette. */
:root {
  --bg: #ffffff; --fg: #1d2a22; --muted: #56655b; --line: #d3ded6; --accent: #1f7a4d;
  --warn-bg: #fff8c5; --warn-line: #d4a72c; --err-bg: #ffebe9; --err-line: #cf222e; --info-bg: #e6f4ec;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1712; --fg: #e4eee7; --muted: #9aab9f; --line: #34453a; --accent: #5cc48d;
    --warn-bg: #3a2f00; --err-bg: #3d1214; --info-bg: #12301f; }
}
* { box-sizing: border-box; }
body.csp { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.csp-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.csp-header { border-bottom: 1px solid var(--line); }
.csp-header .csp-wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.csp-brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.csp-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.csp-nav a { color: var(--muted); text-decoration: none; }
.csp-nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.csp-main { padding-top: 24px; padding-bottom: 48px; }
.csp-intro h1 { margin: 0 0 4px; font-size: 1.6rem; }
.csp-intro p { margin: 0 0 16px; color: var(--muted); }
.csp-controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-bottom: 16px; }
.csp-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.csp-tab { border: 1px solid var(--line); background: transparent; color: var(--fg); padding: 6px 14px; border-radius: 999px; cursor: pointer; font: inherit; }
.csp-tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.csp-state, .csp-search { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); }
.csp-search { flex: 1 1 200px; }
.csp-state select, .csp-search input { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.csp-notice { border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; padding: 8px 12px; margin: 0 0 16px; background: var(--info-bg); }
.csp-notice p { margin: 4px 0; }
.csp-notice-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.csp-notice-error { background: var(--err-bg); border-color: var(--err-line); }
.csp-retry { font: inherit; margin-top: 4px; }
.csp-loading { color: var(--muted); }
.csp-cards { list-style: none; margin: 0; padding: 0; }
.csp-card { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.csp-card-img { width: 112px; height: 72px; object-fit: cover; border-radius: 4px; flex: none; }
.csp-card-body { min-width: 0; }
.csp-card-title { font-size: 1.05rem; margin: 0 0 4px; }
.csp-card-link { color: var(--fg); text-decoration: none; }
.csp-card-link:hover { text-decoration: underline; }
.csp-card-meta { margin: 0; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; }
.csp-card-summary { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.csp-search-empty { color: var(--muted); }
.csp-prose { max-width: 680px; }
.csp-prose h2 { font-size: 1.15rem; margin-top: 1.5em; }
.config-error { border: 2px solid var(--err-line); background: var(--err-bg); padding: 12px 16px; border-radius: 6px; margin: 16px 0; }
.config-error-inline { color: var(--err-line); font-weight: 700; }
.csp-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 16px 0 32px; }
.csp-footer p { margin: 4px 0; }
.csp-small { font-size: .8rem; }
@media (max-width: 520px) { .csp-card-img { width: 80px; height: 56px; } }
.csp-header { border-bottom: 3px solid var(--accent); }
.csp-brand { color: var(--accent); }
.csp-tab[aria-selected="true"] { background: var(--accent); color: #ffffff; border-color: var(--accent); }
