:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #17211d;
  --muted: #52615a;
  --line: #dce3dd;
  --brand: #1f6b52;
  --brand-dark: #154d3a;
  --brand-soft: #e7f3ee;
  --amber-bg: #fef5e7;
  --amber-ink: #8a5300;
  --red-bg: #fdecec;
  --red-ink: #991b1b;
  --green-bg: #e7f6ec;
  --green-ink: #14532d;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(23, 33, 29, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 56px;
}

.wrap-wide {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 64px;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand);
  display: inline-block;
  flex-shrink: 0;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.hero {
  background: linear-gradient(135deg, #174939 0%, #246f56 100%);
  color: #ffffff;
  border: none;
  padding: 28px 22px;
}
.hero h1 {
  margin: 8px 0 10px;
  font-size: 1.65rem;
  line-height: 1.22;
}
.hero p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.92);
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.eyebrow-light {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 10px; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 1.02rem; line-height: 1.35; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.92rem; }
.small { font-size: 0.84rem; color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 1.4rem; }
  .card { padding: 18px 15px; }
}

.fact-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
}
.fact-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.fact-value {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-block { width: 100%; }
.btn-secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 0.84rem;
  border-radius: 8px;
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border-color: #c2e0d4; }
.alert-warn { background: var(--amber-bg); color: var(--amber-ink); border-color: #f3d299; }
.alert-err { background: var(--red-bg); color: var(--red-ink); border-color: #f5bcbc; }
.alert-ok { background: var(--green-bg); color: var(--green-ink); border-color: #b7e1c4; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-green { background: var(--green-bg); color: var(--green-ink); }
.badge-amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge-red { background: var(--red-bg); color: var(--red-ink); }
.badge-neutral { background: #ebefec; color: #36453e; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid #c5d0c8;
  border-radius: 9px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--ink);
  background: #ffffff;
}
.field textarea { min-height: 82px; resize: vertical; }

.radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
}
.radio-option input { margin-top: 3px; flex-shrink: 0; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.check-row input { margin-top: 4px; flex-shrink: 0; }

.clean-list {
  margin: 0;
  padding-left: 19px;
}
.clean-list li { margin-bottom: 6px; }

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 8px;
  flex-shrink: 0;
}

.audio-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.audio-box audio, video {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
}

.code-pill {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #17211d;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 10px;
  margin: 6px 0;
}

#home-map {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
  z-index: 1;
}

.recorder-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tab-link {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}
.tab-link.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 820px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.kpi-num { font-size: 1.5rem; font-weight: 800; color: var(--brand-dark); }
.kpi-label { font-size: 0.78rem; color: var(--muted); }

.score-bar-track {
  width: 100%;
  height: 8px;
  background: #e5ece7;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.score-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

.copy-box {
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 24px;
}

.hidden { display: none !important; }
