/* CalcPerch — shared styles */
:root {
  --brand: #1a6b54;
  --brand-dark: #104738;
  --brand-light: #e8f5f0;
  --ink: #1f2933;
  --ink-soft: #52606d;
  --line: #e4e7eb;
  --bg: #ffffff;
  --radius: 10px;
  --max: 1120px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}
header.site {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
header.site .wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.logo::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 26px;
  background: url(/favicon.svg) no-repeat center / contain;
  flex: 0 0 auto;
  margin-right: 8px;
}
.logo span { color: var(--ink); }
nav.main a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 18px;
  font-size: 0.95rem;
}
nav.main a:hover { color: var(--brand); }
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 60px;
}
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0.3em 0 0.5em; }
h2 { font-size: 1.4rem; margin-top: 1.8em; }
h3 { font-size: 1.15rem; margin-top: 1.5em; }
p.lead { font-size: 1.08rem; color: var(--ink-soft); margin-top: 0; }

/* Calculator card */
.calc {
  background: var(--brand-light);
  border: 1px solid #cbe7dc;
  border-radius: var(--radius);
  padding: 22px;
  margin: 24px 0 34px;
}
.calc label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 14px 0 4px;
}
.calc input[type="number"], .calc input[type="date"], .calc input[type="text"], .calc select {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #b7c9c1;
  border-radius: 8px;
  background: #fff;
}
.calc .row { display: flex; gap: 16px; flex-wrap: wrap; }
.calc .row > div { flex: 1 1 200px; }
.calc button {
  margin-top: 18px;
  padding: 11px 26px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.calc button:hover { background: var(--brand-dark); }
.result {
  margin-top: 18px;
  padding: 16px;
  background: #fff;
  border: 1px solid #cbe7dc;
  border-radius: 8px;
  font-size: 1.05rem;
  display: none;
}
.result strong { color: var(--brand); font-size: 1.3rem; }
.result.show { display: block; }

/* Content */
article table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 0.95rem;
}
article th, article td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
article th { background: #f5f7f9; }
.faq h3 { margin-bottom: 0.2em; }
.faq p { margin-top: 0.2em; }

/* Tool grid (homepage) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.grid a.tool {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.grid a.tool:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 10px rgba(26,107,84,.12);
}
.grid a.tool h3 { margin: 0 0 6px; color: var(--brand); font-size: 1.05rem; }
.grid a.tool p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 20px;
  padding: 2px 10px;
  margin-bottom: 10px;
}

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: #fafbfc;
}
footer.site .wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 20px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
footer.site a { color: var(--ink-soft); }
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  nav.main a { margin-left: 12px; font-size: 0.88rem; }
}

/* ===== v2 design: hero, category tiles, search, page polish ===== */
.hero {
  background: linear-gradient(135deg, #104738 0%, #1a6b54 55%, #2a8a6e 100%);
  color: #fff;
  border-radius: 16px;
  padding: 36px 28px 30px;
  margin: 8px 0 26px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 220px; height: 220px;
  background: url(/favicon.svg) no-repeat center / contain;
  opacity: .14;
  transform: rotate(-8deg);
}
.hero h1 { margin: 0 0 6px; font-size: 1.75rem; color: #fff; }
.hero h1 em { font-style: normal; color: #f0b429; }
.hero p { margin: 0 0 18px; color: #d4e9e1; max-width: 560px; }
.searchbar {
  display: flex; align-items: center;
  background: #fff; border-radius: 12px;
  padding: 4px 6px 4px 16px;
  max-width: 560px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  position: relative; z-index: 1;
}
.searchbar svg { flex: 0 0 auto; }
.searchbar input {
  flex: 1; border: 0; outline: none;
  padding: 12px 10px; font-size: 1.02rem;
  background: transparent; color: var(--ink);
}
/* category tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 10px;
}
.tiles a {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 10px 14px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tiles a:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(26,107,84,.15);
  transform: translateY(-2px);
}
.tiles .ticon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
}
.tiles .ticon svg { width: 24px; height: 24px; stroke: var(--brand); }
.tiles b { font-size: .92rem; font-weight: 600; }
.tiles small { color: var(--ink-soft); font-size: .78rem; }
/* section headers with icon */
.sec {
  display: flex; align-items: center; gap: 10px;
  margin: 34px 0 4px;
}
.sec .ticon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.sec .ticon svg { width: 19px; height: 19px; stroke: var(--brand); }
.sec h2 { margin: 0; }
/* denser tool cards */
.grid a.tool h3 { display: flex; align-items: center; gap: 7px; }
.grid a.tool .em { font-size: 1.05rem; }
/* ===== inner page polish (applies to all 150+ pages) ===== */
article table tr:nth-child(even) td { background: #f7faf9; }
article table th { background: var(--brand-light); color: var(--brand-dark); border-color: #d5e8e0; }
article h2 {
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-light);
}
.calc {
  box-shadow: 0 4px 16px rgba(26,107,84,.08);
  border-width: 1px;
  background: linear-gradient(180deg, #f2faf7 0%, #e8f5f0 100%);
}
.calc button { box-shadow: 0 3px 8px rgba(26,107,84,.25); }
.result.show { border-left: 4px solid var(--brand); }
.badge { font-weight: 600; }

/* back-to-top button */
#toTop {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border: none; border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(16,71,56,.35);
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s, background .15s;
  z-index: 100;
}
#toTop.vis { opacity: 1; visibility: visible; transform: translateY(0); }
#toTop:hover { background: var(--brand-dark); }

/* ===== v3: bigger logo, photo tiles, category bar, sitemap footer ===== */
.logo { font-size: 1.5rem; }
.logo::before { width: 34px; height: 34px; margin-right: 10px; }
/* photo tiles */
.tiles .pimg {
  width: 64px; height: 64px; border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,.10);
}
.tiles a:hover .pimg { transform: scale(1.06); transition: transform .15s; }
/* category top bar — Omni-style text tabs with active underline */
.catbarwrap { border-bottom: 1px solid var(--line); background: #fff; }
.catbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  max-width: var(--max); margin: 0 auto;
  padding: 0 12px;
}
.catbar a {
  display: inline-block;
  white-space: nowrap;
  padding: 12px 12px 9px;
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
}
.catbar a img { display: none; }
.catbar a:hover { color: var(--brand); }
.catbar a.on { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); }
@media (max-width: 640px) {
  .catbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .catbar::-webkit-scrollbar { display: none; }
}
/* category page hero */
.cathead { display: flex; align-items: center; gap: 18px; margin: 6px 0 10px; }
.cathead img { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.cathead h1 { margin: 0 0 4px; }
.cathead p { margin: 0; color: var(--ink-soft); }
/* sitemap footer */
.fmenu {
  max-width: var(--max); margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  padding: 28px 20px 6px;
}
.fmenu b { display: block; font-size: .85rem; color: var(--ink); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.fmenu a { display: block; font-size: .86rem; color: var(--ink-soft); text-decoration: none; padding: 2.5px 0; }
.fmenu a:hover { color: var(--brand); }
.fbottom {
  max-width: var(--max); margin: 0 auto;
  padding: 14px 20px 22px;
  font-size: .85rem; color: var(--ink-soft);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* wide layout, readable article column */
article { max-width: 800px; margin: 0 auto; }
.grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.hero { padding: 44px 36px 36px; }
.hero h1 { font-size: 2rem; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }

/* ===== Pro / specialized tool zone ===== */
.prozone {
  margin: 26px 0 8px;
}
.prohead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.prohead h2 { margin: 0; border: 0; padding: 0; font-size: 1.5rem; }
.prohead .protag {
  background: #f0b429; color: #4a3403;
  font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  border-radius: 4px; padding: 3px 8px; text-transform: uppercase;
}
.prohead p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.progrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}
.progrid a.pro {
  display: block;
  border-radius: 14px;
  padding: 22px 22px 18px;
  text-decoration: none;
  background: linear-gradient(135deg, #0d3a2e 0%, #1a6b54 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  border: 1px solid #1a6b54;
  transition: transform .15s, box-shadow .15s;
}
.progrid a.pro:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16,71,56,.35); }
.progrid a.pro::after {
  content: "";
  position: absolute; right: -26px; bottom: -30px;
  width: 130px; height: 130px;
  background: url(/favicon.svg) no-repeat center / contain;
  opacity: .10;
}
.progrid a.pro .em { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.progrid a.pro h3 { margin: 0 0 6px; color: #fff; font-size: 1.12rem; }
.progrid a.pro p { margin: 0; color: #cfe6dd; font-size: .88rem; position: relative; z-index: 1; }
.progrid a.pro .protag {
  position: absolute; top: 14px; right: 14px;
  background: #f0b429; color: #4a3403;
  font-size: .66rem; font-weight: 800; letter-spacing: .07em;
  border-radius: 4px; padding: 2px 7px;
}
/* highlighted AI tile in category tiles */
.tiles a.protile { border: 2px solid #f0b429; position: relative; }
.tiles a.protile::before {
  content: "PRO";
  position: absolute; top: 8px; right: 8px;
  background: #f0b429; color: #4a3403;
  font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  border-radius: 4px; padding: 1px 6px;
}
