/* IFTA Report Generator
   Visual language: US highway guide signs (Overpass is modeled on Highway Gothic),
   asphalt grays, reflective sign yellow for anything that needs attention,
   and the return itself as a ruled paper worksheet. */
:root {
  --sign: #00653b;        /* interstate guide-sign green */
  --sign-deep: #004a2b;
  --sign-tint: #e3f0e9;
  --asphalt: #1c2220;
  --road: #e8ebe9;        /* page background */
  --paper: #ffffff;
  --ink: #1c2220;
  --muted: #535d59;
  --line: #d3d9d6;
  --rule: #e6eae8;
  --amber: #f2b500;       /* MUTCD warning yellow */
  --amber-tint: #fff4cc;
  --amber-ink: #5c4500;
  --credit: #00653b;
  --due: #1c2220;
  --focus: #f2b500;
  --r-sm: 6px; --r-md: 10px; --r-sign: 12px;
  --shadow: 0 1px 0 rgba(28,34,32,.06), 0 8px 24px -12px rgba(28,34,32,.18);
  --font: "Overpass", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--font); color: var(--ink); background: var(--road); font-feature-settings: "tnum" 1; }
a { color: var(--sign); text-underline-offset: 2px; }
a:hover { color: var(--sign-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; margin: 0 0 10px; }
h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 12px; }
h3 { font-size: 1.08rem; font-weight: 700; margin: 22px 0 6px; }
.lede { color: var(--muted); margin: 0 0 16px; max-width: 68ch; font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: 14px; }

