:root {
  color-scheme: light;
  --ink: #17363b;
  --muted: #63797c;
  --line: #dce8e7;
  --paper: #ffffff;
  --canvas: #f5f9f8;
  --teal: #0c6870;
  --teal-dark: #084d55;
  --mint: #dff3ed;
  --lime: #c8e76a;
  --amber-bg: #fff7e8;
  --amber-line: #ecd7a9;
  --amber-ink: #6b511b;
  font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #91c82e; outline-offset: 3px; }
.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; }
.skip-link { position: absolute; z-index: 5; left: 1rem; top: -5rem; padding: .7rem 1rem; color: #fff; background: var(--teal-dark); border-radius: .5rem; }
.skip-link:focus { top: .75rem; }

.topbar { height: 76px; padding: 0 max(5.5vw, calc((100vw - 1240px) / 2)); display: flex; align-items: center; gap: 3.25rem; background: var(--paper); border-bottom: 1px solid #e9f0ef; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: var(--teal); box-shadow: 0 4px 10px #0c68702b; }
.brand-mark svg { width: 24px; fill: var(--lime); }
.brand-name { color: var(--teal-dark); font-size: 1.54rem; font-weight: 800; letter-spacing: -.075em; }
.brand-name span { color: #71858a; font-weight: 500; }
.top-nav { display: flex; gap: 2rem; height: 100%; align-items: center; }
.top-nav a { display: inline-flex; height: 100%; align-items: center; color: #62787b; text-decoration: none; font-size: .93rem; border-bottom: 2px solid transparent; }
.top-nav a:hover, .top-nav a.nav-active { color: var(--teal-dark); }
.top-nav a.nav-active { font-weight: 700; border-color: #8ab930; }
.local-badge { margin-left: auto; display: flex; align-items: center; gap: .55rem; color: #51696b; font-size: .8rem; font-weight: 600; }
.status-dot, .art-pulse { width: 8px; height: 8px; border-radius: 50%; background: #67aa55; box-shadow: 0 0 0 4px #67aa551f; }

main { max-width: 1240px; margin: 0 auto; padding: 0 30px 74px; }
.hero { position: relative; min-height: 328px; margin-top: 32px; padding: 48px 64px; display: flex; align-items: center; overflow: hidden; color: #fff; border-radius: 20px; background: linear-gradient(112deg, #104f59 0%, #0d6570 62%, #13827b 100%); box-shadow: 0 16px 35px #104f5917; }
.hero-copy { position: relative; z-index: 1; max-width: 630px; }
.eyebrow, .section-kicker { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .13em; }
.eyebrow { color: #cbe99b; }
.eyebrow-line { width: 22px; display: inline-block; vertical-align: middle; margin-right: 7px; border-top: 2px solid #cbe99b; }
.hero h1 { margin: 18px 0 12px; font-size: clamp(2.25rem, 4vw, 3.3rem); line-height: 1.06; font-weight: 750; letter-spacing: -.045em; }
.hero h1 span { color: #d4ed8e; }
.hero-copy p { max-width: 530px; margin: 0; color: #e0eeee; font-size: 1rem; }
.hero-art { width: 320px; height: 260px; position: absolute; right: 42px; top: 26px; opacity: .98; }
.orbit { position: absolute; border: 1px solid #a4d7bd4d; border-radius: 50%; transform: rotate(-31deg); }
.orbit-one { width: 300px; height: 150px; right: -10px; top: 48px; }
.orbit-two { width: 260px; height: 110px; right: 6px; top: 68px; transform: rotate(32deg); }
.hero-cross { width: 124px; height: 124px; position: absolute; right: 74px; top: 56px; display: grid; place-items: center; border: 1px solid #b8e4d380; border-radius: 34px; background: #ffffff13; transform: rotate(8deg); box-shadow: 0 15px 30px #073a3830; }
.hero-cross span, .hero-cross i { display: block; position: absolute; width: 58px; height: 17px; border-radius: 4px; background: var(--lime); }
.hero-cross i { width: 17px; height: 58px; }
.art-card { position: absolute; display: flex; align-items: center; gap: .5rem; padding: .62rem .85rem; border: 1px solid #ffffff33; border-radius: 9px; color: #ecf7f3; background: #0a4a52d9; font-size: .73rem; box-shadow: 0 8px 20px #053d453b; }
.art-card-top { top: 41px; right: 0; }
.art-card-bottom { right: 20px; bottom: 31px; }
.art-mini-icon { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 5px; color: #0e5960; background: #d3eb90; font-size: .7rem; font-weight: 800; }
.art-pulse { display: inline-block; background: #a5dc8d; }

.search-section { padding: 38px 28px 26px; margin: 28px 0 0; border: 1px solid #e5eeec; border-radius: 16px; background: var(--paper); box-shadow: 0 5px 18px #1b51500b; }
.search-heading, .results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.section-kicker { color: #5e8485; }
h2 { letter-spacing: -.025em; }
.search-heading h2, .results-heading h2 { margin: 5px 0 0; color: #183b3f; font-size: 1.42rem; font-weight: 700; }
.competencia-control { min-width: 172px; display: flex; flex-direction: column; gap: 4px; color: #6b8183; font-size: .65rem; font-weight: 800; letter-spacing: .1em; }
.competencia-control select { height: 42px; padding: 0 35px 0 12px; border: 1px solid #cadbd9; border-radius: 8px; color: #234a4e; background: #fbfdfc; font-size: .9rem; font-weight: 650; letter-spacing: 0; cursor: pointer; }
.search-box { display: flex; height: 62px; align-items: center; gap: 14px; margin-top: 22px; padding: 0 18px; border: 1px solid #bbd4d0; border-radius: 11px; background: #fcfefd; transition: border-color .16s, box-shadow .16s; }
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px #0c68701c; }
.search-icon { width: 21px; height: 21px; flex: none; fill: none; stroke: #5a8283; stroke-width: 1.8; }
.search-box input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; color: #1b3f43; background: transparent; font-size: 1rem; }
.search-box input::placeholder { color: #85999a; opacity: 1; }
.search-box:focus-within input:focus-visible { outline: none; }
.clear-button { padding: .4rem .7rem; border: 0; border-radius: 6px; color: #477477; background: #edf5f3; cursor: pointer; }
.clear-button:hover { background: #dfefeb; }
.search-shortcut { width: 25px; height: 25px; flex: none; display: grid; place-items: center; border: 1px solid #d7e4e2; border-radius: 5px; color: #71888a; background: #f8fbfa; font-size: .76rem; }
.search-hint { margin: 8px 0 0 36px; color: #788d8e; font-size: .78rem; }
.group-browser { margin-top: 25px; padding-top: 19px; border-top: 1px solid #e8efed; }
.group-browser-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.group-browser-head p { margin: 3px 0 0; color: #7a8e8f; font-size: .8rem; }
.text-button { min-height: 36px; padding: 0 11px; border: 1px solid #d5e4df; border-radius: 7px; color: #3e7371; background: #f9fcfa; font-size: .74rem; font-weight: 700; cursor: pointer; }
.text-button:hover { background: #eff7f2; }
.group-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.group-card { min-height: 76px; display: grid; grid-template-columns: 39px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e1ebe8; border-radius: 10px; color: #254a4d; text-align: left; background: #fbfdfc; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.group-card:hover { border-color: #9fc8b7; background: #f3f9f5; transform: translateY(-1px); }
.group-card[aria-pressed="true"] { border-color: #52958c; background: #edf7f1; box-shadow: 0 0 0 2px #4f958c1c; }
.group-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #27706e; background: #e6f2ed; }
.group-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.group-copy { min-width: 0; }
.group-copy strong { display: block; color: #477a78; font-size: .67rem; letter-spacing: .05em; }
.group-copy span { display: -webkit-box; overflow: hidden; margin-top: 2px; color: #315458; font-size: .77rem; font-weight: 650; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.group-copy small { display: block; margin-top: 3px; color: #829495; font-size: .67rem; }
.subgroup-browser { margin-top: 13px; padding: 14px; border: 1px solid #dfeae6; border-radius: 10px; background: #f8fbf9; }
.selected-group-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 11px; color: #6f8787; font-size: .73rem; }
.selected-group-label span { color: #3d7775; font-weight: 800; letter-spacing: .05em; }
.selected-group-label strong { color: #294d50; font-size: .88rem; }
.subgroup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.subgroup-button { min-height: 58px; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e0eae7; border-radius: 8px; color: #31575a; text-align: left; background: white; cursor: pointer; transition: border-color .15s, background .15s; }
.subgroup-button:hover { border-color: #a4c9ba; background: #f4faf6; }
.subgroup-button[aria-pressed="true"] { border-color: #54978e; color: #185f5e; background: #e9f5ee; box-shadow: 0 0 0 2px #4f958c16; }
.subgroup-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: #47817d; background: #eaf3ef; }
.subgroup-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.subgroup-copy { min-width: 0; }
.subgroup-copy strong { display: block; color: #648282; font-size: .64rem; letter-spacing: .04em; }
.subgroup-copy span { display: -webkit-box; overflow: hidden; margin-top: 1px; color: #35565a; font-size: .74rem; font-weight: 600; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.subgroup-copy small { display: block; margin-top: 2px; color: #879899; font-size: .64rem; }
.subgroup-all { width: 100%; min-height: 44px; display: flex; justify-content: space-between; padding: 9px 12px; border-color: #d2e4dc; color: #286a66; background: #f0f7f2; font-size: .78rem; font-weight: 700; }
.subgroup-all span { color: #718b84; font-size: .7rem; font-weight: 500; }
.data-notice { margin-top: 18px; padding: 13px 16px; border: 1px solid var(--amber-line); border-radius: 10px; color: var(--amber-ink); background: var(--amber-bg); font-size: .9rem; }
.data-notice strong { font-weight: 800; }
.data-notice a { margin-left: .35rem; font-weight: 700; text-underline-offset: 3px; }
.data-notice.error { border-color: #f0c1b8; color: #853b2e; background: #fff4f1; }

.results-section { margin-top: 39px; }
.results-heading { padding: 0 3px 15px; align-items: flex-end; }
.result-count { color: #708486; font-size: .8rem; }
.results-actions { display: flex; align-items: center; gap: 14px; }
.export-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid #bdd6cc; border-radius: 8px; color: #236565; background: #f7fbf8; font-size: .8rem; font-weight: 750; cursor: pointer; }
.export-button:hover:not(:disabled) { border-color: #8ebeb0; background: #edf7f1; }
.export-button:disabled { color: #9aa9a7; border-color: #e0e8e6; background: #f7f9f8; cursor: not-allowed; }
.export-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.results-list { overflow: hidden; border: 1px solid #e1ebe9; border-radius: 12px; background: var(--paper); }
.result-group + .result-group { border-top: 1px solid #dfeae7; }
.result-group-heading { padding: 12px 20px; color: #426e70; background: #f4f9f7; font-size: .74rem; font-weight: 700; }
.result-group-heading span { display: block; color: #668789; font-size: .66rem; font-weight: 800; letter-spacing: .06em; }
.result-group-heading strong { display: block; margin-top: 2px; color: #305c5e; font-size: .8rem; }
.result-row { width: 100%; min-height: 95px; display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: center; gap: 14px; padding: 14px 20px; border: 0; border-bottom: 1px solid #edf2f1; color: inherit; text-align: left; background: transparent; cursor: pointer; transition: background .15s; }
.result-row:last-child { border-bottom: 0; }
.result-row:hover { background: #f7fbf9; }
.result-main { min-width: 0; }
.result-code { display: inline-block; margin-bottom: 3px; color: #33777a; font-size: .75rem; font-weight: 800; letter-spacing: .045em; font-variant-numeric: tabular-nums; }
.result-name { display: block; overflow: hidden; color: #1c3e42; font-size: .94rem; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; }
.result-sub { display: -webkit-box; overflow: hidden; margin-top: 4px; color: #829394; font-size: .76rem; line-height: 1.35; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.result-preview { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.preview-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 7px; border: 1px solid #e3ece9; border-radius: 6px; color: #668080; background: #fbfdfc; font-size: .68rem; }
.preview-chip strong { color: #24615e; font-size: .72rem; font-variant-numeric: tabular-nums; }
.preview-chip.complement { border-color: #d9e9c4; color: #627f4d; background: #f7faef; }
.preview-chip.complement strong { color: #547532; }
.preview-chip.record-chip { flex-wrap: wrap; border-color: #cedfe9; color: #567584; background: #f3f8fb; }
.preview-chip.record-chip strong { color: #355e70; white-space: normal; }
.row-arrow { color: #7e9999; font-size: 1.2rem; }
.results-footnote { margin: 10px 3px 0; color: #7c8f90; font-size: .75rem; }
.empty-state { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; color: #768d8e; text-align: center; }
.empty-state p { margin: 0; font-size: .9rem; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #4f8584; background: #eaf4f1; }
.spinner { width: 22px; height: 22px; border: 2px solid #c9ded9; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.offline-banner { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 19px; margin-top: 46px; padding: 24px 27px; border: 1px solid #dfece8; border-radius: 14px; background: #eaf4ef; }
.offline-symbol { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #0b6968; background: #d3e9dd; }
.offline-symbol svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.offline-banner h2 { margin: 4px 0 3px; color: #214346; font-size: 1rem; }
.offline-banner p { margin: 0; color: #658082; font-size: .82rem; }
.offline-banner > a { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid #bdd7cd; border-radius: 8px; color: #246667; background: #f6faf7; text-decoration: none; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.offline-banner > a:hover { background: white; }
.footer { min-height: 78px; display: flex; align-items: center; gap: 17px; padding: 16px max(5.5vw, calc((100vw - 1240px) / 2)); border-top: 1px solid #e3ecea; color: #75898a; background: white; font-size: .75rem; }
.footer-brand { color: var(--teal); font-size: 1rem; font-weight: 800; letter-spacing: -.06em; text-decoration: none; }
.footer-source { margin-left: auto; }

.detail-dialog { width: min(700px, calc(100vw - 28px)); max-height: min(86vh, 820px); padding: 0; overflow: auto; border: 1px solid #dce8e6; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 25px 80px #0b343448; }
.detail-dialog::backdrop { background: #12353886; backdrop-filter: blur(3px); }
.dialog-head { position: relative; padding: 26px 28px 23px; color: white; background: linear-gradient(115deg, #104f59, #0f7375); }
.dialog-head .section-kicker { color: #d1e8a3; }
.dialog-close { width: 38px; height: 38px; position: absolute; top: 17px; right: 18px; border: 1px solid #ffffff48; border-radius: 10px; color: white; background: #ffffff12; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.dialog-head h2 { max-width: calc(100% - 40px); margin: 7px 0 4px; font-size: 1.42rem; line-height: 1.25; }
.detail-code { margin-top: 18px; color: #d5ed9f; font-size: .83rem; font-weight: 800; letter-spacing: .06em; }
.detail-path { margin: 0; color: #d2e6e4; font-size: .8rem; }
.detail-body { padding: 23px 28px 28px; }
.detail-section + .detail-section { margin-top: 24px; padding-top: 21px; border-top: 1px solid #e5eeec; }
.detail-section h3 { margin: 0 0 11px; color: #2d5d60; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; }
.value-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.value-card { min-height: 72px; padding: 11px 12px; border: 1px solid #e1ebe9; border-radius: 9px; background: #f8fbfa; }
.value-card span { display: block; color: #7b9091; font-size: .7rem; }
.value-card strong { display: block; margin-top: 3px; color: #1b5d5b; font-size: .95rem; font-variant-numeric: tabular-nums; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 20px; }
.detail-field span { display: block; color: #849697; font-size: .72rem; }
.detail-field strong { display: block; margin-top: 2px; color: #2a4c50; font-size: .86rem; font-weight: 650; }
.code-list { display: flex; flex-wrap: wrap; gap: 7px; }
.code-chip { padding: 4px 8px; border: 1px solid #dbe9e5; border-radius: 6px; color: #336e6e; background: #f4f9f7; font-size: .76rem; font-weight: 700; }
.increment-list { display: grid; gap: 8px; }
.increment-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding: 9px 11px; border: 1px solid #e6eeec; border-radius: 8px; color: #4b6668; font-size: .78rem; }
.complement-list { display: grid; gap: 8px; }
.complement-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e2ebdd; border-radius: 8px; color: #5e7650; background: #f8faF3; font-size: .8rem; }
.complement-row strong { color: #4a6a2e; font-size: .9rem; }
.description { color: #4d6668; font-size: .86rem; white-space: pre-line; }

@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 20px; gap: 1.4rem; }
  .top-nav { gap: 1rem; }
  .top-nav a { font-size: .82rem; }
  .local-badge { font-size: .72rem; }
  main { padding: 0 17px 46px; }
  .hero { min-height: 300px; margin-top: 18px; padding: 35px 29px; }
  .hero-copy { max-width: 94%; }
  .hero-copy p { max-width: 470px; font-size: .93rem; }
  .hero-art { right: -140px; opacity: .34; }
  .search-section { padding: 26px 19px 21px; margin-top: 20px; }
  .search-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .competencia-control { width: 100%; }
  .competencia-control select { width: 100%; }
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subgroup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box { height: 58px; gap: 10px; padding: 0 12px; }
  .search-box input { font-size: .9rem; }
  .search-hint { margin-left: 2px; }
  .results-section { margin-top: 31px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .results-actions { width: 100%; justify-content: space-between; }
  .result-group-heading { padding: 11px 13px; }
  .result-row { grid-template-columns: minmax(0,1fr) 18px; gap: 9px; padding: 15px 13px; }
  .row-arrow { display: none; }
  .result-name { font-size: .86rem; }
  .result-sub { max-width: 100%; font-size: .7rem; }
  .offline-banner { grid-template-columns: 42px 1fr; gap: 14px; padding: 19px; }
  .offline-symbol { width: 42px; height: 42px; }
  .offline-banner > a { grid-column: 2; width: fit-content; }
  .footer { flex-wrap: wrap; gap: 6px 13px; padding: 17px 20px; }
  .footer-source { width: 100%; margin-left: 0; }
  .detail-body { padding: 20px; }
  .dialog-head { padding: 24px 20px 20px; }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .brand { gap: .5rem; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 1.35rem; }
  .topbar { gap: 1rem; padding: 0 14px; }
  .top-nav { gap: .75rem; }
  .top-nav a { font-size: .75rem; }
  .local-badge { gap: .4rem; font-size: .67rem; }
  .status-dot { width: 7px; height: 7px; }
  .hero { min-height: 315px; padding: 30px 22px; }
  .hero h1 { font-size: 2.15rem; }
  .hero-copy p { font-size: .88rem; }
  .results-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
