:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --text: #21313a;
  --muted: #6d7b83;
  --line: #d8e0e4;
  --road: #314b5b;
  --road-dark: #223742;
  --accent: #d9822b;
  --accent-soft: #f2dfc9;
  --success: #356b4a;
  --road-purple: #68417d;
  --shadow: 0 14px 34px rgba(33, 49, 58, 0.10);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(49, 75, 91, 0.14);
  border-color: var(--road);
}

.app-header {
  background: var(--road-purple);
  color: #fff;
  padding: 22px clamp(18px, 4vw, 42px);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  border-bottom: 4px solid var(--accent);
}

.app-header h1 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.kicker,
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.76rem;
  font-weight: 900;
}

.kicker {
  color: #d9e3e8;
}

.tagline {
  margin: 0 0 4px;
  color: #e8edf0;
  font-weight: 700;
}

.page-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 54px;
  display: grid;
  gap: 20px;
}

.status-card,
.entry-card,
.history-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.history-limit {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.history-limit select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 6px 30px 6px 10px;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 640px) {
  .history-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

.status-card {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.status-card h2,
.entry-card h2,
.history-card h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
}

.eyebrow {
  color: var(--accent);
}

.mpg-box {
  min-width: 280px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--road-dark);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  flex-shrink: 0;
}

.mpg-stat {
  min-width: 0;
}

.mpg-stat + .mpg-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  padding-left: 18px;
}

.mpg-stat span {
  display: block;
  font-size: 0.78rem;
  color: #d8e1e6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.mpg-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 1.7rem;
  white-space: nowrap;
}


.entry-card,
.history-card {
  padding: 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

#fuelForm {
  display: grid;
  gap: 16px;
}

#fuelForm label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: auto;
  transform: scale(1.15);
}

.primary-button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--road-purple);
  color: white;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.primary-button:hover {
  background: #563568;
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.message {
  min-height: 1.3em;
  margin: 14px 0 0;
  color: var(--success);
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px 16px;
  background: #fbfcfc;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  align-items: center;
}

.history-main strong {
  display: block;
  font-size: 1rem;
}

.history-main span,
.history-side span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 3px;
}

.history-side {
  text-align: right;
}

.history-side strong {
  font-size: 1.1rem;
}

.empty-state {
  color: var(--muted);
  padding: 8px 0;
}

.vehicle-selector {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.vehicle-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vehicle-select-row select {
  flex: 1;
  min-width: 0;
}

.vehicle-selector select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #d6dee2;
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, var(--road-purple) 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--road-purple) 50%, transparent 50%) right 11px center / 6px 6px no-repeat,
    #fff;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 8px 42px 8px 12px;
  cursor: pointer;
  min-width: 240px;
}

.vehicle-selector select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.secondary-button {
  border: 1px solid var(--road-purple);
  border-radius: 10px;
  padding: 9px 14px;
  background: #fff;
  color: var(--road-purple);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-button:hover {
  background: rgba(104, 65, 125, 0.08);
}

.vehicle-manager {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px;
}

#vehicleForm {
  display: grid;
  gap: 16px;
}

#vehicleForm label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.vehicle-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .page-shell {
    width: min(100% - 20px, 980px);
    padding-top: 14px;
  }

  .status-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .vehicle-select-row {
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-button {
    width: 100%;
  }

  .mpg-box {
    width: 100%;
    min-width: 0;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .entry-card,
  .history-card,
  .vehicle-manager {
    padding: 18px;
    border-radius: 16px;
  }

  .primary-button {
    min-height: 50px;
    font-size: 1.05rem;
  }

  input,
  textarea,
  select {
    font-size: 1rem;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-side {
    text-align: left;
  }

  .vehicle-form-actions {
    flex-direction: column;
  }

  .vehicle-form-actions .primary-button,
  .vehicle-form-actions .secondary-button {
    width: 100%;
  }
}
/* =========================================================
   Site Header
   ========================================================= */

.site-header {
    background: #6b4382;
    border-bottom: 3px solid #d77a1f;
    color: #fff;
}

.site-header-inner {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 16px 0;
}

.site-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.parent-brand {
    display: inline-block;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.parent-brand:hover,
.parent-brand:focus-visible {
    color: #f2b15d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ==========================
   Brand Header
   ========================== */

.brand-header {
    background: #70438a;
    color: #ffffff;
    border-bottom: 3px solid #e58a2b;
}

.brand-header__inner {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 94px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: inherit;
    text-decoration: none;

    display: flex;
    align-items: baseline;
    gap: 13px;
}

.brand__kicker {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    font-weight: 900;
    text-transform: uppercase;
}

.brand__title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-style: italic;
    font-weight: normal;
}

.brand__tagline {
    margin: 0;
    color: #f0e7f5;
    font-size: 0.95rem;
}

@media (max-width: 760px) {
    .brand-header__inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 16px 0;
    }

    .brand__tagline {
        font-size: 0.86rem;
    }
}

/* ==========================
   Site Footer
   ========================== */

.site-footer {
    margin-top: 48px;
    border-top: 1px solid #ddd3c8;
    background: #f6f1e8;
}

.site-footer__inner {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 30px;
}

.site-footer__identity {
    text-align: center;
    color: #6b596e;
}

.site-footer__identity strong {
    color: #70438a;
}

.site-footer__identity p {
    margin: 8px 0 0;
}

.site-footer__links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
}

.site-footer__links a {
    color: #70438a;
    font-weight: 700;
    text-decoration: none;
}

.site-footer__links a:hover {
    color: #e58a2b;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .site-footer__links {
        flex-direction: column;
        gap: 16px;
    }
}