:root {
  color: #18353f;
  background: #f5f8f7;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

.page-shell {
  box-sizing: border-box;
  max-width: 44rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 7rem 2rem;
}

.narrow {
  max-width: 32rem;
}

.eyebrow {
  margin: 0;
  color: #27756f;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0.5rem 0;
  font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 1;
}

.intro {
  font-size: 1.35rem;
}

.status {
  max-width: 36rem;
  color: #49636c;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

input, button, .button {
  box-sizing: border-box;
  border: 1px solid #9aafb2;
  border-radius: 0.4rem;
  font: inherit;
  padding: 0.7rem 0.8rem;
}

textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #9aafb2;
  border-radius: 0.4rem;
  font: inherit;
  padding: 0.7rem 0.8rem;
}

button, .button {
  width: fit-content;
  border-color: #27756f;
  background: #27756f;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.hint, .error, .badge {
  margin: 0;
}

.hint {
  color: #49636c;
}

.error {
  color: #9c1c1c;
  font-weight: 700;
}

.badge {
  width: fit-content;
  border-radius: 999px;
  background: #dcefeb;
  color: #1b5f59;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
}

.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin: 2rem 0;
}

.summary-card, .activity-list li {
  border: 1px solid #d3dfdd;
  border-radius: 0.6rem;
  background: #fff;
  padding: 1rem;
}

.summary-card h2, .summary-card p {
  margin: 0 0 0.5rem;
}

.metric {
  font-size: 1.5rem;
  font-weight: 700;
}

.activity-list {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}

.activity-list a {
  color: inherit;
  text-decoration: none;
}

.danger {
  border-color: #9c1c1c;
  background: #9c1c1c;
}

/* Responsive visual foundation */
:root { color: #162f3b; background: #f4f7f6; line-height: 1.5; }
* { box-sizing: border-box; }
body { min-width: 20rem; }
a { color: #146c66; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid #e88f3d; outline-offset: 3px; }
.app-header { align-items: center; display: flex; gap: 1rem; justify-content: space-between; margin: 0 auto; max-width: 72rem; padding: 1rem 1.5rem; }
.app-header nav { display: flex; gap: 0.3rem; }
.app-header nav a { border-radius: 0.45rem; color: #36525b; font-weight: 700; padding: 0.45rem 0.65rem; text-decoration: none; }
.app-header nav a:hover, .app-header nav a.active { background: #dcebe8; color: #124a48; }
.brand { color: #123e45; font-size: 1.2rem; font-weight: 850; text-decoration: none; }
.public-header { border-bottom: 1px solid #dce5e2; }
.page-shell { max-width: 72rem; padding: clamp(2.2rem, 6vw, 5.5rem) 1.5rem 4rem; }
.app-main { padding-top: 2.5rem; }
.narrow { max-width: 40rem; }
.auth-shell { margin-top: clamp(1rem, 5vw, 4rem); }
.hero { max-width: 56rem; min-height: calc(100vh - 4.5rem); padding-top: clamp(5rem, 15vh, 10rem); }
.eyebrow { font-size: 0.78rem; font-weight: 800; }
h1, h2 { color: #123440; letter-spacing: -0.04em; }
h1 { font-size: clamp(2.35rem, 7vw, 4.75rem); }
.lede { color: #46616a; font-size: 1.15rem; max-width: 42rem; }
.heading-row { align-items: flex-end; gap: 1.5rem; }
.button, .secondary-button, button { align-items: center; border-radius: 0.55rem; display: inline-flex; font-weight: 800; justify-content: center; min-height: 2.85rem; }
.button, button { background: #176f69; border-color: #176f69; }
.button:hover, button:hover { background: #0d514d; color: #fff; }
.secondary-button { background: #fff; border: 1px solid #aec3c1; border-radius: 0.55rem; color: #174b4c; padding: 0.65rem 1rem; text-decoration: none; }
.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 2rem 0 3rem; }
.summary-card, .activity-list li { border-radius: 0.8rem; box-shadow: 0 0.25rem 1rem rgb(18 52 64 / 0.04); }
.summary-card { padding: 1.2rem; }
.summary-detail { border-top: 1px solid #edf2f0; font-size: 0.92rem; margin-top: 0.75rem !important; padding-top: 0.75rem; }
.metric { color: #123e45; font-size: clamp(1.65rem, 4vw, 2.4rem); font-weight: 850; }
.activity-list a { align-items: center; display: flex; justify-content: space-between; padding: 1rem; }
.activity-list small { color: #597078; display: block; }
input, textarea { min-height: 2.8rem; }
input:focus, textarea:focus { border-color: #176f69; outline: 2px solid #91c8c2; }
fieldset { border: 1px solid #c8d8d5; border-radius: 0.65rem; margin: 0; padding: 1rem; }
legend { font-weight: 800; padding: 0 0.35rem; }
.unit-options { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.9rem; }
.unit-options label { align-items: center; background: #f4f8f7; border-radius: 0.45rem; display: flex; flex-direction: row; gap: 0.4rem; padding: 0.45rem 0.6rem; }
.unit-options input { min-height: auto; width: auto; }
.error { background: #fff1f1; border-left: 4px solid #b4232f; padding: 0.8rem 0.9rem; }
.account-email { background: #fff; border: 1px solid #d7e3e0; border-radius: 0.65rem; font-weight: 700; margin: 1rem 0; padding: 0.9rem; }
@media (max-width: 40rem) { .app-header { padding: 0.85rem 1rem; } .app-header nav a { padding: 0.4rem; } .page-shell { padding-left: 1rem; padding-right: 1rem; } .heading-row { align-items: flex-start; flex-direction: column; gap: 0.5rem; } .heading-row .button { width: 100%; } .summary-grid { grid-template-columns: 1fr; } }
.choice-grid, .chart-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0; }
.choice-card { background: #fff; border: 1px solid #c8d8d5; border-radius: .75rem; color: inherit; display: grid; gap: .4rem; padding: 1.2rem; text-decoration: none; }
.choice-card:hover { border-color: #176f69; box-shadow: 0 .3rem 1rem rgb(18 52 64 / .1); }
.analysis, .route-map { border-top: 1px solid #d7e3e0; margin-top: 2.5rem; padding-top: 2rem; }
.analysis-toggles { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.analysis-toggles label { align-items: center; display: flex; flex-direction: row; gap: .35rem; }
.duration-options { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#analysis-graph { background: #fff; border: 1px solid #d7e3e0; border-radius: .65rem; min-height: 19rem; width: 100%; }
.analysis-hover { background: #123440; border-radius: .4rem; color: #fff; font-size: .85rem; padding: .5rem; pointer-events: none; position: absolute; right: .75rem; top: 3.5rem; z-index: 2; }
#weekly-mileage-chart { background: #fff; border: 1px solid #d7e3e0; border-radius: .65rem; min-height: 14rem; width: 100%; }
#analysis-graph text { fill: #36525b; font: 16px system-ui, sans-serif; }
.graph-axis { stroke: #819391; stroke-width: 1.5; }
.splits { border-top: 1px solid #d7e3e0; margin-top: 2.5rem; padding-top: 2rem; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid #d7e3e0; padding: .65rem; text-align: left; }
#route-map { border-radius: .65rem; height: min(60vw, 24rem); min-height: 18rem; overflow: hidden; width: 100%; }
