@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&family=Noto+Serif+KR:wght@500;600;700&display=swap');

:root {
  --navy: #102439;
  --navy-dark: #0b1929;
  --ink: #172b40;
  --muted: #526071;
  --gold: #e6c898;
  --gold-dark: #886133;
  --cream: #fbfaf7;
  --line: #e2e3e2;
  --sans: "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Batang", serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 25px; }
body { margin: 0; color: var(--ink); background: #fff; font: 400 1rem/1.7 var(--sans); word-break: keep-all; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #a57538; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.05em; }
.wrap { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip { position: fixed; left: 15px; top: -100px; padding: 10px 20px; background: white; z-index: 3; }
.skip:focus { top: 10px; }

.header { background: #fff; border-bottom: 1px solid #dddfe2; }
.header-inner { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; line-height: 1.35; font-size: .98rem; text-decoration: none; white-space: nowrap; }
.brand strong { font-size: 1.15rem; }
.brand small { display: block; color: var(--muted); font-size: .74rem; margin-top: 4px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--navy); color: var(--gold); border: 3px double var(--gold); font: 1.4rem var(--serif); }
.header nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 38px); }
.header nav a { font-size: .93rem; font-weight: 600; text-decoration: none; }
.header nav a:hover, .underlink:hover { color: var(--gold-dark); }

