:root {
	--bg: #14100c; --panel: #1e1810; --panel2: #271f15; --line: #3a2e1f;
	--text: #f2e6d0; --muted: #a8977c; --accent: #e7b54e; --accent2: #ff9f2e; --good: #b8e35a; --bad: #ff6a5c;
	color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
button, select, input { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.link { background: none; border: none; color: var(--muted); padding: 0; text-decoration: underline; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 12px; padding: 24px; width: min(420px, 100%); }
.card h1 { margin: 0 0 6px; color: var(--accent); }
.card form { display: flex; gap: 8px; margin-top: 14px; }
.card input { flex: 1; min-width: 0; }

header { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 2px solid var(--accent); }
.brand { font-weight: 700; color: var(--accent); font-size: 18px; margin-right: 6px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button.active { background: var(--accent); color: #1a1208; border-color: var(--accent); font-weight: 600; }
.who { margin-left: auto; color: var(--muted); }

main { padding: 16px; max-width: 1200px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.toolbar input[type=search], .toolbar input[list] { flex: 1; min-width: 180px; }
h2 { color: var(--accent); font-size: 17px; margin: 22px 0 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cards div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cards b { display: block; font-size: 22px; color: var(--accent); }
.cards span { color: var(--muted); font-size: 13px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--panel2); }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.item { cursor: pointer; }
table.grid tr.item:hover td { background: var(--panel2); }
table.grid small { color: var(--muted); }
tr.detail td { background: #19140e; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 13px; }
.cat { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.plus { color: var(--good); } .minus { color: var(--bad); }

.mapwrap { position: relative; height: calc(100vh - 190px); min-height: 360px; background: #0f0c09; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; }
#map { width: 100%; height: 100%; display: block; cursor: grab; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px; font-size: 13px; max-width: 280px; box-shadow: 0 6px 20px #0008; }

.feed { list-style: none; padding: 0; margin: 0; background: var(--panel); border-radius: 10px; }
.feed li { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.feed time { color: var(--muted); font-size: 13px; }
.feed .where { color: var(--muted); font-size: 13px; }
#feedMore { margin-top: 10px; }

.chartwrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
#chart { width: 100%; height: 260px; display: block; }
@media (max-width: 640px) {
	header { padding: 8px; }
	.who { width: 100%; margin-left: 0; }
	main { padding: 10px; }
	table.grid td:nth-child(4), table.grid th:nth-child(4) { display: none; }
}
