* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: rgba(11, 18, 30, .86);
  --panel-strong: rgba(15, 28, 45, .92);
  --line: rgba(93, 214, 255, .18);
  --line-strong: rgba(93, 214, 255, .36);
  --text: #eaf6ff;
  --muted: #8ea7b8;
  --cyan: #35d7ff;
  --green: #2ee6a6;
  --orange: #ff9f43;
  --purple: #b981ff;
  --red: #ff5d71;
  --blue: #4aa3ff;
}
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(53, 215, 255, .18), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(185, 129, 255, .12), transparent 28%),
    linear-gradient(180deg, #070b12 0%, #09131f 46%, #05080e 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(93,214,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93,214,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), rgba(0,0,0,.15));
}
.shell { width: min(1220px, calc(100vw - 40px)); margin: 0 auto; padding: 32px 0 52px; position: relative; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--cyan); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 34px; line-height: 1.08; text-shadow: 0 0 22px rgba(53,215,255,.22); }
h2 { font-size: 18px; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); font-size: 13px; }
.meta span { border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 12px; background: rgba(9, 19, 31, .72); box-shadow: inset 0 0 18px rgba(53,215,255,.08); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.stats article, .panel {
  background: linear-gradient(180deg, rgba(16, 29, 47, .9), rgba(8, 14, 24, .88));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
}
.stats article { position: relative; overflow: hidden; padding: 18px 18px 20px; }
.stats article::after { content: ""; position: absolute; inset: 0; border-top: 2px solid rgba(53,215,255,.45); opacity: .75; }
.stats span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.stats strong { font-size: 29px; line-height: 1; color: #f7fcff; text-shadow: 0 0 16px rgba(53,215,255,.22); }
.panel { padding: 20px; margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.legend { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.legend span { width: 18px; height: 3px; display: inline-block; border-radius: 3px; box-shadow: 0 0 10px currentColor; }
.gasoline { background: var(--green); color: var(--green); }
.diesel { background: var(--orange); color: var(--orange); }
.up { background: var(--red); color: var(--red); }
.down { background: var(--blue); color: var(--blue); }
canvas { width: 100%; display: block; }
.chart-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; align-items: center; height: 34px; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 7px; background: rgba(2, 8, 15, .65); }
.segmented button { min-width: 44px; height: 26px; border: 0; border-radius: 5px; padding: 0 9px; color: var(--muted); background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.segmented button.active { color: #031019; background: linear-gradient(180deg, #51e2ff, #26b8ea); box-shadow: 0 0 18px rgba(53,215,255,.34); }
.segmented button:hover { color: var(--text); }
.province-head select, .table-head input { height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; color: var(--text); background: rgba(3, 10, 18, .72); font-size: 14px; outline: none; }
.province-head select { min-width: 180px; }
.table-head input { width: 220px; }
.x-axis { display: grid; grid-template-columns: repeat(var(--tick-count, 6), minmax(0, 1fr)); gap: 8px; padding: 5px 8px 0 54px; color: var(--muted); font-size: 12px; line-height: 1.2; }
.x-axis span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.x-axis span:first-child { text-align: left; }
.x-axis span:last-child { text-align: right; }
.table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 7px; background: rgba(2,8,15,.38); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 12px 13px; border-bottom: 1px solid rgba(93,214,255,.1); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: #0b1624; }
th { color: #b6d7e8; background: rgba(16, 32, 50, .92); font-weight: 600; }
td { color: #dcecf7; }
.pos { color: #ff7d8d; }
.neg { color: #69b7ff; }
.chart-tooltip { position: fixed; z-index: 30; min-width: 150px; max-width: 250px; padding: 10px 12px; color: #f7fcff; background: rgba(3, 10, 18, .94); border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: 0 14px 34px rgba(0,0,0,.34), 0 0 18px rgba(53,215,255,.18); font-size: 12px; line-height: 1.45; pointer-events: none; opacity: 0; transform: translate(-50%, -100%); transition: opacity .12s ease; }
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip strong { display: block; margin-bottom: 5px; font-size: 13px; color: var(--cyan); }
.chart-tooltip span { display: block; white-space: nowrap; }
@media (max-width: 760px) {
  .shell { width: min(100vw - 24px, 1220px); padding-top: 22px; }
  .topbar { display: block; }
  .meta { justify-content: flex-start; margin-top: 12px; }
  .stats { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .chart-actions { width: 100%; justify-content: space-between; }
  .segmented { width: 100%; justify-content: space-between; }
  .segmented button { flex: 1; }
  .province-head select, .table-head input { width: 100%; }
  .x-axis { --tick-count: 4; padding-left: 44px; font-size: 11px; }
}
.ghost-button { height: 34px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 14px; color: var(--text); background: rgba(9, 19, 31, .72); font: inherit; font-size: 13px; cursor: pointer; box-shadow: inset 0 0 18px rgba(53,215,255,.08); }
.ghost-button:hover { border-color: rgba(53,215,255,.7); box-shadow: 0 0 18px rgba(53,215,255,.22), inset 0 0 18px rgba(53,215,255,.1); }
.modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-start; justify-content: center; padding: 74px 20px 24px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 12, .62); backdrop-filter: blur(6px); }
.modal-panel { position: relative; width: min(820px, 100%); max-height: min(78vh, 760px); overflow: auto; padding: 22px; border: 1px solid var(--line-strong); border-radius: 10px; background: linear-gradient(180deg, rgba(15, 28, 45, .98), rgba(7, 13, 23, .98)); box-shadow: 0 24px 72px rgba(0,0,0,.46), 0 0 34px rgba(53,215,255,.16); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: rgba(3,10,18,.72); font-size: 24px; line-height: 28px; cursor: pointer; }
.icon-button:hover { border-color: rgba(53,215,255,.68); color: var(--cyan); }
.calendar-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.calendar-summary article { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(2,8,15,.5); }
.calendar-summary span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.calendar-summary strong { color: var(--text); font-size: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.month-card { min-height: 112px; padding: 12px; border: 1px solid rgba(93,214,255,.16); border-radius: 8px; background: rgba(2,8,15,.34); }
.month-card h3 { margin: 0 0 10px; color: var(--cyan); font-size: 14px; font-weight: 650; }
.month-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.month-card li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; color: #dcecf7; font-size: 12px; }
.day-chip { display: inline-flex; align-items: center; justify-content: center; height: 24px; border-radius: 999px; background: rgba(53,215,255,.12); color: var(--cyan); font-weight: 700; }
.delta-up { color: #ff8795; }
.delta-down { color: #69b7ff; }
.empty-month { color: rgba(142,167,184,.56); font-size: 12px; }
@media (max-width: 760px) { .calendar-summary, .calendar-grid { grid-template-columns: 1fr; } .modal { padding-top: 48px; } }
.forecast-item { color: rgba(220,236,247,.7); }
.forecast-chip { background: rgba(185,129,255,.16); color: var(--purple); }
.month-card em { color: var(--muted); font-style: normal; font-size: 11px; }
.month-card b { font-weight: 650; color: #dff7ff; }
