/* Shared foundation for every esnaf site. Archetype files (a.css ... e.css) set the look. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--fb); font-size: 16.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: 72px;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--fd); font-weight: var(--fdw, 800); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: var(--fdls, -0.02em); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 52px; padding: 0 24px; border-radius: var(--rb); font: 700 16px/1 var(--fb); text-decoration: none; border: 2px solid transparent; cursor: pointer; white-space: nowrap; transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn .ico { width: 1.3em; height: 1.3em; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { box-shadow: 0 10px 24px -10px var(--accent); }
.btn-wa { background: #1E9E57; color: #fff; }
.btn-line { border-color: currentColor; background: transparent; }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 15px; }

/* Demo ribbon */
.demo { background: #14171A; color: #E9ECEF; font: 500 13px/1.45 var(--fb); text-align: center; padding: 9px max(16px, env(safe-area-inset-left, 0px)); }
.demo a { color: #FFD166; font-weight: 700; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 30; background: var(--hdr-bg, var(--bg)); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; margin-right: auto; }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand b { display: block; font: var(--fdw, 800) clamp(18px, 2.2vw, 21px)/1.15 var(--fd); letter-spacing: var(--fdls, -0.01em); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.brand small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.nav { display: none; gap: 4px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-text, var(--accent)); }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: var(--rb); border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.menu-btn .ico { width: 24px; height: 24px; }
.hdr .call { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
  .hdr .call { display: inline-flex; }
}
.mnav { display: none; border-top: 1px solid var(--line); padding: 8px 0 18px; }
.mnav.open { display: block; }
.mnav a { display: flex; align-items: center; justify-content: space-between; text-decoration: none; font: 600 19px/1.2 var(--fb); padding: 15px 0; border-bottom: 1px solid var(--line); }
.mnav a .ico { opacity: .5; }

/* Sections */
.sec { padding-block: clamp(52px, 6.5vw, 92px); }
.sec-tight { padding-block: clamp(40px, 5vw, 64px); }
.h2 { font-size: clamp(30px, 4.4vw, 46px); }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 60ch; }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.more { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-text, var(--accent)); text-decoration: none; }
.more .ico { transition: transform .2s; }
.more:hover .ico { transform: translateX(3px); }

