/* Shared styles for the list pages (/builders, /builder). Served at /assets/site.css. */
:root {
  color-scheme: light;
  --ink: #1c1915; --muted: #5c564c; --paper: #f4f0e6; --white: #fffdf8; --line: #e3dccf; --line-strong: #cfc6b5;
  --green: #0f6b4c; --green-dark: #0b5340; --green-soft: #e4f1ea; --amber: #7a5310; --amber-soft: #f7ecd4; --red: #9b2c1f;
  --radius: 12px; --shadow: 0 1px 2px rgba(28, 25, 21, 0.05), 0 4px 14px rgba(28, 25, 21, 0.05);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif; background: var(--paper); color: var(--ink); line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hidden { display: none !important; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 560; font-size: 2rem; line-height: 1.15; margin: 0 0 4px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* top bar and layout */
.nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 24px;
  background: rgba(255, 253, 248, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.mark { font-family: Fraunces, Georgia, serif; font-weight: 680; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.01em; }
.nav a.link { text-decoration: none; font-weight: 600; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a.link:hover { color: var(--ink); }
.nav a.link.on { color: var(--ink); border-bottom-color: var(--green); }
.nav .spacer { flex: 1; }
.shell { display: grid; grid-template-columns: 308px minmax(0, 1fr); align-items: start; }
.shell.single { grid-template-columns: minmax(0, 1fr); }
aside { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; background: var(--white); border-right: 1px solid var(--line); padding: 0 0 24px; }
main { padding: 24px 28px 64px; min-width: 0; max-width: 1280px; }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--green); font-weight: 600; text-decoration: none; }
.back { display: inline-block; margin: 0 0 12px; color: var(--green); font-weight: 700; text-decoration: none; }

/* filter rail */
.rail-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--white); border-bottom: 1px solid var(--line); }
.rail-head h2 { margin: 0; font-size: 0.95rem; letter-spacing: 0.02em; }
.link-btn { background: none; border: none; padding: 2px 0; color: var(--green); font-weight: 700; font-size: 0.9rem; }
.link-btn:hover { text-decoration: underline; }
details.sec { border-bottom: 1px solid var(--line); }
details.sec > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -3px; }
details.sec[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.sec-body { padding: 0 18px 16px; }
.f { margin: 0 0 12px; }
.f label.t, .f .t { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin: 0 0 5px; }
.field, .f select { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--white); }
.field.search { padding-left: 34px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235c564c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") 11px 50% no-repeat; }
.group { font-size: 0.78rem; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.group:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); font-size: 0.9rem; }
.chip:hover { border-color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--white); }
.seg button { flex: 1; border: none; border-left: 1px solid var(--line); background: none; padding: 7px 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.seg button:first-child { border-left: none; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 0.95rem; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(16px); }
.hint { color: var(--muted); font-size: 0.82rem; margin: 4px 0 0; }
.rail-foot { display: none; position: sticky; bottom: 0; padding: 12px 18px; background: var(--white); border-top: 1px solid var(--line); }
.rail-foot button { width: 100%; padding: 12px; border: none; border-radius: 10px; background: var(--green); color: #fff; font-weight: 700; }
aside:focus { outline: none; }
.scrim { display: none; }
.active { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.active button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 999px; border: 1px solid var(--green); background: var(--green-soft); color: var(--green-dark); font-size: 0.88rem; font-weight: 600; }
.active button::after { content: "×"; font-size: 1.1rem; line-height: 1; padding: 0 4px; }

/* stat tiles, toolbar */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.stat { text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); min-width: 0; }
.stat .v { font-family: Fraunces, Georgia, serif; font-size: 1.65rem; font-weight: 560; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.stat.lead .v { color: var(--green); }
.toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.toolbar select { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--white); }
.toolbar .count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
#filtersToggle { display: none; padding: 7px 14px; border: 1px solid var(--ink); border-radius: 9px; background: var(--white); font-weight: 700; }
#filtersToggle b { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--green); color: #fff; font-size: 0.8rem; }

/* tags, badges, call button, states */
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: 2px 9px; font-size: 0.8rem; font-weight: 700; }
.badge { background: var(--amber-soft); color: var(--amber); border-radius: 999px; padding: 2px 9px; font-size: 0.8rem; font-weight: 700; }
a.tel { flex: none; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 700; font-size: 0.9rem; text-decoration: none; white-space: nowrap; }
a.tel:hover { background: var(--green-dark); }
.notice { padding: 36px 20px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--line-strong); border-radius: var(--radius); grid-column: 1 / -1; }
.notice b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.notice button { margin-top: 12px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--green); background: var(--white); color: var(--green); font-weight: 700; }
.notice.err b { color: var(--red); }
.skel { height: 84px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(100deg, var(--white) 30%, #f1ecdf 50%, var(--white) 70%) var(--white); background-size: 300% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* permit cards (the profile page) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card:hover, .card:focus-within { border-color: var(--green); }
.card:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.card .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.addr { margin: 0; font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.addr a { text-decoration: none; }
.addr a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.addr a:focus-visible { outline: none; }
.where { color: var(--muted); font-size: 0.9rem; margin: 2px 0 0; }
.value { font-family: Fraunces, Georgia, serif; font-weight: 560; font-size: 1.35rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.value.none { color: var(--muted); font-family: inherit; font-weight: 400; font-size: 0.85rem; }
.who { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--paper); border-radius: 10px; }
.who .name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.who a.name:hover { text-decoration: underline; }
.who.empty { color: var(--muted); font-size: 0.9rem; }
.desc { margin: 0; font-size: 0.93rem; color: #3a352d; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next { margin: 0; font-size: 0.86rem; color: var(--muted); }
.next b { color: var(--ink); font-weight: 600; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; color: var(--muted); font-size: 0.83rem; margin-top: auto; }
.foot span:last-child { color: var(--green); font-weight: 700; white-space: nowrap; }

@media (max-width: 900px) {
  .nav { padding: 0 14px; gap: 16px; }
  .shell { display: block; }
  aside { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(92vw, 380px); height: 100dvh; transform: translateX(-102%); visibility: hidden; transition: transform 0.2s, visibility 0s 0.2s; }
  aside.open { transform: none; visibility: visible; transition: transform 0.2s; box-shadow: 0 0 40px rgba(0, 0, 0, 0.25); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(28, 25, 21, 0.45); }
  .rail-foot { display: block; }
  #filtersToggle { display: inline-block; }
  main { padding: 16px 14px 56px; }
  h1 { font-size: 1.55rem; }
  .cards { grid-template-columns: 1fr; }
  .toolbar .count { margin-left: 0; width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .nav { gap: 14px; } .nav .mark { white-space: nowrap; font-size: 1.05rem; } .nav a.link.state { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