/* ---------- header ---------- */
header.site { background: var(--asphalt); color: #fff; }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 17px; }
.brand:hover { color: #fff; }
.brand .shield { display: inline-grid; place-items: center; height: 34px; padding: 0 9px; border-radius: 8px; background: var(--sign); box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
nav.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: 15px; }
nav.top a { color: #dfe5e2; text-decoration: none; padding: 6px 0; }
nav.top a:hover { color: #fff; text-decoration: underline; }
.pro-badge { display: none; align-items: center; gap: 6px; background: var(--amber); color: var(--asphalt); font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
body.is-pro .pro-badge { display: inline-flex; }

/* ---------- hero ---------- */
.hero { background: var(--asphalt); color: #fff; padding: 28px 0 34px; position: relative; }
.hero::after { /* the lane line */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 48px, transparent 48px 84px);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; }
.hero h1 { color: #fff; }
.hero .lede { color: #c9d1cd; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; color: #e7ece9; font-size: 15px; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points svg { flex: none; color: var(--amber); }

/* the guide sign */
.guide-sign { background: var(--sign); color: #fff; border-radius: var(--r-sign); padding: 14px 22px 16px; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px #fff, 0 10px 30px -12px rgba(0,0,0,.6); min-width: 250px; }
.guide-sign .gs-top { font-size: 15px; font-weight: 600; opacity: .95; }
.guide-sign .gs-main { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 2px 0 6px; white-space: nowrap; }
.guide-sign .gs-sub { font-size: 14px; color: #d7ebe0; }
.guide-sign .gs-flag { display: inline-block; margin-top: 8px; background: var(--amber); color: var(--asphalt); font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 4px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 24px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-title .aside { font-size: 14px; font-weight: 400; color: var(--muted); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin: 20px 0; box-shadow: var(--shadow); }
aside.summary { position: sticky; top: 16px; }

/* ---------- forms ---------- */
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
label > input, label > select { display: block; width: 100%; margin-top: 5px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, button { font: inherit; }
input[type=text], input[type=number], select {
  height: 42px; padding: 0 11px; border: 1px solid #b9c2be; border-radius: var(--r-sm); background: #fff; color: var(--ink); min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:hover, input[type=number]:hover, select:hover { border-color: #8f9a95; }
input:focus, select:focus { outline: none; border-color: var(--sign); box-shadow: 0 0 0 3px rgba(0,101,59,.18); }
input::placeholder { color: #8b9590; }
details.more { margin-top: 12px; }
details.more > summary { font-size: 14px; color: var(--sign); font-weight: 600; cursor: pointer; }

/* ---------- buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--sign); background: var(--sign); color: #fff; cursor: pointer; text-decoration: none; font-size: 15px; font-weight: 700; transition: background-color .15s, border-color .15s, color .15s; }
button:hover, .btn:hover { background: var(--sign-deep); border-color: var(--sign-deep); color: #fff; }
button.secondary, .btn.secondary { background: #fff; color: var(--sign); border-color: #b9c2be; }
button.secondary:hover, .btn.secondary:hover { border-color: var(--sign); background: var(--sign-tint); color: var(--sign-deep); }
button.link { background: none; border: none; color: var(--sign); padding: 0 6px; min-height: 36px; text-decoration: underline; font-weight: 600; }
button.link:hover { color: var(--sign-deep); background: none; }
.btn.buy { background: var(--amber); border-color: var(--amber); color: var(--asphalt); }
.btn.buy:hover { background: #ffc61a; border-color: #ffc61a; color: var(--asphalt); }
button:disabled { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- banners & notices ---------- */
.banner { padding: 10px 14px; border-radius: var(--r-sm); background: var(--sign-tint); margin: 12px 0; font-size: 15px; overflow-wrap: anywhere; }
.banner.warn { background: var(--amber-tint); color: var(--amber-ink); border-left: 4px solid var(--amber); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--sign-tint); color: var(--sign-deep); }
.pill.warn { background: var(--amber-tint); color: var(--amber-ink); }
.notices { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fafbfa; }
.notices > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 15px; }
.notices > summary::-webkit-details-marker { display: none; }
.notices > summary .chev { margin-left: auto; transition: transform .2s; }
.notices[open] > summary .chev { transform: rotate(180deg); }
.notices .hit { background: var(--amber); color: var(--asphalt); font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.notices .list { padding: 0 14px 12px; }
.notice { border-top: 1px solid var(--rule); padding: 10px 0; font-size: 14px; }
.notice .nh { display: flex; gap: 10px; align-items: baseline; }
.notice .code { flex: none; min-width: 40px; text-align: center; font-weight: 800; font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--asphalt); color: #fff; }
.notice.on-return .code { background: var(--amber); color: var(--asphalt); }
.notice p { margin: 4px 0 0 50px; color: var(--muted); }

/* ---------- entry grid ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tab { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; }
.tab:hover { background: var(--sign-tint); color: var(--sign-deep); border-color: var(--sign); }
.tab.active { background: var(--asphalt); color: #fff; border-color: var(--asphalt); }
.tab.locked { color: var(--muted); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
th { background: #f3f5f4; font-weight: 700; font-size: 13px; color: var(--muted); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 800; background: #f3f5f4; border-top: 2px solid var(--ink); }
tr.sur td { color: var(--muted); font-style: italic; }
.grid td { padding: 6px; }
.grid input { width: 100%; min-width: 84px; text-align: right; }
.grid select { min-width: 190px; width: 100%; }
.grid select[data-f="period"] { margin-top: 6px; font-size: 14px; }
.grid .rate { white-space: nowrap; font-size: 14px; color: var(--muted); }
.grid .del { min-height: 36px; width: 36px; padding: 0; background: none; border: 1px solid transparent; color: var(--muted); }
.grid .del:hover { color: #9b2c1f; border-color: var(--line); background: #fff; }
.hint { font-size: 14px; color: var(--muted); margin: 10px 0 0; max-width: 80ch; }
.hint b { color: var(--ink); font-weight: 600; }

/* ---------- summary panel ---------- */
.summary .net { padding: 16px; border-radius: var(--r-sm); background: var(--asphalt); color: #fff; margin-bottom: 14px; }
.summary .net .k { font-size: 14px; color: #c9d1cd; }
.summary .net .v { font-size: 2.3rem; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.summary .net.credit { background: var(--sign); }
.summary .net.empty .v { color: #8b9590; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; font-size: 15px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 700; }
.summary .note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.summary .warnings { margin: 12px 0 0; padding: 10px 12px 10px 28px; background: var(--amber-tint); color: var(--amber-ink); border-radius: var(--r-sm); font-size: 14px; }
.pro-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.pro-box h3 { margin: 0 0 8px; font-size: 1rem; }
.pro-box ul { list-style: none; padding: 0; margin: 0 0 14px; font-size: 14px; }
.pro-box li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.pro-box li svg { color: var(--sign); margin-top: 2px; }
.pro-box .btn { width: 100%; }
.pro-box .price { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }
.pro-on { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--sign-deep); background: var(--sign-tint); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 14px; }

/* ---------- the worksheet ---------- */
.worksheet { margin-top: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.ws-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 20px 14px; border-bottom: 2px solid var(--ink); }
.ws-head h2 { margin: 0; font-size: 1.25rem; }
.ws-head .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ws-body { position: relative; }
.ws-body table { font-size: 14.5px; }
.ws-body .tablewrap { border: 0; border-radius: 0; }
.ws-body tbody tr:nth-child(even) td { background: #fafbfa; }
.ws-foot { padding: 12px 20px 16px; font-size: 14px; color: var(--muted); }
.ws-empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.blur { filter: blur(5px); user-select: none; color: var(--muted); }
.lock-overlay { position: absolute; inset: 52px 0 0 0; display: grid; place-items: center; padding: 20px; background: linear-gradient(180deg, rgba(255,255,255,0) 0, rgba(255,255,255,.85) 90px, rgba(255,255,255,.95)); }
.lock-card { max-width: 440px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 20px 22px; }
.lock-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.lock-card p { margin: 0 0 14px; font-size: 15px; color: var(--muted); }

/* ---------- content ---------- */
.content { max-width: 760px; }
.content p, .content li { line-height: 1.65; }
.content ol { padding-left: 22px; }
.content ol li { margin-bottom: 6px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.02rem; }
.faq details p { margin: 8px 0 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0; }
.compare > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.compare > div.pro { border: 2px solid var(--sign); }
.compare h3 { margin: 0 0 8px; }
.compare ul { margin: 0; padding-left: 18px; font-size: 15px; }
.jlist { columns: 3 200px; padding-left: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #f3f5f4; border-radius: var(--r-sm); padding: 10px 12px; }
.kpi .k { font-size: 13px; color: var(--muted); } .kpi .v { font-size: 1.3rem; font-weight: 800; }

/* ---------- footer, dialogs ---------- */
footer.site { margin-top: 56px; padding: 26px 0 40px; background: var(--asphalt); color: #c9d1cd; font-size: 14px; }
footer.site a { color: #fff; }
footer.site .links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
dialog { border: 1px solid var(--line); border-radius: var(--r-md); max-width: 760px; width: calc(100% - 32px); padding: 22px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(28,34,32,.55); }
dialog h2 { margin-top: 0; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.print-only { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  aside.summary { position: static; }
}
@media (max-width: 720px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .guide-sign .gs-main { font-size: 1.6rem; white-space: normal; }
  .notices > summary { flex-wrap: wrap; }
  .guide-sign { min-width: 0; }
  .panel { padding: 16px; }
  .compare { grid-template-columns: 1fr; }
  /* entry grid becomes stacked cards */
  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid-wrap.tablewrap { border: 0; overflow: visible; }
  .grid tr { position: relative; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 10px 4px; margin-bottom: 10px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
  .grid td { border: 0; padding: 4px 0; min-width: 0; }
  .grid input, .grid select { min-width: 0; }
  .grid td.j { grid-column: 1 / -1; padding-right: 44px; }
  .grid td.rate { grid-column: 1 / -1; text-align: left; }
  .grid td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .grid td.x { position: absolute; top: 8px; right: 6px; width: auto; padding: 0; }
  .grid input { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  body { background: #fff; font-size: 11pt; }
  header.site, footer.site, .hero, .no-print, .app, .worksheet, .content, nav { display: none !important; }
  .print-only { display: block !important; }
  table { font-size: 9.5pt; } th { position: static; }
  .tablewrap { overflow: visible; border: none; }
  @page { margin: 12mm; }
}

/* ---------- generated content pages ---------- */
.content-page { padding-top: 26px; }
.content-page > h1 { margin-top: 6px; }
.content-page > p, .content-page > ul, .content-page > ol { max-width: 75ch; }
.content-page .tablewrap { background: #fff; box-shadow: var(--shadow); margin: 14px 0; }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 36px 0 16px; padding: 20px 22px; border-radius: var(--r-md); background: var(--sign); color: #fff; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px #fff; }
.cta-band p { margin: 4px 0 0; color: #d7ebe0; max-width: 60ch; }

/* Buy button before the Stripe link is configured */
.btn.soon { opacity: .6; cursor: default; pointer-events: none; }
