:root {
  --ink: #181c32;
  --muted: #586174;
  --paper: #fff;
  --wash: #f5f7fb;
  --line: #dbe0ea;
  --magenta: #13b0c2;
  --magenta-dark: #0f8d9b;
  --cyan: #13b0c2;
  --yellow: #faa61a;
  --navy: #181c32;
  --purple: #0f8d9b;
  --green: #218f91;
  --orange: #faa61a;
  --red: #d87819;
  --shadow: 0 18px 48px rgba(22, 33, 61, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Bai Jamjuree", sans-serif; font-size: 1rem; line-height: 1.65; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, strong, .button { text-wrap: balance; }
p, li { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 100; padding: .65rem 1rem; background: var(--ink); color: white; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; min-height: 76px; padding: .8rem clamp(1rem, 4vw, 4.5rem); display: flex; align-items: center; gap: 2rem; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(219,224,234,.85); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; text-decoration: none; margin-right: auto; }
.brand img { width: 190px; height: 54px; object-fit: contain; object-position: left center; }
nav { display: flex; gap: 1.5rem; }
nav a { text-decoration: none; font-weight: 600; font-size: .92rem; }
nav a:hover { color: var(--magenta); }
.status-badge { flex: none; display: inline-flex; align-items: center; padding: .24rem .65rem; border-radius: 999px; background: var(--yellow); color: #392d08; font-family: "Bai Jamjuree", sans-serif; font-weight: 700; font-size: .75rem; letter-spacing: .04em; white-space: nowrap; }
.status-badge.mini { font-size: .65rem; }

.hero { min-height: calc(100vh - 76px); padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 7vw, 8rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .78fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; overflow: hidden; background: radial-gradient(circle at 76% 30%, rgba(19,176,194,.16), transparent 30%), linear-gradient(135deg, #fff 55%, #e7f7f9 100%); }
.eyebrow { margin: 0 0 .7rem; color: var(--magenta-dark); font-family: "Bai Jamjuree", sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; font-family: "Bai Jamjuree", sans-serif; font-size: clamp(3rem, 6.2vw, 5.6rem); font-weight: 700; line-height: .96; letter-spacing: -.045em; }
.hero-title-line { display: block; width: fit-content; white-space: nowrap; }
.hero-title-accent { color: var(--magenta); }
.hero-lead { max-width: 650px; margin: 2rem 0 0; color: #384258; font-size: clamp(1.12rem, 2vw, 1.35rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button { min-height: 48px; padding: .7rem 1.1rem; display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 700; line-height: 1.35; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--navy); color: white; box-shadow: 0 9px 20px rgba(24,28,50,.22); }
.button.primary:hover { background: #0b0e1b; }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button.compact { min-height: 40px; padding: .45rem .8rem; font-size: .88rem; }
.hero-visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.mascot-frame { width: min(100%, 430px); aspect-ratio: 4 / 5; padding: 1.1rem; overflow: hidden; border: 2px solid var(--cyan); border-radius: 46% 46% 24px 24px; background: #13b0c2; box-shadow: var(--shadow); }
.mascot { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; border-radius: 42% 42% 16px 16px; }
.hero-number { position: absolute; z-index: 2; left: -1rem; top: 7%; width: 138px; height: 138px; display: grid; align-content: center; justify-items: center; text-align: center; border-radius: 50%; color: white; background: var(--navy); box-shadow: var(--shadow); }
.hero-number strong { font-family: "Bai Jamjuree", sans-serif; font-size: 3.4rem; line-height: .9; }
.hero-number span { max-width: 11ch; margin-top: .45rem; font-size: .78rem; font-weight: 600; line-height: 1.25; }
.hero-note { position: absolute; min-width: 145px; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 10px 30px rgba(22,33,61,.09); }
.hero-note b { color: #c56f00; font-family: "Bai Jamjuree", sans-serif; font-size: 1.35rem; margin-right: .35rem; }
.note-a { top: 15%; right: -1.2rem; }
.note-b { left: -1.5rem; bottom: 10%; }

.notice { margin: 0 clamp(1rem, 7vw, 8rem); padding: 1.1rem 1.35rem; display: flex; gap: 1rem; align-items: baseline; border-left: 5px solid var(--yellow); background: #fff9dd; border-radius: 0 12px 12px 0; }
.notice p { margin: 0; color: #564b2c; }
.section-block { padding: clamp(5rem, 9vw, 8rem) clamp(1rem, 7vw, 8rem); }
.section-heading { max-width: 850px; margin-bottom: 2.4rem; }
.section-heading h2 { margin: 0; font-family: "Bai Jamjuree", sans-serif; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.section-heading > p:last-child { margin: .8rem 0 0; color: var(--muted); font-size: 1.1rem; }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.topic-card { position: relative; min-height: 205px; padding: 1.3rem; display: flex; flex-direction: column; justify-content: space-between; text-align: left; border: 1px solid var(--line); border-radius: 20px; background: white; color: var(--ink); cursor: pointer; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border .2s ease; }
.topic-card::after { content: ""; position: absolute; right: -32px; bottom: -42px; width: 120px; height: 120px; border-radius: 50%; background: var(--topic-color); opacity: .12; }
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.topic-card .topic-index { color: var(--topic-color); font-family: "Bai Jamjuree", sans-serif; font-size: .75rem; font-weight: 700; }
.topic-card strong { max-width: 100%; display: block; font-family: "Bai Jamjuree", sans-serif; font-size: 1.25rem; line-height: 1.35; white-space: nowrap; }
.topic-card span:last-child { color: var(--muted); font-size: .85rem; }

.atlas-section { background: var(--navy); color: white; }
.atlas-heading { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.atlas-heading .eyebrow { color: #71d8e6; }
.atlas-heading p:last-child { color: #bcc5d4; }
.result-count { min-width: 125px; padding: 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; text-align: center; background: rgba(255,255,255,.05); }
.result-count strong { display: block; font-family: "Bai Jamjuree", sans-serif; font-size: 2rem; line-height: 1; }
.result-count span { color: #cbd2dd; font-size: .78rem; }
.controls { display: grid; grid-template-columns: minmax(250px, 1.5fr) minmax(190px, .7fr) auto; gap: .75rem; align-items: end; margin-bottom: 1.1rem; }
.search-control { height: 52px; padding: 0 .9rem; display: flex; align-items: center; gap: .7rem; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: white; color: var(--ink); }
.search-control svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2; }
.search-control input { width: 100%; border: 0; outline: none; color: inherit; font-size: 1rem; }
kbd { padding: .1rem .38rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--wash); font-size: .75rem; }
.select-control { display: grid; gap: .25rem; color: #cbd2dd; font-size: .76rem; }
.select-control select { height: 52px; padding: 0 2.2rem 0 .8rem; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: white; color: var(--ink); }
.text-button { height: 52px; padding: 0 .8rem; border: 0; background: transparent; color: #dce2eb; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.atlas-shell { padding: clamp(1rem, 2vw, 1.6rem); border-radius: 22px; background: white; color: var(--ink); box-shadow: 0 25px 70px rgba(0,0,0,.24); }
.section-map { display: grid; grid-template-columns: repeat(12, minmax(42px, 1fr)); gap: .48rem; }
.section-tile { position: relative; aspect-ratio: 1; min-height: 46px; display: grid; place-items: center; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--tile-color) 15%, white); color: var(--ink); cursor: pointer; font-family: "Bai Jamjuree", sans-serif; font-weight: 700; transition: transform .16s ease, color .16s ease, background .16s ease; }
.section-tile::before { content: ""; position: absolute; top: 7px; left: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--tile-color); }
.section-tile:hover, .section-tile:focus-visible { transform: scale(1.08); z-index: 2; color: white; background: var(--tile-color); }
.section-tile[hidden] { display: none; }
.section-tile.pinned { box-shadow: inset 0 0 0 3px var(--yellow); }
.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-state p { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: .65rem 1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .78rem; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--legend-color); }

.facilitator-panel { margin: 0 clamp(1rem, 7vw, 8rem); padding: clamp(1.5rem, 4vw, 3rem); grid-template-columns: 1fr 1.2fr; gap: 2.5rem; border: 2px solid var(--cyan); border-radius: 24px; background: #e7f7f9; }
.facilitator-panel:not([hidden]) { display: grid; }
.facilitator-panel h2 { margin: 0; font-family: "Bai Jamjuree", sans-serif; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.25; }
.facilitator-panel p { color: var(--muted); }
.question-list { margin: 0; padding-left: 1.5rem; display: grid; gap: .65rem; }
.pinned-wrap { grid-column: 1 / -1; padding-top: 1.3rem; border-top: 1px solid #a7dce5; }
.pinned-header { display: flex; justify-content: space-between; }
.pinned-header button { border: 0; color: var(--magenta); background: transparent; cursor: pointer; text-decoration: underline; }
.pinned-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.pin-chip { padding: .45rem .7rem; border: 1px solid #8ccfdc; border-radius: 999px; background: white; cursor: pointer; }

.sources-section { background: var(--wash); }
.source-list { display: grid; gap: .65rem; }
.source-item { padding: 1.1rem 1.2rem; display: grid; grid-template-columns: 1fr auto; gap: .8rem 2rem; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: white; }
.source-item h3 { margin: 0; font-size: 1rem; overflow-wrap: break-word; }
.source-meta { color: var(--muted); font-size: .84rem; }
.source-item a { color: var(--magenta); font-weight: 700; text-underline-offset: 3px; }
.policy-section { color: white; background: var(--navy); }
.policy-heading { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 2rem; align-items: end; }
.policy-heading h2 { color: white; }
.policy-heading > div > p:last-child { color: #cbd3df; }
.release-meta { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.2); border-radius: 16px; overflow: hidden; }
.release-meta div { padding: .9rem 1rem; }
.release-meta div + div { border-left: 1px solid rgba(255,255,255,.2); }
.release-meta dt { color: #9ba9bb; font-size: .72rem; font-weight: 600; }
.release-meta dd { margin: .2rem 0 0; font-size: .86rem; font-weight: 700; white-space: nowrap; }
.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.policy-card { position: relative; padding: clamp(1.3rem, 3vw, 2rem); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(255,255,255,.055); }
.policy-card-featured { border-color: var(--yellow); }
.policy-card h3 { margin: .15rem 0 .8rem; font-family: "Bai Jamjuree", sans-serif; font-size: 1.25rem; }
.policy-card p { margin: .65rem 0 0; color: #d8dee8; line-height: 1.7; }
.policy-card a { color: #68dbe7; font-weight: 600; text-underline-offset: 3px; }
.policy-number { color: var(--yellow); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
.citation-note { padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .86rem; }
footer { padding: 2rem clamp(1rem, 7vw, 8rem); display: flex; align-items: center; gap: 2rem; border-top: 1px solid var(--line); }
.footer-brand { margin-right: auto; }
.footer-brand img { width: 210px; height: 74px; }
.footer-copy { color: var(--muted); font-size: .82rem; }
.footer-copy p { margin: 0; }
.footer-links { margin-top: .55rem; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem 1rem; }
.footer-links a { color: var(--ink); text-underline-offset: 3px; }

.detail-dialog { width: min(1120px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: clamp(1.2rem, 4vw, 2.5rem); border: 0; border-radius: 24px; color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.detail-dialog::backdrop { background: rgba(9,15,29,.72); backdrop-filter: blur(4px); }
.dialog-topbar, .dialog-title-row, .dialog-actions, .dialog-nav { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.dialog-topbar > div { display: flex; align-items: center; gap: .55rem; }
.topic-chip { padding: .2rem .6rem; border-radius: 999px; color: white; background: var(--magenta); font-size: .76rem; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); cursor: pointer; font-size: 1.6rem; line-height: 1; }
.dialog-title-row { margin: 1.2rem 0; }
.dialog-title-row h2 { margin: 0; font-family: "Bai Jamjuree", sans-serif; font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 700; line-height: 1; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.law-card { min-width: 0; padding: 1.3rem; border-radius: 18px; }
.draft-card { color: white; background: var(--ink); }
.current-card { border: 1px solid var(--line); background: var(--wash); }
.law-year { font-size: .78rem; font-weight: 700; opacity: .75; }
.law-card h3 { margin: .25rem 0 1rem; font-family: "Bai Jamjuree", sans-serif; }
.law-text { max-height: 330px; overflow: auto; white-space: pre-wrap; line-height: 1.75; }
.draft-card .law-text { color: #edf0f6; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.analysis-grid article { padding: 1rem; border: 1px solid var(--line); border-radius: 14px; }
.analysis-grid article.wide { grid-column: 1 / -1; }
.analysis-grid span { color: var(--magenta); font-size: .78rem; font-weight: 700; }
.analysis-grid h3 { margin: .25rem 0; font-size: 1rem; }
.analysis-grid p { margin: .35rem 0 0; color: var(--muted); }
.section-feedback { margin-top: 1rem; padding: 1.1rem 1.2rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.5rem; align-items: center; border: 1px solid #8ccfdc; border-radius: 16px; background: #e7f7f9; }
.section-feedback-kicker { color: var(--magenta-dark); font-size: .76rem; font-weight: 700; letter-spacing: .04em; }
.section-feedback h3 { margin: .2rem 0 0; font-family: "Bai Jamjuree", sans-serif; font-size: 1.15rem; line-height: 1.35; }
.section-feedback p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.feedback-button { background: var(--cyan); color: var(--ink); box-shadow: 0 8px 18px rgba(19,176,194,.2); white-space: nowrap; }
.feedback-button:hover { background: #59c6d1; }
.dialog-source { margin-top: 1rem; padding: 1rem; border-radius: 14px; background: #fff8dc; }
.dialog-source > div { display: grid; gap: .25rem; margin: .35rem 0; }
.dialog-source a { color: var(--magenta); font-weight: 600; overflow-wrap: anywhere; }
.dialog-source small { color: var(--muted); }
.dialog-nav { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.dialog-nav button { border: 0; background: transparent; color: var(--magenta); font-weight: 700; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 100; padding: .65rem 1rem; border-radius: 999px; color: white; background: var(--ink); opacity: 0; transform: translate(-50%, 1rem); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  nav { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-visual { min-height: 390px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-control { grid-column: 1 / -1; }
  .text-button { justify-self: start; }
  .section-map { grid-template-columns: repeat(9, 1fr); }
  .policy-heading { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { min-height: 66px; gap: .6rem; }
  .brand img { width: 150px; height: 46px; }
  .hero { padding-top: 3.2rem; }
  .hero h1 { font-size: clamp(2.65rem, 13vw, 4rem); }
  .hero-actions { display: grid; }
  .hero-visual { min-height: 430px; margin-top: 1rem; }
  .mascot-frame { width: min(86vw, 380px); }
  .hero-number { left: 0; width: 112px; height: 112px; }
  .hero-number strong { font-size: 2.7rem; }
  .hero-number span { font-size: .7rem; }
  .note-a { right: 0; }
  .note-b { left: 0; }
  .notice { display: block; }
  .notice p { margin-top: .25rem; }
  .topic-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .topic-card { min-height: 170px; padding: 1rem; }
  .topic-card strong { font-size: 1.05rem; }
  .atlas-heading { align-items: start; }
  .result-count { min-width: 88px; }
  .controls { grid-template-columns: 1fr; }
  .search-control { grid-column: auto; }
  .section-map { grid-template-columns: repeat(6, 1fr); gap: .38rem; }
  .section-tile { min-height: 42px; }
  .facilitator-panel:not([hidden]) { grid-template-columns: 1fr; }
  .pinned-wrap { grid-column: auto; }
  .source-item { grid-template-columns: 1fr; }
  .policy-grid { grid-template-columns: 1fr; }
  .release-meta { grid-template-columns: 1fr; }
  .release-meta div + div { border-left: 0; border-top: 1px solid rgba(255,255,255,.2); }
  footer { display: block; }
  .footer-copy { margin-top: 1.2rem; }
  .footer-links { justify-content: flex-start; }
  .detail-dialog { width: 100%; max-height: 100vh; margin: 0; border-radius: 20px 20px 0 0; padding: 1rem; }
  .dialog-title-row { align-items: flex-start; flex-direction: column; }
  .compare-grid, .analysis-grid { grid-template-columns: 1fr; }
  .analysis-grid article.wide { grid-column: auto; }
  .section-feedback { grid-template-columns: 1fr; }
  .feedback-button { width: 100%; white-space: normal; }
  .law-text { max-height: none; }
}

@media (max-width: 380px) {
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .hero, .notice, #overview, .controls, #sources, #data-policy, footer, .dialog-actions, .dialog-nav { display: none !important; }
  .atlas-section { padding: 1rem; color: black; background: white; }
  .atlas-shell { box-shadow: none; }
  .section-map { grid-template-columns: repeat(12, 1fr); }
}
