/* aisos 공통 스타일 (모바일 우선) */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1d2129;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2f6bff;
  --primary-dark: #1f4fd1;
  --ok: #15803d;
  --warn: #b45309;
  --error: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; }

.hero { margin-bottom: 20px; }
.brand { margin: 0 0 8px; font-weight: 800; color: var(--primary); letter-spacing: .02em; }
.hero h1 { margin: 0 0 8px; font-size: 1.6rem; line-height: 1.3; }
.lead { margin: 0; color: var(--muted); }
.page-title { font-size: 1.4rem; margin: 0 0 16px; }

.tabs { display: flex; gap: 4px; background: var(--line); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.tab {
  flex: 1; border: 0; background: transparent; padding: 10px 8px; border-radius: 9px;
  font: inherit; font-size: .95rem; color: var(--muted); cursor: pointer;
}
.tab.is-active { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.card { background: var(--card); border-radius: 14px; padding: 18px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.notice p { margin: 0; color: var(--muted); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field em { font-style: normal; color: var(--primary); font-size: .8rem; margin-left: 4px; }
.field input {
  width: 100%; padding: 13px 14px; font: inherit; font-size: 16px; /* iOS 확대 방지 */
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }

.btn {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: 10px;
  background: var(--primary); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem;
  text-align: center; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: #eef3ff; }

.hint { margin: 10px 0 0; color: var(--muted); font-size: .85rem; }

.result { margin-top: 8px; }
.result-title { font-weight: 700; margin: 4px 0 8px; }
.msg { padding: 12px 14px; border-radius: 10px; background: var(--card); margin: 0; }
.msg-warn { color: var(--warn); background: #fff7ed; }
.msg-error { color: var(--error); background: #fef2f2; }

.candidates { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.candidate {
  display: block; width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); font: inherit; color: inherit; cursor: pointer;
}
.candidate:hover, .candidate:focus-visible { border-color: var(--primary); }
.candidate:disabled { opacity: .6; }
.c-name { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.c-addr { display: block; color: var(--text); font-size: .9rem; }
.c-meta { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }

/* 업체 확인 화면 */
.card-title { font-size: 1.05rem; margin: 0 0 12px; }
.optional { font-style: normal; color: var(--muted); font-size: .8rem; margin-left: 4px; font-weight: 400; }
.field select {
  width: 100%; padding: 12px 10px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.field select:disabled { background: var(--bg); color: var(--muted); }
.field .hint, .card > .hint { display: block; margin-top: 6px; }
.hint.top { margin: -4px 0 12px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
.field-row.two { grid-template-columns: 1fr 1fr; }
@media (min-width: 420px) { .field-row { grid-template-columns: 1fr 1fr 1fr; } .field-row.two { grid-template-columns: 1fr 1fr; } }
.error { color: var(--error); font-size: .85rem; margin: 6px 0 0; }
.badge-ok { margin: 4px 0 0; color: var(--ok); font-size: .85rem; font-weight: 600; }

.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.channel { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.channel.is-on { border-color: var(--primary); background: #f5f8ff; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.check span { font-weight: 600; }
.auto { font-style: normal; font-size: .75rem; color: var(--primary); background: #e8efff; border-radius: 6px; padding: 2px 6px; }
.channel-url {
  width: 100%; margin-top: 8px; padding: 11px 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.sns-note { margin-top: 12px; font-size: .9rem; }

/* 예 / 아니오 / 모름 선택 */
.radio-group { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.radio-group legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.radios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.radio { position: relative; display: block; }
.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio span {
  display: block; text-align: center; padding: 11px 6px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font-size: .95rem; color: var(--muted);
}
.radio input:checked + span { border-color: var(--primary); background: #f5f8ff; color: var(--primary); font-weight: 700; }
.radio input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.space { margin-top: 10px; }
.src { color: var(--muted); font-size: .75rem; margin-left: 4px; white-space: nowrap; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow-wrap: anywhere; }

.info { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px 10px; margin: 0; }
.info dt { color: var(--muted); font-size: .9rem; }
.info dd { margin: 0; overflow-wrap: anywhere; }
.info .ok { color: var(--ok); font-weight: 600; }

/* ---- 진단 진행 화면 (3-C) ---- */
.lead.small { font-size: .9rem; margin-bottom: 14px; }
.mt { margin-top: 10px; }
.url { color: var(--muted); font-size: .85rem; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .3s ease; }
.bar-label { margin: 10px 0 14px; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 1.6em 1fr; gap: 2px 8px; align-items: baseline; color: var(--muted); }
.steps .mark { text-align: center; font-weight: 800; }
.steps .note { grid-column: 2; font-size: .8rem; color: var(--warn); }
.steps .is-ok { color: var(--text); }
.steps .is-ok .mark { color: var(--ok); }
.steps .is-warn { color: var(--text); }
.steps .is-warn .mark { color: var(--warn); }
.steps .is-current { color: var(--primary); font-weight: 700; }
.steps .is-current .mark { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.error[hidden], [hidden] { display: none !important; }

/* ---- 결과 화면 (임시 표) ---- */
.total { text-align: center; }
.total-label { margin: 0; color: var(--muted); font-size: .9rem; }
.total-score { margin: 0; line-height: 1.1; }
.total-score strong { font-size: 3.4rem; color: var(--primary); }
.total-score span { color: var(--muted); margin-left: 4px; }
.total-sub { margin: 6px 0 0; font-weight: 700; }
.section-title { font-size: 1.35rem; font-weight: 800; margin: 30px 0 12px; padding: 4px 0 4px 12px; border-left: 6px solid var(--primary); display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.section-title .st-ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; font-size: .95rem; flex: none; }
.section-title small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.rows { padding: 6px 16px; }
.row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.is-dim { color: var(--muted); }
.row-main { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.row-sub { font-size: .8rem; color: var(--muted); }
.cond-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cond-head h3 { margin: 0; font-size: 1.05rem; }
.cond-score strong { font-size: 1.3rem; color: var(--primary); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.badges:empty { display: none; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.badge.b-unknown { background: #fff7ed; color: var(--warn); }
.badge.b-na { background: #f3f4f6; color: var(--muted); }
.badge.b-platform { background: #fef2f2; color: var(--error); }
.part { padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.part-main { display: grid; grid-template-columns: 1.4em 1fr auto; gap: 6px; align-items: baseline; }
.part-label { font-weight: 600; }
.part-score { font-weight: 700; }
.part .mark { text-align: center; font-weight: 800; }
.part.is-ok .mark { color: var(--ok); }
.part.is-no .mark { color: var(--error); }
.part.is-unknown .mark { color: var(--warn); }
.part.is-na { color: var(--muted); }
.basis { margin: 4px 0 0 1.9em; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.why { margin: 4px 0 0 1.9em; font-size: .82rem; color: var(--warn); }
.why.platform { color: var(--error); }

/* ---- 검색 후보 카드 (대표 주소 확인 후 바로 진단) ---- */
.place-card { list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.pc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pc-name { font-size: 1.1rem; }
.pc-cat { color: var(--muted); font-size: .82rem; }
.pc-addr { margin: 4px 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.pc-line { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.pc-label { margin: 0 0 6px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.pc-link { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; min-width: 0; }
.type-badge { flex: none; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #e8efff; color: var(--primary); font-weight: 600; }
.pc-url { min-width: 0; font-size: .9rem; overflow-wrap: anywhere; word-break: break-all; }
.pc-none { margin: 0 0 10px; color: var(--warn); font-weight: 600; }
.linkbtn { display: block; margin: 10px auto 0; padding: 4px 8px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.pc-custom { margin-top: 12px; }
.pc-custom[hidden] { display: none; }
.pc-custom .hint { text-align: center; }
.field input.is-error { border-color: var(--error); }
.place-card .error { margin: -6px 0 10px; }
.place-card .error[hidden] { display: none; }
.badge.b-found { background: #e7f6ec; color: var(--ok); font-weight: 700; }
.rows > .hint { margin: 10px 0; }
.row-sub { overflow-wrap: anywhere; word-break: break-all; }

/* 결과 화면: 항목 안내 문구 (예: 0점일 때 "직접 확인해 보세요") */
.advice { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: #fff7e0; color: #6b4e00; font-size: 0.875rem; }

/* ---------------------------------------------------------------- 결과 화면 (요약형): 점수·등급, 문제, 아코디언, 할 일 */
.hero { text-align: center; padding: 22px 16px; border-top: 6px solid var(--line); }
.hero .total-score strong { font-size: 4rem; }
.hero.grade-danger { border-top-color: var(--error); }
.hero.grade-danger .total-score strong, .hero.grade-danger .grade-badge { color: var(--error); }
.hero.grade-warn { border-top-color: #d97706; }
.hero.grade-warn .total-score strong, .hero.grade-warn .grade-badge { color: var(--warn); }
.hero.grade-good { border-top-color: var(--ok); }
.hero.grade-good .total-score strong, .hero.grade-good .grade-badge { color: var(--ok); }
.grade-badge { display: inline-block; margin: 10px 0 6px; padding: 4px 16px; border-radius: 999px; font-weight: 800; background: var(--bg); }
.grade-line { margin: 4px 0 0; font-size: 1.05rem; font-weight: 700; }

.problems, .todo-list { list-style: none; padding-left: 16px; padding-right: 16px; }
.problems li, .todo-list li { display: grid; grid-template-columns: 1.8em 1fr; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.problems li:last-child, .todo-list li:last-child { border-bottom: 0; }
.todo-list { margin: 0; padding: 0; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; font-weight: 800; }
.problems .num { background: var(--error); }

/* 아코디언: 스크립트가 있을 때(.js)만 접는다. 없으면 모두 펼쳐 보인다 */
.acc { background: var(--card); border-radius: 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
.acc-head { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 10px; align-items: center; width: 100%; padding: 14px 16px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.acc-name { font-weight: 700; }
.acc-score strong { font-size: 1.2rem; color: var(--primary); }
/* '자세히 보기' 텍스트 버튼 (화살표 대신). 스크립트가 없으면 모두 펼쳐져 있으므로 숨긴다 */
.acc-more { display: none; font-size: .78rem; font-weight: 600; color: var(--primary); padding: 3px 10px; border-radius: 999px; background: #e8efff; white-space: nowrap; }
.js .acc-more { display: inline-block; }
.acc-more .t-open { display: none; }
.acc.is-open .acc-more .t-closed { display: none; }
.acc.is-open .acc-more .t-open { display: inline; }

/* 참고 주소 '보기' 버튼, 채널 아이콘 */
.link-ico { display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px 0 0; padding: 3px 10px; border-radius: 999px; background: #e8efff; color: var(--primary); font-size: .78rem; font-weight: 600; text-decoration: none; word-break: keep-all; }
.link-ico:hover { background: #d6e2ff; }
.item-links { margin-top: 2px; }
.row-label { display: inline-flex; align-items: center; gap: 8px; }
.ch-ico { flex: none; vertical-align: middle; }
.ch-list { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 8px 0 6px; }
.ch-chip { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 56px; color: inherit; text-decoration: none; }
.is-dim .ch-chip { opacity: .55; }
a.ch-chip.is-link:hover .ch-ico, a.link-ch:hover .ch-ico { filter: brightness(1.1); box-shadow: 0 0 0 2px #cdd9ff; border-radius: 7px; }
.ch-chip em { font-style: normal; font-size: .65rem; padding: 0 6px; border-radius: 999px; background: #fff7ed; color: var(--warn); }
.ch-found { margin-top: 10px; }
.ch-hint { margin: 2px 0 8px; font-size: .8rem; }
.link-ch { position: relative; display: inline-block; margin: 4px 8px 0 0; line-height: 0; }
.ch-num { position: absolute; right: -6px; bottom: -4px; min-width: 14px; height: 14px; padding: 0 3px; box-sizing: border-box; border-radius: 999px; background: #fff; border: 1.5px solid var(--primary); color: var(--primary); font-size: .62rem; font-weight: 800; line-height: 11px; text-align: center; }
.link-ch .ch-ico { width: 26px; height: 26px; }
.ch-chip small { font-size: .68rem; line-height: 1.2; text-align: center; color: var(--muted); word-break: keep-all; }
.acc-bar { grid-column: 1 / -1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.acc-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.acc-body { padding: 0 16px 14px; border-top: 1px solid var(--line); }
.js .acc-body { display: none; }
.js .acc.is-open .acc-body { display: block; }
.acc-note { margin: 10px 0 0; }
.box-title { margin: 14px 0 4px; font-weight: 700; font-size: .9rem; }

.items { list-style: none; margin: 8px 0 0; padding: 0; }
.item { display: grid; grid-template-columns: 1.6em 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .mark { text-align: center; font-weight: 800; }
.item.is-ok .mark { color: var(--ok); }
.item.is-no .mark { color: var(--error); }
.item.is-unknown .mark { color: var(--warn); }
.item-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.item-score { color: var(--muted); font-weight: 600; white-space: nowrap; }
.item-line { margin-top: 2px; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.found-box { padding-bottom: 4px; }
.found-box .row-sub.est { color: var(--warn); }
.plain { margin: 6px 0 0; padding-left: 1.1em; font-size: .85rem; color: var(--muted); }
.plain li { margin-bottom: 6px; }
#ebook-btn { display: block; text-align: center; }
.item.is-na .mark { color: var(--muted); }

/* 공유: 소유자 하단 공유 카드 / 타인용 요약 화면의 큰 버튼 */
.share-title, .cta-title { margin: 0 0 6px; font-weight: 800; font-size: 1.05rem; }
.share .btn { margin-top: 10px; }
.btn-kakao { background: #fee500; color: #191919; }
.btn-kakao:hover { background: #f0d800; }
.share-msg { min-height: 1.2em; }
.cta { text-align: center; padding: 22px 16px; }
.btn-big { padding: 18px; font-size: 1.2rem; margin-top: 12px; }

/* 점수 해석 안내 (결과 화면 점수 카드 바로 아래) */
.score-note { margin: -4px 4px 14px; font-size: .85rem; line-height: 1.5; color: var(--muted); }

/* ---- 결과 항목 카드: 상태별 왼쪽 색 바, 큰 점수, 세부 항목 목록 ---- */
.item { border-left: 5px solid var(--line); padding-left: 10px; margin-bottom: 8px; background: var(--card); border-radius: 0 10px 10px 0; padding-right: 8px; border-bottom: 0; }
.item.is-ok { border-left-color: var(--ok); }
.item.is-partial { border-left-color: #f59e0b; }
.item.is-no { border-left-color: var(--error); }
.item.is-unknown { border-left-color: #9ca3af; }
.item.is-na { border-left-color: var(--line); }
.item.is-partial .mark { color: #d97706; }
.item-score { font-size: 1rem; font-weight: 700; color: var(--muted); }
.item-score strong { font-size: 1.45rem; font-weight: 800; color: var(--text, #111); }
.item-score.is-low strong { color: var(--error); }
.parts { list-style: none; margin: 8px 0 0; padding: 0; }
.part-row { display: grid; grid-template-columns: 1.4em 1fr auto; gap: 2px 6px; align-items: baseline; padding: 6px 0; border-top: 1px dashed var(--line); font-size: .85rem; }
.part-row .p-mark { font-weight: 800; text-align: center; }
.part-row .p-name { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.part-row .p-name .ch-ico { width: 18px; height: 18px; }
.part-row .p-pt { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.part-row .p-pt strong { font-size: 1rem; color: inherit; }
.part-row .p-detail { grid-column: 2 / -1; color: var(--muted); overflow-wrap: anywhere; }
.part-row.p-yes .p-mark { color: var(--ok); }
.part-row.p-part .p-mark { color: #d97706; }
.part-row.p-no .p-mark, .part-row.p-no .p-pt strong { color: var(--error); }
.part-row.p-unk .p-mark { color: #9ca3af; }
.part-row.p-unk .p-name, .part-row.p-unk .p-detail { color: var(--muted); }
.link-ch.is-own, .link-ico.is-own { opacity: .4; }
.own-note { font-size: .78rem; }

/* 채널 목록: 찾은 것과 못 찾은 것 사이 구분선, 못 찾은 것은 회색조로 */
.found-box .row.is-dim { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; border-bottom: 0; }
.is-dim .ch-chip { opacity: .5; filter: grayscale(1) saturate(.4); }

/* 대표 주소 기준 박스, 계산식·안내 줄, 최근 글 목록 */
.rep-box { margin: 6px 0 4px; padding: 8px 10px; border-radius: 8px; background: #f3f5ff; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .88rem; }
.rep-box .rep-label { color: var(--muted); }
.rep-box .rep-val { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rep-box .ch-ico { width: 20px; height: 20px; }
.rep-box .hint { flex-basis: 100%; margin: 0; }
.item-line.formula { color: #374151; font-weight: 600; }
.item-line.note { color: var(--muted); }
.posts { list-style: none; margin: 6px 0 0; padding: 0; font-size: .85rem; }
.posts li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.posts .ch-ico { width: 18px; height: 18px; }
.posts .post-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.posts small { color: var(--muted); }

/* v28: 항목별 자세히 보기, 항목 설명·요약, 대표 주소 제목 링크, SNS 채널 줄 */
.item-desc { font-size: .8rem; color: var(--muted); margin: 1px 0 3px; line-height: 1.45; }
.item-line.summary { color: var(--text); font-weight: 600; }
.item-title-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--primary); }
.item-title-link .ext { margin-left: 4px; font-size: .8em; color: var(--primary); }
.acc-sub { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); margin-top: 1px; }
.item-more { display: none; margin-top: 6px; padding: 4px 12px; border: 0; border-radius: 999px; background: #eef2ff; color: var(--primary-dark); font-size: .8rem; font-weight: 700; cursor: pointer; }
.js .item-more { display: inline-flex; }
.item-more .t-open { display: none; }
.item.open .item-more .t-open { display: inline; }
.item.open .item-more .t-closed { display: none; }
.js .item-detail { display: none; }
.js .item.open .item-detail { display: block; margin-top: 6px; }
.p-ico-link { display: inline-flex; }
.parts-sns .part-row.p-no { opacity: .55; }
.parts-sns .part-row.p-no .p-ico-link, .parts-sns .part-row.p-no .ch-ico { filter: grayscale(1) saturate(.4); }
.est-tag { font-style: normal; font-size: .72rem; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: #fff7ed; color: #b45309; }

/* v29: SNS·채널 연결 5칸 */
.sns-slots { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sns-slot { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ico name pt" "ico state pt"; gap: 0 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sns-slot .slot-ico { grid-area: ico; display: inline-flex; gap: 4px; align-items: center; min-width: 28px; }
.sns-slot .ch-ico { width: 26px; height: 26px; }
.sns-slot .slot-name { grid-area: name; font-weight: 700; font-size: .88rem; }
.sns-slot .slot-state { grid-area: state; font-size: .78rem; color: var(--muted); }
.sns-slot .slot-pt { grid-area: pt; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.sns-slot .slot-pt strong { font-size: 1rem; }
.sns-slot.p-yes { border-color: #bbf7d0; background: #f0fdf4; }
.sns-slot.p-yes .slot-state { color: var(--ok); font-weight: 700; }
.sns-slot.p-no .slot-ico .ch-ico { filter: grayscale(1) saturate(.3); opacity: .55; }
.sns-slot.p-no .slot-pt strong { color: var(--error); }

/* v29: 이전 진단 대비, 이력, 상담 */
.consult .consult-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 2px; }
.cmp-groups, .cmp-items, .history { list-style: none; margin: 8px 0 0; padding: 0; }
.history li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: .86rem; }
.history li.is-current { background: #eef2ff; border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.history .hs-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.history .hs-now { font-size: .75rem; color: var(--primary-dark); font-weight: 700; }
.history .hs-link { font-weight: 700; }
.btn-kakao { background: #fee500; color: #191919; border-color: #fee500; }
.btn-kakao:hover { background: #f5dc00; }
.consult.is-small { padding: 12px 14px; }
.consult.is-small .consult-title { font-size: .9rem; }
.consult.is-small .btn { font-size: .85rem; padding: 8px 12px; margin-top: 6px; }

/* 전에 같은 가게를 진단한 기록 안내 (작은 한 줄) */
.seen-prev { margin: 8px 4px 0; font-size: .82rem; color: var(--muted); line-height: 1.7; }
.seen-prev a { margin-left: 6px; font-weight: 700; white-space: nowrap; }

/* v29: 이전 진단과 비교 카드 (눈에 띄게: 색 테두리·옅은 배경, 큰 점수, 오름 초록/내림 빨강) */
.compare { border: 2px solid #c7d2fe; background: #f5f7ff; scroll-margin-top: 12px; }
.compare.is-up { border-color: #86efac; background: #f3fcf6; }
.compare.is-down { border-color: #fca5a5; background: #fff6f6; }
.compare .cmp-title { margin: 0 0 4px; font-size: 1.5rem; font-weight: 800; }
.cmp-from-line { margin: 0 0 6px; font-size: .84rem; color: var(--muted); }
.cmp-hero { text-align: center; padding: 14px 0 8px; }
.cmp-sub { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 2px; }
.cmp-big { margin: 0; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 8px 12px; }
.cmp-big .cmp-prev { font-size: 1.7rem; font-weight: 700; color: var(--muted); }
.cmp-big .cmp-arrow { font-size: 1.5rem; color: var(--muted); }
.cmp-big strong { font-size: 3rem; line-height: 1; }
.cmp-same-line { margin: 10px 0 2px; font-size: 1.05rem; font-weight: 800; }
.cmp-tip { margin: 0; font-size: .84rem; color: var(--muted); }
.cmp-badge { display: inline-block; margin-top: 10px; padding: 5px 16px; border-radius: 999px; font-size: 1.15rem; font-weight: 800; }
.cmp-badge.up { background: #dcfce7; color: #15803d; }
.cmp-badge.down { background: #fee2e2; color: #b91c1c; }
.cmp-note { margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
.cmp-groups li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed #d6dcf5; font-size: .9rem; }
.cmp-groups .cg-name small, .cmp-items small { color: var(--muted); font-weight: 400; }
.cmp-chip { font-style: normal; font-weight: 800; font-size: .8rem; padding: 2px 9px; border-radius: 999px; background: #eef0f4; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.cmp-chip.up { background: #dcfce7; color: #15803d; }
.cmp-chip.down { background: #fee2e2; color: #b91c1c; }
.cmp-block { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb; }
.cmp-block.up { border-color: #bbf7d0; }
.cmp-block.down { border-color: #fecaca; }
.cmp-block-title { margin: 0 0 4px; font-weight: 800; font-size: .95rem; }
.cmp-block.up .cmp-block-title, .cmp-block.up .ci-val { color: #15803d; }
.cmp-block.down .cmp-block-title, .cmp-block.down .ci-val { color: #b91c1c; }
.cmp-items li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px dashed #e5e7eb; font-size: .88rem; }
.cmp-items li:first-child { border-top: 0; }
.cmp-items .ci-name { color: var(--text); }
.cmp-items .ci-val { white-space: nowrap; font-weight: 600; }
.cmp-items .ci-val em { font-style: normal; font-weight: 800; }
.cmp-small { margin: 8px 0 0; font-size: .75rem; color: var(--muted); }
.cmp-skip { margin-top: 12px; font-size: .74rem; color: #9ca3af; }
.cmp-skip-title { margin: 0 0 2px; }
.cmp-skip ul { margin: 0; padding-left: 16px; }
/* 첫 화면 하단: 자주 묻는 질문 + 서비스 소개 (index.php) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.btn { display: block; text-align: center; text-decoration: none; }
.info-sec { margin-top: 36px; }
.info-h2 { margin: 0 0 6px; font-size: 1.4rem; line-height: 1.35; }
.info-h3 { margin: 0 0 4px; font-size: 1.1rem; }
.info-sub { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.info-note { margin: 12px 0 0; color: var(--muted); font-size: .8rem; }
.faq-group { margin-top: 22px; }
.faq-group h3 { margin: 0 0 8px; font-size: 1.02rem; }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
details.faq[open] { border-color: #c7d6ff; }
details.faq summary { cursor: pointer; list-style: none; position: relative; padding: 14px 44px 14px 14px; font-weight: 700; font-size: .95rem; line-height: 1.5; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: attr(data-no); color: var(--primary); font-size: .72rem; font-weight: 800; margin-right: 8px; }
details.faq summary::after { content: "+"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #f1f3f7; color: var(--muted); font-size: 1.1rem; }
details.faq[open] summary::after { content: "−"; background: #eef3ff; color: var(--primary); }
.faq-answer { padding: 0 14px 14px 14px; color: #3f4756; font-size: .9rem; }
.faq-answer p { margin: 0 0 8px; }
.faq-answer ul { margin: 6px 0 10px; padding-left: 20px; }
.faq-answer li { padding: 1px 0; }
.faq-answer .faq-note { background: #f5f7fb; border-left: 3px solid #9bb4ff; border-radius: 0 8px 8px 0; padding: 8px 10px; margin: 10px 0 0; color: #4b5565; }
.info-principle { background: #eef3ff; border: 1px solid #d3e0ff; border-radius: 14px; padding: 20px 16px; margin-bottom: 12px; }
.info-principle h3 { margin: 0 0 10px; font-size: 1.2rem; line-height: 1.45; }
.info-principle h3 span { color: var(--primary); }
.info-principle p { margin: 0; color: #3f4756; font-size: .92rem; }
.info-two { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 12px 0; }
.info-box { background: #f5f6f8; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.info-box.is-blue { background: #eef3ff; border-color: #d3e0ff; }
.info-box h4 { margin: 0 0 6px; font-size: .98rem; }
.info-box p { margin: 0; color: #4b5565; font-size: .88rem; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flow li { position: relative; background: #f5f6f8; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 48px; }
.flow li.is-mine { background: #eef3ff; border-color: #a9c1ff; }
.flow b { position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; }
.flow strong { display: block; font-size: .94rem; }
.flow span { display: block; margin-top: 2px; color: var(--muted); font-size: .84rem; }
.flow em { display: block; font-style: normal; font-weight: 700; color: var(--primary); }
.score-bar { display: block; width: 100%; height: auto; margin: 4px 0 8px; }
.score-bar .seg-text { fill: #fff; font-size: 20px; font-weight: 800; }
.seg-explain { fill: #2f6bff; background: #2f6bff; }
.seg-mentions { fill: #0f9d7a; background: #0f9d7a; }
.seg-sns { fill: #f08a1c; background: #f08a1c; }
.bar-legend { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; }
.bar-legend small { color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.score-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.score-table th, .score-table td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.score-table thead th { font-size: .75rem; color: var(--muted); }
.score-table .pt { text-align: right; white-space: nowrap; font-weight: 700; }
.score-table .grp th { background: #f3f6fc; font-size: .9rem; }
.score-table .grp th span { float: right; color: var(--primary); }
.score-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.score-table tfoot th, .score-table tfoot td { background: #f7f9ff; color: #1947c7; font-weight: 800; border-bottom: 0; }
.info-cta { text-align: center; background: linear-gradient(135deg, #edf3ff, #f8faff); border: 1px solid #dce6ff; border-radius: 16px; padding: 24px 16px; margin-top: 20px; }
.info-cta h3 { margin: 0; font-size: 1.2rem; }
.info-cta p { margin: 6px 0 14px; color: var(--muted); font-size: .9rem; }
.info-cta .btn { max-width: 320px; margin: 0 auto; }
.info-foot { margin-top: 28px; text-align: center; color: #8792a5; font-size: .76rem; line-height: 1.6; }
.flow-5 li { padding-right: 10px; }
.page-brand { margin: 0 0 14px; font-size: 1.1rem; }
.page-brand a, .brand a { color: inherit; text-decoration: none; }
.info-sec:first-of-type { margin-top: 8px; }

/* 첫 화면 폼 아래: 구분선·질문 카드 4개(정사각형 2×2)·소개 카드 (폭은 위 입력 폼과 같은 .wrap) */
.home-below { padding-top: 0; }
.home-sep { border: 0; border-top: 1px solid var(--line); margin: 36px 0 32px; }
.home-sec { margin-bottom: 20px; }
.home-h { margin: 0 0 12px; font-size: 1.05rem; }
.qcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qcard {
  display: flex; flex-direction: column; justify-content: flex-start; gap: 10px;
  aspect-ratio: 1 / 1; padding: 14px; overflow: hidden;
  background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.qcard:hover, .qcard:focus-visible { transform: translateY(-4px); box-shadow: 0 8px 18px rgba(47,107,255,.16); }
.qcard-no { font-size: .78rem; font-weight: 800; color: var(--primary); }
.qcard-q { font-size: .98rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.home-more { margin: 10px 2px 0; text-align: right; font-size: .85rem; }
.home-more a { color: var(--muted); text-decoration: none; }
.home-more a:hover { color: var(--primary); }
.about-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.about-card:hover, .about-card:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(47,107,255,.16); }
.about-ico { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: #eef3ff; color: var(--primary); }
.about-txt { flex: 1; min-width: 0; }
.about-txt strong { display: block; font-size: 1rem; }
.about-txt span { display: block; margin-top: 2px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.about-arrow { flex: none; font-size: 1.8rem; color: var(--muted); line-height: 1; }
