:root {
  --ink: var(--owtl-ink, #17211f);
  --muted: var(--owtl-muted, #61706c);
  --paper: var(--owtl-paper, #f5f3ec);
  --panel: var(--owtl-panel, #fffefd);
  --line: var(--owtl-line, #d8ded8);
  --green: var(--owtl-green, #0d8774);
  --blue: var(--owtl-blue, #225f9a);
  --amber: var(--owtl-amber, #c7901d);
  --coral: #d95745;
  --red: #a92d3a;
  --violet: var(--owtl-plum, #6d4f85);
  --shadow: var(--owtl-shadow, 0 18px 46px rgba(31, 42, 38, 0.11));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(245, 243, 236, 0.96), rgba(239, 246, 243, 0.96)),
    linear-gradient(90deg, rgba(34, 95, 154, 0.05), transparent 34%, rgba(215, 93, 72, 0.045)),
    repeating-linear-gradient(135deg, rgba(23, 33, 31, 0.055) 0 1px, transparent 1px 18px);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.masthead,
.control-band,
.weather-panel,
.stat-panel,
.chart-panel,
.alerts-panel,
.table-panel,
.lga-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 28px 28px;
  margin-bottom: 22px;
  overflow: hidden;
}

.masthead::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #0e1110, var(--green), var(--blue), var(--amber), var(--coral));
}

.masthead::after {
  content: "QLD DATA MODULE";
  position: absolute;
  right: 20px;
  top: 13px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 8vw, 5.8rem);
  line-height: 0.9;
}

.masthead-copy {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.62;
}

h2 {
  font-size: 1.3rem;
}

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #0e1110;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  background:
    repeating-linear-gradient(135deg, rgba(14, 17, 16, 0.055) 0 3px, transparent 3px 9px),
    #fff;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  margin-bottom: 22px;
}

.month-readout span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.month-readout strong {
  display: block;
  margin-top: 3px;
  font-size: 1.4rem;
}

.range-wrap {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-weight: 800;
}

.range-wrap input {
  min-width: 0;
}

.slider-target {
  grid-column: 2;
  align-self: start;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--coral);
}

.apply-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 22px;
}

.weather-panel,
.stat-panel,
.chart-panel,
.alerts-panel,
.table-panel,
.lga-panel {
  padding: 24px;
}

.wide {
  grid-column: 1 / -1;
}

.weather-top,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.chart-note {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.62;
}

.weather-glyph {
  position: relative;
  width: 96px;
  height: 76px;
  flex: 0 0 auto;
}

.weather-glyph span {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.weather-glyph span:nth-child(1) {
  width: 58px;
  height: 58px;
  right: 8px;
  top: 0;
}

.weather-glyph span:nth-child(2) {
  width: 74px;
  height: 34px;
  left: 4px;
  bottom: 5px;
  border-radius: 24px;
}

.weather-glyph span:nth-child(3) {
  width: 34px;
  height: 34px;
  right: 18px;
  bottom: 2px;
}

.weather-copy {
  min-height: 58px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.68;
}

.gauge {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0ea;
  border: 1px solid var(--line);
}

.gauge-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--coral), var(--red));
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.metric-list div,
.stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(14, 17, 16, 0.04), transparent 36%),
    #fbfcfa;
}

.metric-list span,
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-list strong,
.stat strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.1rem, 3vw, 1.85rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.stat-panel {
  display: grid;
  gap: 14px;
}

.lga-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 20px;
}

.lga-summary-grid div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(14, 17, 16, 0.04), transparent 36%),
    #fbfcfa;
}

.lga-summary-grid span,
.lga-ranking small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.lga-summary-grid strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.15rem, 3vw, 2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.lga-summary-grid small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 800;
}

.lga-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

.lga-lists h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.lga-ranking {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lga-ranking li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: baseline;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lga-ranking span {
  min-width: 0;
  color: var(--ink);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.lga-ranking strong {
  color: var(--ink);
  font-weight: 950;
  white-space: nowrap;
}

.lga-ranking small {
  grid-column: 1 / -1;
}

.lga-combo-chart {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.lga-combo-chart svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 14px;
  overflow: visible;
}

.lga-bar {
  fill: rgba(33, 102, 165, 0.28);
  stroke: rgba(33, 102, 165, 0.58);
  stroke-width: 1;
}

.lga-loss-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lga-loss-dot {
  fill: var(--coral);
  stroke: #fff;
  stroke-width: 2.5;
}

.lga-axis-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-anchor: start;
}

.lga-site-axis {
  fill: var(--blue);
}

.lga-loss-axis {
  fill: var(--coral);
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #0e1110;
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(14, 17, 16, 0.06) 0 3px, transparent 3px 9px),
    #f2f5f1;
}

.segmented a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
  text-decoration: none;
}

.segmented a.active {
  background: var(--ink);
  color: #fff;
}

.chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.key-line {
  width: 34px;
  height: 0;
  border-top: 3px solid currentColor;
}

.key-box {
  width: 24px;
  height: 12px;
  border-radius: 3px;
  background: currentColor;
}

.key-loss {
  color: var(--coral);
}

.key-egm {
  color: var(--blue);
}

.key-venues {
  color: var(--blue);
}

#trendChart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 18px;
  overflow: visible;
}

.axis {
  stroke: var(--line);
  stroke-width: 1;
}

.axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.axis-label-end {
  text-anchor: end;
}

.axis-value {
  dominant-baseline: middle;
  fill: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.axis-value-left {
  fill: var(--coral);
  text-anchor: end;
}

.axis-value-right {
  fill: var(--blue);
  text-anchor: start;
}

.trend-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.egm-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
}

.trend-area {
  fill: rgba(217, 87, 69, 0.14);
}

.selected-dot {
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 4;
}

.selected-egm-dot {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 3;
}

.chart-label-bg {
  stroke-width: 1;
  filter: drop-shadow(0 6px 12px rgba(23, 33, 31, 0.14));
}

.chart-label-bg-loss {
  fill: rgba(255, 255, 255, 0.94);
  stroke: rgba(217, 87, 69, 0.38);
}

.chart-label-bg-egm {
  fill: rgba(255, 255, 255, 0.96);
  stroke: rgba(33, 102, 165, 0.38);
}

.chart-callout {
  dominant-baseline: auto;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.chart-callout-loss {
  fill: var(--ink);
  font-size: 18px;
}

.chart-callout-egm {
  fill: var(--blue);
  font-size: 15px;
}

.bars {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.bar-row {
  display: grid;
  grid-template-columns: 38px 1fr 74px;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #edf0ea;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.alerts-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.alerts-list li {
  padding: 16px 18px;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: #fff8e7;
  line-height: 1.58;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.notes {
  max-width: 780px;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.68;
  text-align: center;
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 16px;
  }

  .masthead,
  .control-band,
  .dashboard-grid,
  .metric-list,
  .lga-summary-grid,
  .lga-lists {
    grid-template-columns: 1fr;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-grid {
    display: grid;
  }

  .range-wrap {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .weather-top,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
