/* 유리창 로봇청소기 제휴 링크 페이지
   - 흰 바탕, 진한 글자, 강조색 1개(--accent)
   - 본문 16px 이상, 버튼 48px 이상
   - 외부 글꼴 없음(시스템 글꼴) */

:root {
  --bg: #ffffff;
  --text: #16181d;
  --muted: #555c68;
  --line: #e2e5e9;
  --soft: #f2f4f6;
  --accent: #0a5fc2;
  --on-accent: #ffffff;
  --disabled-bg: #e4e7eb;
  --disabled-text: #5f6672;
  --placeholder: #d7dbe0;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --text: #eef1f5;
    --muted: #b3bac5;
    --line: #2b3139;
    --soft: #1c2128;
    --accent: #5ea3ff;
    --on-accent: #08111f;
    --disabled-bg: #2b3139;
    --disabled-text: #b3bac5;
    --placeholder: #2a3038;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
}

/* 1. 수수료 고지 띠 */
.disclosure {
  background: var(--soft);
  border-bottom: 2px solid var(--accent);
}

.disclosure p {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 8px;
}

/* 2. 영상: 세로 9:16 유지, 폭은 화면 안에서. 높이는 app.js 가 첫 화면에 버튼이 보이도록 맞춘다. */
.video-box {
  position: relative;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  height: min(calc((min(100vw, 480px) - 32px) * 16 / 9), 52vh);
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--placeholder);
  cursor: default;
}

.video-box.has-video {
  background: #000;
  cursor: pointer;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.video-box video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sound-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* 3. 한 줄 소개 */
.headline {
  margin: 12px 0 2px;
  font-size: 21px;
  line-height: 1.35;
  text-align: center;
}

.sub {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

/* 4·9. 제품 버튼 */
.products {
  margin-top: 12px;
}

.products-bottom {
  margin-top: 32px;
}

.product {
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.product + .product {
  margin-top: 10px;
}

.product-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.product-name.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.product-note {
  margin: 2px 0 0;
  color: var(--muted);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.cta:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.cta:active {
  filter: brightness(0.92);
}

.cta.is-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

.price-note {
  margin: 6px 0 0;
  color: var(--muted);
  text-align: center;
}

/* 5~8. 본문 블록 */
.card {
  margin-top: 32px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.35;
}

.card h3 {
  margin: 14px 0 4px;
  font-size: 17px;
}

.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card li {
  position: relative;
  padding: 4px 0 4px 26px;
}

.card li::before {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 18px;
  text-align: center;
  font-weight: 700;
}

.record-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin: 0;
}

.record-stats div {
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--soft);
  text-align: center;
}

.record-stats dt {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.record-stats dd {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
}

#record-pros li::before,
.fit-good li::before {
  content: "✓";
  color: var(--accent);
}

#record-cons li::before,
.fit-bad li::before {
  content: "✕";
  color: var(--muted);
}

.safety-list li::before {
  content: "!";
  color: var(--accent);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list details:first-child {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin: 0 0 12px;
  color: var(--text);
  white-space: pre-line;
}

.notice {
  margin: 40px 0;
  font-size: 18px;
  text-align: center;
}

/* 내용 파일을 못 읽었을 때: 고지 띠·안내 문구·맨 아래 고지만 남긴다 */
body.load-failed .page > :not(#load-error) {
  display: none !important;
}

/* 10. 맨 아래 */
.footer {
  max-width: 480px;
  margin: 24px auto 0;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer p {
  margin: 4px 0;
}

.disclosure-bottom {
  margin-top: 12px !important;
  color: var(--text);
  font-weight: 700;
}

/* 통계 화면 */
body[data-page="stats"] .page {
  max-width: 760px;
}

.stats-head h1 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.stats-summary {
  margin: 0 0 16px;
  color: var(--muted);
}

.stats-msg {
  margin: 24px 0;
  font-size: 18px;
}

.table-wrap {
  overflow-x: auto;
  margin: 8px 0 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.stats-table th,
.stats-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.stats-table .wrap {
  white-space: normal;
  min-width: 5em;
}

.stats-table th {
  background: var(--soft);
}

.stats-table td.num,
.stats-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stats-table tfoot td {
  font-weight: 700;
  border-bottom: 0;
}

.stats-section h2 {
  margin: 16px 0 4px;
  font-size: 18px;
}
