:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #111827;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --petrol: #0f9f6e;
  --diesel: #2563eb;
  --cng: #d97706;
  --danger: #d92d20;
  --success: #067647;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.07);
}

body.dark {
  --bg: #07111d;
  --surface: #101c2b;
  --surface-soft: #0c1725;
  --ink: #f9fafb;
  --muted: #a4acb9;
  --line: #263448;
  --brand: #2dd4bf;
  --brand-strong: #5eead4;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34rem),
    linear-gradient(180deg, var(--surface-soft), var(--bg) 34rem);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 30px) 98px;
}

.app-header,
.header-actions,
.toolbar,
.status-strip,
.section-heading,
.switch-row,
.city-card header,
.log-card,
.legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-header {
  margin-bottom: 18px;
  padding: 8px 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #2563eb);
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.05rem;
}

.muted,
.section-heading p,
.field span,
.hero p,
.disclaimer,
.pump-card small,
.log-card span {
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.icon-button {
  min-width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.text-icon {
  width: auto;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 900;
}

.text-icon.strong {
  border-color: color-mix(in srgb, var(--brand), var(--line) 28%);
  background: var(--brand);
  color: #ffffff;
}

.toolbar {
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
  background: color-mix(in srgb, var(--surface), transparent 4%);
  backdrop-filter: blur(16px);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-card {
  display: grid;
  gap: 5px;
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.status-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-card strong {
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 7px;
  width: 100%;
}

.field span {
  font-size: 0.8rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
}

.primary-action,
.secondary-action,
.primary-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.secondary-action {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  align-items: end;
  gap: clamp(18px, 3vw, 30px);
  padding: clamp(22px, 4vw, 42px);
  margin-bottom: 18px;
  border-radius: 8px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    linear-gradient(110deg, rgba(7, 17, 29, 0.96), rgba(15, 118, 110, 0.84) 58%, rgba(37, 99, 235, 0.72)),
    url("https://images.unsplash.com/photo-1542362567-b07e54358753?auto=format&fit=crop&w=1600&q=75");
  background-position: center;
  background-size: cover;
}

.hero.removed-panel {
  display: grid !important;
}

.hero-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.78rem;
  font-weight: 900;
}

.hero h2 {
  margin: 10px 0 8px;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.95;
  text-wrap: balance;
}

.hero .disclaimer,
.hero p {
  color: rgba(255, 255, 255, 0.76);
}

.price-grid,
.insight-grid,
.settings-grid,
.pump-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.price-tile {
  min-height: 168px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
}

.price-tile span,
.insight-card span,
.mini-price b {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.price-tile strong {
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  line-height: 1;
}

.price-tile small,
.price-tile em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.insight-grid {
  margin-bottom: 20px;
}

.insight-card,
.settings-card,
.pump-card {
  display: grid;
  gap: 9px;
  padding: 16px;
}

.insight-card strong {
  font-size: 1.15rem;
}

.section-heading {
  margin: 20px 0 10px;
}

.city-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.city-list.compact {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.city-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.city-card:hover,
.city-card.selected {
  border-color: color-mix(in srgb, var(--brand), var(--line) 36%);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.10);
  transform: translateY(-1px);
}

.city-card.selected {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand), transparent 93%), var(--surface));
}

.city-name {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.favorite {
  min-width: 62px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0;
  font-weight: 900;
  padding: 0 10px;
}

.favorite::after {
  content: "Save";
  font-size: 0.78rem;
}

.favorite.saved {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.favorite.saved::after {
  content: "Saved";
}

.mini-grid {
  display: grid;
  gap: 8px;
}

.mini-price {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid color-mix(in srgb, var(--line), transparent 35%);
}

.mini-price.unavailable {
  opacity: 0.72;
}

.mini-price em {
  grid-column: 2 / -1;
  font-style: normal;
  font-weight: 800;
}

.change.up {
  color: var(--danger);
}

.change.down {
  color: var(--success);
}

.chart-card {
  padding: 16px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--bg);
}

.segment {
  min-width: 70px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.10);
}

.chart {
  height: 260px;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 100% 33%, 12.5% 100%, auto;
}

.chart svg {
  width: 100%;
  height: 100%;
}

.chart-line {
  fill: none;
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
}

.petrol-line {
  stroke: var(--petrol);
}

.diesel-line {
  stroke: var(--diesel);
}

.cng-line {
  stroke: var(--cng);
}

.legend {
  justify-content: start;
  margin-top: 12px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
}

.petrol-dot {
  background: var(--petrol);
}

.diesel-dot {
  background: var(--diesel);
}

.cng-dot {
  background: var(--cng);
}

.calculator-card,
.log-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.estimate {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 8px;
  background: rgba(15, 159, 110, 0.12);
  color: var(--brand-strong);
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
}

.log-form .primary-action {
  align-self: end;
}

.log-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.log-card {
  padding: 14px;
}

.log-card div {
  display: grid;
  gap: 3px;
}

.switch-row {
  min-height: 42px;
}

.switch-row input {
  width: 22px;
  min-height: 22px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface), transparent 18%);
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  width: min(720px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface), transparent 8%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.nav-item.active {
  background: var(--ink);
  color: #ffffff;
}

.blog-page {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 34px) 60px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--petrol);
  font-weight: 900;
  text-decoration: none;
}

.blog-article {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.blog-article h1 {
  margin-bottom: 14px;
}

.blog-article h2 {
  margin: 28px 0 10px;
}

.blog-article p,
.blog-article li {
  color: var(--muted);
  line-height: 1.7;
}

.lede {
  font-size: 1.15rem;
}

.blog-highlight {
  display: grid;
  gap: 7px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--petrol), var(--line) 55%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--petrol), transparent 88%);
}

.blog-highlight strong {
  color: var(--ink);
}

@media (max-width: 860px) {
  .app-header,
  .toolbar,
  .status-strip,
  .hero,
  .section-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .price-grid,
  .status-strip,
  .insight-grid,
  .settings-grid,
  .pump-grid,
  .calculator-card,
  .log-form {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    bottom: 8px;
  }

  .nav-item {
    min-height: 50px;
    font-size: 0.7rem;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 12px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .text-icon {
    width: 100%;
  }

  .hero {
    min-height: 0;
  }

  .mini-price {
    grid-template-columns: 64px 1fr;
  }

  .mini-price span {
    grid-column: 2;
  }

  .nav-item span {
    font-size: 0.66rem;
  }
}
