/* 좋은얼굴신종연치과의원 — treatment pages only (treatment-*.html link it after site.css and page.css; never edit those here).
   A treatment page is a long guide in numbered hanji sheets: a grouped contents list, a comparison that is a table on desk and
   cards on phones, a parts list, a visit timeline, check-box lists that work on a printout, an FAQ in <details>, related cards.
   Body copy stays >= 17px on phones (labels >= 16px); every ink is the site's own (ink, ink-2, timber-ink: >= 6:1 on hanji).
   Grids that change with width use container queries, so the main column's real width decides, with or without the side list. */

:root {
  --slip: rgba(255, 255, 255, .36);                         /* a lighter slip of paper laid on the sheet */
  --slip-edge: inset 0 0 0 1.5px rgba(43, 38, 34, .14);
  --mark-good: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5.4' fill='none' stroke='%2384421F' stroke-width='2.1'/%3E%3C/svg%3E");
  --mark-mind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.6 14 13.2H2z' fill='none' stroke='%235A5048' stroke-width='1.9' stroke-linejoin='round'/%3E%3C/svg%3E");
  --mark-not: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5.6' fill='none' stroke='%235A5048' stroke-width='1.8'/%3E%3Cpath d='M4.2 11.8 11.8 4.2' stroke='%235A5048' stroke-width='1.8'/%3E%3C/svg%3E");
  --mark-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='none' stroke='%235A5048' stroke-width='1.6'/%3E%3Cpath d='M8 4.6V8l2.4 1.6' fill='none' stroke='%235A5048' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------- contents: four groups of numbered links (four columns on desk, two by two on phones) ---------- */
.toc.toc-tx { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule); }
.sub .toc-tx .toc-label { margin-bottom: 12px; }
.toc-tx .toc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.4em), 1fr)); gap: 16px clamp(16px, 2.4vw, 32px); }
.sub .toc-tx .toc-gh { margin: 0 0 2px; font-size: 16px; font-weight: 700; letter-spacing: .04em; color: var(--timber-ink); }
.toc-tx ol { margin: 0; padding: 0; list-style: none; }
.toc-tx li { border-top: 1px solid var(--rule); }
.toc.toc-tx a { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 7px 0; border-radius: 4px; background: none; box-shadow: none;
  font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--ink); text-decoration: none; }
.toc.toc-tx a:hover { background: none; box-shadow: none; }
.toc-tx a:hover .toc-t { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.toc-tx .toc-no { flex: none; min-width: 1.6em; font: 600 15px/1 var(--display); letter-spacing: .04em; color: var(--timber-ink); font-variant-numeric: tabular-nums; }
.toc-tx .toc-t { min-width: 0; }
@media (min-width: 900px) { .toc-tx .toc-groups { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }  /* the groups side by side */

/* ---------- every sheet: its contents number above the heading ---------- */
.sub .tx-sec .sec-no { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; font: 600 16px/1 var(--display); letter-spacing: .1em;
  color: var(--timber-ink); font-variant-numeric: tabular-nums; }
.sub .tx-sec .sec-no::after { content: ""; width: 34px; height: 1.5px; background: currentColor; opacity: .45; }
.sub .tx-sec h3 { font-size: 19px; }
.sub .tx-sec b { font-weight: 700; color: var(--ink); }
.sub .tx-sec .prose p { margin-bottom: 16px; }

/* ---------- 이런 분께: two tick lists, then the "talk to us first" list on its own slip ---------- */
/* the four width-aware blocks are containers on screen only: Chrome will not split a size-contained box across printed pages */
@media screen { .who, .cmp, .parts, .tl { container-type: inline-size; } }
.who-cols { display: grid; gap: 26px 40px; }
@container (min-width: 640px) { .who-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sub .who h3 { margin: 0 0 6px; font: 600 21px/1.45 var(--display); }
.who-first { margin-top: 28px; padding: 24px 26px 20px; border-radius: 12px; background: rgba(43, 38, 34, .045); box-shadow: var(--slip-edge); }
.who-first .dots li { padding-top: 12px; padding-bottom: 12px; }
.who-first .dots li::before { top: calc(12px + .875em - 3.5px); }
.who-first .dots b { display: block; }                          /* the condition on its own line, the reason under it */

/* ---------- 다쳤을 때 (urgent): first aid in numbered steps on one warm slip; calm, not alarm red ----------
   the mark is a plus in a timber disc; the step numbers are filled timber discs, so the order reads at a glance */
.urgent h2 { display: flex; align-items: center; gap: 12px; }
.urgent-mark { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--timber-ink); }
.urgent-mark::before, .urgent-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 4px; margin: -2px 0 0 -8px; border-radius: 1px; background: var(--hanji); }
.urgent-mark::after { transform: rotate(90deg); }
.urgent-box { margin-top: 4px; padding: 24px 26px 22px; border-radius: 12px; background: rgba(255, 251, 243, .74); box-shadow: inset 0 0 0 2px rgba(132, 66, 31, .32); }
.urgent-steps > li { padding-bottom: 20px; }
.urgent-steps > li::before { color: var(--hanji); background: var(--timber-ink); box-shadow: none; }
.urgent-steps > li::after { top: 54px; bottom: 4px; }
.sub .urgent-steps p { margin: 0; padding-top: 9px; }
.sub .tx-sec .urgent-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgba(132, 66, 31, .24); color: var(--ink-2); }

