/* The Business Places — frontend design system (approved direction D-019) */

:root {
  --paper: #FFFFFF;
  --wash: #F6F3F2;
  --card: #FFFFFF;
  --ink: #121212;
  --muted: #6B6462;
  --brand: #E30613;
  --brand-press: #B60310;
  --logo-red: #FF0000;
  --brand-soft: #FCEBEB;
  --on-brand: #FFFFFF;
  --ok: #1B7A3D;
  --line: #E7E2E0;
  --hero-bg: #0F0E0E;
  --hero-ink: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(18,18,18,.06), 0 3px 10px rgba(18,18,18,.05);
  --shadow-lift: 0 6px 14px rgba(18,18,18,.09), 0 18px 40px rgba(227,6,19,.10);
  --display: 'Zilla Slab', Rockwell, 'Roboto Slab', Georgia, serif;
  --body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wrap: 1100px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151313; --wash: #1B1918; --card: #1E1B1A;
    --ink: #ECE8E6; --muted: #A39B98;
    --brand: #FF4348; --brand-press: #FF6B6F; --logo-red: #FF3B3B; --brand-soft: #351416;
    --on-brand: #1A0505; --ok: #4CAF6E; --line: #322D2B;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 3px 10px rgba(0,0,0,.3);
    --shadow-lift: 0 6px 14px rgba(0,0,0,.5), 0 18px 40px rgba(255,67,72,.14);
  }
}
:root[data-theme="dark"] {
  --paper: #151313; --wash: #1B1918; --card: #1E1B1A;
  --ink: #ECE8E6; --muted: #A39B98;
  --brand: #FF4348; --brand-press: #FF6B6F; --logo-red: #FF3B3B; --brand-soft: #351416;
  --on-brand: #1A0505; --ok: #4CAF6E; --line: #322D2B;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 3px 10px rgba(0,0,0,.3);
  --shadow-lift: 0 6px 14px rgba(0,0,0,.5), 0 18px 40px rgba(255,67,72,.14);
}
:root[data-theme="light"] {
  --paper: #FFFFFF; --wash: #F6F3F2; --card: #FFFFFF;
  --ink: #121212; --muted: #6B6462;
  --brand: #E30613; --brand-press: #B60310; --logo-red: #FF0000; --brand-soft: #FCEBEB;
  --on-brand: #FFFFFF; --ok: #1B7A3D; --line: #E7E2E0;
  --shadow-sm: 0 1px 2px rgba(18,18,18,.06), 0 3px 10px rgba(18,18,18,.05);
  --shadow-lift: 0 6px 14px rgba(18,18,18,.09), 0 18px 40px rgba(227,6,19,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wash); color: var(--ink); font-family: var(--body); line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* animations */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pindrop { 0% { opacity: 0; transform: translateY(-26px) rotate(-45deg); } 60% { opacity: 1; transform: translateY(3px) rotate(-45deg); } 100% { transform: translateY(0) rotate(-45deg); } }
@keyframes ping { 0% { transform: rotate(-45deg) scale(.6); opacity: .7; } 100% { transform: rotate(-45deg) scale(2.4); opacity: 0; } }
.reveal { opacity: 0; animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; } .d3 { animation-delay: .25s; } .d4 { animation-delay: .35s; }
@media (prefers-reduced-motion: reduce) { *, .reveal, .pinshape { animation: none !important; opacity: 1 !important; scroll-behavior: auto !important; } }

/* pin + rule motif */
.rulepin { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.rulepin::before, .rulepin::after { content: ""; flex: 1; height: 5px; border-top: 2px solid var(--logo-red); border-bottom: 2px solid var(--logo-red); }
.pinshape { display: inline-block; width: 14px; height: 14px; flex: none; background: var(--logo-red); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); position: relative; }
.pinshape.drop { animation: pindrop .8s cubic-bezier(.2,.8,.3,1.2) both; }
.pinshape.pulse::before { content: ""; position: absolute; inset: -2px; border-radius: 50% 50% 50% 0; border: 2px solid var(--logo-red); animation: ping 2.4s ease-out infinite; }
.pinshape::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--paper); z-index: 1; }

