/* PR Data Observatory: data dictionary page (dictionary.js). Loads after twin.css. */
body.dict-page { overflow: auto; background: var(--color-bg); height: auto; }
body.dict-page .topbar .btn { text-decoration: none; height: 34px; }
body.dict-page .topbar .views .btn[aria-current="page"] { background: var(--tint-blue-bg); border-color: var(--tint-blue-bg); color: var(--tint-blue-fg); pointer-events: none; }
html { scroll-padding-top: calc(var(--topbar-height) + 12px); }

.dict { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; max-width: 1280px; margin: 0 auto; padding: calc(var(--topbar-height) + 22px) 20px 80px; align-items: start; }
.dict-side { position: sticky; top: calc(var(--topbar-height) + 18px); max-height: calc(100vh - var(--topbar-height) - 36px); overflow: auto; padding-right: 4px; }
.side-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); margin: 0 0 6px; font-weight: 700; }
.dict-nav, .dict-domains { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 12px; margin-bottom: 14px; }
.dict-nav a { display: block; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--color-text); font-size: 13px; }
.dict-nav a:hover { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.dn { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--color-text); }
.dn small { color: var(--color-text-muted); }
.dn.sub { padding-left: 22px; font-size: 13px; }
.dn:hover { background: var(--color-bg); }
.dn.on { background: var(--tint-blue-bg); color: var(--tint-blue-fg); font-weight: 700; }
.dn.on small { color: var(--tint-blue-fg); }

.dict-main { min-width: 0; }
.d-hero { background: var(--color-surface); border-radius: var(--radius-lg); padding: 30px 32px; box-shadow: var(--shadow-sm); margin-bottom: 26px; border-top: 6px solid var(--color-primary); }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--color-primary-dark); font-weight: 700; margin-bottom: 8px; }
.d-hero h1 { margin: 0 0 10px; font-size: 32px; color: var(--color-primary-dark); line-height: 1.15; }
.lede { font-size: 15px; line-height: 1.6; color: var(--color-text-muted); max-width: 820px; margin: 0 0 18px; }
.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.d-stats .kpi .v { font-size: 24px; }
.d-search { position: relative; margin: 6px 0 10px; }
.d-search > .ms-icon { position: absolute; left: 14px; top: 12px; color: var(--color-text-muted); font-size: 20px; }
.d-search input { width: 100%; height: 46px; border: 1px solid var(--color-border); border-radius: 23px; padding: 0 44px 0 44px; font: inherit; font-size: 15px; background: var(--color-bg); }
.d-search input:focus { outline: 2px solid var(--color-primary-dark); outline-offset: 1px; background: #fff; }
.d-search .icon-btn { position: absolute; right: 7px; top: 7px; border-color: transparent; }
.d-search .icon-btn[hidden] { display: none; }

.d-block { margin-bottom: 40px; }
.d-block h2 { font-size: 23px; color: var(--color-primary-dark); margin: 0 0 8px; }
.d-block h3 { font-size: 15px; margin: 18px 0 6px; }
.d-lede { font-size: 14px; line-height: 1.6; color: var(--color-text-muted); max-width: 860px; margin: 0 0 14px; }
.b-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.b-head h2 { margin: 0; }
.b-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 12px 14px; margin-bottom: 10px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--color-text-muted); }
.filters label.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--color-text); font-size: 12.5px; padding-bottom: 6px; }
.filters label.grow { flex: 1; min-width: 200px; }
.filters select, .filters input[type=search] { height: 34px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; font-size: 13px; padding: 0 8px; background: #fff; max-width: 260px; }
.filters label.grow input { max-width: none; width: 100%; }
.count { font-size: 12.5px; color: var(--color-text-muted); margin: 8px 0; }
.empty { padding: 24px; background: var(--color-surface); border-radius: var(--radius-md); color: var(--color-text-muted); }

/* entries */
.dom > h3 { font-size: 19px; color: var(--color-primary-dark); margin: 26px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--tint-blue-bg); display: flex; align-items: baseline; gap: 8px; }
p.dom-sum { margin: 6px 0 4px; font-size: 14px; line-height: 1.55; color: var(--color-text); max-width: 860px; }
p.grp-sum { margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--color-text-muted); max-width: 860px; }
.dom > h3 small, h4.grp small { font-weight: 400; color: var(--color-text-muted); font-size: 12px; }
h4.grp { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-muted); margin: 16px 0 6px; }
details.de { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 6px; border: 1px solid transparent; }
details.de[open] { border-color: var(--color-border); box-shadow: var(--shadow-md); }
details.de.flash { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(51,140,179,.35); }
details.de > summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-md); }
details.de > summary::-webkit-details-marker { display: none; }
details.de > summary::before { content: '▸'; color: var(--color-text-muted); font-size: 13px; margin-right: -6px; padding-top: 1px; transition: transform .15s; }
details.de[open] > summary::before { transform: rotate(90deg); }
details.de > summary:hover { background: var(--color-bg); }
.de-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.de-name { font-weight: 700; font-size: 14px; }
.de-one { font-size: 12.5px; color: var(--color-text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
details.de[open] .de-one { display: none; }
.de-meta { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 42%; }
.chip.g { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.chip.b { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.chip.y { background: var(--tint-yellow-bg); color: var(--tint-yellow-fg); }
span.chip { padding: 2px 9px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.de-body { padding: 4px 18px 16px 34px; font-size: 13.5px; line-height: 1.6; }
.de-body h5 { margin: 14px 0 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); }
.de-body p { margin: 0 0 6px; max-width: 880px; }
.de-plain { font-size: 15px; line-height: 1.55; color: var(--color-text); }
.de-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 10px 0 4px; padding: 10px 12px; background: var(--color-bg); border-radius: var(--radius-sm); }
.de-facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }
.de-facts dd { margin: 0; font-size: 13px; font-weight: 500; }
.plain-list { margin: 4px 0 6px; padding-left: 18px; }
.plain-list li { margin: 3px 0; }
.plain-list.caution li::marker { color: var(--color-warning); }
.de-sd { font-size: 12px; color: var(--color-text-muted); }
.de-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; }
.de-cite { margin-top: 8px; padding: 12px; background: var(--color-bg); border-radius: var(--radius-md); }
.seg { display: inline-flex; border: 0; padding: 0; margin: 0 0 8px; gap: 0; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-block; padding: 5px 12px; font-size: 12px; border: 1px solid var(--color-border); background: #fff; margin-left: -1px; }
.seg label:first-child span { border-radius: 14px 0 0 14px; margin-left: 0; }
.seg label:last-child span { border-radius: 0 14px 14px 0; }
.seg input:checked + span { background: var(--color-primary-strong); color: #fff; border-color: var(--color-primary-strong); }
.seg input:focus-visible + span { outline: 3px solid var(--color-primary-dark); outline-offset: 2px; }
.cite-pre { white-space: pre-wrap; word-break: break-word; margin: 0 0 4px; padding: 10px 12px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: 12.5px/1.5 ui-monospace, Consolas, monospace; max-height: 260px; overflow: auto; }
.cite-box { margin-bottom: 12px; padding: 14px; background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.flat-row { margin-bottom: 4px; }
.flat-dom { font-size: 11px; color: var(--color-text-muted); margin: 8px 0 2px 4px; }
code { font: 12px ui-monospace, Consolas, monospace; background: var(--color-bg); padding: 1px 5px; border-radius: 4px; }
table.pt { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
table.pt th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); padding: 9px 12px; border-bottom: 1px solid var(--color-border); background: var(--color-bg); }
table.pt td, table.pt th[scope=row] { padding: 8px 12px; border-bottom: 1px solid var(--color-border-light); vertical-align: top; text-align: left; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--color-text); font-weight: 500; }
table.pt td.num, table.pt th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.codes { box-shadow: none; border: 1px solid var(--color-border-light); }
.tbl-wrap { overflow-x: auto; }
.bar { display: block; height: 4px; background: var(--color-border-light); border-radius: 2px; margin-top: 4px; max-width: 320px; }
.bar i { display: block; height: 100%; background: var(--color-primary); border-radius: 2px; }

/* sources */
.src-card { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 14px 18px; margin-bottom: 12px; }
.src-card h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kvl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 5px 14px; margin: 0; font-size: 13px; line-height: 1.5; }
.kvl > div { display: contents; }
.kvl dt { color: var(--color-text-muted); font-size: 12px; }
.kvl dd { margin: 0; overflow-wrap: anywhere; }
.credit { font-style: italic; }
.src-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; margin: 8px 0 4px; }
.src-links .ms-icon { font-size: 13px; vertical-align: -2px; }

