/* TipFees — built to read like a gate price board: flat, high-contrast, no decoration. */

:root {
  --ink: #14241c;
  --board: #f2f3ef;
  --paper: #ffffff;
  --signal: #0f6b3f;
  --signal-tint: #e8f1eb;
  --caution: #a44a16;
  --rule: #c9cec6;
  --soft: #556259;
  --measure: 62ch;
  --shell: 70rem;
  font-size: 17px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ece8;
    --board: #18201c;
    --paper: #11160f;
    --signal: #5fbf8c;
    --signal-tint: #16301f;
    --caution: #e08b5a;
    --rule: #33403a;
    --soft: #9aa89f;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 10;
  background: var(--signal);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
}

/* ---------------------------------------------------------------- chrome */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 2px solid var(--ink);
}

.wordmark {
  display: inline-block;
  padding: 0.25rem 0;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.125rem;
  font-size: 0.9375rem;
}

.topnav a { display: inline-block; padding: 0.4375rem 0; }

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--soft);
  font-size: 0.9375rem;
}
.footer p { max-width: var(--measure); }

a { color: var(--signal); text-underline-offset: 0.15em; }

/* a link alone in a paragraph is a standalone control, not inline prose */
p > a:only-child { display: inline-block; padding: 0.25rem 0; }
a:hover { color: var(--ink); }
a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.crumbs {
  font-size: 0.875rem;
  color: var(--soft);
  margin-bottom: 1rem;
}
.crumbs a { color: var(--soft); display: inline-block; padding: 0.3125rem 0; }

/* ------------------------------------------------------------- headings */

h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  max-width: 34ch;
}

h2 {
  font-size: 1.4375rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  margin: 1.75rem 0 0.5rem;
}

p, li { max-width: var(--measure); }

.lede {
  font-size: 1.1875rem;
  color: var(--ink);
  margin: 0 0 1.5rem;
}

.where {
  display: block;
  font-size: 0.8125rem;
  color: var(--soft);
  font-weight: 400;
}

/* Sits beside the address. Padding keeps it past the 24px minimum tap
   target without pushing the line height around. */
.directions {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--signal);
  background: var(--signal-tint);
  border-radius: 0.25rem;
  text-decoration: none;
}

.directions:hover,
.directions:focus { text-decoration: underline; }

.verified {
  font-size: 0.875rem;
  color: var(--soft);
  margin: 0.75rem 0 0;
}

.tag {
  font-size: 0.8125rem;
  color: var(--soft);
}
.tag::before { content: "("; }
.tag::after { content: ")"; }

/* ------------------------------------------------- the board (the hero) */

.board-head {
  margin-top: 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--soft);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--board);
  overflow: hidden;
}

.board-cell {
  padding: 1.125rem 1.125rem 1rem;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.board-cell:last-child { border-right: 0; }

.board-amount {
  font-size: 2.375rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.board-cell-blank .board-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--soft);
  letter-spacing: 0;
}

.board-load { font-weight: 600; font-size: 0.9375rem; }
.board-detail { font-size: 0.8125rem; color: var(--soft); max-width: none; }


/* -------------------------------------------------------------- tables */

.scroller { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.9375rem;
}

thead th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--soft);
  border-bottom: 2px solid var(--ink);
  padding: 0.5rem 0.75rem 0.375rem;
  white-space: nowrap;
}

tbody th {
  text-align: left;
  font-weight: 600;
  vertical-align: top;
}

