/* ==========================================================================
   GPX Route Analyzer — global stylesheet (no external fonts/assets)
   Outdoor professional palette: deep forest green / stone / signal orange
   Mobile-first, breakpoints: 480 / 768 / 1024 / 1440
   ========================================================================== */

:root {
  --green-900: #12271c;
  --green-800: #1a3a29;
  --green-700: #225035;
  --green-600: #2a6844;
  --green-500: #358556;
  --green-400: #55a474;
  --green-100: #e6f1ea;
  --green-50:  #f2f8f4;

  --ink: #1b2320;
  --stone-800: #333b37;
  --stone-600: #555f5a;
  --stone-500: #6d7771;
  --stone-400: #93a09a;
  --stone-300: #c2cac5;
  --stone-200: #dde3df;
  --stone-100: #edf1ee;
  --bg: #f5f8f6;
  --card: #ffffff;

  --orange: #e2612b;
  --orange-dark: #c44e1d;
  --amber: #f0a52f;
  --red: #d34343;
  --red-bg: #fdeeee;
  --info: #2e7eb8;
  --info-bg: #ecf4fa;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(18, 39, 28, .07), 0 2px 6px rgba(18, 39, 28, .05);
  --shadow-md: 0 6px 18px rgba(18, 39, 28, .10);
  --shadow-lg: 0 18px 48px rgba(18, 39, 28, .18);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --header-h: 62px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Defense against accidental horizontal scroll on small screens
   (clip does not establish a scroll container, so sticky header stays). */
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--green-900); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
code { font-family: var(--mono); font-size: .88em; background: var(--stone-100); padding: .12em .4em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--stone-200); margin: 1.6rem 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.section { padding: 46px 0; }
.section--tight { padding: 30px 0; }
.section--alt { background: var(--card); border-top: 1px solid var(--stone-200); border-bottom: 1px solid var(--stone-200); }
.section-head { max-width: 720px; margin-bottom: 26px; }
.section-head .eyebrow { color: var(--orange); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.section-head p { color: var(--stone-600); }
.muted { color: var(--stone-500); }
.small { font-size: .86rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

/* ---------------- Buttons / chips / badges ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  font: 600 .95rem/1.2 var(--font); white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--green-600); color: var(--green-700); }
.btn-outline:hover { background: var(--green-50); }
.btn-light { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.55); color: #fff; }
.btn-light:hover { background: rgba(255,255,255,.24); color: #fff; }
.btn-ghost { background: var(--stone-100); color: var(--stone-800); }
.btn-ghost:hover { background: var(--stone-200); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  background: var(--green-100); color: var(--green-700);
}
.chip-core { background: var(--orange); color: #fff; }
.chip-pro { background: linear-gradient(135deg, #4a3a1d, #7a5c22); color: #ffd99a; }
.chip-risk-high { background: var(--red); color: #fff; }
.chip-risk-mid  { background: var(--amber); color: #3d2c05; }
.chip-risk-low  { background: var(--green-500); color: #fff; }
.chip-info { background: var(--info-bg); color: var(--info); }

/* ---------------- Header / nav ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stone-200);
}
.nav-bar { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--green-900); font-size: 1.04rem; }
.brand:hover { color: var(--green-800); }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: linear-gradient(150deg, var(--green-600), var(--green-800));
  display: grid; place-items: center; color: #fff;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand small { display: block; font-size: .63rem; font-weight: 600; color: var(--stone-500); letter-spacing: .04em; }
.nav-links { display: none; align-items: center; gap: 2px; margin-left: 8px; }
.nav-links a {
  padding: 8px 12px; border-radius: 8px; color: var(--stone-800);
  font-weight: 600; font-size: .93rem; position: relative;
}
.nav-links a:hover { background: var(--green-50); color: var(--green-700); }
.nav-links a.active { color: var(--green-700); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2.5px;
  background: var(--orange); border-radius: 2px;
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--stone-300); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  border: 0; background: transparent; padding: 7px 13px; cursor: pointer;
  font: 600 .85rem var(--font); color: var(--stone-600); min-height: 36px;
}
.lang-switch button.active { background: var(--green-700); color: #fff; }
.nav-fav { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--stone-700); }
.nav-fav:hover { background: var(--green-50); color: var(--green-700); }
.nav-fav svg { width: 21px; height: 21px; }
.fav-count {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--orange); color: #fff; border-radius: 9px; font-size: .68rem; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.fav-count.on { display: inline-flex; }
.nav-toggle {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent;
  cursor: pointer; border-radius: 9px;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 22px; height: 2px; background: var(--green-900); border-radius: 2px; position: relative; transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }
.mobile-menu {
  display: none; border-top: 1px solid var(--stone-200); background: #fff; padding: 8px 18px 16px;
}
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 12px 6px; font-weight: 600; color: var(--stone-800); border-bottom: 1px solid var(--stone-100); }
.mobile-menu a.active { color: var(--green-700); }

/* Compact header on phones: hide Pro chip + tagline, shrink controls,
   let the brand name ellipsize so the hamburger never overflows. */
@media (max-width: 560px) {
  .nav-bar { gap: 8px; }
  .brand { font-size: .92rem; gap: 8px; min-width: 0; flex: 0 1 auto; }
  .brand > span:nth-child(2) { min-width: 0; overflow: hidden; }
  .brand > span:nth-child(2) > span:first-child {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .brand small { display: none; }
  .nav-right { gap: 6px; flex: 0 0 auto; }
  .nav-right .chip-pro { display: none; }
  .lang-switch button { padding: 7px 10px; }
  .nav-fav { width: 38px; height: 38px; }
  .nav-toggle { width: 40px; height: 40px; }
}

@media (min-width: 1024px) {
  .nav-links { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------------- Footer ---------------- */
.site-footer { background: var(--green-900); color: #c9d8cf; margin-top: 60px; }
.footer-grid { display: grid; gap: 28px; padding: 46px 0 30px; }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-col h4 { color: #fff; font-size: .92rem; margin-bottom: 12px; letter-spacing: .04em; }
.footer-col a { display: block; color: #aec5b7; padding: 4px 0; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: .82rem; color: #8fa899;
}
.footer-disclaimer { padding-bottom: 4px; }
.footer-disclaimer p {
  margin: 0; font-size: .78rem; line-height: 1.6; color: #8fa899; max-width: 920px;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--green-900), var(--green-700) 55%, #33583f);
}
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .42; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(18,39,28,.88) 0%, rgba(18,39,28,.55) 45%, rgba(18,39,28,.25) 100%);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; padding: 64px 0 70px; max-width: 720px; }
.hero h1 { color: #fff; font-size: 2rem; margin-bottom: .45em; }
.hero p.lead { font-size: 1.08rem; color: #dce8e0; margin-bottom: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-bar { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; }
.trust-bar span { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: #d7e5db; font-weight: 600; }
.trust-bar svg { width: 17px; height: 17px; color: #8fd3a8; }
@media (min-width: 768px) { .hero h1 { font-size: 2.7rem; } .hero-inner { padding: 92px 0 100px; } }

/* Page hero (inner pages) */
.page-hero { position: relative; color: #fff; overflow: hidden; background: var(--green-800); }
.page-hero .hero-media { opacity: .35; }
.page-hero-inner { position: relative; padding: 42px 0 46px; }
.page-hero h1 { color: #fff; font-size: 1.6rem; }
.page-hero p { color: #d6e3da; max-width: 700px; margin-bottom: 0; }
@media (min-width: 768px) { .page-hero-inner { padding: 58px 0 60px; } .page-hero h1 { font-size: 2.1rem; } }

.breadcrumb { font-size: .83rem; margin-bottom: 14px; color: #bdd0c4; }
.breadcrumb a { color: #bdd0c4; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { margin: 0 7px; opacity: .6; }

/* ---------------- Cards & grids ---------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-4 { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.photo-card {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  min-height: 208px; color: #fff; isolation: isolate;
  box-shadow: var(--shadow-sm); border: 1px solid var(--stone-200);
  transition: transform .2s ease, box-shadow .2s ease;
}
.photo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); color: #fff; }
.photo-card .pc-img { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transition: transform .35s ease; background-color: var(--green-700); }
.photo-card:hover .pc-img { transform: scale(1.05); }
.photo-card .pc-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .pc-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(12,26,18,.08) 30%, rgba(12,26,18,.86) 100%);
}
.photo-card .pc-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; }
.photo-card .pc-tags { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.photo-card h3 { color: #fff; margin: 0 0 4px; font-size: 1.02rem; padding-right: 34px; }
.photo-card p { margin: 0; font-size: .84rem; color: #d9e6dd; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-card.feat { min-height: 250px; }
.photo-card.feat h3 { font-size: 1.22rem; }
.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(12,26,18,.42); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(4px); transition: background .15s, transform .15s;
}
.fav-btn:hover { background: rgba(12,26,18,.65); transform: scale(1.08); }
.fav-btn svg { width: 19px; height: 19px; }
.fav-btn.is-fav { color: #ffcf5c; }
.fav-btn.is-fav svg { fill: #ffcf5c; }

.card {
  background: var(--card); border: 1px solid var(--stone-200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.card h2, .card h3 { margin-top: 0; }
.card--flush { padding: 0; overflow: hidden; }

.feature-mini { display: flex; gap: 13px; align-items: flex-start; }
.feature-mini .fm-ico {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px;
  background: var(--green-100); color: var(--green-700); display: grid; place-items: center;
}
.feature-mini .fm-ico svg { width: 22px; height: 22px; }
.feature-mini h3 { font-size: 1rem; margin-bottom: 3px; }
.feature-mini p { font-size: .9rem; color: var(--stone-600); margin: 0; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.field label { display: block; font-weight: 600; font-size: .86rem; color: var(--stone-800); margin-bottom: 5px; }
.field .hint { font-weight: 400; color: var(--stone-500); font-size: .78rem; margin-top: 4px; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--stone-300); border-radius: var(--radius-sm);
  font: 400 .95rem var(--font); color: var(--ink); background: #fff;
}
textarea { min-height: 110px; resize: vertical; font-family: var(--mono); font-size: .86rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-400); outline-offset: 0; border-color: var(--green-500); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red); background: var(--red-bg); }
.field-error { color: var(--red); font-size: .8rem; margin-top: 4px; display: none; }
.field.has-error .field-error { display: block; }
.input-suffix { position: relative; }
.input-suffix .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--stone-500); font-size: .84rem; pointer-events: none; }
.input-suffix input { padding-right: 44px; }
.inline-num { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-num input[type="number"] { width: 110px; }
.checkline { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--stone-700); white-space: nowrap; }
.checklist { margin: 6px 0 0; padding-left: 0; list-style: none; }
.checklist li { position: relative; padding: 5px 0 5px 26px; font-size: .88rem; color: var(--stone-700); border-bottom: 1px dashed var(--stone-100); }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-50); color: var(--green-700); font-size: .72rem; font-weight: 800; display: grid; place-items: center; }

/* sunrise day timeline */
.day-bar { position: relative; height: 34px; border-radius: 999px; background: #20283a; margin: 26px 4px 0; overflow: visible; }
.day-bar .db-civ { position: absolute; top: 0; bottom: 0; background: #f3e2b8; border-radius: 999px; opacity: .55; }
.day-bar .db-sun { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg,#f5b33c,#e8852b); border-radius: 999px; }
.day-bar .db-mark { position: absolute; top: -6px; width: 2px; height: 46px; background: var(--stone-700); transform: translateX(-1px); }
.day-bar .db-mark span { position: absolute; top: -20px; left: 0; transform: translateX(-50%); font-size: .68rem; font-weight: 700; white-space: nowrap; color: var(--stone-700); }
.day-axis { display: flex; justify-content: space-between; font-size: .68rem; color: var(--stone-500); margin: 6px 4px 0; }
/* dimension score bars for checklists */
.dim-row { margin: 12px 0; }
.dim-row .dim-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
.dim-track { height: 10px; border-radius: 999px; background: var(--stone-100); overflow: hidden; }
.dim-fill { height: 100%; border-radius: 999px; background: var(--green-500); transition: width .25s; }
.dim-fill.warn { background: var(--amber); }
.dim-fill.risk { background: var(--red); }
.verdict { font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; }
.verdict.go { color: var(--green-700); } .verdict.caution { color: #b57610; } .verdict.nogo { color: var(--red); }
.seg { display: inline-flex; background: var(--stone-100); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font: 600 .88rem var(--font); color: var(--stone-600); min-height: 38px;
}
.seg button.active { background: #fff; color: var(--green-700); box-shadow: var(--shadow-sm); }
input[type="range"] { width: 100%; min-height: 28px; accent-color: var(--green-600); }
.checkbox { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.checkbox input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--green-600); }
.checkbox .cb-label { font-size: .92rem; }
.checkbox .cb-sub { display: block; font-size: .8rem; color: var(--stone-500); }

/* ---------------- Stats / metrics ---------------- */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } .stat-grid.cols-6 { grid-template-columns: repeat(6, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--stone-200); border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.stat .s-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--stone-500); font-weight: 700; }
.stat .s-value { font-size: 1.32rem; font-weight: 800; color: var(--green-900); line-height: 1.2; margin-top: 2px; }
.stat .s-value small { font-size: .72rem; font-weight: 600; color: var(--stone-500); }
.stat.accent .s-value { color: var(--orange-dark); }
.stat.danger .s-value { color: var(--red); }
.stat.good .s-value { color: var(--green-600); }

.meter { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .86rem; }
.meter .m-label { flex: 0 0 132px; color: var(--stone-700); font-weight: 600; }
.meter .m-track { flex: 1; height: 10px; background: var(--stone-100); border-radius: 999px; overflow: hidden; }
.meter .m-fill { height: 100%; border-radius: 999px; background: var(--green-500); }
.meter .m-fill.warn { background: var(--amber); }
.meter .m-fill.risk { background: var(--red); }
.meter .m-val { flex: 0 0 58px; text-align: right; font-weight: 700; color: var(--stone-800); }

.grade-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; font-size: .72rem; color: #fff; font-weight: 700; }
.grade-bar div { display: grid; place-items: center; min-width: 0; white-space: nowrap; overflow: hidden; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--stone-200); border-radius: var(--radius-sm); background: #fff; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
table.data th, table.data td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--stone-100); white-space: nowrap; }
table.data th { background: var(--green-50); color: var(--green-800); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; cursor: default; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable::after { content: " \2195"; color: var(--stone-400); font-weight: 400; }
table.data th.sort-asc::after { content: " \2191"; color: var(--green-700); }
table.data th.sort-desc::after { content: " \2193"; color: var(--green-700); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--green-50); }
table.data tr.active-row { background: var(--green-100); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- Tabs / panels ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--stone-200); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs button {
  border: 0; background: transparent; padding: 11px 16px; cursor: pointer; white-space: nowrap;
  font: 600 .9rem var(--font); color: var(--stone-500); border-bottom: 2.5px solid transparent; margin-bottom: -2px;
}
.tabs button.active { color: var(--green-700); border-bottom-color: var(--orange); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.panel { background: #fff; border: 1px solid var(--stone-200); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin: 0 0 16px; }
.callout svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; }
.callout.info { background: var(--info-bg); color: #23597e; }
.callout.success { background: var(--green-100); color: var(--green-800); }
.callout.warn { background: #fdf4e3; color: #7a5410; }
.callout.danger { background: var(--red-bg); color: #8e2a2a; }
.callout p:last-child { margin: 0; }
.tool-disclaimer { align-items: flex-start; margin-bottom: 0; }

/* ---------------- Upload dropzone ---------------- */
.dropzone {
  border: 2px dashed var(--stone-300); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.hover { border-color: var(--green-500); background: var(--green-50); }
.dropzone .dz-ico {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--green-100); color: var(--green-700); display: grid; place-items: center;
}
.dropzone .dz-ico svg { width: 28px; height: 28px; }
.dropzone h3 { margin-bottom: 4px; }
.dropzone p { color: var(--stone-500); font-size: .88rem; margin: 0; }
.file-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--stone-200); border-radius: var(--radius-sm); background: #fff; margin-top: 9px;
}
.file-item .fi-name { font-weight: 600; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-meta { font-size: .78rem; color: var(--stone-500); }
.file-item.is-error { border-color: var(--red); background: var(--red-bg); }
.file-item .fi-remove { margin-left: auto; border: 0; background: transparent; cursor: pointer; color: var(--stone-500); width: 38px; height: 38px; border-radius: 50%; }
.file-item .fi-remove:hover { color: var(--red); background: var(--red-bg); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--stone-200); border-top-color: var(--green-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Charts ---------------- */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { width: 100%; display: block; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, -110%);
  background: var(--green-900); color: #fff; font-size: .76rem; line-height: 1.5;
  padding: 8px 11px; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow-md); display: none;
}
.chart-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--green-900); border-bottom: 0;
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .8rem; color: var(--stone-600); }
.chart-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.svg-map { width: 100%; height: auto; background: linear-gradient(160deg, #f2f6f1, #e6efe8); border-radius: var(--radius-sm); border: 1px solid var(--stone-200); }

/* ---------------- Difficulty rating ---------------- */
.rating-hero { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.score-ring { --score: 0; width: 118px; height: 118px; border-radius: 50%; flex: 0 0 118px;
  background: conic-gradient(var(--ring, var(--green-500)) calc(var(--score)*1%), var(--stone-100) 0);
  display: grid; place-items: center; position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 10px; background: #fff; border-radius: 50%; }
.score-ring .sr-val { position: relative; font-size: 1.9rem; font-weight: 800; color: var(--green-900); }
.score-ring .sr-val small { display: block; font-size: .62rem; text-align: center; color: var(--stone-500); font-weight: 700; letter-spacing: .08em; }
.rating-badges { display: flex; flex-wrap: wrap; gap: 9px; }
.rbadge { padding: 8px 15px; border-radius: 10px; font-weight: 800; font-size: .9rem; color: #fff; text-align: center; }
.rbadge small { display: block; font-size: .66rem; font-weight: 600; opacity: .85; letter-spacing: .05em; }
.rv-easy { background: #3d8b40; }
.rv-moderate { background: #7ba834; }
.rv-hard { background: #e0992c; }
.rv-veryhard { background: #e2612b; }
.rv-extreme { background: #c0392b; }
.rv-black { background: #222; }

/* Danger list */
.danger-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--stone-200); margin-bottom: 10px; background: #fff; }
.danger-item .di-ico { flex: 0 0 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; }
.danger-item.sev-high .di-ico { background: var(--red-bg); color: var(--red); }
.danger-item.sev-mid .di-ico { background: #fdf4e3; color: #b57610; }
.danger-item.sev-low .di-ico { background: var(--info-bg); color: var(--info); }
.danger-item .di-ico svg { width: 19px; height: 19px; }
.danger-item h4 { margin: 0 0 2px; font-size: .94rem; }
.danger-item p { margin: 0; font-size: .84rem; color: var(--stone-600); }

/* ---------------- Tool shell ---------------- */
.tool-layout { display: grid; gap: 22px; }
@media (min-width: 1024px) { .tool-layout.aside { grid-template-columns: 380px 1fr; align-items: start; } }
.tool-note { font-size: .85rem; color: var(--stone-600); }
.result-empty {
  border: 2px dashed var(--stone-300); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; color: var(--stone-500); background: #fff;
}
.result-empty svg { width: 42px; height: 42px; margin-bottom: 10px; color: var(--stone-400); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; font-size: .9rem; }
.kv dt { color: var(--stone-600); }
.kv dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.output-box { background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--radius-sm); padding: 16px; }
.output-headline { font-size: 1.5rem; font-weight: 800; color: var(--green-800); }
.output-sub { color: var(--stone-600); font-size: .9rem; }
.big-result { font-size: 2rem; font-weight: 800; color: var(--green-800); line-height: 1.15; }
.big-result small { display: block; font-size: .85rem; font-weight: 600; color: var(--stone-500); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.pill { padding: 6px 13px; border-radius: 999px; background: var(--stone-100); font-size: .83rem; font-weight: 600; color: var(--stone-800); }
.pill.good { background: var(--green-100); color: var(--green-700); }
.pill.warn { background: #fdf4e3; color: #8a5f0d; }
.pill.risk { background: var(--red-bg); color: var(--red); }

/* ---------------- Ad slot ---------------- */
.ad-slot {
  margin: 26px 0; border: 1px dashed var(--stone-300); border-radius: var(--radius-sm);
  min-height: 96px; display: grid; place-items: center; background:
  repeating-linear-gradient(45deg, #fafbfa, #fafbfa 12px, #f3f6f4 12px, #f3f6f4 24px);
  color: var(--stone-400); font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.ad-slot.ad-leaderboard { min-height: 90px; }
.ad-slot.ad-rect { min-height: 250px; }

/* ---------------- Cookie bar / toast ---------------- */
.cookie-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80;
  background: var(--green-900); color: #dce8e0; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 15px 18px;
  display: none; gap: 14px; align-items: center; flex-wrap: wrap;
}
.cookie-bar.show { display: flex; }
.cookie-bar p { margin: 0; font-size: .86rem; flex: 1 1 260px; }
.cookie-bar a { color: #8fd3a8; }
.app-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--green-900); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: .88rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 90; max-width: 88vw; text-align: center;
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Favorites ---------------- */
.fav-section + .fav-section { margin-top: 34px; }
.empty-state { text-align: center; padding: 54px 20px; color: var(--stone-500); }
.empty-state svg { width: 48px; height: 48px; color: var(--stone-300); margin-bottom: 12px; }

/* ---------------- Articles ---------------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.9rem; font-size: 1.35rem; }
.prose h3 { margin-top: 1.5rem; font-size: 1.08rem; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.4em 0; padding: 10px 18px; border-left: 4px solid var(--orange); background: var(--stone-100); border-radius: 0 8px 8px 0; color: var(--stone-800); }
.prose img.fig { border-radius: var(--radius); margin: 1.4em 0; box-shadow: var(--shadow-sm); width: 100%; }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--stone-500); font-size: .85rem; margin-bottom: 18px; }
.article-meta .chip { font-size: .74rem; }
.article-toc { background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--radius); padding: 14px 18px; margin: 18px 0 26px; font-size: .9rem; }
.article-toc strong { display: block; margin-bottom: 6px; color: var(--green-800); }
.article-toc ol { margin: 0; padding-left: 1.3em; }
.article-cta {
  border-radius: var(--radius); overflow: hidden; position: relative; color: #fff;
  padding: 26px 24px; margin: 30px 0; background: linear-gradient(120deg, var(--green-800), var(--green-600));
}
.article-cta h3 { color: #fff; }
.article-cta p { color: #d7e6dc; margin-bottom: 14px; }
.article-grid-body { display: grid; gap: 26px; }
@media (min-width: 1024px) { .article-grid-body { grid-template-columns: 230px 1fr; align-items: start; } .article-toc-sticky { position: sticky; top: 84px; } }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.filter-bar .search-box { flex: 1 1 220px; min-width: 0; position: relative; }
.filter-bar .search-box input { padding-left: 40px; }
.filter-bar .search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--stone-400); }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-chips button {
  border: 1px solid var(--stone-300); background: #fff; border-radius: 999px; padding: 8px 15px;
  cursor: pointer; font: 600 .85rem var(--font); color: var(--stone-600); min-height: 38px;
}
.filter-chips button.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.result-count { font-size: .85rem; color: var(--stone-500); margin-bottom: 14px; }

/* ---------------- Legal / prose pages ---------------- */
.legal { max-width: 820px; }
.legal h2 { margin-top: 2rem; }
.legal h3 { margin-top: 1.4rem; }
.legal .updated { color: var(--stone-500); font-size: .88rem; }

.contact-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.email-big { font-size: 1.25rem; font-weight: 800; color: var(--green-700); font-family: var(--mono); }

/* ---------------- Pro section ---------------- */
.pro-zone {
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: linear-gradient(130deg, #202b18, #3d3517 55%, #5b461a);
  color: #f3ead4; padding: 40px 26px;
}
.pro-zone h2 { color: #ffd99a; }
.pro-zone .grid .card { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #e9e0c9; }
.pro-zone .grid .card h3 { color: #ffd99a; }
.pro-zone .grid .card p { color: #cdc3a8; margin: 0; font-size: .9rem; }
.pro-now { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(143,211,168,.16); color: #9fe0b6; font-size: .78rem; font-weight: 700; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--stone-200); margin-left: 7px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--green-500); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--green-500); }
.timeline li strong { display: block; color: var(--green-800); }

/* misc */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.divider-v { width: 1px; background: var(--stone-200); }

/* static pages: about / contact / privacy */
.narrow { max-width: 860px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.contact-grid { display: grid; gap: 28px; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 300px; align-items: start; } }
.contact-side { position: static; }
@media (min-width: 1024px) { .contact-side { position: sticky; top: 84px; } }
.contact-email { font-size: 1.25rem; font-weight: 700; color: var(--green-700); word-break: break-all; }
.info-list { list-style: none; margin: 0 0 14px; padding: 0; }
.info-list li { position: relative; padding-left: 22px; margin-bottom: 10px; font-size: .92rem; color: var(--stone-700); }
.info-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.legal .updated { color: var(--stone-500); font-size: .9rem; }
.legal h2 { font-size: 1.15rem; }
.final-cta-title { font-size: 1.8rem; margin: 0 0 10px; }
.tools-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* ---------------- Print ---------------- */
@media print {
  .site-header, .site-footer, .cookie-bar, .app-toast, .ad-slot, .no-print,
  .fav-btn, .hero-cta, .nav-toggle { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .panel, .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .photo-card .pc-shade { background: none; }
  a { color: #000; }
  .print-block { display: block !important; }
}