/* header / footer */
.site-head { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; width: 100%; flex-wrap: wrap; }
.wordmark { font-family: var(--display); font-size: 20px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.wordmark:hover { text-decoration: none; }
.site-nav { display: flex; gap: 18px; margin-left: auto; font-size: 14.5px; align-items: center; }
.site-nav a { color: var(--muted); } .site-nav a:hover { color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); width: 40px; height: 40px; border-radius: 8px; cursor: pointer; place-items: center; }

@media (max-width: 768px) {
    .wordmark { font-size: 18px; }
    .nav-toggle { display: grid; }
    .site-nav { order: 3; flex-basis: 100%; width: 100%; flex-direction: column; align-items: stretch; gap: 0; margin-left: 0; max-height: 0; overflow: hidden; transition: max-height .28s ease; }
    .site-nav.open { max-height: 340px; }
    .site-nav a { padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
    .site-nav .btn.ghost { margin: 12px 0 6px; justify-content: center; padding: 12px; }
    .site-nav .theme-toggle { width: auto; align-self: flex-start; margin-top: 4px; padding: 0 10px; }
}
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; font-size: 14px; background: var(--brand); color: var(--on-brand); font-weight: 600; white-space: nowrap; border: none; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease; font-family: var(--body); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(227,6,19,.28); text-decoration: none; color: var(--on-brand); }
.btn:active { background: var(--brand-press); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); box-shadow: none; color: var(--brand); }
.btn.dark { background: var(--ink); color: var(--paper); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--muted); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }

