:root {
  --paper: #fbf8f3;
  --card: #ffffff;
  --ink: #2b2620;
  --muted: #857a6f;
  --line: #ebe4da;
  --leader: #cfc4b6;
  --accent: #d2462d; /* paprika */
  --accent-soft: #fbe9e4;
  --saffron: #b9821a;
  --saffron-soft: #f8efdc;
  --basil: #4f8a4b;
  --basil-soft: #e8f1e4;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  color-scheme: light dark;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171513;
    --card: #201d1a;
    --ink: #efe9e1;
    --muted: #a39789;
    --line: #322d28;
    --leader: #4a433b;
    --accent: #f0735a;
    --accent-soft: #3a221c;
    --saffron: #e1b04a;
    --saffron-soft: #33291a;
    --basil: #86bf7f;
    --basil-soft: #1f2c1e;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* A thin gingham strip, like a tablecloth edge. */
.cloth {
  height: 6px;
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 3px, transparent 3px 6px);
  opacity: 0.55;
}

main { max-width: 44rem; margin: 0 auto; padding: 1.4rem 1.1rem 4rem; }

/* Masthead */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.brand .logo { width: 2.4rem; height: 2.4rem; color: var(--accent); stroke-width: 1.3; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; letter-spacing: 0.04em; }
.tagline { font-size: 0.68rem; letter-spacing: 0.12em; white-space: nowrap; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }
.ghost {
  display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer; color: var(--muted);
}
.ghost:hover, .ghost[aria-expanded='true'] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* Key */
.key { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.4rem; }
.key h2 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.45rem; }
.key h2 .icon { color: var(--accent); }
.key h3 { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0.9rem 0 0.25rem; }
.key p { margin: 0; line-height: 1.5; font-size: 0.93rem; }
.key-grid { display: grid; gap: 0.6rem 1.6rem; }
@media (min-width: 640px) { .key-grid { grid-template-columns: 1fr 1fr; } }
.legend { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 0.65rem; font-size: 0.9rem; line-height: 1.4; }
.legend li { display: flex; gap: 0.65rem; align-items: flex-start; }
.mark { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 600; }
.mark.notable { background: var(--saffron-soft); color: var(--saffron); }
.mark.new { background: var(--basil-soft); color: var(--basil); }
.mark.price { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.mark.save { color: var(--saffron); border: 1px solid var(--line); }
.mark.leader { border-radius: 0; height: 0.9rem; border-bottom: 2px dotted var(--leader); }

.referral { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0 0 !important; font-size: 0.9rem; }
.referral .icon { color: var(--accent); }

/* Search */
.search {
  display: flex; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.3rem 0.3rem 0.3rem 1rem; box-shadow: 0 1px 2px rgb(60 40 20 / 0.05);
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.zip-field { flex: 1; display: flex; align-items: center; gap: 0.5rem; color: var(--muted); min-width: 0; }
.zip-field input { border: 0; background: none; outline: none; font-size: 1.05rem; width: 100%; padding: 0.45rem 0; color: var(--ink); letter-spacing: 0.04em; }
.area-field select { border: 0; border-left: 1px solid var(--line); background: none; padding: 0.4rem 0.6rem; outline: none; color: var(--ink); cursor: pointer; }
.go { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.go:hover { filter: brightness(1.05); }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin: 1.1rem 0 0.2rem; }
.segmented { display: inline-flex; background: var(--line); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: none; padding: 0.35rem 0.9rem; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 0.92rem; }
.segmented button[aria-selected='true'] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.chips { display: flex; align-items: center; gap: 0.4rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip > span {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.32rem 0.75rem; border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.88rem; color: var(--muted); cursor: pointer; user-select: none;
}
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:checked + span { color: var(--ink); border-color: transparent; }
.chip:first-child input:checked + span { background: var(--saffron-soft); color: var(--saffron); }
.chip:nth-child(2) input:checked + span { background: var(--basil-soft); color: var(--basil); }
.sort select { border: 0; background: none; color: var(--muted); font-size: 0.88rem; cursor: pointer; padding: 0.3rem 0.2rem; }

.banner { margin: 1rem 0 0; padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--basil-soft); font-size: 0.92rem; }
.summary { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 1.3rem 0 0.2rem; }

/* The list, set like a menu */
.menu { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 2rem 1fr; gap: 0 0.4rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.save-btn { background: none; border: 0; padding: 0.1rem 0; cursor: pointer; color: var(--leader); align-self: start; }
.save-btn .icon { width: 1.3rem; height: 1.3rem; }
.save-btn:hover, .save-btn[aria-pressed='true'] { color: var(--saffron); }
.line1 { display: flex; align-items: last baseline; gap: 0.45rem; }
.name { font-family: var(--serif); font-size: 1.14rem; font-weight: 600; color: var(--ink); text-decoration: none; }
a.name:hover { color: var(--accent); }
.leader { flex: 1; min-width: 1.2rem; border-bottom: 2px dotted var(--leader); transform: translateY(-0.28em); }
.dist { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 0.95rem; white-space: nowrap; }
.desc { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 0.15rem 0 0; }
.meta { font-size: 0.86rem; color: var(--muted); margin: 0.2rem 0 0; }
.meta a { color: inherit; text-decoration-color: var(--leader); }
.meta a:hover { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.45rem 0 0; }
.tag { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.76rem; padding: 0.12rem 0.55rem 0.12rem 0.4rem; border-radius: 999px; }
.tag .icon { width: 0.95rem; height: 0.95rem; }
.tag.notable { background: var(--saffron-soft); color: var(--saffron); }
.tag.new { background: var(--basil-soft); color: var(--basil); }
.tag.gone { background: var(--line); color: var(--muted); padding-left: 0.55rem; }
.empty { padding: 1.4rem 0; color: var(--muted); text-align: center; }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0 0.25rem; }
.more { display: block; margin: 1.2rem auto 0; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1.2rem; color: var(--muted); cursor: pointer; }
.more:hover { color: var(--accent); }

/* Alerts */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 2.6rem; }
.panel > summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; display: flex; align-items: center; gap: 0.55rem; font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .icon { color: var(--accent); }
.panel > summary::after { content: '+'; margin-left: auto; color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.panel[open] > summary::after { content: '–'; }
.alerts form, .alerts .next, .alerts .mine-title, .alerts .mine, .alerts > .hint { margin-left: 1.2rem; margin-right: 1.2rem; }
.alerts form { display: grid; gap: 0.85rem; }
.alerts > .hint { margin-bottom: 1.1rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.field input, .field select { padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 0.95rem; color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: transparent; }
.hint { font-size: 0.82rem; color: var(--muted); margin: 0; line-height: 1.45; }
.how { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
@media (max-width: 520px) { .how { grid-template-columns: 1fr; } }
.how legend { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; padding: 0; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; }
.option > span { display: grid; gap: 0.15rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; height: 100%; }
.option small { color: var(--muted); font-size: 0.78rem; }
.option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 0.55rem; align-items: baseline; font-size: 0.92rem; }
.primary, .button {
  display: inline-block; border: 0; border-radius: 999px; padding: 0.6rem 1.2rem; background: var(--accent); color: #fff;
  cursor: pointer; text-decoration: none; text-align: center; font-weight: 500;
}
.primary:hover, .button:hover { filter: brightness(1.05); }
.error { color: var(--accent); margin: 0; min-height: 1em; font-size: 0.9rem; }
.next { margin-top: 0.4rem; padding: 0.8rem 1rem; border-radius: 10px; background: var(--paper); font-size: 0.92rem; line-height: 1.55; }
.next ol { margin: 0; padding-left: 1.2rem; }
.next code { user-select: all; font-size: 0.9em; background: var(--line); padding: 0.05rem 0.3rem; border-radius: 4px; }
.mine-title { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 1.2rem; }
.mine { padding: 0; list-style: none; font-size: 0.92rem; }
.mine li { padding: 0.45rem 0; border-top: 1px solid var(--line); display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.mine li > span { flex: 1; min-width: 12rem; }

footer { margin-top: 2.8rem; padding-top: 1.2rem; border-top: 1px dotted var(--leader); font-size: 0.8rem; color: var(--muted); line-height: 1.5; text-align: center; }
footer p { margin: 0.25rem 0; }
footer .referral { justify-content: center; margin-bottom: 0.8rem !important; }
