:root {
  color-scheme: light;
  --ink: #173331;
  --muted: #607471;
  --paper: #f4f7f3;
  --card: #ffffff;
  --brand: #075f5b;
  --brand-2: #0a8179;
  --accent: #f0a33a;
  --line: #d7e2de;
  --danger: #a13a30;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.brand-logo {
  width: min(280px, 58vw);
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
  border-radius: 12px;
}

.consent-row {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
}

.consent-row input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: .15rem;
}

.topbar {
  background: linear-gradient(135deg, #064d49, #0c7971);
  color: white;
  padding: 28px max(20px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar h1 { margin: 2px 0 4px; font-size: clamp(30px, 5vw, 46px); }
.topbar p { margin: 0; opacity: .9; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--brand-2); }
.topbar .eyebrow { color: #9fe1db; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 0 max(12px, calc((100vw - 1080px) / 2));
}
.tab { min-height: 60px; border: 0; background: transparent; color: var(--muted); font-weight: 700; }
.tab.active { color: var(--brand); border-bottom: 4px solid var(--brand); }

main { width: min(1080px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 64px; }
.view { display: none; }
.view.active { display: block; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(26px, 4vw, 36px); }

.button { min-height: 52px; padding: 12px 20px; border-radius: 12px; border: 2px solid transparent; font-weight: 800; }
.button.primary { background: var(--brand); color: white; }
.button.secondary { color: var(--brand); background: white; border-color: var(--line); }
.button.danger { color: var(--danger); background: #fff5f3; border-color: #efc7c2; }
.button.full { width: 100%; }
.badge { border-radius: 999px; padding: 8px 12px; background: #d9fff9; color: #064d49; white-space: nowrap; font-weight: 800; font-size: 14px; }
.badge.muted { background: rgba(255,255,255,.15); color: white; }

.card-list { display: grid; gap: 14px; }
.card, .panel, .result-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 8px 26px rgba(22, 63, 59, .06); }
.card h3, .panel h3 { margin: 0 0 10px; font-size: 23px; }
.card p { margin: 6px 0; line-height: 1.55; }
.card-meta { color: var(--muted); font-size: 15px; }
.score { display: inline-flex; align-items: center; min-width: 60px; justify-content: center; background: #e6f6f3; color: var(--brand); border-radius: 999px; padding: 8px 12px; font-weight: 900; }
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: 18px; }

.panel { margin: 18px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
label { display: grid; gap: 8px; margin-bottom: 18px; font-weight: 750; }
input, textarea, select { width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: white; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(10,129,121,.16); border-color: var(--brand-2); }
small { color: var(--muted); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 8px 0 20px; }
legend { font-weight: 800; margin-bottom: 10px; }

.legal-page, .download-page {
  width: min(820px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 64px;
  line-height: 1.75;
}
.legal-page h1, .download-page h1 { font-size: clamp(30px, 7vw, 48px); line-height: 1.15; }
.legal-page h2 { margin-top: 1.8em; }
.legal-logo, .download-logo { width: min(460px, 100%); max-height: 160px; object-fit: contain; object-position: left center; }
.notice { padding: 14px 16px; border: 1px solid #efc88e; border-radius: 12px; background: #fff8e8; }
.download-lead { font-size: 20px; color: var(--muted); }
.download-button { display: inline-block; text-decoration: none; margin: 12px 0; }
.download-meta { color: var(--muted); font-size: 14px; }
.qr-card { text-align: center; margin: 28px 0; }
.qr-card img { width: min(280px, 76vw); border-radius: 16px; border: 1px solid var(--line); }
.install-steps { margin-top: 30px; }
.install-steps li { margin-bottom: .6em; }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.option-grid label { display: flex; align-items: center; gap: 8px; margin: 0; border: 2px solid var(--line); border-radius: 12px; padding: 12px; }
.option-grid input { width: 24px; min-height: 24px; }
.form-actions { display: flex; gap: 12px; }
.result-box { white-space: pre-wrap; line-height: 1.7; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100% - 36px); background: #153c39; color: white; padding: 14px 20px; border-radius: 12px; box-shadow: 0 10px 35px rgba(0,0,0,.22); z-index: 10; }

@media (max-width: 680px) {
  :root { font-size: 17px; }
  .topbar { padding: 22px 18px; align-items: start; }
  .topbar > div > p:last-child { display: none; }
  .tabs { overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { min-height: 52px; }
  main { width: min(100% - 20px, 1080px); padding-top: 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .option-grid { grid-template-columns: repeat(2, 1fr); }
  .section-heading { align-items: center; }
  .button { min-height: 56px; }
}