.site-foot { margin-top: 46px; border-top: 1px solid var(--line); background: var(--card); }
.site-foot .wrap { padding-top: 34px; padding-bottom: 34px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; }
.site-foot h6 { margin: 0 0 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.site-foot ul { list-style: none; margin: 0; padding: 0; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.site-foot .brand-col p { color: var(--muted); font-size: 14px; max-width: 34ch; }
.foot-legal { border-top: 1px solid var(--line); }
.foot-legal .wrap { padding: 16px 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
@media (max-width: 720px) { .site-foot .wrap { grid-template-columns: 1fr 1fr; } }

/* hero */
.hero { position: relative; background: var(--hero-bg); color: var(--hero-ink); }
.hero-media { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.hero .wrap { padding-top: 46px; padding-bottom: 40px; position: relative; z-index: 2; }
.hero-map { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.hero-veil { position: absolute; inset: 0; background: radial-gradient(120% 120% at 22% 20%, transparent 40%, rgba(15,14,14,.65) 100%); pointer-events: none; }
.hero .rulepin { max-width: 420px; margin-bottom: 18px; }
.hero .pinshape::after { background: var(--hero-bg); }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4.6vw, 44px); margin: 0 0 8px; line-height: 1.12; text-wrap: balance; }
.hero h1 .hl { box-shadow: inset 0 -.34em 0 rgba(255,0,0,.42); }
.hero .lede { margin: 0 0 22px; opacity: .82; max-width: 54ch; font-size: 17px; }

.search { display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 8px; background: #FFF; padding: 8px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.28); max-width: 720px; }
.search input, .search select { border: none; background: #F2EFEE; padding: 12px 14px; border-radius: 8px; font-size: 14.5px; font-family: var(--body); color: #201c1b; width: 100%; }
.search input::placeholder { color: #8a807d; }
.search .btn { justify-content: center; }
.loc-search { position: relative; }
.loc-search .loc-input { width: 100%; }
.loc-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lift); overflow: hidden; display: none; text-align: left; }
.loc-suggest.open { display: block; }
.loc-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; }
.loc-item.active, .loc-item:hover { background: var(--brand-soft); }
.loc-name { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.loc-ctx { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .search { grid-template-columns: 1fr; } }

.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); }
.stat b { font-family: var(--display); font-size: 24px; font-weight: 700; display: block; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }

/* sections */
.section { padding: 34px 0 6px; }
.section.alt { background: var(--card); }
.sec-title { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0 0 16px; display: inline-flex; align-items: center; gap: 10px; }
.sec-title::after { content: ""; display: block; width: 34px; height: 3px; background: var(--logo-red); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sec-head a { font-size: 14px; }

/* category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 8px; }
.cat { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px 15px; background: var(--card); display: flex; flex-direction: column; gap: 7px; overflow: hidden; transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; color: var(--ink); }
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: transparent; text-decoration: none; }
.cat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--logo-red); transform: scaleY(0); transform-origin: top; transition: transform .2s ease; }
.cat:hover::before { transform: scaleY(1); }
.cat.soon { pointer-events: none; }
.cat .ico { width: 30px; height: 30px; color: var(--brand); }
.cat.soon .ico { color: var(--muted); opacity: .5; }
.cat b { font-size: 15.5px; font-weight: 600; }
.cat .n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat .n.live { color: var(--brand); font-weight: 600; }

/* chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--ink); background: var(--card); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* listing cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.article-hero { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; margin: 4px 0 24px; max-width: 900px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0 0 18px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.lcard { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; display: flex; flex-direction: column; transition: transform .16s ease, box-shadow .2s ease; }
.lcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.lcard.featured { border-color: var(--ink); }
.lcard-media { display: block; overflow: hidden; background: var(--wash); }
.lcard:not(.row) .lcard-media { aspect-ratio: 16 / 9; }
.lcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.lcard.row { flex-direction: row; align-items: stretch; }
.lcard.row .lcard-media { flex: none; width: 116px; }
.lcard.row .lcard-body { flex: 1 1 auto; min-width: 0; }
@media (max-width: 520px) { .lcard.row .lcard-media { width: 88px; } }
.lcard-media .ph-img, .lcard-media .ph { width: 100%; height: 100%; }
.ph-img { object-fit: cover; display: block; transition: transform .3s ease; }
.lcard:hover .ph-img { transform: scale(1.04); }
.tab { position: absolute; top: 0; right: 12px; z-index: 3; background: var(--ink); color: var(--paper); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px 4px; border-radius: 0 0 6px 6px; }
/* generated placeholder for imageless listings */
.ph { position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--wash), color-mix(in srgb, var(--brand-soft) 55%, var(--wash))); min-height: 100%; }
.ph-map { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.ph-mono { position: relative; z-index: 1; font-family: var(--display); font-weight: 700; font-size: 32px; color: var(--ink); letter-spacing: .02em; }
.lcard.row .ph-mono { font-size: 23px; }
.ph-ico { position: absolute; top: 8px; left: 8px; z-index: 1; opacity: .85; }
.ph-ico .ico { width: 20px; height: 20px; color: var(--brand); }
.lcard h3 { margin: 0; font-size: 16.5px; font-weight: 650; line-height: 1.3; }
.lcard h3 a { color: var(--ink); } .lcard h3 a:hover { color: var(--brand); text-decoration: none; }
.vcheck { color: var(--ok); font-size: 14px; }
.lmeta { font-size: 13px; color: var(--muted); }
.lrow { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.mini { font-size: 12.5px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: border-color .15s, color .15s; background: none; }
.mini:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.mini.go { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* archive layout */
.crumbs { font-size: 13px; color: var(--muted); padding: 16px 0 0; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 500; }
.archive-head { padding: 8px 0 4px; }
.archive-head h1 { font-family: var(--display); font-size: clamp(23px, 3.4vw, 32px); font-weight: 700; margin: 0 0 6px; text-wrap: balance; }
.archive-head .rulepin { max-width: 320px; margin: 0 0 12px; }
.archive-head p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
/* category/city chooser */
.choose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; padding-bottom: 34px; }
.choose { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; }
.choose:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: transparent; text-decoration: none; }
.choose-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 10px; color: var(--brand); }
.choose-ico .ico { width: 24px; height: 24px; }
.choose-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.choose-main b { font-size: 16.5px; font-weight: 650; }
.choose-n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.choose-arrow { color: var(--brand); font-size: 18px; transition: transform .2s ease; }
.choose:hover .choose-arrow { transform: translateX(4px); }

.breakdown { margin: 0 0 22px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.breakdown-title { font-family: var(--display); font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.breakdown .chip { display: inline-flex; align-items: center; gap: 7px; }
.chip-n { font-size: 12px; font-variant-numeric: tabular-nums; background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 999px; font-weight: 600; }
.chip:hover .chip-n { background: var(--brand); color: #fff; }
.cols { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; padding-bottom: 30px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.cards { display: flex; flex-direction: column; gap: 12px; }
.lcard.row h3 { display: flex; gap: 6px; align-items: baseline; }

/* map + panels */
.map { border: 1px solid var(--line); border-radius: 10px; height: 320px; position: relative; overflow: hidden; background: var(--wash); z-index: 0; }
.map.small { height: 200px; }
/* Leaflet container + brand marker */
.leaflet-container { font-family: var(--body); background: var(--wash); }
.map .leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--muted); }
.map .leaflet-control-attribution a { color: var(--brand); }
.map .leaflet-popup-content { font-size: 13.5px; }
.map .leaflet-popup-content a { color: var(--brand); font-weight: 600; }
.tbp-marker { background: none; border: none; }
.tbp-pin { display: block; width: 18px; height: 18px; background: var(--logo-red); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 5px rgba(0,0,0,.35); }
@media (prefers-color-scheme: dark) { .leaflet-tile { filter: brightness(.85) contrast(1.05); } }
:root[data-theme="dark"] .leaflet-tile { filter: brightness(.85) contrast(1.05); }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--card); }
.panel h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panel ul { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.panel li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.panel li:last-child { border-bottom: 0; }
.panel li span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.panel li a { color: var(--ink); } .panel li a:hover { color: var(--brand); text-decoration: none; }
.adslot { border: 1px dashed var(--line); border-radius: 10px; padding: 26px 16px; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

/* single listing */
.badges { display: flex; gap: 8px; margin: 16px 0 10px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.badge.v { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.f { background: var(--ink); color: var(--paper); }
.prose { font-size: 15.5px; max-width: 66ch; }
.prose p { margin: 0 0 14px; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hours tr:last-child td { border-bottom: 0; }
.hours tr.today td { color: var(--brand); font-weight: 600; }
.claim { margin: 22px 0; padding: 16px 18px; border-radius: 10px; background: var(--brand-soft); display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14.5px; }

/* feedback form */
.notice { border-radius: 10px; padding: 14px 16px; margin: 0 0 20px; font-size: 14.5px; }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.notice.err { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); color: var(--brand); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.fb-form { max-width: 640px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 18px; }
.fb-row { display: flex; flex-direction: column; gap: 7px; }
.fb-label { font-size: 14px; font-weight: 600; }
.fb-label .req { color: var(--brand); }
.fb-label .opt { color: var(--muted); font-weight: 400; font-size: 13px; }
.fb-form input[type="text"], .fb-form input[type="email"], .fb-form textarea, .fb-select {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--card); color: var(--ink); font-family: var(--body); font-size: 15px;
}
.fb-form textarea { resize: vertical; }
.fb-select {
    max-width: 320px; cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23888' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}
.fb-form input:focus, .fb-form textarea:focus, .fb-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fb-toggle { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-opt { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14.5px; transition: border-color .15s, background .15s; }
.fb-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.fb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .fb-grid { grid-template-columns: 1fr; } }
.fb-form .btn { align-self: flex-start; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .pinshape { margin: 0 auto 14px; width: 26px; height: 26px; }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 20px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.pagination .active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Free tools / calculators ---------- */
.tool-group { margin: 8px 0 34px; }
.tool-group-title { font-family: var(--display); font-size: 22px; margin: 0 0 14px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--brand); }
.tool-card b { font-size: 16px; line-height: 1.25; }
.tool-ico { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.tool-tag { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.tool-card.soon { opacity: .62; pointer-events: none; box-shadow: none; }
.tool-soon { align-self: flex-start; margin-top: 2px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

.tool-wrap { max-width: 760px; }
.tool-body { margin: 6px 0 18px; }
.tool-calc { display: flex; flex-direction: column; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-sm); }
.tc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .tc-grid2 { grid-template-columns: 1fr; } }
.tc-field { display: flex; flex-direction: column; gap: 6px; }
.tc-field > label { font-size: 13.5px; font-weight: 600; }
.tc-money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); overflow: hidden; }
.tc-money span { padding: 0 11px; color: var(--muted); font-size: 15px; background: var(--wash); align-self: stretch; display: flex; align-items: center; }
.tc-money.suffix span { order: 2; }
.tc-money input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 12px; font-size: 15px; color: var(--ink); font-family: var(--body); }
.tc-money input:focus { outline: none; }
.tc-money:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tc-checks { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.tc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
.tc-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0; }

.tool-out { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.to-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding: 18px 20px; background: var(--brand-soft); flex-wrap: wrap; }
.to-head span { font-size: 14px; font-weight: 600; color: var(--ink); }
.to-head b { font-family: var(--display); font-size: 30px; color: var(--brand); line-height: 1; }
.to-head b small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.to-table { width: 100%; border-collapse: collapse; }
.to-table td { padding: 11px 20px; font-size: 14.5px; border-top: 1px solid var(--line); }
.to-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.to-foot { margin: 0; padding: 13px 20px; font-size: 13px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); background: var(--wash); }
.to-foot a { color: var(--brand); }

.tool-disclaimer { margin: 16px 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.tool-disclaimer a { color: var(--brand); }
.tool-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 22px 0 10px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--wash); }
.tool-cta-lead { font-family: var(--display); font-size: 18px; }
.tool-cta-links { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-provinces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 4px; }
.tool-provinces-lead { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.tool-provinces .chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.tool-back { margin: 18px 0 40px; }

/* related tools on category/city hubs */
.related-tools { margin: 34px 0 10px; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rt-card { display: flex; flex-direction: column; gap: 4px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.rt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--brand); text-decoration: none; }
.rt-card b { font-size: 15px; }
.rt-card span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.tool-back a { color: var(--brand); font-weight: 600; text-decoration: none; }

/* ---------- Tool generators (invoice/quote/name) ---------- */
.doc-actions { margin: 14px 0 6px; }
.di-row { display: grid; grid-template-columns: 1fr 68px 92px 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.di-row input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--paper); color: var(--ink); font-size: 14px; font-family: var(--body); width: 100%; }
.di-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.di-del { border: 1px solid var(--line); background: var(--wash); color: var(--muted); border-radius: 8px; height: 36px; cursor: pointer; font-size: 18px; line-height: 1; }
.di-del:hover { color: var(--brand); border-color: var(--brand); }
.doc-form textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 14px; resize: vertical; }
.doc-form input[type="text"], .doc-form input[type="date"] { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; }
.doc-form textarea:focus, .doc-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.doc-paper { background: #fff; color: #141414; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 34px; margin-top: 6px; }
.dp-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.dp-from { font-size: 14px; line-height: 1.5; }
.dp-title { text-align: right; }
.dp-title h2 { margin: 0 0 6px; font-family: var(--display); letter-spacing: .04em; color: var(--brand); }
.dp-meta { font-size: 13px; color: #555; }
.dp-to { font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.dp-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #888; margin-bottom: 4px; }
.dp-ph { color: #b3b3b3; }
.dp-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.dp-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #888; border-bottom: 2px solid #eee; padding: 8px 10px; }
.dp-table th:nth-child(2), .dp-table th:nth-child(3), .dp-table th:nth-child(4), .dp-table td:nth-child(2), .dp-table td:nth-child(3), .dp-table td:nth-child(4) { text-align: right; }
.dp-table td { padding: 9px 10px; font-size: 14px; border-bottom: 1px solid #f0f0f0; font-variant-numeric: tabular-nums; }
.dp-totals { margin-left: auto; border-collapse: collapse; min-width: 240px; }
.dp-totals td { padding: 6px 10px; font-size: 14px; text-align: right; }
.dp-totals td:first-child { color: #666; }
.dp-totals .dp-grand td { font-weight: 700; font-size: 17px; color: #141414; border-top: 2px solid #eee; padding-top: 10px; }
.dp-notes { margin-top: 22px; padding-top: 14px; border-top: 1px solid #eee; font-size: 13px; color: #555; }

.bn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 18px 20px; }
.bn-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.bn-chip b { font-size: 15px; }
.bn-chip a { font-size: 12px; color: var(--muted); }
.bn-chip a:hover { color: var(--brand); }

@media print {
    body { background: #fff; }
    .site-head, .site-foot, .crumbs, .archive-head, .tool-disclaimer, .tool-cta, .tool-back, .doc-form, .doc-actions { display: none !important; }
    main, .wrap, .tool-wrap { margin: 0; padding: 0; max-width: none; }
    .doc-paper { border: 0; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
}

/* ---------- Cookie consent banner ---------- */
.cookie-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; margin: 0 auto; max-width: 720px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); animation: cc-in .35s cubic-bezier(.2,.7,.2,1) both; }
.cookie-consent .cc-text { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; flex: 1 1 300px; }
.cookie-consent .cc-text a { color: var(--brand); }
.cookie-consent .cc-actions { display: flex; gap: 10px; margin-left: auto; }
.cookie-consent .cc-actions .btn { padding: 9px 18px; }
@keyframes cc-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cookie-consent { animation: none; } }
@media (max-width: 520px) { .cookie-consent .cc-actions { width: 100%; } .cookie-consent .cc-actions .btn { flex: 1; justify-content: center; } }

/* ---------- Self-hosted webfonts (Inter body, Zilla Slab display) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/zillaslab-600.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/zillaslab-700.woff2') format('woff2'); }

/* mortgage calculator: grouped result rows + field hints */
.tc-hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.to-table tr.to-group td { padding-top: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; background: var(--wash); }
.to-table td.to-sub { color: var(--muted); font-size: 13px; padding-left: 32px; font-weight: 400; }
.to-table td.to-sub:last-child { font-weight: 500; }

/* amortization schedule */
.amort { border-top: 1px solid var(--line); }
.amort-toggle { width: 100%; padding: 13px 20px; background: var(--wash); border: 0; border-bottom: 1px solid var(--line); color: var(--brand); font-family: var(--body); font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.amort-toggle:hover { background: var(--brand-soft); }
.amort-chart { display: block; width: 100%; height: 150px; }
.amort-legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 20px 12px; font-size: 12px; color: var(--muted); }
.amort-table-wrap { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); }
.amort-table thead th { position: sticky; top: 0; background: var(--card); text-align: right; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 9px 20px; border-bottom: 1px solid var(--line); }
.amort-table thead th:first-child { text-align: left; }
.amort-table td { text-align: right; font-variant-numeric: tabular-nums; }
.amort-table td:first-child { text-align: left; font-weight: 600; }
.amort-table tr.amort-term td { background: var(--brand-soft); }
.amort-table tfoot .amort-total td { position: sticky; bottom: 0; background: var(--wash); border-top: 2px solid var(--line); font-weight: 700; }
.amort-foot { margin: 0; padding: 13px 20px; font-size: 13px; color: var(--muted); line-height: 1.55; border-top: 1px solid var(--line); }
