:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --surface: #fffdf8;
  --ink: #212a24;
  --muted: #4e5950;
  --line: #dcded3;
  --green: #27523d;
  --green-dark: #193c2b;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body, figure, fieldset { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.08; letter-spacing: -.038em; }
h1 { font-size: clamp(2.65rem, 5.8vw, 5.1rem); }
h2 { font-size: clamp(1.95rem, 3.4vw, 3.05rem); }
h3 { font-size: 1.12rem; line-height: 1.3; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #5e7149; outline-offset: 4px; }
.wrap { width: min(100% - 80px, 1232px); margin-inline: auto; }
.skip, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { inset: 10px auto auto 10px; width: auto; height: auto; padding: .6rem 1rem; clip-path: none; background: white; z-index: 5; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 78px; display: flex; align-items: center; gap: 38px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.17rem; font-weight: 750; text-decoration: none; white-space: nowrap; letter-spacing: -.045em; }
.brand-light { font-weight: 460; }
.main-nav { display: flex; gap: 26px; margin-left: auto; }
.main-nav a, .search-open { color: var(--muted); font-size: .88rem; font-weight: 620; text-decoration: none; }
.main-nav a:hover, .main-nav a.current { color: var(--green); text-decoration: underline; text-underline-offset: 5px; }
.search-open { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 40px; padding: 8px 15px; background: var(--surface); }
.search-open:hover { border-color: var(--green); color: var(--green); }

.home { padding-top: 38px; }
.hero { display: grid; grid-template-columns: .98fr 1.02fr; min-height: 450px; border-radius: 22px; overflow: hidden; background: #e8ecdf; }
.hero-copy { padding: clamp(36px, 5.4vw, 83px); align-self: center; }
.hero-copy h1 { color: #203c2d; }
.hero-copy p, .guide-intro p { max-width: 37ch; margin: 22px 0 27px; font-size: 1.01rem; color: var(--muted); }
.hero-art, .feature-art, .guide-art { position: relative; background: #d9d1bd; }
.hero-art img, .feature-art img, .guide-art img { height: 100%; object-fit: cover; }
.hero-art img { position: absolute; inset: 0; object-position: 55% 50%; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .9rem; padding: 11px 17px; min-height: 46px; border-radius: 7px; text-decoration: none; font-size: .88rem; font-weight: 680; }
.primary { color: #fff; background: var(--green); }
.primary:hover { background: var(--green-dark); }
.section { margin-block: 54px 0; scroll-margin-top: 22px; }
.section.compact { margin-top: 37px; }
.section-heading { margin-bottom: 22px; }
.category-grid, .topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.category-card { min-height: 151px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; transition: border-color .18s, background .18s, transform .18s; }
.category-card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--pastel); }
.category-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 11px; }
.category-top .arrow { color: var(--muted); }
.category-card p, .topic-card p { margin-top: 4px; color: var(--muted); font-size: .88rem; line-height: 1.52; }
.palette-home { --pastel: #e4eddf; --accent: #355d45; }
.palette-tech { --pastel: #e4ecf4; --accent: #3c5879; }
.palette-pet { --pastel: #f3e7d7; --accent: #79541e; }
.palette-auto { --pastel: #e8e7f2; --accent: #544b75; }
.palette-garden { --pastel: #e4ecd7; --accent: #4c602f; }
.palette-baby { --pastel: #f4e3e1; --accent: #815358; }
.arrow { font-size: 1.03em; }

.featured { display: grid; grid-template-columns: 1fr 1fr; min-height: 290px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.feature-art img { position: absolute; inset: 0; object-position: center 58%; }
.feature-copy { align-self: center; padding: clamp(24px, 3.8vw, 51px); }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; color: var(--green); text-decoration: none; font-size: .71rem; font-weight: 750; }
.feature-copy h3 { margin-block: 9px 10px; font: 500 clamp(1.75rem, 3.1vw, 2.75rem)/1.12 var(--serif); letter-spacing: -.035em; }
.feature-copy h3 a { text-decoration: none; }
.feature-copy p { color: var(--muted); margin-bottom: 16px; }
.text-link { color: var(--green); font-size: .92rem; font-weight: 720; text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover { color: var(--green-dark); }
.site-footer { margin-top: 62px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 92px; gap: 16px; }
.footer-inner > a:last-child { color: var(--muted); font-size: .85rem; text-underline-offset: 4px; }

.subpage { padding-top: 29px; min-height: calc(100vh - 235px); }
.breadcrumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; color: var(--muted); font-size: .8rem; }
.breadcrumbs a { text-underline-offset: 3px; }
.category-hero { display: flex; align-items: center; gap: 24px; padding: clamp(25px, 5vw, 58px); border-radius: 15px; background: var(--pastel); }
.category-hero h1 { color: var(--accent); font-size: clamp(2.6rem, 5vw, 4.5rem); }
.category-hero p { margin-top: 9px; color: var(--muted); }
.category-hero .category-icon { background: var(--surface); flex-shrink: 0; }
.topic-card { scroll-margin-top: 20px; min-height: 130px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.topic-card:target { border-color: var(--green); background: #edf2e8; }
.topic-card .text-link { display: inline-block; margin-top: 11px; }
.other-categories { display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 35px; color: var(--green); font-size: .87rem; }
.other-categories span { color: var(--muted); font-weight: 700; }
.other-categories a { text-underline-offset: 3px; }
.prose { max-width: 840px; }
.prose h1 { margin-block: 24px 20px; }
.prose h2 { margin-block: 26px 9px; font-size: 1.8rem; }
.prose p { max-width: 68ch; color: var(--muted); }

.guide-hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: stretch; gap: 36px; border-radius: 15px; overflow: hidden; background: #e8ecdf; }
.guide-intro { padding: clamp(23px, 4.9vw, 62px); align-self: center; }
.guide-intro h1 { color: #203c2d; font-size: clamp(2.45rem, 4.55vw, 4.4rem); }
.guide-art img { position: absolute; inset: 0; }
.guide-art figcaption { position: absolute; right: 9px; bottom: 9px; padding: 2px 6px; border-radius: 3px; color: #322c25; background: #fffdf0ee; font-size: .7rem; }
.drainage { margin-top: 30px; padding: 23px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.drainage h2 { font-size: clamp(1.65rem, 2.5vw, 2.3rem); }
.drain-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin-top: 15px; border: 0; }
.drain-options label { position: relative; }
.drain-options input { position: absolute; opacity: 0; }
.drain-options span { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 40px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.drain-options input:focus-visible + span { outline: 3px solid #5e7149; outline-offset: 2px; }
.drain-options input:checked + span { border-color: var(--green); background: var(--green); color: white; }
.drain-answer, .table-note, .empty { margin-top: 11px; color: var(--muted); font-size: .9rem; }
.comparison { width: 100%; margin-top: 12px; border-spacing: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; }
.comparison th, .comparison td { padding: 13px 15px; line-height: 1.45; vertical-align: top; font-size: .9rem; }
.comparison thead th { background: #e9eee3; color: var(--green-dark); font-size: .78rem; }
.comparison thead th:first-child { border-top-left-radius: 9px; }
.comparison thead th:last-child { border-top-right-radius: 9px; }
.comparison tbody tr + tr > * { border-top: 1px solid var(--line); }
.comparison small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.seller-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--green); font-weight: 700; text-underline-offset: 4px; }
.source-note { margin-top: 13px; font-size: .84rem; color: var(--muted); }
.source-note a { text-underline-offset: 3px; }

.search-dialog { width: min(550px, 100% - 28px); max-height: 78vh; margin-top: min(12vh, 95px); padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 90px #0c1f2144; }
.search-dialog::backdrop { background: #18201975; }
.search-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.search-heading h2 { font-size: 1.7rem; }
.close { line-height: 1; font-size: 1.6rem; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); color: inherit; background: var(--paper); }
.search-dialog input { width: 100%; min-height: 43px; padding: 8px 11px; border: 1px solid #9ba99b; border-radius: 6px; }
.search-results { padding: 0; margin: 10px 0 0; list-style: none; }
.search-results li + li { border-top: 1px solid var(--line); }
.search-results a { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 9px 2px; color: var(--green-dark); text-decoration: none; font-size: .91rem; font-weight: 650; }
.search-results a:hover { text-decoration: underline; }
.search-results small, .search-empty { color: var(--muted); font-size: .78rem; font-weight: 500; }

.icon { position: relative; display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; }
.icon::before, .icon::after { content: ''; position: absolute; }
.icon-brand { border-radius: 7px; width: 27px; height: 27px; background: var(--green); }
.icon-brand::before { width: 12px; height: 7px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.icon-search::before { width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 100%; transform: translate(-2px,-2px); }
.icon-search::after { width: 6px; height: 1.5px; background: currentColor; transform: translate(4px,4px) rotate(46deg); }
.category-icon { width: 41px; height: 41px; border-radius: 10px; background: var(--pastel); color: var(--accent); }
.icon-home::before { width: 16px; height: 13px; border: 1.6px solid; border-top: 0; border-radius: 1px; transform: translateY(4px); }
.icon-home::after { width: 13px; height: 13px; border-top: 1.6px solid; border-left: 1.6px solid; transform: translateY(-3px) rotate(45deg); }
.icon-tech::before { width: 18px; height: 13px; border: 1.6px solid; border-radius: 2px; transform: translateY(-2px); }
.icon-tech::after { width: 12px; height: 1.6px; background: currentColor; transform: translateY(7px); }
.icon-pet::before { width: 12px; height: 9px; border-radius: 58% 58% 40% 40%; background: currentColor; transform: translateY(4px); }
.icon-pet::after { width: 4px; height: 5px; border-radius: 50%; background: currentColor; transform: translate(-7px,-2px); box-shadow: 4px -4px, 10px -4px, 14px 0; }
.icon-auto::before { width: 20px; height: 8px; border: 1.6px solid; border-radius: 4px 4px 2px 2px; transform: translateY(3px); }
.icon-auto::after { width: 12px; height: 6px; border: 1.6px solid; border-bottom: 0; border-radius: 4px 4px 0 0; transform: translateY(-4px); }
.icon-garden::before { width: 12px; height: 17px; border: 1.6px solid; border-radius: 90% 5% 90% 5%; transform: rotate(18deg); }
.icon-garden::after { width: 1.6px; height: 12px; background: currentColor; transform: translate(-1px,3px) rotate(37deg); }
.icon-baby::before { width: 12px; height: 14px; border: 1.6px solid; border-radius: 3px; transform: translateY(3px); }
.icon-baby::after { width: 6px; height: 6px; border: 1.6px solid; border-bottom: 0; border-radius: 4px 4px 0 0; transform: translateY(-6px); }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 44px); }
  .hero { min-height: 365px; }
  .hero-copy { padding: 33px; }
  .hero-break { display: none; }
  .category-grid, .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-hero { gap: 0; }
  .guide-intro { padding: 26px; }
}

@media (max-width: 570px) {
  .wrap { width: calc(100% - 30px); }
  .topbar-inner { min-height: 59px; gap: 12px; }
  .brand { font-size: 1.04rem; gap: 6px; }
  .icon-brand { width: 24px; height: 24px; }
  .main-nav { gap: 12px; }
  .main-nav a { font-size: .76rem; }
  .main-nav a:nth-child(2) { display: none; }
  .search-open { padding: 5px 9px; font-size: .76rem; gap: 3px; }
  .home { padding-top: 16px; }
  .hero, .featured, .guide-hero { grid-template-columns: 1fr; }
  .hero { border-radius: 13px; }
  .hero-copy { padding: 28px 22px 30px; }
  .hero-art { min-height: 210px; }
  .hero-copy p, .guide-intro p { margin-block: 13px 19px; font-size: .94rem; }
  .section { margin-top: 33px; }
  .section-heading { margin-bottom: 13px; }
  .category-grid, .topic-grid { gap: 9px; }
  .category-card { min-height: 145px; padding: 12px; }
  .category-card h3 { font-size: .98rem; }
  .category-card p, .topic-card p { font-size: .79rem; }
  .category-icon { width: 33px; height: 33px; }
  .feature-art { min-height: 195px; }
  .feature-copy { padding: 19px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; }
  .site-footer { margin-top: 39px; }
  .subpage { padding-top: 14px; }
  .category-hero { padding: 21px 16px; gap: 11px; }
  .category-hero h1 { font-size: 2.34rem; }
  .category-hero p { font-size: .86rem; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 0; padding: 13px; }
  .guide-art { min-height: 190px; }
  .drainage { margin-top: 16px; padding: 14px; }
  .comparison, .comparison tbody, .comparison tr, .comparison th, .comparison td { display: block; }
  .comparison thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .comparison th, .comparison td { padding: 4px 10px; }
  .comparison tbody tr { padding: 8px 0; }
  .comparison tbody tr + tr { border-top: 1px solid var(--line); }
  .comparison tbody tr + tr > * { border-top: 0; }
  .comparison td[data-label]::before { content: attr(data-label) ' · '; font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media (max-width: 360px) {
  .search-open > span:last-child { display: none; }
}
