/* 안심1초 — 어르신을 위한 큰 글씨 화면 */

:root {
  --ink: #14181c;
  --ink-soft: #3c454e;
  --line: #cfd6dd;
  --line-strong: #9aa5af;
  --bg: #f4f7fa;
  --card: #ffffff;
  --brand: #0b4f9c;
  --brand-dark: #083a75;
  --brand-soft: #e8f1fb;
  --danger: #a4170f;
  --danger-bg: #fdecea;
  --caution: #7a3f00;
  --caution-bg: #fff3df;
  --safe: #10602a;
  --safe-bg: #e7f6ea;
  --focus: #ffbf47;
  --radius: 18px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", "Nanum Gothic", system-ui, -apple-system, sans-serif;
  font-size: 19px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 12px; }

h1, h2, h3 { margin: 0; line-height: 1.35; letter-spacing: -0.02em; }

button, textarea, input, a { font-family: inherit; }

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 12px 18px;
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ── 머리글 ─────────────────────────────────────────── */
.site-header {
  background: var(--brand);
  color: #fff;
  padding: 18px 0 20px;
  border-bottom: 6px solid #ffd166;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  font-size: 38px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 6px 10px;
}

.brand-name {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-sub {
  margin: 0;
  font-size: 17px;
  color: #dfeaf8;
}

.header-note {
  margin: 0;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}

main { padding: 22px 0 40px; }

/* ── 소개 ───────────────────────────────────────────── */
.intro {
  text-align: center;
  padding: 10px 0 6px;
}

.intro h1 {
  font-size: 27px;
  font-weight: 800;
  margin-bottom: 10px;
}

.intro p {
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 560px;
}

.lights {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 4px;
}

.light {
  font-size: 16px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 14px;
  border: 2px solid transparent;
}
.light-danger { background: var(--danger-bg); color: var(--danger); border-color: #f2b8b3; }
.light-caution { background: var(--caution-bg); color: var(--caution); border-color: #f0cfa0; }
.light-safe { background: var(--safe-bg); color: var(--safe); border-color: #a9d8b4; }

/* ── 판독 결과 ──────────────────────────────────────── */
.result { margin: 18px 0 4px; }

.result-card {
  background: var(--card);
  border-radius: 22px;
  padding: 26px 20px 22px;
  border: 2px solid var(--line);
  border-top: 14px solid var(--brand);
  box-shadow: 0 10px 26px rgba(16, 32, 48, 0.12);
}

.result-card[data-level="danger"] { border-top-color: var(--danger); background: var(--danger-bg); }
.result-card[data-level="caution"] { border-top-color: #e8830c; background: var(--caution-bg); }
.result-card[data-level="safe"] { border-top-color: #178036; background: var(--safe-bg); }

.result-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.result-emoji { font-size: 54px; line-height: 1; }

.result-word {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 5px 16px;
  color: #fff;
  background: var(--brand);
}
.result-card[data-level="danger"] .result-word { background: var(--danger); }
.result-card[data-level="caution"] .result-word { background: #c96a00; }
.result-card[data-level="safe"] .result-word { background: #178036; }

.result-title {
  font-size: 31px;
  font-weight: 900;
  margin: 4px 0 8px;
}
.result-card[data-level="danger"] .result-title { color: var(--danger); }
.result-card[data-level="caution"] .result-title { color: #8a4a00; }
.result-card[data-level="safe"] .result-title { color: var(--safe); }

.result-lead {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 18px;
}

.result-sub {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
  padding-top: 14px;
  border-top: 2px dashed rgba(20, 24, 28, 0.18);
}

.reason-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.reason-list li {
  position: relative;
  padding: 0 0 12px 34px;
  font-size: 20px;
  line-height: 1.55;
}

.reason-list li::before {
  content: "•";
  position: absolute;
  left: 8px;
  top: -2px;
  font-size: 30px;
  color: var(--brand);
  line-height: 1.3;
}
.result-card[data-level="danger"] .reason-list li::before { color: var(--danger); }
.result-card[data-level="caution"] .reason-list li::before { color: #c96a00; }
.result-card[data-level="safe"] .reason-list li::before { color: #178036; }

.result-tip {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 18px;
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

/* ── 버튼 ───────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid transparent;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.99); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 0 var(--brand-dark);
  margin-top: 6px;
}
.btn-primary:hover { background: #0d5cb4; }

.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border-color: var(--brand);
}
.btn-secondary:hover { background: var(--brand-soft); }

.btn-speak { background: #ffffff; color: var(--ink); border-color: var(--line-strong); }
.btn-share { background: #ffffff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
  font-size: 18px;
  min-height: 56px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── 입력 카드 ──────────────────────────────────────── */
.methods { display: grid; gap: 18px; margin-top: 22px; }

.method {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 22px;
  box-shadow: 0 4px 14px rgba(16, 32, 48, 0.06);
}

.method h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  font-weight: 800;
  margin-bottom: 8px;
}

.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  flex: none;
}

.hint {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 170px;
  padding: 14px 16px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.6;
  resize: vertical;
}
textarea:focus { background: #fff; }

.row { margin-top: 10px; }

.input-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 800;
  font-size: 17px;
}

.btn-upload { margin-bottom: 12px; }

#previewWrap {
  margin: 4px 0 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  background: #fbfcfd;
}
#preview {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
}

.ocr-status {
  min-height: 28px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 6px 0;
}

.ocr-status.is-error { color: var(--danger); }

.small-label {
  display: block;
  font-size: 17px;
  font-weight: 700;
  margin: 8px 0 6px;
  color: var(--ink-soft);
}

#ocrText { min-height: 130px; }

/* ── 예시 ───────────────────────────────────────────── */
.examples { margin-top: 30px; }

.examples h2, .help h2 {
  font-size: 23px;
  font-weight: 800;
  margin-bottom: 6px;
}

.examples .sub, .help .sub {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.example {
  text-align: left;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 14px;
  cursor: pointer;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.example:hover { border-color: var(--brand); background: var(--brand-soft); }

.example .tag {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-dark);
}
.example .preview-text {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.45;
  display: block;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── 신고 번호 ──────────────────────────────────────── */
.help {
  margin-top: 34px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 22px;
}

.call-grid { display: grid; gap: 10px; margin-top: 6px; }

.call {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--brand-soft);
  border: 2px solid #b9d2ee;
  color: var(--ink);
  text-decoration: none;
}
.call:hover { background: #dbe9fa; }
.call strong { font-size: 30px; font-weight: 900; color: var(--brand-dark); letter-spacing: 0.02em; }
.call span { font-size: 18px; font-weight: 700; color: var(--ink-soft); }

/* ── 바닥글 ─────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  background: #eef2f6;
  padding: 22px 0 34px;
}
footer p {
  max-width: 760px;
  margin: 0 auto 8px;
  padding: 0 18px;
  font-size: 15.5px;
  color: #4b5560;
  line-height: 1.6;
}

/* ── 알림 토스트 ────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #16212c;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: calc(100% - 32px);
  text-align: center;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 좁은 화면 ──────────────────────────────────────── */
@media (max-width: 430px) {
  body { font-size: 18.5px; }
  .brand-name { font-size: 26px; }
  .brand-sub { font-size: 15.5px; }
  .header-note { display: none; }
  .intro h1 { font-size: 24px; }
  .result-title { font-size: 28px; }
  .method h2, .examples h2, .help h2 { font-size: 21px; }
  .example-grid { grid-template-columns: 1fr; }
  .btn { font-size: 20px; }
  .call strong { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* 인쇄·아주 큰 화면에서도 한 줄 폭 유지 */
@media (min-width: 900px) {
  body { font-size: 20px; }
  .intro h1 { font-size: 30px; }
}
