:root {
  color-scheme: light;
  --ink: #142826;
  --muted: #536764;
  --accent: #165e50;
  --accent-dark: #0c493e;
  --navy: #122e30;
  --pale: #edf6f1;
  --line: #d6e2dd;
  --surface: #ffffff;
  --page: #f7f9f7;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans CJK KR", sans-serif;
  --serif: "함초롬바탕", "HCR Batang", "AppleMyungjo", Batang, "Noto Serif CJK KR", serif;
  font: 100%/1.55 var(--sans);
  background: var(--page);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
a { color: var(--accent-dark); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid #3e8265; outline-offset: 4px; }
.skip { position: fixed; top: .6rem; left: .6rem; z-index: 5; padding: .6rem 1rem; background: white; transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 3.5rem, 76rem); margin-inline: auto; }

.site-header { background: var(--navy); color: white; }
.header-layout { display: flex; min-height: 5.15rem; align-items: center; justify-content: space-between; gap: 1.6rem; }
.brand { display: inline-flex; gap: .8rem; align-items: center; font-size: 1.175rem; font-weight: 750; color: white; text-decoration: none; letter-spacing: -.035em; line-height: 1.2; flex-shrink: 0; }
.brand small { display: block; padding-top: .28rem; font-size: .8rem; font-weight: 500; letter-spacing: .01em; color: #c0d8d1; }
.brand-mark { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: .5rem; background: #b8e3ce; color: var(--navy); font: 700 1.8rem/1 Georgia, serif; }
.site-header :focus-visible { outline-color: #b8e3ce; }
.top-nav { background: #1a3939; border-top: 1px solid #365451; }
.top-nav .wrap { display: flex; column-gap: clamp(.35rem, 2.5vw, 2.5rem); }
.top-nav a { padding: .85rem .4rem .7rem; border-bottom: .22rem solid transparent; color: #e3efea; font-size: .945rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.top-nav a[aria-current] { color: #e4ffed; border-color: #ade2c7; }
.top-nav a:hover { color: white; border-color: #72a994; }

.search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: .38rem; background: white; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; padding: .64rem .72rem; }
.search input:focus-visible { outline-offset: -3px; }
.search button { align-self: stretch; display: inline-grid; place-items: center; min-width: 2.7rem; border: 0; border-radius: 0 .3rem .3rem 0; background: transparent; color: var(--accent-dark); }
.search button:hover { background: var(--pale); }
.search-global { min-width: min(100%, 22rem); color: var(--ink); background: #edf6f3; border-color: transparent; }
.search-global input::placeholder { color: #526e67; }
.search-icon { position: relative; block; width: .9rem; height: .9rem; border: 2px solid currentColor; border-radius: 50%; margin: -.14rem .19rem .08rem 0; }
.search-icon::after { position: absolute; bottom: -.25rem; right: -.23rem; width: .38rem; height: 2px; background: currentColor; transform: rotate(48deg); content: ""; }

.masthead { border-bottom: 1px solid var(--line); background: linear-gradient(105deg, #eff7f1 0%, #e6f1eb 100%); }
.hero { position: relative; min-height: 12.6rem; display: grid; grid-template-columns: 1fr auto; gap: .65rem 2rem; align-content: center; padding-block: 2rem; }
.hero-label { grid-column: 1; display: flex; align-items: center; gap: .65rem; font-size: .88rem; color: var(--muted); font-weight: 650; }
.state { display: inline-block; white-space: nowrap; border: 1px solid #aad4bd; border-radius: .27rem; padding: .19rem .48rem; color: #205442; background: #e4f3e7; font-weight: 680; font-size: .875rem; }
.state[data-phase="effective"] { color: white; background: var(--accent); border-color: var(--accent); }
.state[data-phase="held"] { color: #633f1b; border-color: #e1c69f; background: #fff2db; }
.publication-note { margin-top: .8rem; padding: .75rem .9rem; border-left: 3px solid var(--accent); background: var(--pale); }
.publication-note p + p { margin-top: .32rem; }
.notice-dates { margin-block: 1rem; }
.notice-dates > div { display: grid; grid-template-columns: minmax(8rem, 10rem) 1fr; gap: .25rem .65rem; padding-block: .35rem; }
.notice-dates dt { font-weight: 680; }
.enactment-notice h3 { margin-top: 1.05rem; }
.enactment-notice .notice-number { margin: 0 0 .35rem; color: var(--muted); font-weight: 640; }
@media (max-width: 480px) { .notice-dates > div { grid-template-columns: 1fr; } }
.hero h1 { grid-column: 1; font-size: clamp(1.5rem, 3.05vw, 2.55rem); line-height: 1.21; letter-spacing: -.06em; word-break: keep-all; }
.dates { grid-column: 1; display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); font-size: .9rem; }
.dates div { display: flex; gap: .4rem; }
.dates dt { font-weight: 690; }
.hero-button { grid-column: 2; grid-row: 2 / 4; align-self: center; }
.button { padding: .54rem .85rem; min-height: 2.56rem; border-radius: .36rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; width: fit-content; font-size: .9rem; font-weight: 680; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.button-solid { color: white; background: var(--accent); border: 1px solid var(--accent); }
.button-solid:hover { background: var(--accent-dark); }
.button-quiet { color: var(--accent-dark); background: white; border: 1px solid #cbd9d3; }
.button-quiet:hover { background: var(--pale); border-color: #a5c3b5; }

#main { flex: 1; min-width: 0; margin-block: 1.65rem 3rem; }
#main:focus { outline: none; }
.reading-layout { display: grid; grid-template-columns: minmax(12.5rem, 15.5rem) minmax(0, 1fr); align-items: start; gap: 1.5rem; }
.toc { position: sticky; top: .75rem; border-radius: .52rem; border: 1px solid var(--line); background: white; }
.toc-disclosure > summary { min-height: 3.38rem; padding: .86rem 1rem; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 760; }
.toc summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.toc-disclosure > summary::after,
.toc-content summary::after,
.related summary::after { float: right; content: "+"; font-weight: 650; color: var(--accent-dark); }
.toc-disclosure[open] > summary::after,
.toc-content details[open] > summary::after,
.related[open] > summary::after { content: "−"; }
.toc-content { max-height: calc(100vh - 6rem); overflow-y: auto; }
.toc-content details { border-bottom: 1px solid #e9efec; }
.toc-content summary { font-size: .885rem; padding: .57rem 1rem; font-weight: 660; }
.toc-content summary:hover { background: var(--pale); }
.toc-content details[open] > summary { color: var(--accent-dark); background: var(--pale); }
.toc-content ul { list-style: none; padding: .2rem 0 .35rem; }
.toc-content li a { display: block; color: #425955; font-size: .84rem; padding: .31rem .95rem .31rem 1.45rem; text-decoration: none; }
.toc-content li a:hover, .toc-content a[aria-current] { background: #dfeee5; color: var(--accent-dark); }
.toc-other { padding: .4rem 0; }
.toc-asset { display: flex; justify-content: space-between; gap: .3rem; padding: .48rem 1rem; font-size: .875rem; text-decoration: none; font-weight: 650; }
.toc-asset small { color: var(--muted); font-size: .8rem; }
.reader { min-width: 0; }
.reader-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; padding: .72rem .9rem; gap: .65rem; background: #f2f7f3; border: 1px solid var(--line); border-radius: .5rem .5rem 0 0; }
.reader-tools select { width: 100%; min-width: 0; }
.search-local { min-width: 0; }
input:not(.search input), textarea, select { min-height: 2.56rem; padding: .5rem .65rem; border: 1px solid #aabfb5; background: white; border-radius: .36rem; max-width: 100%; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #42645a 50%), linear-gradient(135deg, #42645a 50%, transparent 50%); background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%; background-size: 5px 5px; background-repeat: no-repeat; }
.chapter { border: 1px solid var(--line); margin-top: -.0625rem; background: white; }
.chapter + .chapter { margin-top: 1.2rem; border-radius: .5rem; }
.chapter h2 { padding: 1.05rem clamp(1.1rem, 3vw, 2.55rem) .9rem; font-size: clamp(1.15rem, 2vw, 1.48rem); font-weight: 770; letter-spacing: -.035em; border-bottom: 1px solid var(--line); }
.reader > .button { margin-top: 1rem; }
.article { scroll-margin-top: 1rem; padding: 1.13rem clamp(1.1rem, 3vw, 2.55rem); border-bottom: 1px solid #e8eeea; }
.article:last-child { border-bottom: 0; }
.article:target { background: #f1f8f2; box-shadow: inset 3px 0 var(--accent); }
.article-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .55rem; margin-bottom: .39rem; }
.article h3 { color: var(--ink); font-size: 1.1rem; font-weight: 780; letter-spacing: -.024em; }
.article h3 span { font-weight: 710; }
.article-body { font: 1.04rem/1.85 var(--serif); word-break: keep-all; overflow-wrap: anywhere; }
.article-body p { margin-block: .2rem; }
.copy-link { flex: 0 0 auto; padding: .13rem .4rem; border-radius: .3rem; background: white; color: var(--muted); border: 1px solid var(--line); font-size: .81rem; min-height: 1.78rem; }
.copy-link:hover { background: var(--pale); }
.related { margin-top: .7rem; font-size: .88rem; width: fit-content; max-width: 100%; }
.related summary { font-weight: 650; list-style: none; color: var(--accent-dark); }
.related summary::after { float: none; margin-left: .5rem; }
.related ul { padding: .32rem 0 .15rem 1.25rem; }

.page-title { margin: .65rem 0 1.4rem; }
.breadcrumbs { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; color: var(--muted); font-size: .86rem; }
.page-title h1 { font-size: clamp(1.7rem, 3.4vw, 2.45rem); letter-spacing: -.05em; line-height: 1.27; margin-bottom: .42rem; }
.page-title h1 + p { color: var(--muted); }
.section-nav { display: flex; flex-wrap: wrap; gap: .1rem .45rem; border-bottom: 1px solid var(--line); margin-block: 0 1rem; }
.section-nav a { min-height: 2.6rem; border-bottom: 3px solid transparent; padding: .5rem .72rem; text-decoration: none; font-weight: 660; }
.section-nav a[aria-current], .section-nav a:hover { border-bottom-color: var(--accent); background: var(--pale); }
.panel { padding: clamp(1rem, 3vw, 1.85rem); border: 1px solid var(--line); background: white; border-radius: .52rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.22rem; letter-spacing: -.024em; }
.panel h3 { font-size: 1.02rem; }
.panel > p, .annex-section > p { margin-top: .65rem; }
.panel p + .button { margin-top: .85rem; }
.empty p { color: var(--muted); }
.back-link { display: inline-flex; width: fit-content; font-size: .9rem; margin-bottom: .75rem; }

.filter-bar, .library-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; background: #edf4ef; padding: .85rem; border: 1px solid var(--line); border-radius: .45rem; }
.filter-bar { margin-top: 1rem; }
.filter-bar label, .library-toolbar label { font-size: .9rem; font-weight: 670; }
.filter-status { margin: .7rem 0 .52rem; color: var(--muted); font-size: .9rem; }
.annex-section { margin-top: 1.4rem; }
.annex-section h3 { margin-bottom: .55rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .3rem; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { padding: .58rem .67rem; text-align: left; border-bottom: 1px solid #e1e9e4; }
th { background: #e9f3ed; font-weight: 720; }
td:last-child { min-width: 4.4rem; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f7faf8; }
.grade { display: inline-block; white-space: nowrap; padding: .1rem .42rem; border-radius: .25rem; background: #e6f1ea; font-weight: 690; }
.library-toolbar { align-items: end; }
.library-toolbar > div { display: grid; gap: .3rem; }
.library-toolbar > .button { margin-left: auto; }
.form-list, .result-list, .notice-list, .download-list { list-style: none; padding: 0; }
.form-list, .result-list { background: white; border-radius: .42rem; border: 1px solid var(--line); }
.form-list:empty { display: none; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid #e1e9e5; }
.form-row:last-child, .result-list li:last-child { border-bottom: 0; }
.form-number, .form-refs, .form-version { font-size: .85rem; color: var(--muted); }
.form-row h2 { font-size: 1.11rem; margin-block: .09rem; }
.form-row h2 a { color: var(--ink); text-decoration: none; }
.form-row h2 a:hover { text-decoration: underline; }
.form-actions, .file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.form-actions .button { padding-inline: .58rem; }
.catalog-notes { margin-top: .9rem; font-size: .91rem; color: var(--muted); }
.catalog-notes p + p { margin-top: .6rem; }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.preview-panel { background: #edf3ef; }
.preview-heading { display: flex; gap: .6rem; justify-content: space-between; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.page-preview { display: block; border: 1px solid var(--line); background: white; }
.page-preview img { display: block; width: 100%; height: auto; }
.pdf-frame { width: 100%; min-height: 40rem; border: 1px solid var(--line); background: white; }
.form-info dl { margin-block: .7rem .9rem; }
.form-info dl > div, .contacts > div { display: grid; grid-template-columns: 5.4rem 1fr; gap: .25rem .5rem; margin-block: .57rem; }
.form-info dt, .contacts dt { font-weight: 710; }
.form-info h3 { padding-top: 1rem; margin-top: .9rem; border-top: 1px solid var(--line); }
.form-info p { margin-top: .45rem; }
.history h2 small { margin-left: .25rem; }
.compare > div { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.compare p { white-space: pre-line; }
.download-list { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .9rem; }
.download-list li { display: flex; align-items: center; gap: .4rem; }
.download-list span { color: var(--muted); font-size: .88rem; }
.download-card .button + .button { margin-left: .35rem; }
.feedback-form { display: grid; gap: .55rem; max-width: 35rem; }
.feedback-form label { margin-top: .2rem; font-weight: 730; }
.feedback-form p { color: var(--muted); font-size: .91rem; }
.feedback-form button { margin-top: .38rem; }
.search-page { max-width: 37rem; margin-bottom: 1rem; }
.search-page button { padding-inline: .9rem; font-weight: 690; }
.result-list li { padding: .9rem 1rem; border-bottom: 1px solid #e1e9e5; }
.result-list h2 { font-size: 1.1rem; }
.result-list small, .result-list p { color: var(--muted); font-size: .9rem; }
.result-list p { margin-top: .18rem; }

.site-footer { background: #e9f0ec; border-top: 1px solid var(--line); padding: 1.15rem 0 1.25rem; }
.footer-layout { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; }
.footer-layout p, .footer-layout a { font-size: .875rem; color: #3f5651; }
.footer-layout nav { display: flex; flex-wrap: wrap; gap: .28rem 1rem; }
.footer-layout p { margin-top: .15rem; }

@media (max-width: 760px) {
  .wrap { width: calc(100% - 2rem); }
  .header-layout { min-height: auto; flex-direction: column; align-items: stretch; padding-block: .85rem; gap: .75rem; }
  .brand { width: fit-content; }
  .brand-mark { width: 2.2rem; height: 2.2rem; font-size: 1.5rem; }
  .top-nav .wrap { width: 100%; padding-inline: 1rem; column-gap: .55rem; overflow-x: auto; }
  .top-nav a { font-size: .86rem; padding-block: .65rem .48rem; }
  .hero { display: grid; grid-template-columns: minmax(0, 1fr); min-height: auto; padding-block: 1.2rem; }
  .hero h1 { font-size: clamp(1.43rem, 5.7vw, 2.2rem); line-height: 1.28; }
  .hero-button { grid-column: 1; grid-row: auto; margin-top: .22rem; }
  #main { margin-block: 1rem 2rem; }
  .reading-layout { display: block; }
  .toc { position: static; margin-bottom: .75rem; }
  .toc-content { max-height: min(52vh, 23rem); }
  .toc-disclosure:not([open]) > summary { border-bottom: 0; }
  .reader-tools { padding: .65rem; gap: .42rem; }
  .article { padding-block: .9rem; }
  .article-body { line-height: 1.72; }
  .form-row { grid-template-columns: minmax(0, 1fr) auto; }
  .form-actions { grid-column: 1 / -1; }
  .preview-layout { display: flex; flex-direction: column; gap: 0; }
  .preview-layout > * { width: 100%; }
  .form-info { order: -1; }
  .compare > div { grid-template-columns: 1fr; }
  .library-toolbar > .button { margin-left: 0; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 1.5rem); }
  .reader-tools { grid-template-columns: minmax(0, 1fr); }
  .dates { gap: .35rem .63rem; }
  .copy-link { font-size: .75rem; }
}

@media print {
  .site-header, .toc, .reader-tools, .site-footer, .hero-button, .copy-link, .related, .back-link { display: none; }
  .wrap { width: 100%; }
  .reading-layout { display: block; }
  .chapter, .masthead, .chapter h2 { border: 0; background: white; }
  .hero { min-height: auto; }
  .article { break-inside: avoid-page; }
}