/* glossary */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.az a { min-width: 28px; text-align: center; padding: 3px 6px; border-radius: 8px; background: var(--color-surface); text-decoration: none; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-sm); }
.gl { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 8px 18px 14px; }
.gl-dl { margin: 0; }
.gl h3.gl-letter { font-size: 18px; font-weight: 700; color: var(--color-primary-dark); margin: 14px 0 2px; border-bottom: 1px solid var(--color-border-light); }
.gl dt { font-weight: 700; margin-top: 10px; font-size: 14px; }
.gl dt small { font-weight: 400; color: var(--color-text-muted); }
.gl dd { margin: 2px 0 0; font-size: 13.5px; line-height: 1.55; max-width: 860px; }
.gl-see { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.gl-src { font-size: 12px; color: var(--color-text-muted); margin-top: 3px; overflow-wrap: anywhere; }

@media (max-width: 1100px) { body.dict-page .topbar .views .btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } body.dict-page .topbar .views .btn { width: 36px; padding: 0; justify-content: center; border-radius: 50%; } }
@media (max-width: 900px) {
  .dict { grid-template-columns: 1fr; gap: 12px; padding: calc(var(--topbar-height) + 12px) 12px 60px; }
  .dict-side { position: static; max-height: none; display: flex; gap: 10px; overflow-x: auto; padding: 0 0 4px; }
  .dict-nav, .dict-domains { margin: 0; flex: none; }
  .dict-nav { display: flex; gap: 2px; align-items: center; } .dict-nav .side-h, .dict-domains .side-h { display: none; }
  .dict-domains { display: flex; gap: 2px; } .dn { white-space: nowrap; width: auto; }
  .d-hero { padding: 20px; } .d-hero h1 { font-size: 24px; }
  .kvl { grid-template-columns: 1fr; } .kvl dt { margin-top: 6px; }
  .de-meta { display: none; }
  .de-body { padding-left: 18px; }
  body.dict-page .topbar .brand span { display: none; } body.dict-page .topbar .snapshot { display: none; }
}
@media print {
  .topbar, .dict-side, .filters, .b-tools, .d-search, .de-actions, .skip { display: none !important; }
  .dict { display: block; padding-top: 0; }
  details.de { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .d-block, .src-card { break-inside: avoid; }
}