td, tbody th {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

td:first-child, tbody th:first-child { padding-left: 0; }
td:last-child, tbody th:last-child { padding-right: 0; }

.num { text-align: right; white-space: nowrap; }
thead .num { text-align: right; }
.soft { color: var(--soft); font-weight: 400; }

.compare { max-width: 54rem; }
.compare tbody th { min-width: 11rem; }

.compare tbody th a {
  display: block;
  padding: 0.1875rem 0;
  min-height: 1.75rem;
}

.cheapest th:first-child {
  box-shadow: inset 3px 0 0 var(--signal);
  padding-left: 0.625rem;
}
.cheapest { background: var(--signal-tint); }

.rank-table .rank { width: 2.5rem; color: var(--soft); }
.rank-table tbody th:first-child { padding-left: 0.75rem; }

.detail tbody th { width: 9rem; color: var(--soft); font-weight: 600; }
.fees tbody th:first-child { padding-left: 0; }

/* --------------------------------------------------------------- lists */

.list, .chooser {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
  max-width: 44rem;
}

.list li {
  border-bottom: 1px solid var(--rule);
  max-width: none;
}

.list li a {
  display: block;
  padding: 0.6875rem 0;
  font-weight: 600;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

.list li a:hover { text-decoration-color: currentColor; }
.list li a .where { font-weight: 400; margin-top: 0.0625rem; }

.chooser li {
  border-bottom: 1px solid var(--rule);
  max-width: none;
  font-size: 1.1875rem;
}

.chooser li a { display: block; padding: 0.875rem 0; font-weight: 600; }

.notes { padding-left: 1.125rem; margin: 0.5rem 0 1rem; }
.notes li { margin-bottom: 0.375rem; }
.notes.bad li::marker { color: var(--caution); }

.steps { padding-left: 1.5rem; margin: 0.5rem 0 1.5rem; }
.steps li { margin-bottom: 0.625rem; }

.flag {
  border-left: 3px solid var(--caution);
  padding: 0.25rem 0 0.25rem 0.75rem;
  margin: 1rem 0;
  color: var(--ink);
  font-size: 0.9375rem;
}

.empty { color: var(--soft); }

.count {
  color: var(--soft);
  font-size: 0.875rem;
  margin: 0 0 0.25rem;
  min-height: 1.25rem;
}

/* -------------------------------------------------------------- inputs */

.filter {
  width: 100%;
  max-width: 28rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.625rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  margin: 0.5rem 0 0.75rem;
}

.assume {
  margin: 1rem 0 1.5rem;
  font-size: 0.9375rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.625rem 0;
}
.assume summary {
  cursor: pointer;
  color: var(--signal);
  font-weight: 600;
  padding: 0.25rem 0;
}
.assume ul { padding-left: 1.125rem; margin: 0.75rem 0 0.5rem; }
.assume p { margin-bottom: 0.25rem; }

section { margin-top: 0.5rem; }


.tablenote { margin: -0.5rem 0 1rem; }

/* On a phone a four-column comparison cannot fit, so each row becomes its own
   small price board: the tip on one line, its load prices beneath. */

/* ---------------------------------------------------- responsive
   These come last on purpose: they override the base rules above,
   and equal-specificity selectors are decided by source order. */

@media (max-width: 44rem) {
  .compare { font-size: 0.875rem; }
  .compare tbody th { min-width: 0; }
  .compare td, .compare tbody th { padding: 0.5rem 0.375rem; }
  .compare td:first-child, .compare tbody th:first-child { padding-left: 0; }
  .compare td:last-child, .compare tbody th:last-child { padding-right: 0; }
  .compare thead th { padding: 0.5rem 0.375rem 0.375rem; }
  thead th { white-space: normal; }
  .rank-table .rank { width: 1.5rem; }
  .cheapest th:first-child { padding-left: 0.5rem; }
  .fees { font-size: 0.875rem; }
  main { padding-left: 1rem; padding-right: 1rem; }
  .masthead, .footer { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 40rem) {
  .board { grid-template-columns: 1fr; }
  .board-cell { border-right: 0; border-bottom: 1px solid var(--rule); }
  .board-cell:last-child { border-bottom: 0; }
  .board-amount { font-size: 2rem; }
  h1 { font-size: 1.625rem; }
  :root { font-size: 16px; }
}

@media (max-width: 34rem) {
  .compare.loads thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare.loads,
  .compare.loads tbody { display: block; }
  .compare.loads tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 0 0.625rem;
  }
  .compare.loads tbody th {
    flex: 1 0 100%;
    border: 0;
    padding: 0;
    min-width: 0;
  }
  .compare.loads tbody td {
    flex: 1 1 0;
    min-width: 4rem;
    border: 0;
    padding: 0.5rem 0.5rem 0 0;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    white-space: normal;
  }
  .compare.loads tbody td.soft { font-weight: 400; font-size: 0.875rem; }
  .compare.loads tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--soft);
  }
  .compare.loads .cheapest {
    background: var(--signal-tint);
    box-shadow: inset 3px 0 0 var(--signal);
    padding-left: 0.5rem;
  }
  .compare.loads .cheapest th:first-child { box-shadow: none; padding-left: 0; }
}

@media print {
  .masthead, .topnav, .footer, .filter { display: none; }
  body { font-size: 11pt; }
}
