/* 자료 페이지(용어 사전 · 숫자로 보는 암 · 치료법) 공통 스타일 — 메인 페이지와 같은 PB 톤 */
:root {
  --ivory: #faf9f6;
  --sand: #f5f2eb;
  --navy: #162436;
  --navy-2: #22344d;
  --accent: #8c6d46;
  --accent-soft: #f1eadf;
  --card: #ffffff;
  --text: #1e2530;
  --muted: #6e6a63;
  --line: #e7e1d6;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--ivory); color: var(--text); line-height: 1.65; word-break: keep-all;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* 상단 바 */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  max-width: 480px; margin: 0 auto; padding: 12px 16px; background: rgba(250, 249, 246, .94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top .back { font-size: 15px; font-weight: 700; color: var(--navy); padding: 4px 0; }
.top .home { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--accent); }

.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; }
section { margin-top: 28px; }
.hero { margin-top: 26px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--accent); }
h1 { font-family: var(--serif); font-size: 27px; font-weight: 700; color: var(--navy); letter-spacing: -0.5px; margin-top: 4px; }
h2 { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: -0.4px; margin: 26px 0 4px; }
section > h2:first-child { margin-top: 0; }
h3 { font-size: 16px; font-weight: 800; color: var(--navy); }
.desc { font-size: 15.5px; color: #3c4350; margin-top: 8px; padding-bottom: 14px; border-bottom: 2px solid var(--navy); }
.base { font-size: 13px; color: var(--muted); margin-top: 10px; }
.sub { font-size: 14px; color: var(--muted); margin-bottom: 12px; }

/* 검색 · 분류 */
.search {
  width: 100%; font: inherit; font-size: 17px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--text); outline: none;
}
.search:focus { border-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chips button, .seg button {
  font: inherit; font-size: 14.5px; font-weight: 700; color: var(--navy-2); background: var(--sand);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; cursor: pointer;
}
.chips button.on, .seg button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.count { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.seg { display: flex; gap: 6px; margin-bottom: 14px; }
.seg.wide { margin-top: 22px; }
.seg.wide button { flex: 1; padding: 11px 0; font-size: 15.5px; border-radius: 12px; }

/* 아코디언 (용어 · 치료) */
.list, .treats { display: grid; gap: 8px; margin-top: 12px; }
.term, .treat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: box-shadow .3s; }
.term.hit { box-shadow: 0 0 0 2px var(--accent); }
.term summary, .treat summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 40px 14px 16px; position: relative;
}
.term summary::-webkit-details-marker, .treat summary::-webkit-details-marker { display: none; }
.term summary::after, .treat summary::after { content: "+"; position: absolute; right: 16px; font-size: 20px; color: var(--muted); }
.term[open] summary::after, .treat[open] summary::after { content: "−"; }
.tt { font-size: 16.5px; font-weight: 800; color: var(--navy); }
.tg { font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.badge { font-size: 12px; font-weight: 700; color: #7a5c36; border: 1px solid #d9c7ab; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.tb { padding: 0 16px 16px; font-size: 15px; color: #2c323d; }
.tb p + p { margin-top: 10px; }
.tb p b { display: block; font-size: 13.5px; color: var(--accent); margin-bottom: 2px; }
.tb .note { background: var(--sand); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; }
.tb .note b { display: inline; margin: 0 6px 0 0; }
.rel { font-size: 14px; color: var(--muted); }
.rel a, .rel span { display: inline-block; margin: 4px 6px 0 0; font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--navy); }
.rel span { color: var(--muted); border-color: transparent; }
.rel b { display: inline !important; }
.empty { text-align: center; color: var(--muted); padding: 20px 0; }

/* 숫자 타일 */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; }
.tiles span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tiles b { display: block; font-size: 19px; font-weight: 800; color: var(--navy); margin-top: 4px; letter-spacing: -0.3px; }
.tiles small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.tiles.big { grid-template-columns: 1fr; }
.tiles.big > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 10px; padding: 14px 16px; }
.tiles.big span { font-size: 14px; grid-column: 1; }
.tiles.big b { font-size: 24px; grid-column: 2; grid-row: 1 / span 2; margin: 0; text-align: right; }
.tiles.big small { grid-column: 1; font-size: 13px; }

/* 막대: 한 계열이라 범례 없이 제목이 이름, 값은 막대 끝에 글자로 */
.bars { list-style: none; display: grid; gap: 7px; }
.bars li { display: grid; grid-template-columns: 52px 1fr 66px; align-items: center; gap: 8px; font-size: 14px; }
.bv small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.2; }
.fact.howto { background: var(--sand); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.fact.howto b { margin-right: 0; }
.bl { color: var(--muted); font-weight: 700; }
.bt { height: 14px; background: var(--sand); border-radius: 4px; overflow: hidden; }
.bt i { display: block; height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; }
.bv { text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.fact { font-size: 14.5px; color: #3c4350; margin-top: 10px; }
.fact b { color: var(--navy); margin-right: 6px; }
.fact small { color: var(--muted); }
.src { margin-top: 8px; font-size: 12.5px; }
.src a { display: inline-block; margin-right: 10px; color: var(--muted); border-bottom: 1px solid var(--line); }

.ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ranks > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.ranks h3 { font-size: 14px; color: var(--accent); margin-bottom: 6px; }
.ranks ol { list-style: none; display: grid; gap: 3px; font-size: 14px; }
.ranks ol b { display: inline-block; width: 20px; color: var(--muted); font-weight: 700; }

.ctype { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.ctype h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 10px; }
.ctype .tiles > div { background: var(--sand); border: 0; }
.story { margin: 12px 0 0 18px; display: grid; gap: 6px; font-size: 14.5px; color: #2c323d; }
.story a { font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }

.tbl { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
th, td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--line); }
thead th { background: var(--sand); font-size: 13px; color: var(--muted); }
tbody th { color: var(--navy); white-space: nowrap; }
td:last-child { white-space: nowrap; }

.warn { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: 14.5px; color: #3c3326; margin-top: 14px; }
.basis { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.basis h2 { font-size: 17px; }
.basis h3 { font-size: 14px; color: var(--navy); margin-top: 14px; }
.basis p + p { margin-top: 8px; }
.basis ul { margin: 6px 0 0 18px; display: grid; gap: 6px; }
.basis b { color: var(--text); }

.foot { margin-top: 36px; padding: 18px 0 0; border-top: 2px solid var(--navy); font-size: 13px; color: var(--muted); }
.foot p + p { margin-top: 6px; }
.others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.others a { font-size: 14px; font-weight: 700; color: var(--navy); background: var(--sand); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }

@media (max-width: 360px) {
  .tiles, .ranks { grid-template-columns: 1fr 1fr; }
}

/* 메인 페이지의 아래에서 올라오는 창 안에서 볼 때: 상단 바·다른 페이지 링크 숨김 */
.embed .top, .embed .others { display: none; }
.embed .hero { margin-top: 14px; }
.embed body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.ctype .tiles.big > div { background: var(--sand); }
