/* Wildscape Insights: stats page + admin dashboard. Chart colors validated for CVD in light and dark. */
:root {
	--wsm-ch-1: #2F7D4A;
	--wsm-ch-2: #B8862B;
	--wsm-ch-grid: #E7E0CC;
	--wsm-ch-text: #5E5A4E;
	--wsm-ch-surface: #FFFDF7;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .wsm-portal-body { --wsm-ch-1: #258048; --wsm-ch-2: #BB8B2E; --wsm-ch-grid: #34362F; --wsm-ch-text: #A8A08A; --wsm-ch-surface: #1F211E; }
}

.wsm-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; }
.wsm-tab { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ws-border, #DDD3B6); background: var(--ws-card, #FFFDF7); color: var(--ws-ink, #1B1B18) !important; text-decoration: none; font-weight: 600; font-size: .9rem; }
.wsm-tab.is-active { background: var(--ws-primary, #1E5631); border-color: var(--ws-primary, #1E5631); color: var(--ws-on-primary, #EDE3C4) !important; }

.wsm-chg { font-weight: 700; font-size: .8rem; }
.wsm-chg--up { color: var(--ws-success, #2E7D4F); }
.wsm-chg--down { color: var(--ws-danger, #B23B2E); }
.wsm-chg--flat { color: var(--ws-muted, #5E5A4E); }

.wsm-highlights ul { margin: 0; padding-left: 1.1em; }
.wsm-highlights li { margin-bottom: 6px; }

.wsm-ch-grid { display: grid; gap: 20px; }
@media (min-width: 1100px) { .wsm-ch-grid { grid-template-columns: 1fr 1fr; } }
.wsm-ch { position: relative; margin: 0; max-width: 620px; }
.wsm-ch__title { font-weight: 700; margin-bottom: 6px; color: var(--ws-ink, #1B1B18); }
.wsm-ch svg { display: block; width: 100%; height: auto; overflow: visible; }
.wsm-ch__grid { stroke: var(--wsm-ch-grid); stroke-width: 1; }
.wsm-ch__tick { fill: var(--wsm-ch-text); font: 11px/1 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wsm-ch__val { fill: var(--ws-ink, #1B1B18); font: 700 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wsm-ch__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wsm-ch__area { stroke: none; opacity: .1; }
.wsm-ch__line.wsm-ch--s1 { stroke: var(--wsm-ch-1); }
.wsm-ch__line.wsm-ch--s2 { stroke: var(--wsm-ch-2); }
.wsm-ch__area.wsm-ch--s1, .wsm-ch__bar.wsm-ch--s1 { fill: var(--wsm-ch-1); }
.wsm-ch__area.wsm-ch--s2 { fill: var(--wsm-ch-2); }
.wsm-ch__bar.wsm-ch--s1 { opacity: 1; }
.wsm-ch__dot, .wsm-ch__hover { stroke: var(--wsm-ch-surface); stroke-width: 2; }
.wsm-ch__dot.wsm-ch--s1, .wsm-ch__hover.wsm-ch--s1 { fill: var(--wsm-ch-1); }
.wsm-ch__dot.wsm-ch--s2, .wsm-ch__hover.wsm-ch--s2 { fill: var(--wsm-ch-2); }
.wsm-ch__cross { stroke: var(--wsm-ch-text); stroke-width: 1; opacity: .5; }
.wsm-ch__tip { position: absolute; top: 24px; pointer-events: none; transform: translateX(-50%); padding: 6px 10px; border-radius: 6px; background: var(--ws-ink, #1B1B18); color: var(--ws-surface, #F7F2E4); font: 600 12px/1.3 system-ui, sans-serif; white-space: nowrap; }

.wsm-hb { margin: 0; }
.wsm-hb ul { list-style: none; margin: 0; padding: 0; }
.wsm-hb li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; min-height: 30px; }
.wsm-hb__label { font-size: .9rem; color: var(--ws-ink, #1B1B18); }
.wsm-hb__track { display: block; height: 14px; }
.wsm-hb__bar { display: block; height: 14px; background: var(--wsm-ch-1); border-radius: 0 4px 4px 0; }
.wsm-hb__val { font-weight: 700; font-size: .9rem; min-width: 3ch; text-align: right; color: var(--ws-ink, #1B1B18); }

.wsm-copy { display: flex; gap: 8px; }
.wsm-copy input { flex: 1; min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--ws-border, #DDD3B6); border-radius: 8px; background: var(--ws-surface, #F7F2E4); color: var(--ws-ink, #1B1B18); font-size: .9rem; }

/* Admin */
.wsm-admin .wsm-ch { max-width: none; }
.wsm-admin .wsm-ch__tick { font-size: 11px; }
.wsm-qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid #DDD3B6; border-radius: 6px; }
.wsm-qr svg, .wsm-qr img { display: block; width: 160px; height: 160px; }
.wsm-admin .wsm-card__sub { display: block; margin-top: 4px; font-size: 12px; color: #5E5A4E; }
.wsm-admin .wsm-tabs { margin: 12px 0 16px; }
.wsm-admin .wsm-ch-grid--stack { grid-template-columns: 1fr; }
.wsm-admin .wsm-mt { margin-top: 12px; }
.wsm-admin .wsm-help { margin: 8px 0 12px; }
.wsm-admin .wsm-help summary { cursor: pointer; color: #1E5631; }
.wsm-copy--admin { margin: 6px 0 4px; max-width: 420px; }
.wsm-copy--admin input { min-height: 30px; font-family: Consolas, Monaco, monospace; font-size: 12px; }
.wsm-links-table td { vertical-align: top; }
.wsm-qr-details summary { cursor: pointer; color: #1E5631; margin-bottom: 6px; }
.wsm-just-made td { background: #EEF5EF !important; }
.wsm-link-form [data-wsm-dest] { margin: 10px 0 0; }
.wsm-links-table td:first-child { min-width: 300px; }