.hero {
  color: white;
  background:
    linear-gradient(90deg, #0b1929 0%, #11273b 38%, #13283ce8 66%, #0b1929d8),
    url("assets/architecture.jpg") center 48% / cover;
  border-bottom: 4px solid #c6a474;
}
.hero-grid { min-height: 498px; display: grid; grid-template-columns: 1.18fr .82fr; gap: clamp(35px, 7vw, 110px); align-items: center; padding-block: 65px; }
.eyebrow { color: var(--gold-dark); font-size: .87rem; font-weight: 700; letter-spacing: .07em; margin: 0 0 12px; }
.hero .eyebrow { color: var(--gold); display: flex; gap: 12px; align-items: center; }
.hero .eyebrow span { width: 22px; height: 1px; background: var(--gold); }
.hero h1 { margin: 0 0 22px; font-size: clamp(2.5rem, 4.65vw, 4.3rem); line-height: 1.28; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero-intro > p:not(.eyebrow) { color: #dee7ed; line-height: 1.85; margin-bottom: 30px; }
.button { display: inline-flex; justify-content: center; align-items: center; font-weight: 700; text-decoration: none; border: 1px solid transparent; padding: 11px 19px; border-radius: 4px; font-size: .94rem; text-align: center; }
.primary { background: var(--navy); color: #fff; }
.primary:hover { background: #203d57; }
.hero .primary { background: var(--gold); color: var(--navy); }
.hero .primary:hover { background: #f5dbaf; }
.emergency { background: #f9f5ec; color: var(--navy); padding: clamp(22px, 3.3vw, 40px); border-top: 4px solid #bc8951; border-radius: 5px; box-shadow: 0 15px 32px #0003; }
.emergency-label { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: .88rem; color: #854417; margin-bottom: 15px; }
.emergency-label span { display: grid; place-items: center; height: 23px; width: 23px; border-radius: 50%; background: #f1e1cf; flex: none; }
.emergency h2 { font-size: clamp(1.32rem, 2.4vw, 2rem); line-height: 1.55; margin-bottom: 14px; }
.emergency ol { padding-left: 22px; margin: 0 0 16px; color: #394b5a; font-size: .91rem; }
.emergency li { padding-left: 3px; margin: 7px 0; }
.emergency a { color: #49341f; text-underline-offset: 4px; font-weight: 700; font-size: .86rem; }

.section { padding-block: 63px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 27px; }
.section-heading h2 { margin: 0; font-size: clamp(1.78rem, 3vw, 2.55rem); line-height: 1.35; }
.underlink { white-space: nowrap; text-underline-offset: 5px; font-size: .9rem; }
.featured-grid, .entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.featured-card, .entry { color: inherit; text-decoration: none; display: block; border: 1px solid var(--line); background: white; border-radius: 6px; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.featured-card:hover, .entry:hover { border-color: #ac8a5b; box-shadow: 0 6px 20px #11243816; }
.featured-card img { display: block; width: 100%; height: 157px; object-fit: cover; filter: saturate(.65) brightness(.82); }
.featured-card:nth-child(2) img { object-position: center 55%; }
.featured-card:nth-child(3) img { object-position: center 62%; }
.featured-card > div, .entry { padding: 20px 22px; }
.entry-tag { color: var(--gold-dark); font-size: .82rem; font-weight: 700; }
.featured-card h3, .entry h3 { margin: 6px 0 7px; font-size: 1.16rem; line-height: 1.55; letter-spacing: -.035em; }
.featured-card p, .entry p { color: var(--muted); margin: 0 0 13px; font-size: .94rem; }
.entry-link { font-size: .83rem; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.category-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.category { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; background: var(--cream); border: 1px solid var(--line); padding: 10px 12px; border-radius: 4px; font-size: .88rem; font-weight: 600; text-decoration: none; }
.category:hover { border-color: #a78252; }
.category span:last-child { color: var(--muted); font-size: .77rem; white-space: nowrap; }
.category b { color: var(--gold-dark); margin-left: 3px; }
.library { background: #f4f6f8; border-block: 1px solid #e2e7eb; }
.searchbar { display: grid; grid-template-columns: 1fr minmax(155px, 22%) auto; gap: 8px; }
.searchbar input, .searchbar select { width: 100%; min-width: 0; padding: 10px 14px; border: 1px solid #c9d1d9; border-radius: 4px; background-color: #fff; color: var(--ink); }
.searchbar input::placeholder { color: #566575; font-size: .9rem; }
#result-count { color: var(--muted); font-size: .9rem; margin: 18px 0 12px; }
.entry { display: flex; flex-direction: column; }
.entry .entry-link { margin-top: auto; }
.no-results { grid-column: 1 / -1; margin: 14px 0; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px 0 0; }
.pagination button { background: white; color: var(--ink); border: 1px solid #c9d1d9; padding: 4px 10px; min-width: 35px; border-radius: 4px; }
.pagination button.active-page { background: var(--navy); color: white; border-color: var(--navy); }
.pagination button:disabled { opacity: .48; }

.article-shell { width: min(820px, calc(100% - 80px)); padding-block: 36px 68px; overflow-wrap: anywhere; }
.breadcrumb { color: #5c6977; font-size: .86rem; margin-bottom: 36px; }
.breadcrumb span { margin-inline: 6px; }
.article-shell h1, main.section > h1 { font-size: clamp(2rem, 4.5vw, 3.55rem); line-height: 1.42; margin-bottom: 24px; }
.article-shell h2 { font-size: clamp(1.32rem, 2.65vw, 1.88rem); line-height: 1.5; margin-bottom: 10px; }
.article-shell section { margin-top: 37px; }
.article-shell p, .article-shell ol, .article-shell ul { color: #3a4b5d; line-height: 1.92; }
.article-shell .eyebrow { color: var(--gold-dark); }
.article-shell .lede { font-size: 1.12rem; margin-block: 32px; }
.article-shell ol, .article-shell ul { padding-left: 24px; margin-block: 0 12px; }
.article-shell li { padding-left: 3px; margin: 5px 0; }
.scam-examples { background: var(--cream); border: 1px solid #e6ded0; border-radius: 6px; padding: 19px 22px 10px; }
.scam-examples li { margin-block: 8px; }
.response-steps ol li { margin-block: 8px; }
.article-contact { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 21px 23px; border: 1px solid #dfd4c2; border-left: 4px solid #af8855; border-radius: 5px; background: #fbf8f0; }
.article-contact p { margin: 5px 0 0; color: #435263; font-size: .92rem; line-height: 1.7; }
.article-contact .consult { background: #fff; color: var(--navy); border-color: #a9916d; white-space: nowrap; }
.article-contact .consult:hover { background: #f0e3cd; }
.after-content { background: var(--navy); color: white; border-color: var(--navy); border-left-color: #c6a474; }
.after-content p { color: #e0e8ee; }
.after-content .consult { background: var(--gold); border-color: var(--gold); }
.article-shell .after-content { margin-top: 32px; }
.article-shell .sources { padding-block: 19px 4px; border-top: 1px solid var(--line); }
.sources p { font-size: .93rem; }
.sources a, .related a, .all-group a { text-underline-offset: 4px; }
.limit, .line-panel { background: #f2f5f7; border-left: 3px solid #9daebb; padding: 17px 20px; }
.limit p, .limit ul { margin-bottom: 0; }
.line-panel { margin-bottom: 22px; }
.intake-form { padding: clamp(18px, 4vw, 34px); margin: 27px 0 30px; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 12px 25px #1024390b; }
.intake-form label { display: block; font-size: .96rem; font-weight: 700; }
.intake-form label > span { color: var(--gold-dark); font-weight: 700; margin-left: .35em; font-size: .76rem; }
.intake-form label > small { display: block; margin-top: 5px; color: var(--muted); font-size: .81rem; font-weight: 400; }
.intake-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 19px; }
.intake-form :is(input:not([type="checkbox"]), select, textarea) { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: 400 1rem / 1.55 var(--sans); color: var(--ink); background: #fff; border: 1px solid #b6c0ca; border-radius: 4px; }
.intake-form textarea { resize: vertical; min-height: 120px; }
.intake-form :is(input:not([type="checkbox"]), textarea)::placeholder { color: #687587; }
.intake-consent { margin: 22px 0; padding: 15px 17px; background: #f4f6f8; border-radius: 4px; }
.article-shell .intake-consent h2 { font: 700 .96rem / 1.5 var(--sans); letter-spacing: 0; margin: 0 0 5px; }
.intake-consent p { font-size: .83rem; margin-bottom: 12px; }
.intake-form .consent-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-size: .88rem; }
.consent-choice input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy); }
.intake-trap { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
.intake-actions { display: flex; }
.intake-actions .button { min-width: 170px; }
.intake-actions .button:disabled { opacity: .65; }
.intake-result { margin: 14px 0 0; padding: 10px 13px; border-radius: 4px; background: #fbf0e8; }
.intake-result[data-success="true"] { background: #eaf4ee; }
.inbox-entry { margin: 16px 0; border: 1px solid var(--line); border-radius: 6px; padding: 17px 20px; }
.inbox-entry time, .inbox-entry small { color: var(--muted); font-size: .83rem; }
.inbox-entry p { margin: 8px 0; }
.inbox-entry .inbox-message { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 0; }
.inbox-entry summary { color: var(--muted); cursor: pointer; font-size: .83rem; margin-top: 12px; }
.inbox-entry form { margin-top: 9px; }
.inbox-pages { display: flex; gap: 15px; margin-top: 24px; }
.welcome-dialog { width: min(550px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 30px); margin: auto; padding: 0; color: var(--ink); background: white; border: 0; border-radius: 14px; box-shadow: 0 24px 90px #0b192968; overflow: hidden; }
.welcome-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.welcome-dialog::backdrop { background: rgb(10 24 39 / 62%); }
body:has(.welcome-dialog[open]) { overflow: hidden; }
.welcome-heading { position: relative; padding: 29px 34px 17px; border-top: 4px solid #c6a474; }
.welcome-heading .eyebrow { padding-right: 27px; margin: 0 0 8px; font-size: .79rem; }
.welcome-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.27; }
.welcome-close { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #f2f5f8; color: #29394a; font: 1.65rem/1 var(--sans); }
.welcome-close:hover { background: #e4ebf1; }
.welcome-copy { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 34px; color: #253548; font-size: .94rem; line-height: 1.75; scrollbar-width: thin; }
.welcome-copy p { margin: 0 0 15px; }
.welcome-copy strong, .welcome-copy .welcome-signoff { color: var(--navy); font-weight: 700; }
.welcome-copy .welcome-signoff { margin: 10px 0 16px; }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 27px 23px; border-top: 1px solid #e6edf2; }
.welcome-actions .button { min-height: 49px; padding: 8px; border: 0; border-radius: 7px; font-size: .94rem; }
.welcome-online { background: linear-gradient(120deg, #dff1ff, #87c4f5); color: #0d2a46; }
.welcome-online:hover { background: linear-gradient(120deg, #d3eaff, #73b7ee); }
.welcome-intake { background: linear-gradient(120deg, #2167a8, #10294f); color: #fff; }
.welcome-intake:hover { background: linear-gradient(120deg, #1b548e, #0f2647); }
.chat-launcher {
  position: fixed; z-index: 65; bottom: max(18px, env(safe-area-inset-bottom)); right: 20px;
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px 9px 10px;
  color: #fff; background: #112c47; border: 1px solid #254362; border-radius: 999px;
  box-shadow: 0 5px 18px #10243938; text-decoration: none; font-size: .85rem; font-weight: 700;
}
.chat-launcher-icon { position: relative; display: grid; place-items: center; width: 23px; height: 19px; border-radius: 5px; color: #112c47; background: #f0dbb9; font: 700 .7rem/1 var(--sans); }
.chat-launcher-icon::after { content: ""; position: absolute; left: 4px; bottom: -3px; border: 4px solid transparent; border-top-color: #f0dbb9; border-left: 0; }
.chat-panel { position: fixed; z-index: 66; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 54px); right: 20px; width: min(416px, calc(100vw - 32px)); height: min(745px, calc(100dvh - 90px)); border: 1px solid #cfd9e2; border-radius: 13px; box-shadow: 0 16px 50px #10243945; background: white; overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel iframe { display: block; width: 100%; height: 100%; border: 0; }
.support-nav { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 20px; }
.support-nav a { text-underline-offset: 4px; }
.support-reference { color: var(--muted); overflow-wrap: anywhere; font-size: .82rem; }
.support-details { padding: 12px 14px; background: #eef4f8; border-radius: 4px; }
.support-threads { list-style: none; padding: 0 !important; }
.support-threads a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.support-threads a:hover { background: #f1f5f9; }
.support-threads span { color: var(--muted); font-size: .85rem; }
.support-transcript { display: flex; flex-direction: column; gap: 10px; min-height: 175px; max-height: min(51dvh, 440px); padding: 15px; overflow-y: auto; overscroll-behavior: contain; background: #f4f6f8; border: 1px solid var(--line); border-radius: 6px; }
.support-bubble { width: fit-content; max-width: 90%; padding: 9px 13px; border: 1px solid #dce2e9; border-radius: 5px; background: white; }
.support-bubble.staff { align-self: flex-end; background: #e9f2fa; border-color: #cddfea; }
.support-bubble header { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: .82rem; }
.support-bubble time { color: var(--muted); font-size: .76rem; }
.support-bubble p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-composer { margin: 15px 0 24px; padding: 16px; }
.support-composer button { margin-top: 14px; }
.related { border-top: 1px solid var(--line); padding-top: 20px; }
.all-group { margin-bottom: 40px; }
.all-group li { margin-bottom: 4px; }
.footer { color: #e3eaf0; background: var(--navy-dark); padding: 35px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.footer p { color: #aab6c2; margin: 5px 0 0; font-size: .85rem; }
.footer a { display: inline-block; margin-left: 20px; font-size: .85rem; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 48px); }
  .article-shell { width: min(820px, calc(100% - 48px)); }
  .hero-grid { gap: 26px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 670px) {
  .wrap, .article-shell { width: calc(100% - 32px); }
  .header-inner { justify-content: center; flex-wrap: wrap; gap: 13px; padding-block: 13px; }
  .header nav { width: 100%; justify-content: center; flex-wrap: wrap; gap: 8px 14px; }
  .chat-launcher { right: 12px; }
  .header nav a { font-size: .85rem; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 45px 35px; }
  .hero-intro { padding-inline: 3px; }
  .hero-intro > p:not(.eyebrow) { font-size: .96rem; }
  .emergency { padding: 20px; }
  .section { padding-block: 39px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .featured-grid, .entry-grid { grid-template-columns: 1fr; gap: 12px; }
  .featured-card { display: grid; grid-template-columns: 36% 1fr; }
  .featured-card img { height: 100%; min-height: 150px; }
  .featured-card > div, .entry { padding: 14px 16px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .searchbar { grid-template-columns: 1fr auto; }
  .searchbar input { grid-column: 1 / -1; }
  .article-shell { padding-block: 24px 44px; }
  .breadcrumb { margin-bottom: 18px; }
  .article-contact { flex-direction: column; align-items: flex-start; gap: 12px; padding: 15px 16px; }
  .intake-row { grid-template-columns: 1fr; }
  .intake-actions .button { width: 100%; }
  .welcome-heading { padding: 22px 21px 13px; }
  .welcome-copy { padding: 0 21px; font-size: .88rem; line-height: 1.65; }
  .welcome-copy p { margin-bottom: 12px; }
  .welcome-actions { gap: 8px; padding: 11px 16px 15px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer a { margin: 0 16px 0 0; }
}

@media (max-width: 540px) {
  .chat-panel { inset: 7px 7px auto; width: auto; height: calc(100dvh - 14px); border-radius: 11px; }
  body:has(.chat-panel:not([hidden])) { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
