:root {
  color-scheme: dark;
  --page: #0a1829;
  --navy: #0f2238;
  --surface: #11263c;
  --raised: #192f46;
  --line: #33485d;
  --control-line: #536980;
  --ivory: #f7f4ec;
  --text: #d7e1eb;
  --muted: #adbdcc;
  --gold: #d9bf8c;
  --gold-light: #efd5a0;
  --gutter: clamp(20px, 4.7vw, 72px);
  --content: 1312px;
  --radius: 12px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23d9bf8c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 100%;
  color: var(--ivory);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; line-height: 1.6; word-break: keep-all; overflow-wrap: break-word; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: transparent; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 4px; }
::selection { color: var(--page); background: var(--gold); }
svg { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wrap, .header-inner { width: 100%; max-width: var(--content); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Masthead */
.header { position: sticky; top: 0; z-index: 8; background: #0b1b2d; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 1.05rem; letter-spacing: -.04em; }
.brand strong { font-weight: 750; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 35px; height: 35px; border: 1px solid #9b8766; border-radius: 8px;
  background: #182b3b; color: var(--gold-light); padding-right: 4px;
  font: italic bold 26px Georgia, serif; letter-spacing: -4px; line-height: 1;
}
.brand-mark span { padding-top: 5px; font-size: .82em; }
nav { display: flex; align-items: center; gap: clamp(13px, 2.5vw, 34px); color: var(--muted); font-size: .9rem; font-weight: 600; }
nav a, nav button { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
nav a:hover, nav button:hover, nav .nav-active { color: var(--gold-light); }
nav a.nav-active { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 9px; }
#saved-count { margin-left: 5px; padding: 0 6px; border-radius: 4px; background: var(--raised); color: var(--text); font-size: .75rem; }

/* City photograph and introduction */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy); border-bottom: 1px solid #3c4651; }
.hero-photo { position: absolute; inset: 0 0 0 auto; z-index: -2; width: 76%; height: 100%; object-fit: cover; object-position: center 65%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0f2238 10%, #0f2238 26%, rgb(15 34 56 / 93%) 38%, rgb(15 34 56 / 48%) 55%, rgb(10 24 41 / 8%) 78%),
              linear-gradient(0deg, rgb(10 24 41 / 75%), transparent 26%, rgb(10 24 41 / 7%));
}
.hero-inner { position: relative; display: flex; align-items: center; min-height: clamp(325px, 29vw, 420px); padding-block: 48px 52px; }
.hero-copy { max-width: 590px; }
.eyebrow, #dialog-kicker { font: 700 .75rem/1.3 -apple-system, BlinkMacSystemFont, Arial, sans-serif; letter-spacing: .17em; color: var(--gold); }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.hero h1 { margin: 14px 0; font-size: clamp(2.4rem, 3.85vw, 3.8rem); line-height: 1.19; letter-spacing: -.065em; font-weight: 800; }
.hero h1 span { color: var(--gold-light); }
.hero p { color: #dee6ef; font-size: 1rem; line-height: 1.75; letter-spacing: -.025em; }
.hero-link, .button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 43px; border: 1px solid; border-radius: 8px; padding: 8px 14px; font-size: .9rem; font-weight: 700; line-height: 1.4; }
.hero-link, .button.primary, .chip.active { background: var(--gold); border-color: var(--gold); color: #102237; }
.hero-link { margin-top: 23px; min-height: 45px; padding-inline: 22px; }
.hero-link:hover, .button.primary:hover, .chip.active:hover { color: #102237; background: var(--gold-light); border-color: var(--gold-light); }
.photo-credit { position: absolute; right: var(--gutter); bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: #e7e9e9; font-size: .75rem; line-height: 1.5; text-shadow: 0 1px 4px #03101d; }
.photo-credit a { text-decoration: underline; text-decoration-color: #89949d; text-underline-offset: 2px; }

/* Directory and comparison controls */
.directory { padding-block: clamp(38px, 4vw, 62px) 70px; }
.section-heading, .results-toolbar, .card-top, .card-meta, .dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; }
.section-heading, .results-toolbar { flex-wrap: wrap; }
.section-heading { align-items: flex-end; margin-bottom: 22px; }
.section-heading h2 { display: flex; align-items: baseline; gap: 9px; margin-top: 7px; font-size: clamp(1.55rem, 2.6vw, 2.25rem); line-height: 1.3; letter-spacing: -.055em; }
#total-count { color: var(--gold); font: normal 1.5rem/1 Georgia, serif; letter-spacing: -.03em; }
.update-label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .875rem; }
.update-label time, .source-date, .offer-date { font-variant-numeric: tabular-nums; }
.calendar-icon { display: inline-block; width: 13px; height: 12px; margin-top: 1px; border: 1px solid; border-radius: 2px; }
.calendar-icon::before { content: ""; display: block; margin-top: 3px; border-top: 1px solid; }
.search-row { display: grid; grid-template-columns: minmax(200px, 1fr) auto; align-items: stretch; gap: 12px; }
.search-box, .price-controls label { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 48px; border: 1px solid var(--control-line); border-radius: 9px; background: var(--navy); }
.search-box { padding: 0 15px; }
.search-box > svg { color: var(--gold); width: 20px; height: 20px; }
.search-box input { width: 100%; min-width: 0; padding: 11px 0; background: transparent; outline: none; border: 0; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box:focus-within, .price-controls label:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.search-box kbd { padding: 1px 7px; background: var(--raised); border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.price-controls { display: flex; gap: 10px; }
.price-controls label { gap: 4px; padding-left: 13px; color: var(--muted); font-size: .875rem; }
select {
  appearance: none; border: 0; border-radius: 5px; cursor: pointer; background-color: transparent;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 12px center;
  padding: 9px 34px 9px 8px; color: var(--ivory); font-weight: 650;
}
select option { color: var(--ivory); background: var(--navy); }
.price-controls select { min-width: 80px; min-height: 46px; color: var(--gold-light); font-size: 1rem; }
.price-controls select:focus-visible { outline: none; }
.filter-row { padding: 15px 0 20px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 34px; padding: 5px 14px; border-radius: 30px; background: var(--navy); border: 1px solid var(--line); color: var(--text); font-size: .875rem; font-weight: 600; }
.chip:hover { border-color: var(--gold); color: var(--gold-light); }
.chip.active { border-color: var(--gold); background: var(--gold); color: #102237; }
.results-toolbar { margin-block: 13px 11px; }
.result-count { color: var(--text); font-size: .9rem; }
.result-count strong { color: var(--ivory); }
#price-count:not(:empty), #filter-description:not(:empty) { display: inline-block; border-left: 1px solid var(--control-line); padding-left: 9px; margin-left: 6px; color: var(--muted); }
.result-options, .check { display: flex; align-items: center; color: var(--text); font-size: .875rem; }
.result-options { gap: 13px; }
.check { min-height: 38px; gap: 7px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.toolbar-divider { width: 1px; height: 13px; background: var(--line); }
.sort-label select { padding-left: 3px; padding-right: 21px; background-position: right 1px center; font-size: .875rem; }
.data-notice { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; margin-bottom: 18px; background: #152a3e; border-left: 2px solid #9d8963; border-radius: 0 5px 5px 0; color: var(--text); font-size: .875rem; }
.data-notice strong { color: var(--gold-light); }
.info-symbol { flex: none; display: inline-grid; place-content: center; width: 15px; height: 15px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font: italic 700 .75rem/1 Georgia, serif; }

/* Clinic cards */
.clinic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.clinic-card { display: flex; flex-direction: column; min-width: 0; padding: clamp(18px, 2vw, 27px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.clinic-card:focus-within { border-color: #93876e; }
.card-top { margin: -5px -5px 10px 0; }
.area-label { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: .875rem; }
.area-label svg { width: 15px; height: 15px; color: var(--gold); }
.save-button, .icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--muted); }
.save-button:hover, .icon-button:hover { color: var(--gold-light); background: var(--raised); }
.save-button.saved { color: var(--gold); }
.save-button.saved svg { fill: currentColor; }
.clinic-card h3 { color: var(--ivory); font-size: clamp(1.15rem, 1.55vw, 1.4rem); letter-spacing: -.045em; line-height: 1.38; }
.name-button { display: block; width: 100%; text-align: left; font-weight: 750; overflow-wrap: anywhere; }
.name-button:hover { color: var(--gold-light); }
.jp-name, .dialog-jp { margin-top: 4px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.badge { display: inline-block; padding: 2px 8px; border: 1px solid #3c556d; border-radius: 5px; background: #1b3349; color: #d6e3ee; font-size: .75rem; line-height: 1.55; font-weight: 600; }
.badge.review { border-color: #655c4b; background: #302e2c; color: var(--gold-light); }
.badge.warning, .detail-label { border-color: #7c5c46; background: #352e2c; color: #f1c7a4; }
.price-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: .8125rem; color: var(--muted); }
.price-label span:first-child { color: var(--ivory); font-weight: 700; }
.price-label span + span::before { content: "·"; padding-right: 7px; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 3px; margin: 3px 0 0; color: var(--gold-light); line-height: 1.35; font-variant-numeric: tabular-nums; }
.price strong { font-size: clamp(1.9rem, 2.7vw, 2.5rem); font-weight: 700; letter-spacing: -.045em; }
.price .yen { font-size: 1.125rem; }
.price .unknown { color: var(--text); font-size: 1.65rem; }
.price-after { padding-left: 4px; color: var(--muted); font-size: .75rem; }
.fee, .card-note { color: var(--muted); font-size: .875rem; }
.card-note { margin: 12px 0 17px; color: var(--text); }
.card-note.caution { color: #f1c7a4; }
.card-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-meta { flex-wrap: wrap; gap: 2px 6px; margin-bottom: 8px; color: var(--muted); font-size: .8125rem; }
.card-meta button { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; color: var(--gold-light); font-size: inherit; }
.card-meta svg { width: 14px; height: 14px; }
.card-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }
.button { border-color: var(--control-line); background: transparent; color: var(--text); }
.button:hover { border-color: var(--gold); color: var(--ivory); background: var(--raised); }
.button.primary { border-color: var(--gold); background: var(--gold); color: #102237; }
.button.soft { border-color: #9a8766; color: var(--gold-light); background: #222d35; }
.button.soft:hover { border-color: var(--gold-light); background: #30383b; }
.loading, .empty-state { grid-column: 1 / -1; padding: 40px 20px; text-align: center; border: 1px dashed var(--control-line); border-radius: var(--radius); color: var(--text); }
.empty-icon { font-size: 2.25rem; color: var(--gold); }
.empty-state p { margin: 5px 0 14px; }
[hidden] { display: none !important; }

/* Footer and detail sheets */
.footer { border-top: 1px solid var(--line); background: #091523; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 25px; padding-block: 30px; }
.footer p, .footer-right { font-size: .8125rem; color: var(--muted); }
.footer p { margin-top: 8px; }
.footer-right { display: flex; flex-wrap: wrap; gap: 9px 16px; justify-content: flex-end; }
.footer-right > span { flex-basis: 100%; text-align: right; font-size: .75rem; letter-spacing: .09em; }
.footer-right a, .footer-right button { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

dialog { width: min(640px, calc(100% - 28px)); max-height: 86vh; max-height: 86dvh; padding: 0; border: 1px solid var(--control-line); border-radius: 16px; background: var(--surface); color: var(--ivory); box-shadow: 0 20px 80px #010b15a8; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(3 11 20 / 79%); }
.dialog-top { position: sticky; top: 0; z-index: 1; background: var(--navy); border-bottom: 1px solid var(--line); padding: 7px 20px; }
.icon-button { color: var(--ivory); }
#dialog-content { padding: clamp(20px, 3vw, 32px); }
#dialog-title { margin: 5px 0; letter-spacing: -.045em; font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.35; }
.detail-price, .review-item { padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--navy); }
.detail-price { border-color: #6a614e; }
.detail-price .fee { margin-top: 4px; }
.inline-source, .source-list a { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
.inline-source { font-size: .875rem; font-weight: 600; }
.source-date, .offer-date, .review-date { color: var(--muted); font-size: .8125rem; }
.source-date { display: inline-block; margin-left: 10px; }
.detail-section { padding-block: 24px; border-bottom: 1px solid var(--line); scroll-margin-top: 58px; }
.detail-section:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-section h3 { margin-bottom: 8px; font-size: 1.1875rem; letter-spacing: -.035em; }
.detail-section p, .detail-section li, .about-intro { color: var(--text); line-height: 1.75; }
.detail-section p + p, .review-item p { margin-top: 6px; }
.detail-section ul { padding-left: 21px; }
.detail-links, .source-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source-list { flex-direction: column; font-size: .875rem; overflow-wrap: anywhere; }
.detail-label { display: block; margin-top: 12px; padding: 8px 11px; border-radius: 6px; font-size: .875rem; }
.review-count { color: var(--gold); }
.review-item { margin-block: 10px; }
.review-item .inline-source { display: inline-block; margin-top: 7px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; width: max-content; max-width: calc(100% - 28px); padding: 10px 18px; opacity: 0; pointer-events: none; transform: translate(-50%, 5px); border: 1px solid var(--gold); border-radius: 8px; background: var(--navy); color: var(--ivory); font-size: .9rem; transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 990px) {
  .clinic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-photo { width: 82%; }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 82px; }
  .header-inner { min-height: 60px; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: .95rem; gap: 7px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 7px; font-size: 23px; }
  nav { gap: 12px; font-size: .8125rem; }
  nav a.nav-active { text-underline-offset: 6px; }
  .hero-inner { min-height: 320px; padding-block: 34px 51px; }
  .hero-photo { width: 100%; object-position: 55% 68%; }
  .hero::before { background: linear-gradient(90deg, rgb(10 24 41 / 95%) 0, rgb(10 24 41 / 87%) 37%, rgb(10 24 41 / 36%) 88%), linear-gradient(0deg, rgb(10 24 41 / 93%), transparent 34%); }
  .hero h1 { margin-block: 12px; font-size: clamp(2.05rem, 7.5vw, 2.8rem); }
  .hero p { font-size: .9375rem; }
  .photo-credit { font-size: .75rem; gap: 3px; }
  .hero-link { margin-top: 18px; }
  .directory { padding-top: 33px; }
  .section-heading { margin-bottom: 17px; }
  .section-heading h2 { margin-top: 5px; }
  .search-row { grid-template-columns: 1fr; gap: 9px; }
  .price-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .price-controls label { justify-content: space-between; }
  .price-controls select { flex: 1; min-width: 0; }
  .filter-row { padding-block: 12px 15px; }
  .chip { padding-inline: 11px; }
  .results-toolbar { gap: 3px 12px; }
  .result-options { margin-left: auto; gap: 8px; }
  .clinic-grid { grid-template-columns: 1fr; gap: 12px; }
  .clinic-card { padding: 20px; }
  .footer-right { justify-content: flex-start; }
  .footer-right > span { text-align: left; }
}
@media (max-width: 400px) {
  .header-inner { column-gap: 10px; row-gap: 0; justify-content: flex-start; padding-block: 6px; }
  nav { gap: 10px; }
  .desktop-break { display: none; }
  .hero-inner { padding-bottom: 53px; }
  .photo-credit { right: auto; left: var(--gutter); }
  .update-label { font-size: .8125rem; }
}
@media (max-width: 360px) {
  html { scroll-padding-top: 98px; }
  nav a, nav button { min-height: 34px; }
  .result-options { margin-left: 0; }
  .toolbar-divider { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
