:root {
	--bg: #07140f;
	--panel: #0e1f18;
	--muted: #90a39a;
	--text: #e6fff4;
	--accent: #22c55e;
	--good: #16a34a;
	--moderate: #f59e0b;
	--poor: #ef4444;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
	margin: 0;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	background: radial-gradient(1200px 800px at 20% -10%, #103a2d 0%, #07140f 45%  ), var(--bg);
	color: var(--text);
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 12px;
	padding: 12px 16px;
	border-bottom: 1px solid rgba(255,255,255,0.08);
	backdrop-filter: blur(6px);
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(7,20,15,0.6);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
.brand .logo { height: 22px; }
.brand .product { opacity: 0.9; }
.export button {
	appearance: none;
	background: var(--panel);
	color: var(--text);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 10px;
	padding: 10px 14px;
	min-height: 44px;
	margin-left: 8px;
	cursor: pointer;
}
.export button:hover { border-color: rgba(255,255,255,0.25); }

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

.status-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 12px;
}
.status-dot { width: 14px; height: 14px; border-radius: 999px; background: var(--good); box-shadow: 0 0 16px rgba(22,163,74,0.6); }
.status-title { font-size: 14px; color: var(--muted); }
.status-text { font-size: 20px; font-weight: 700; }

.gauges { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.gauge-card { background: var(--panel); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 10px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gauge svg { width: 100%; height: 90px; }
.gauge-bg { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 12; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; }
.gauge-value { font-size: 18px; font-weight: 700; }
.gauge-label { color: var(--muted); font-size: 12px; }

.panels { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 12px; }
.panel-title { font-weight: 600; margin-bottom: 8px; letter-spacing: 0.2px; }
.panel-title.collapsible { cursor: pointer; position: relative; padding-right: 26px; }
.panel-title.collapsible::after { content: "▾"; position: absolute; right: 6px; top: 0; opacity: 0.6; }
.panel.collapsed .panel-grid { display: none; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.panel-grid .k { color: var(--muted); margin-right: 8px; display: inline-block; min-width: 64px; }
.panel-grid div { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 10px 12px; min-height: 44px; }

.charts { background: var(--panel); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 12px; min-height: 220px; }

.action-bar { position: fixed; left: 0; right: 0; bottom: 0; display: none; gap: 8px; justify-content: center; padding: 10px 12px; background: rgba(7,20,15,0.9); border-top: 1px solid rgba(255,255,255,0.08); backdrop-filter: blur(6px); z-index: 20; }
.ab-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; min-height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); color: var(--text); background: var(--panel); text-decoration: none; }
.ab-btn.primary { background: var(--accent); color: #062713; border-color: transparent; }

.footer { text-align: center; color: var(--muted); padding: 24px 0 64px; }
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Tablet */
@media (max-width: 1100px) {
	.gauges { grid-template-columns: repeat(3, minmax(0,1fr)); }
	.gauge svg { height: 100px; }
}

/* Small tablets / large phones */
@media (max-width: 820px) {
	.status-text { font-size: 18px; }
	.gauges { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.panel-grid { grid-template-columns: 1fr; }
	.charts { min-height: 260px; }
	.action-bar { display: flex; }
}

/* Mobile */
@media (max-width: 520px) {
	.topbar { padding: 10px 12px; }
	.brand .logo { height: 20px; }
	.brand .product { font-size: 14px; }
	.export button { padding: 10px 14px; min-height: 46px; margin-left: 6px; }
	.status-banner { padding: 12px; }
	.gauge svg { height: 110px; }
	.gauge-value { font-size: 20px; }
	.panel { padding: 10px; }
	.panel-grid div { padding: 10px 12px; }
}

/* Very small phones */
@media (max-width: 380px) {
	.gauges { grid-template-columns: 1fr; }
}
