/* ============================================================
   IEM — light content system + Data Market components
   Ink frame (header, hero, footer, live panels) around light,
   dense content. Tokens in iem-brand.css.
   ============================================================ */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }

body.dm-page { background: var(--bg-light); color: var(--text); margin: 0; font: 15px/24px var(--font-sans); -webkit-font-smoothing: antialiased; }
.dm-page *, .dm-page *::before, .dm-page *::after { box-sizing: border-box; min-width: 0; }
.dm-page main a { color: inherit; text-decoration: none; }
.dm-page h1, .dm-page h2, .dm-page h3, .dm-page h4, .dm-page p { margin: 0; }
.dm-page .iem-container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* phase line (on ink) */
.phase-line { background: var(--ink-950); border-bottom: 1px solid var(--ink-line); color: var(--ink-text-2); font-size: 12.5px; line-height: 18px; }
.phase-line .iem-container { display: flex; align-items: center; gap: 10px; padding-top: 7px; padding-bottom: 7px; }
.phase-line b { color: var(--ink-text); font-weight: 500; }
.phase-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber-400); flex-shrink: 0; }

/* buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 6px; font: 600 14px/1 var(--font-sans); cursor: pointer; border: 1px solid transparent; transition: background-color .14s, border-color .14s, color .14s; white-space: nowrap; text-decoration: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--accent-600); color: #fff !important; }
.btn-primary:hover { background: var(--accent-700); }
.btn-secondary { background: #fff; color: var(--text) !important; border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--text-2) !important; border-color: var(--line); }
.btn-ghost:hover { color: var(--text) !important; border-color: var(--line-strong); }
.btn-light { background: #fff; color: var(--ink-950) !important; }
.btn-light:hover { background: var(--accent-50); }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); font: 14px var(--font-sans); outline: none; }
.input.sm { height: 34px; width: auto; font-size: 13px; padding: 0 10px; }
.input:focus { border-color: var(--accent-600); box-shadow: 0 0 0 3px var(--accent-100); }

/* bands */
.band { padding: 80px 0; }
.band-light { background: var(--bg-light); color: var(--text); }
.band-surface { background: var(--surface); color: var(--text); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-head { margin-bottom: 32px; }
.band-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.band-head h2 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.band-head p { margin-top: 6px; color: var(--text-2); font-size: 15px; }

/* ---------- HERO (ink) ---------- */
.dm-hero { position: relative; background: var(--ink-950); color: var(--ink-text); padding: 72px 0 48px; overflow: hidden; }
.dm-hero::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); pointer-events: none; }
.dm-hero::after { content: ''; position: absolute; left: 50%; top: -240px; width: 900px; height: 520px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(53, 80, 220, .35), transparent); pointer-events: none; }
.dm-hero > .iem-container { position: relative; z-index: 1; }
.dm-hero-head { text-align: center; max-width: 820px; margin: 0 auto; }
.dm-pill { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ink-line); background: var(--ink-panel); font-size: 13px; color: var(--ink-text); }
.dm-hero h1 { margin-top: 22px; font-size: 52px; line-height: 58px; font-weight: 700; letter-spacing: -.025em; color: #fff; }
.dm-lead { margin: 16px auto 0; max-width: 620px; font-size: 17px; line-height: 26px; color: var(--ink-text-2); }
.dm-search { margin: 28px auto 0; max-width: 680px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 6px 6px 6px 16px; color: var(--muted); box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.dm-search input { flex: 1; border: 0; outline: none; font: 15px var(--font-sans); color: var(--text); height: 40px; background: transparent; }
.dm-popular { margin-top: 16px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-text-2); }
.dm-popular button { height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--ink-line); background: var(--ink-panel); color: var(--ink-text); font: 13px var(--font-sans); cursor: pointer; }
.dm-popular button:hover { border-color: rgba(140, 157, 245, .5); }