/* ---------- 건강보험: one note under the heading stands for every row ---------- */
.sub .tx-sec .ins-note { margin: -4px 0 14px; color: var(--ink-2); }
.ins-ref, .cmp-pts .tbc, .tl-time .tbc { white-space: nowrap; }   /* a pointer or a short chip never breaks inside itself */

/* ---------- 다른 방법과 비교: cards on phones, a three-column table where the column is wide enough ---------- */
.cmp { margin-top: 4px; --cmp-cols: minmax(0, 1.12fr) minmax(0, 1fr) minmax(0, 1fr); }  /* set outside the query: it cannot style its own container */
.cmp-head { display: none; }
.cmp-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.cmp-opt { padding: 22px 22px 18px; border-radius: 12px; background: var(--slip); box-shadow: var(--slip-edge); }
.cmp-opt.is-this { background: rgba(255, 251, 243, .74); box-shadow: inset 0 0 0 2px rgba(132, 66, 31, .42); }
.sub .tx-sec .cmp-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font: 600 23px/1.35 var(--display); }
.cmp-this { display: inline-block; padding: 5px 11px; border-radius: 999px; font: 700 16px/1.2 var(--font); color: var(--timber-ink); background: rgba(132, 66, 31, .1); }
.sub .cmp-how p { margin: 0; color: var(--ink-2); }
.sub .tx-sec .cmp-label { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.cmp-cell + .cmp-cell { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.cmp-pts { margin: 0; padding: 0; list-style: none; }
.cmp-pts li { position: relative; padding: 3px 0 3px 27px; }
.cmp-pts li::before { content: ""; position: absolute; left: 0; top: calc(3px + .875em - 8px); width: 16px; height: 16px; background: var(--mark-good) center / contain no-repeat; }
.cmp-mind .cmp-pts li::before { background-image: var(--mark-mind); }
@container (min-width: 660px) {
  .cmp-head { display: grid; grid-template-columns: var(--cmp-cols); gap: 0 26px; padding: 0 0 10px; border-bottom: 1.5px solid rgba(43, 38, 34, .32);
    font-size: 16px; font-weight: 700; color: var(--ink-2); }
  .cmp-head span { display: flex; align-items: center; gap: 8px; }
  .cmp-hg::before, .cmp-hm::before { content: ""; flex: none; width: 15px; height: 15px; background: var(--mark-good) center / contain no-repeat; }
  .cmp-hm::before { background-image: var(--mark-mind); }
  .cmp-list { gap: 0; }
  .cmp-opt { display: grid; grid-template-columns: var(--cmp-cols); gap: 0 26px; padding: 20px 0; border-radius: 0; background: none; box-shadow: none;
    border-bottom: 1px solid var(--rule); font-size: 17px; line-height: 1.62; }   /* three columns of short lines: a little tighter */
  .cmp-pts li::before { top: calc(3px + .81em - 8px); }
  /* this page's own row: a tinted slip drawn with a spread shadow, so it takes no layout room and the columns stay aligned */
  .cmp-opt.is-this { margin: 20px 0 14px; padding: 6px 0; border-bottom: 0; border-radius: 2px; box-shadow: 0 0 0 14px rgba(255, 251, 243, .74); }
  .sub .tx-sec .cmp-name { font-size: 22px; flex-direction: column; align-items: flex-start; }
  .sub .tx-sec .cmp-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cmp-cell + .cmp-cell { margin: 0; padding: 0; border: 0; }
}

/* ---------- 재료: a ruled list of parts (name left, what it is right, the caution under a triangle) ---------- */
.parts { margin: 4px 0 0; }
.part { display: grid; gap: 4px 30px; padding: 18px 0; border-top: 1px solid var(--rule); }
.part:first-child { border-top: 0; padding-top: 2px; }
.part:last-child { padding-bottom: 0; }
.part dt { font: 600 22px/1.4 var(--display); }
.part dd { margin: 0; }
.sub .part dd p { margin: 0; }
.sub .part .part-mind { position: relative; margin-top: 10px; padding-left: 27px; color: var(--ink-2); }
.part-mind::before { content: ""; position: absolute; left: 0; top: calc(.875em - 8px); width: 16px; height: 16px; background: var(--mark-mind) center / contain no-repeat; }
@container (min-width: 620px) { .part { grid-template-columns: 8.5em minmax(0, 1fr); } .part dt { padding-top: 1px; } }

/* ---------- 방문 일정: a vertical timeline (when / rail / what); on phones the label sits above ---------- */
.tl { margin: 6px 0 0; padding: 0; list-style: none; }
.tl > li { position: relative; padding: 0 0 24px 38px; }
.tl > li:last-child { padding-bottom: 0; }
.tl > li::before { content: ""; position: absolute; z-index: 1; left: 3px; top: 7px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--hanji); border: 2.5px solid var(--timber-ink); }
.tl > li:first-child::before, .tl > li:last-child::before { background: var(--timber-ink); }
.tl > li::after { content: ""; position: absolute; left: 9.75px; top: 26px; bottom: -3px; width: 1.5px; background: rgba(132, 66, 31, .42); }
.tl > li:last-child::after { display: none; }
.sub .tx-sec .tl-when { margin: 0 0 2px; font: 600 19px/1.5 var(--display); color: var(--timber-ink); }
.sub .tx-sec .tl-what { margin: 0; }
.sub .tx-sec .tl-time { position: relative; margin: 6px 0 0; padding-left: 25px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.tl-time::before { content: ""; position: absolute; left: 0; top: calc(.75em - 8px); width: 16px; height: 16px; background: var(--mark-time) center / contain no-repeat; }
.sub .tx-sec .tl-note { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule); }
@container (min-width: 600px) {
  .tl > li { display: grid; grid-template-columns: 9.5em 44px minmax(0, 1fr); padding: 0 0 26px; }
  .tl-when { grid-column: 1; text-align: right; }
  .tl-body { grid-column: 3; }
  .tl > li::before { left: calc(9.5em + 22px - 7.5px); }
  .tl > li::after { left: calc(9.5em + 22px - .75px); }
}

/* ---------- 어르신·지병: an empty box before each line, to tick on a printout ---------- */
.checks, .nots { margin: 4px 0 0; padding: 0; list-style: none; }
.checks li, .nots li { position: relative; padding: 13px 0 13px 38px; border-top: 1px solid var(--rule); }
.checks li:first-child, .nots li:first-child { border-top: 0; }
.checks li::before { content: ""; position: absolute; left: 1px; top: calc(13px + .875em - 10px); width: 20px; height: 20px; border-radius: 4px;
  background: rgba(255, 255, 255, .5); border: 2px solid var(--ink-2); }                /* a border, not a shadow: it prints */
.nots li::before { content: ""; position: absolute; left: 2px; top: calc(13px + .875em - 9px); width: 18px; height: 18px; background: var(--mark-not) center / contain no-repeat; }
/* the drawn marks are background images, which browsers leave off paper unless asked */
.cmp-pts li::before, .cmp-hg::before, .cmp-hm::before, .part-mind::before, .nots li::before, .tl-time::before, .tl > li::before, .tl > li::after {
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---------- 자주 묻는 질문: <details>, the whole question row is the target ---------- */
.sub .tx-sec .faq-tip { margin: -6px 0 10px; color: var(--ink-2); font-size: 17px; }
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item > summary { display: flex; align-items: flex-start; gap: 12px; min-height: 64px; padding: 16px 2px 16px 0; cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 700; line-height: 1.55; color: var(--ink); border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::marker { content: ""; }
.faq-q { flex: none; width: 1.05em; font: 600 21px/1.45 var(--display); color: var(--timber-ink); }
.faq-qt { flex: 1 1 auto; min-width: 0; }
.faq-ic { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1.5px rgba(43, 38, 34, .3); }
.faq-ic::before, .faq-ic::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 2px; margin: -1px 0 0 -6.5px; border-radius: 1px; background: var(--ink);
  transition: transform .2s; }
.faq-ic::after { transform: rotate(90deg); }
.faq-item[open] > summary .faq-ic::after { transform: rotate(0deg); }        /* plus folds into a minus */
.faq-item > summary:hover .faq-qt { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.faq-item > summary:hover .faq-ic { background: rgba(255, 255, 255, .75); }
.faq-item > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.faq-a { padding: 0 44px 20px calc(1.05em + 12px); }
.sub .faq-a p { margin: 0; }
.faq-item:target > summary .faq-qt, .faq-item[open] > summary .faq-qt { color: var(--ink); }

/* ---------- 함께 보시면 좋은 진료: the overview cards, narrower ---------- */
.cards.rel { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

@media (max-width: 760px) {
  .urgent-box { padding: 20px 16px 18px; }
  .urgent-steps > li::after { top: 50px; }
  .sub .urgent-steps p { padding-top: 7px; }
  .who-first { padding: 20px 18px 16px; }
  .cmp-opt { padding: 20px 18px 16px; }
  .sub .tx-sec .cmp-name { font-size: 22px; }
  .faq-item > summary { font-size: 18px; gap: 10px; }
  .faq-a { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .faq-ic::before, .faq-ic::after { transition: none; } }

/* ---------- print: the contents and the numbers stay (they match), every answer is open, blocks keep together ---------- */
@page { margin: 14mm 13mm; }
@media print {
  .draft { position: static; display: inline-block; margin: 0 0 8pt; }      /* the draft note above the guide, not over its title */
  .sub .tx-sec .faq-tip { display: none; }
  body.sub .toc.toc-tx { display: block !important; margin-top: 10pt; padding-top: 8pt; break-inside: avoid; }
  .toc-tx .toc-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6pt 14pt; }
  .toc.toc-tx a { min-height: 0; padding: 2pt 0; font-size: 10.5pt; }
  .toc-tx .toc-no { font-size: 9.5pt; }
  .sub .tx-sec { break-inside: auto; margin-top: 14pt; }
  .sub .tx-sec h2, .sub .tx-sec .sec-no, .sub .tx-sec h3, .tl-when, .part dt, .faq-item > summary { break-after: avoid; page-break-after: avoid; }
  .cmp-opt, .part, .tl > li, .faq-item, .steps > li, .facts > div, .ticks li, .dots li, .checks li, .nots li, .cards.rel li { break-inside: avoid; page-break-inside: avoid; }
  .who-cols { display: block; }                    /* a two-column grid row will not split across pages: stacked, it flows */
  .who-col + .who-col { margin-top: 12pt; }
  .cmp-head { break-after: avoid; page-break-after: avoid; }
  .dots li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .who-first, .urgent-box { background: none; box-shadow: none; border: 1px solid #bbb; }
  .urgent-mark, .urgent-mark::before, .urgent-mark::after, .urgent-steps > li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .urgent .urgent-box { break-inside: avoid; page-break-inside: avoid; }
  /* the wide layouts again (no containers on paper): comparison table, parts beside their names, timeline with labels left */
  .cmp-head { display: grid; grid-template-columns: var(--cmp-cols); gap: 0 16pt; padding: 0 0 5pt; border-bottom: 1px solid #888; font-size: 10pt; font-weight: 700; color: var(--ink-2); }
  .cmp-head span { display: flex; align-items: center; gap: 5pt; }
  .cmp-hg::before, .cmp-hm::before { content: ""; flex: none; width: 10pt; height: 10pt; background: var(--mark-good) center / contain no-repeat; }
  .cmp-hm::before { background-image: var(--mark-mind); }
  .cmp-list { gap: 0; }
  .cmp-opt, .cmp-opt.is-this { display: grid; grid-template-columns: var(--cmp-cols); gap: 0 16pt; margin: 0; padding: 9pt 0; border: 0; border-bottom: 1px solid #bbb;
    border-radius: 0; background: none; box-shadow: none; line-height: 1.6; }
  .sub .tx-sec .cmp-name { flex-direction: column; align-items: flex-start; font-size: 13pt; }
  .cmp-this { padding: 1pt 6pt; font-size: 9pt; }
  .sub .tx-sec .cmp-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cmp-cell + .cmp-cell { margin: 0; padding: 0; border: 0; }
  .cmp-pts li::before { top: calc(3px + .8em - 7px); width: 13px; height: 13px; }
  .cmp-pts li { padding-left: 20px; }
  .part { grid-template-columns: 7.5em minmax(0, 1fr); padding: 9pt 0; }
  .part dt { font-size: 13pt; }
  .tl > li { display: grid; grid-template-columns: 8em 36px minmax(0, 1fr); padding: 0 0 9pt; }
  .tl-when { grid-column: 1; text-align: right; }
  .tl-body { grid-column: 3; }
  .tl > li::before { left: calc(8em + 18px - 7.5px); top: 3pt; }
  .tl > li::after { left: calc(8em + 18px - .75px); top: calc(3pt + 19px); }
  .sub .tx-sec .tl-when { font-size: 12pt; }
  .sub .tx-sec .tl-time { margin-top: 2pt; font-size: 10.5pt; }
  .faq-item > summary { min-height: 0; padding: 8pt 0 3pt; font-size: 11.5pt; }
  .faq-ic { display: none; }
  .faq-a { padding: 0 0 8pt calc(1.05em + 12px); }
  .tx-card { box-shadow: none; border: 1px solid #bbb; }
  .tx-card .tx-more { display: none; }
  .tl > li::before { background: #fff; }
  .tl > li:first-child::before, .tl > li:last-child::before { background: var(--timber-ink); }
}
/* a closed <details> keeps its answer out of the layout; on paper it shows (Chrome 131+, Safari 18.4+; js opens them too) */
@media print { details.faq-item::details-content { content-visibility: visible; display: contents; } }
