:root {
  color-scheme: light;
  --ink: #172620;
  --muted: #65756e;
  --line: #e4e9e4;
  --paper: #f5f7f4;
  --white: #fff;
  --green: #187252;
  --green-dark: #10583e;
  --green-soft: #e8f3ed;
  --red: #a63d36;
  --red-soft: #fff4f1;
  --shadow: 0 18px 55px rgba(27, 47, 36, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; line-height: 1.65; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin-top: 0; font-family: "Space Grotesk", system-ui, sans-serif; letter-spacing: -.04em; line-height: 1.15; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: rgba(245, 247, 244, .92); }
.header-inner { min-height: 76px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Space Grotesk", system-ui, sans-serif; font-size: 1.12rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.brand img { display: block; width: 52px; height: 54px; object-fit: contain; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: .9rem; font-weight: 700; }
.main-nav a { color: var(--green-dark); text-decoration: none; }
.main-nav a:hover, .main-nav a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }

.header-inner { position: relative; }
.main-nav .header-note { color: var(--muted); font-weight: 400; }
.tools-dropdown { position: static; }
.tools-dropdown summary { color: var(--green-dark); cursor: pointer; list-style: none; }
.tools-dropdown summary::-webkit-details-marker { display: none; }
.tools-dropdown summary::after { margin-left: 6px; content: "▾"; font-size: .72em; }
.tools-dropdown[open] summary::after { content: "▴"; }
.tools-dropdown-list { position: absolute; z-index: 20; top: calc(100% - 4px); right: 0; width: 220px; max-height: min(70vh, 460px); overflow-y: auto; margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); list-style: none; }
.main-nav .tools-dropdown-list a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--ink); font-size: .84rem; font-weight: 400; text-decoration: none; }
.main-nav .tools-dropdown-list a:hover, .main-nav .tools-dropdown-list a:focus-visible { background: var(--green-soft); color: var(--green-dark); text-decoration: none; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 11px; background: var(--green); color: var(--white) !important; cursor: pointer; font-weight: 700; text-decoration: none !important; }
.btn:hover { background: var(--green-dark); }
.btn-small { min-height: 38px; padding: 0 14px; border-radius: 9px; }
.btn-light { background: var(--green-soft); color: var(--green-dark) !important; }
.btn-light:hover { background: #deeee4; }
.btn-danger { background: var(--red-soft); color: var(--red) !important; }
.btn-danger:hover { background: #fde4de; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #97c37b; outline-offset: 2px; }

input[type=text], input[type=url], input[type=email], input[type=search], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfa; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 700; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: .8rem; }
.hp { position: absolute; left: -9999px; }

/* Cards and layout */
.card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 9px 28px rgba(27, 47, 36, .045); }
.hero { padding: 56px 0 36px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: .77rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 760px; margin-bottom: 14px; font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.04; }
h1 span { color: var(--green); }
.lead { max-width: 620px; margin: 0; color: var(--muted); font-size: 1.07rem; }
.section { padding: 10px 0 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 1.45rem; }
.section-head a { color: var(--green-dark); font-weight: 700; }
.muted { color: var(--muted); }

.search { display: flex; gap: 10px; max-width: 760px; margin-top: 28px; padding: 14px; box-shadow: var(--shadow); }
.search input { flex: 1; min-width: 0; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cat-grid a { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); font-weight: 600; text-decoration: none; }
.cat-grid a:hover { border-color: var(--green); color: var(--green-dark); }
.cat-grid span { color: var(--muted); font-weight: 400; }

.listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.listings.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.listing { display: flex; flex-direction: column; }
.listing-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.listing h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.02em; }
.listing h3 a { text-decoration: none; }
.listing h3 a:hover { color: var(--green-dark); text-decoration: underline; }
.chip { flex: 0 0 auto; padding: 2px 9px; border-radius: 99px; background: var(--green-soft); color: var(--green-dark); font-size: .74rem; font-weight: 700; text-decoration: none; }
.host { margin: 2px 0 8px; color: var(--muted); font-size: .84rem; }
.desc { flex: 1; margin: 0 0 12px; color: #4f5e57; font-size: .94rem; }
.visit { color: var(--green-dark); font-weight: 700; text-decoration: none; }
.visit:hover { text-decoration: underline; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; font-weight: 700; }
.pager a { color: var(--green-dark); }
.pager span { color: var(--muted); font-weight: 400; }

/* Text pages */
.page { max-width: 760px; padding: 50px 0 60px; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page h2 { margin: 30px 0 8px; font-size: 1.3rem; }
.page p, .page li { color: #4f5e57; }
.page a { color: var(--green-dark); }
.form-card { max-width: 640px; margin-top: 24px; }

.detail h1 { margin-bottom: 6px; }
.detail .host { font-size: 1rem; }
.detail .desc { margin: 20px 0 24px; font-size: 1.05rem; }

.notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 11px; font-weight: 600; }
.notice-ok { background: var(--green-soft); color: var(--green-dark); }
.notice-error { background: var(--red-soft); color: var(--red); }

/* Featured websites (rotating) */
.featured { position: relative; margin-bottom: 36px; }
.feature-slide { display: flex; min-height: 120px; align-items: center; gap: 20px; padding: 18px 24px 30px; border-radius: 14px; background: linear-gradient(110deg, #0c2a20, #187252); color: #fff; text-decoration: none; transition: transform .2s; }
.feature-slide[hidden] { display: none; }
.feature-slide:hover { transform: translateY(-2px); }
.feature-slide > div { flex: 1; min-width: 0; }
.feature-label { margin: 0 0 4px; color: #d3f26b; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.feature-title { margin: 0 0 4px; font-size: 1.25rem; }
.feature-desc { margin: 0; color: rgba(255,255,255,.88); font-size: .88rem; }
.feature-cta { flex: 0 0 auto; color: #e4f2dc; font-size: .88rem; font-weight: 700; }
.feature-dots { position: absolute; bottom: 10px; left: 24px; display: flex; gap: 6px; }
.feature-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.feature-dots button[aria-current] { background: #d3f26b; }

/* Ads */
.ad { margin-block: 0 36px; text-align: center; }
.ad-label { display: block; margin-bottom: 4px; color: #98a39c; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* Footer */
.site-footer { padding: 22px 0; border-top: 1px solid var(--line); background: var(--white); color: var(--muted); font-size: .84rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.footer-inner p { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--green-dark); }

/* Admin */
.admin { padding: 36px 0 60px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tabs a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--white); font-size: .9rem; font-weight: 700; text-decoration: none; }
.tabs a[aria-current] { border-color: var(--green); background: var(--green); color: var(--white); }
.badge { display: inline-block; min-width: 22px; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: #d3f26b; color: var(--ink); font-size: .75rem; text-align: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-actions form { margin: 0; }
.stack { display: grid; gap: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .9rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--green-soft); color: var(--green-dark); }
.status-pending { color: #9a6a00; font-weight: 700; }
.status-approved { color: var(--green); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.msg-new { border-left: 4px solid var(--green); }
code { padding: 1px 5px; border-radius: 5px; background: var(--green-soft); }

@media (max-width: 900px) {
  .listings.row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .hero { padding: 36px 0 26px; }
  .search { flex-direction: column; }
  .listings { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .feature-slide { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 16px 30px; }
  .feature-dots { left: 16px; }
  .brand img { width: 42px; height: 44px; }
}
