/* Philly Sewer Line Guide: mobile-first, system fonts, no external requests. */
:root {
  --bg: #ffffff;
  --surface: #f3f6f6;
  --ink: #17212b;
  --muted: #475462;
  --brand: #0d5c63;
  --brand-dark: #08444a;
  --accent: #a24419;
  --water: #1c64a8;
  --line: #cfd8db;
  --note-bg: #fff5e1;
  --note-ink: #4f3300;
  --draft-bg: #fdeaea;
  --draft-ink: #861a1a;
  --ok-bg: #e7f4ec;
  --ok-ink: #14532d;
  --radius: 10px;
  --max: 46rem;
  --max-wide: 68rem;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 0.5em; }
h1 { font-size: 1.8rem; margin-top: 0.6em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
.small { font-size: 0.9rem; color: var(--muted); }
.wrap { max-width: var(--max-wide); margin: 0 auto; padding: 0 16px; }
main { max-width: var(--max); margin: 0 auto; padding: 0 16px 48px; }
main.wide { max-width: var(--max-wide); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* Preview + draft flags */
.preview-bar { background: var(--draft-bg); color: var(--draft-ink); font-size: 0.85rem; text-align: center; padding: 6px 16px; border-bottom: 1px solid #f2c4c4; }
.draft-flag { background: var(--draft-bg); color: var(--draft-ink); border: 2px dashed var(--draft-ink); border-radius: var(--radius); padding: 10px 14px; font-size: 0.95rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.brand small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.site-nav { padding-bottom: 8px; }
.menu summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 10px 0; min-height: 44px; list-style: none; display: flex; align-items: center; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::before { content: ""; width: 18px; height: 12px; margin-right: 8px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; background: linear-gradient(currentColor, currentColor) center/100% 2px no-repeat; }
.menu ul { list-style: none; padding: 0; margin: 0 0 8px; }
.menu li { margin: 0; border-top: 1px solid var(--line); }
.menu a { display: block; padding: 11px 2px; text-decoration: none; }
.nav-wide { display: none; }
[aria-current="page"] { font-weight: 700; color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; border: 0; font-size: 1rem; cursor: pointer; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-small { min-height: 44px; padding: 8px 16px; font-size: 0.92rem; }
.btn-ghost { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn-ghost:hover { background: var(--surface); color: var(--brand-dark); }
.btn[disabled], .btn[aria-disabled="true"] { background: #56616b; cursor: not-allowed; }

/* Content blocks */
.lede { font-size: 1.1rem; color: var(--ink); }
.byline { font-size: 0.88rem; color: var(--muted); margin-top: -0.3em; }
.callout { background: var(--note-bg); color: var(--note-ink); border-left: 5px solid #c98a00; border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; margin: 1.2em 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-info { background: var(--surface); color: var(--ink); border-left-color: var(--brand); }
.callout-ok { background: var(--ok-bg); color: var(--ok-ink); border-left-color: #1f7a45; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 2px 0 10px 48px; margin-bottom: 8px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.card-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 1em 0 1.5em; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; text-decoration: none; color: var(--ink); }
a.card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(13, 92, 99, 0.12); }
a.card .more { color: var(--brand); font-weight: 600; }
.hero { padding: 8px 0 4px; }
.hero h1 { font-size: 1.95rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }
.phone { white-space: nowrap; font-weight: 600; }
.cite { font-size: 0.78rem; vertical-align: super; text-decoration: none; margin-left: 2px; }
.table-wrap { overflow-x: auto; margin: 1em 0 1.5em; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--surface); }
tr:last-child td { border-bottom: 0; }
figure { margin: 1.2em 0 1.6em; }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.diagram { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 6px; }
.legend { display: grid; grid-template-columns: 1fr; gap: 4px 18px; padding: 0; list-style: none; font-size: 0.93rem; }
.legend li { display: flex; gap: 8px; align-items: baseline; }
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: 0.85rem; color: #fff; flex: none; }
.key-you { background: var(--accent); }
.key-water { background: var(--water); }
.key-city { background: #4c5964; }
.sources { margin-top: 2.5em; border-top: 2px solid var(--line); padding-top: 0.5em; }
.sources h2 { font-size: 1.1rem; }
.sources ol { font-size: 0.9rem; padding-left: 1.3em; }
.sources li { overflow-wrap: anywhere; }
.toc { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; font-size: 0.95rem; }
.toc ul { margin: 0; padding-left: 1.1em; }
dl.faq dt { font-weight: 700; margin-top: 1.2em; }
dl.faq dd { margin: 0.3em 0 0; }
.faq-item { border-bottom: 1px solid var(--line); padding: 4px 0 10px; }
.faq-item h2 { font-size: 1.1rem; margin: 1em 0 0.4em; }

/* Form */
.form { margin: 1.5em 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 6px; }
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 6px; font-weight: 400; }
input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid #7d8a95; border-radius: 8px;
}
textarea { min-height: 96px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.check input { width: 24px; height: 24px; margin-top: 3px; flex: none; accent-color: var(--brand); }
.consent-box { border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; background: #fff; margin: 0 0 18px; }
.consent-box .check { font-size: 1rem; }
.consent-text strong { font-weight: 700; }
.form-status { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
.form-status.off { background: var(--note-bg); color: var(--note-ink); border: 1px solid #e3b75a; }
.form-status.ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #8cc7a2; }
.form-status.err { background: var(--draft-bg); color: var(--draft-ink); border: 1px solid #e9a9a9; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.req { color: var(--draft-ink); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 22px 0 28px; margin-top: 24px; }
.site-footer .independence { font-size: 0.98rem; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { display: inline-block; padding: 6px 0; min-height: 32px; }

@media (min-width: 640px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .legend { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
}
@media (min-width: 960px) {
  .menu { display: none; }
  .nav-wide { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; padding: 0; margin: 0; font-size: 0.95rem; }
  .nav-wide li { margin: 0; }
  .nav-wide a { display: inline-block; padding: 8px 0; text-decoration: none; }
  .nav-wide a:hover { text-decoration: underline; }
  .card-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .home-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
}
@media print {
  .site-header, .site-footer .footer-links, .preview-bar, .btn { display: none; }
  a { color: #000; }
}

.header-cta { white-space: nowrap; flex: none; }
@media (max-width: 639px) {
  figure .diagram { margin: 0 -16px; border-left: 0; border-right: 0; border-radius: 0; padding: 4px 0; }
}