/* Breadcrumb page header (inner pages) */
.phead { padding-block: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 44px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.phead h1 { font-size: clamp(34px, 5.6vw, 60px); max-width: 18ch; }
.phead p { margin-top: 16px; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--rc); background: var(--surface); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; font: 700 17.5px/1.35 var(--fb); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: transform .25s; color: var(--accent-text, var(--accent)); }
.faq details[open] summary .ico { transform: rotate(45deg); }
.faq details p { padding: 0 22px 22px; color: var(--muted); max-width: 68ch; }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14.5px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 14px; font: 500 16px/1.3 var(--fb); color: var(--ink); background: var(--field-bg, #fff); border: 1.5px solid var(--field-line, var(--line)); border-radius: var(--rf); appearance: none; }
.field select { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.form .btn { width: 100%; }
.form-note { font-size: 14px; color: var(--muted); }

/* Chips (symptoms, districts) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15.5px/1 var(--fb); cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Mobile action bar */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 8px; padding: 10px max(12px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--mbar-bg, rgba(255,255,255,.96)); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.mbar .btn { flex: 1; min-height: 50px; }
@media (min-width: 900px) { .mbar { display: none; } }

/* Footer */
.ftr { background: var(--ftr-bg, #12161B); color: var(--ftr-ink, #C9D1D9); padding-block: 56px 40px; font-size: 15px; }
.ftr-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ftr-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.ftr h4 { font: 700 15px/1.3 var(--fb); color: #fff; margin-bottom: 12px; letter-spacing: 0; }
.ftr a { text-decoration: none; }
.ftr a:hover { color: #fff; }
.ftr li { padding: 4px 0; }
.ftr .fbrand { font: var(--fdw, 800) 22px/1.2 var(--fd); color: #fff; margin-bottom: 10px; }
.ftr-bot { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13.5px; color: #8B949E; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* Map */
.map { width: 100%; aspect-ratio: 16 / 10; max-height: 420px; border: 0; border-radius: var(--rc); background: var(--surface); }

/* Reveal on scroll: content stays visible without JS and with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
  .js .rv.in { opacity: 1; transform: none; }
  .js .hero-in > * { animation: rise .8s cubic-bezier(.16,1,.3,1) both; }
  .js .hero-in > *:nth-child(2) { animation-delay: .08s; }
  .js .hero-in > *:nth-child(3) { animation-delay: .16s; }
  .js .hero-in > *:nth-child(4) { animation-delay: .24s; }
  .js .hero-in > *:nth-child(5) { animation-delay: .32s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* ---- Shared components driven by archetype tokens (--deep, --deep-muted) ---- */
/* Steps: a real sequence */
.steps { display: grid; gap: 14px; counter-reset: s; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(var(--n, 3), 1fr); } }
.steps li { position: relative; padding: 26px 24px 24px; border-radius: var(--rc); background: var(--surface); border: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 800 18px/1 var(--fd); margin-bottom: 16px; }
.steps b { display: block; font: 700 19px/1.3 var(--fd); }
.steps p { color: var(--muted); margin-top: 6px; }

/* Areas */
.areas { display: grid; gap: 28px; }
@media (min-width: 900px) { .areas { grid-template-columns: 1fr 1.2fr; align-items: center; } }

/* CTA band */
.cta { background: var(--accent); color: var(--on-accent); }
.cta-in { display: grid; gap: 22px; align-items: center; }
@media (min-width: 900px) { .cta-in { grid-template-columns: 1fr auto; } }
.cta h2 { font-size: clamp(30px, 4.6vw, 50px); }
.cta .btn { background: var(--deep); color: #fff; min-height: 60px; font-size: 18px; }
.cta .cta-phone { font: 800 clamp(26px, 3.4vw, 36px)/1 var(--fd); text-decoration: none; display: block; margin-top: 10px; font-variant-numeric: tabular-nums; }

/* Inner pages */
.phead { background: var(--surface); border-bottom: 1px solid var(--line); }
.doc { display: grid; gap: 40px; }
@media (min-width: 980px) { .doc { grid-template-columns: 1fr 360px; gap: 64px; align-items: start; } }
.doc-main { display: grid; gap: 36px; min-width: 0; }
.doc-main > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; }
.doc-main h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 14px; }
.doc-main p { font-size: 17.5px; max-width: 66ch; }
.ticks { display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; }
.ticks .ico { color: var(--accent-text); margin-top: 3px; }
.aside { position: sticky; top: 88px; display: grid; gap: 16px; }
.aside-card { background: var(--deep); color: #fff; border-radius: 18px; padding: 26px; display: grid; gap: 14px; }
.aside-card h3 { font-size: 22px; }
.aside-card p { color: var(--deep-muted); }
.aside-links { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 22px; }
.aside-links a { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.aside-links a:last-child { border-bottom: 0; }
.svc-cards { display: grid; gap: 18px; }
@media (min-width: 760px) { .svc-cards { grid-template-columns: 1fr 1fr; } }
.svc-card { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; }
.svc-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.svc-card div { padding: 22px; display: grid; gap: 8px; }
.svc-card h3 { font-size: 22px; }
.svc-card p { color: var(--muted); }
.contact-grid { display: grid; gap: 28px; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 56px; } }
.cards { display: grid; gap: 12px; }
.ccard { display: flex; gap: 16px; align-items: center; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); text-decoration: none; }
.ccard .ico { width: 28px; height: 28px; color: var(--accent-text); }
.ccard small { display: block; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.ccard b { display: block; font-size: 17.5px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 32px); }
.panel h2 { font-size: 26px; margin-bottom: 18px; }
.area-cards { display: grid; gap: 14px; }
@media (min-width: 760px) { .area-cards { grid-template-columns: 1fr 1fr; } }
.area-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); }
.area-card h3 { font-size: 21px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.area-card h3 .ico { color: var(--accent-text); }
.area-card p { color: var(--muted); }
.area-card.home { background: var(--deep); color: #fff; border-color: var(--deep); }
.area-card.home p { color: var(--deep-muted); }

/* Phones: keep the trust strip to two compact columns. */
@media (max-width: 599px) {
  .trust ul { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .trust ul li { padding: 14px 10px; font-size: 13.5px; gap: 8px; align-items: flex-start; min-width: 0; }
  .trust ul li .ico { width: 22px; height: 22px; }
  .trust ul li b { display: block; font-size: 19px; margin: 0 0 2px; }
  .flow li, .steps li { padding: 20px 18px; }
}

/* Long option labels must not widen the form on phones. */
.form > *, .field { min-width: 0; }
.field input, .field select, .field textarea { max-width: 100%; text-overflow: ellipsis; }