.dm-stats { margin-top: 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 28px; border-top: 1px solid var(--ink-line); text-align: left; }
.dm-stats b { display: block; font-size: 30px; line-height: 36px; font-weight: 500; color: #fff; }
.dm-stats span { font-size: 13px; color: var(--ink-text-2); }

/* ---------- AREAS ---------- */
.dm-areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.area-card { border: 1px solid var(--line); border-radius: 12px; padding: 22px; background: #fff; box-shadow: var(--shadow-card); }
.area-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.area-ico { width: 36px; height: 36px; border-radius: 8px; background: var(--ink-950); color: #fff; display: grid; place-items: center; }
.area-count { font-size: 12px; color: var(--muted); }
.area-card h3 { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text); }
.area-card h3 .mono { color: var(--accent-600); margin-right: 6px; }
.area-card > p { margin-top: 6px; font-size: 13.5px; line-height: 20px; color: var(--text-2); }
.area-cats { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.area-cats li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); cursor: pointer; }
.area-cats li:hover { color: var(--accent-700); }
.area-cats li .n { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.area-cats li.zero { opacity: .55; }
.code { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font: 500 11.5px var(--mono); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }

/* ---------- CATALOGUE ---------- */
.cat-tools { display: flex; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { height: 34px; padding: 0 14px; border: 0; background: transparent; font: 500 13px var(--font-sans); color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--ink-950); color: #fff; }
.cat-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.filters { position: sticky; top: 92px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.f-group h3 { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.f-opt { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.f-opt input { accent-color: var(--accent-600); width: 15px; height: 15px; margin: 0; }
.f-opt .n { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.results { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cat-table th { position: sticky; top: 0; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); background: var(--surface); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cat-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.cat-table tr { cursor: pointer; }
.cat-table tbody tr:hover td { background: #FAFBFE; }
.cat-table tr:last-child td { border-bottom: 0; }
.t-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); }
.t-prov { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.t-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.cat-table td:nth-child(3) .mono { white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 4px; font: 500 11.5px var(--mono); white-space: nowrap; border: 1px solid var(--line); color: var(--text-2); background: #fff; }
.chip.lic { color: var(--accent-700); background: var(--accent-50); border-color: var(--accent-100); }
.chip.fmt { color: var(--text); }
.chip.ok { color: var(--teal-700); background: var(--teal-50); border-color: #CBEDE8; }
.meter { display: flex; align-items: center; gap: 8px; white-space: nowrap; font: 12.5px var(--mono); color: var(--text); }
.meter i { display: inline-flex; gap: 2px; }
.meter i b { width: 4px; height: 12px; border-radius: 1px; background: var(--line); display: block; }
.meter i b.f { background: var(--teal-600); }
.meter small { color: var(--muted); font-size: 11px; }
.tick { color: var(--teal-600); flex-shrink: 0; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.pcard { background: #fff; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.pcard:hover { background: #FAFBFE; }
.pcard p { font-size: 13px; line-height: 20px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty b { display: block; color: var(--text); margin-bottom: 6px; }

/* ---------- DRAWER ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(10, 16, 41, .5); z-index: 1100; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: #fff; z-index: 1101; overflow-y: auto; box-shadow: var(--shadow-pop); color: var(--text); }
.drawer[hidden], .drawer-scrim[hidden] { display: none; }
.dr-head { padding: 24px 28px 18px; border-bottom: 1px solid var(--line); background: var(--surface); position: relative; }
.dr-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; color: var(--text-2); }
.dr-head h2 { margin-top: 12px; font-size: 22px; line-height: 29px; font-weight: 600; letter-spacing: -.01em; padding-right: 36px; }
.dr-orig { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.dr-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.dr-tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.dr-tabs button { height: 44px; padding: 0 12px; border: 0; background: none; font: 500 13.5px var(--font-sans); color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dr-tabs button.on { color: var(--text); border-bottom-color: var(--accent-600); }
.dr-body { padding: 24px 28px 40px; }
.dr-body h4 { font-size: 13px; font-weight: 600; color: var(--text); margin: 22px 0 8px; }
.dr-body h4:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 24px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
.uses { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 22px; }
.dict { width: 100%; border-collapse: collapse; font-size: 13px; }
.dict th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dict td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.dict td:first-child { font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.dict td:nth-child(2) { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.sample { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.sample table { border-collapse: collapse; width: 100%; font: 12px/18px var(--mono); }
.sample th { text-align: left; font-weight: 500; color: var(--accent-700); background: var(--surface); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sample td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text); max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lic-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lic-two ul, .lic-card ul { list-style: none; padding: 0; margin: 0; }
.lic-two li, .lic-card li { position: relative; padding: 4px 0 4px 22px; font-size: 13px; line-height: 19px; color: var(--text-2); }
.yes li::before { content: '✓'; position: absolute; left: 2px; color: var(--success); font-weight: 700; }
.no li::before { content: '✕'; position: absolute; left: 2px; color: var(--danger); font-weight: 700; }
.cond li::before { content: '·'; position: absolute; left: 6px; color: var(--muted); font-weight: 700; }

/* ---------- HOW / LOG ---------- */
.how-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; gap: 16px; }
.steps .mono { font-size: 12px; color: var(--accent-600); padding-top: 2px; }
.steps b { font-size: 15px; color: var(--text); font-weight: 600; }
.steps p { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.log-panel { background: var(--ink-950); color: var(--ink-text); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-pop); }
.log-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--ink-line); font-size: 13px; font-weight: 600; }
.log-panel ul { list-style: none; margin: 0; padding: 8px 0; }
.log-panel li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; padding: 10px 18px; align-items: start; }
.log-panel time { font-size: 12px; color: var(--ink-text-2); padding-top: 1px; }
.log-panel li b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.log-panel li span { font-size: 12px; color: var(--ink-text-2); }
.log-panel code { font: 11.5px var(--mono); color: var(--teal-400); }
.log-foot { padding: 12px 18px; border-top: 1px solid var(--ink-line); font-size: 12px; color: var(--ink-text-2); }

/* ---------- LICENCES ---------- */
.lic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.lic-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.lic-card h3 { font-size: 15px; line-height: 21px; font-weight: 600; color: var(--text); }
.lic-card .k { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---------- TRUST ---------- */
.trust-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.trust-list > div { border-left: 2px solid var(--accent-600); padding-left: 16px; }
.trust-list .mono { font-size: 12px; color: var(--muted); }
.trust-list b { display: block; margin-top: 6px; font-size: 15px; color: var(--text); font-weight: 600; }
.trust-list p { margin-top: 6px; font-size: 13.5px; line-height: 21px; color: var(--text-2); }

/* ---------- CTA (ink band) ---------- */
.cta-wrap { padding-top: 0; }
.cta-band { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 16px; overflow: hidden; background: var(--ink-950); color: var(--ink-text); position: relative; }
.cta-band::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.cta-band > div { position: relative; padding: 40px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cta-band > div + div { border-left: 1px solid var(--ink-line); background: linear-gradient(135deg, rgba(53, 80, 220, .28), transparent 70%); }
.cta-band h3 { font-size: 22px; line-height: 28px; font-weight: 600; color: #fff; }
.cta-band p { font-size: 14px; line-height: 22px; color: var(--ink-text-2); max-width: 440px; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .lic-grid { grid-template-columns: repeat(2, 1fr); }
  .dmp { grid-template-columns: 1fr; }
  .dmp-facts { border-right: 0; border-bottom: 1px solid var(--ink-line); }
}
@media (max-width: 1023px) {
  .cat-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .dm-areas, .trust-list { grid-template-columns: 1fr 1fr; }
  .how-layout { grid-template-columns: 1fr; }
  .seg { display: none; }
}
@media (max-width: 680px) {
  .band { padding: 56px 0; }
  .dm-hero { padding: 48px 0 36px; }
  .dm-hero h1 { font-size: 36px; line-height: 42px; }
  .dm-stats { grid-template-columns: 1fr 1fr; }
  .dm-areas, .trust-list, .lic-grid, .cards, .cta-band, .lic-two { grid-template-columns: 1fr; }
  .cta-band > div + div { border-left: 0; border-top: 1px solid var(--ink-line); }
  .dm-search button { padding: 0 12px; }
  .dm-page .iem-container { padding: 0 16px; }
  .dr-head, .dr-body { padding-left: 18px; padding-right: 18px; }
}
