/* Trust center styles. Brand colours come from /theme.css (generated from config/branding.json).
   Layout language: a narrow column of bordered panels on a soft page background. */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --page-bg: color-mix(in srgb, var(--c-background) 55%, #fafafa);
  --border: #e3e3e0;
  --border-strong: #cfcfca;
  --inset: #f1f1ef;
  --dark: #141414;
  --shadow: 0 1px 2px rgb(16 24 40 / 4%);
  --shadow-lg: 0 16px 40px rgb(16 24 40 / 16%);
  --focus: 0 0 0 3px color-mix(in srgb, var(--c-primary) 30%, transparent);
  --primary-soft: color-mix(in srgb, var(--c-primary) 8%, #fff);
  --ok: #1d7a3a; --ok-bg: #e9f6ee;
  --warn: #8f5600; --warn-bg: #fff4dd;
  --err: #b42318; --err-bg: #fdecea;
  --info: #26508a; --info-bg: #ebf1fb;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--c-ink); background: var(--page-bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--c-primary); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.2rem; }
h3, .h3 { font-size: 1rem; }
p { margin: 0 0 .85em; }
code { font-size: .9em; background: var(--inset); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.container { width: min(960px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--c-muted); }
.small { font-size: .85rem; }
.warn { color: var(--warn); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -100px; background: var(--dark); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 1rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Icons */
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-muted { color: var(--c-muted); }

/* Demo notice */
.demo-notice { background: #fff8db; color: #5c4400; border-bottom: 1px solid #f0dc8c; padding: .5rem 1rem; text-align: center; font-size: .82rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page-bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--c-ink); flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.brand-name { font-weight: 700; font-size: 1.3rem; }
.brand-title { font-size: 1.15rem; font-weight: 400; color: var(--c-ink); padding-left: .9rem; border-left: 1px solid var(--border-strong); line-height: 1.2; }
.site-nav { display: flex; gap: .15rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav a { color: var(--c-muted); text-decoration: none; font-size: .875rem; padding: .4rem .65rem; border-radius: var(--radius-sm); white-space: nowrap; }
.site-nav a:hover { color: var(--c-ink); background: var(--inset); }
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: .25rem; padding-block: .6rem; min-height: 0; }
  .site-nav { width: 100%; margin-left: -.65rem; }
}

/* Page + panels */
.page { padding: 1.25rem 0 3rem; display: grid; gap: 1rem; }
.panel { background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.15rem; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.2rem; font-weight: 500; }
.panel-head h2 .i { width: 20px; height: 20px; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 780px) { .panel-row { grid-template-columns: 1fr; } }
.card { background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.inset { background: var(--inset); border-radius: var(--radius-sm); padding: .9rem; margin-bottom: 1rem; }
.inset-title { font-size: .875rem; font-weight: 500; margin: 0 0 .6rem; }

/* Review banner */
.review-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; border-top: 4px solid var(--c-primary); padding: 1.35rem 1.5rem; }
.review-banner h1 { margin: 0 0 .25rem; font-size: 1.3rem; }
.review-banner p { margin: 0; color: var(--c-ink); font-size: .9rem; }

/* Search */
.search-panel { display: flex; align-items: center; gap: .65rem; padding: .25rem .9rem; }
.search-panel input { border: 0; box-shadow: none; padding: .7rem 0; background: transparent; }
.search-panel input:focus { box-shadow: none; }
.search-panel:focus-within { border-color: var(--c-ink); }
.kbd { display: flex; gap: .2rem; }
kbd { font: 500 .72rem var(--font); color: var(--c-muted); background: var(--inset); border-radius: 4px; padding: .1rem .35rem; }
@media (max-width: 520px) { .kbd { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .6rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn .i { width: 16px; height: 16px; }
.btn-sm { padding: .45rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .45rem; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-primary { background: var(--c-primary); color: var(--c-primary-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--c-primary) 86%, #000); }
.btn-outline, .btn-secondary { background: var(--c-surface); color: var(--c-ink); border-color: var(--border-strong); }
.btn-outline:hover, .btn-secondary:hover { border-color: var(--c-ink); }
.btn-ghost { background: transparent; color: var(--c-ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--inset); }
.btn-danger { background: var(--c-surface); color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
.btn-danger:hover { background: var(--err-bg); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--c-primary); text-decoration: underline; cursor: pointer; }
.icon-btn { background: none; border: 0; font-size: 1.5rem; line-height: 1; width: 2.1rem; height: 2.1rem; border-radius: 50%; cursor: pointer; color: var(--c-muted); }
.icon-btn:hover { background: var(--inset); color: var(--c-ink); }

/* Overview */
.prose p { font-size: .9rem; line-height: 1.6; }
.prose p:last-child { margin: 0; }

/* Compliance badges */
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 1rem .5rem; }
.cbadge { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .35rem .2rem; background: none; border: 0; border-radius: var(--radius-sm); font: inherit; color: inherit; cursor: pointer; text-align: center; }
.cbadge:hover { background: var(--inset); }
.cbadge-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-weight: 800; font-size: .95rem; letter-spacing: .03em; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c-primary) 70%, #fff), var(--c-primary) 60%, color-mix(in srgb, var(--c-primary) 75%, #000));
  box-shadow: inset 0 0 0 3px rgb(255 255 255 / 35%), 0 0 0 1px color-mix(in srgb, var(--c-primary) 50%, transparent); }
.cbadge-name { font-size: .78rem; line-height: 1.3; }
.cbadge-sample { font-size: .66rem; font-weight: 700; color: #7a5600; background: #fff8db; border-radius: 999px; padding: 0 .4rem; }

/* Documents */
.doc-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: .45rem .8rem; font: inherit; font-size: .875rem; color: var(--c-muted); cursor: pointer; }
.tab:hover { color: var(--c-ink); }
.tab[aria-selected="true"] { color: var(--c-ink); border-bottom-color: var(--c-ink); font-weight: 500; }
.featured-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .5rem; }
.featured-item { display: flex; align-items: center; gap: .75rem; background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem; text-decoration: none; color: var(--c-ink); height: 100%; transition: border-color .15s; }
.featured-item:hover { border-color: var(--border-strong); }
.featured-item:hover .featured-title { text-decoration: underline; }
.featured-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 6px; background: var(--dark); color: #fff; flex-shrink: 0; }
.featured-icon .i { width: 22px; height: 22px; }
.featured-text { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.featured-title { font-size: .9rem; }
.featured-lock { color: var(--c-ink); padding-right: .4rem; }
.doc-category { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.filters .field { margin: 0; }
.filters .grow { flex: 1 1 260px; }
.filters select { width: auto; min-width: 170px; }
@media (max-width: 560px) { .filters .field, .filters select { width: 100%; } }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.input-icon input { padding-left: 2.2rem; }
#doc-count { margin: .5rem 0; }

.doc-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc-rows:empty { display: none; }
.doc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; padding: .95rem 1rem; border-bottom: 1px solid var(--border); align-items: start; }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: color-mix(in srgb, var(--inset) 50%, transparent); }
.doc-row.is-retired .doc-title a, .doc-row.is-retired .doc-icon { opacity: .6; }
.doc-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; background: var(--inset); color: var(--c-ink); }
.doc-title { font-size: .95rem; font-weight: 600; margin: .1rem 0 .2rem; }
.doc-title a { color: var(--c-ink); text-decoration: none; }
.doc-title a:hover { text-decoration: underline; }
.doc-desc { font-size: .85rem; color: var(--c-muted); margin: 0 0 .25rem; }
.doc-meta { font-size: .78rem; color: var(--c-muted); margin: 0; }
.doc-side { display: grid; justify-items: end; gap: .45rem; text-align: right; }
.doc-updated { font-size: .75rem; color: var(--c-muted); margin: 0; }
@media (max-width: 640px) {
  .doc-row { grid-template-columns: auto minmax(0, 1fr); }
  .doc-side { grid-column: 2; justify-items: start; text-align: left; }
}
.empty-state { text-align: center; padding: 1.75rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--c-muted); list-style: none; margin: 0; }
.skeleton-list { display: grid; gap: .5rem; }
.skeleton-list div { height: 74px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--inset) 0, #fafafa 50%, var(--inset) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-list[hidden] { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Badges */
.badges { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-published { background: var(--ok-bg); color: var(--ok); }
.badge-retired { background: #eef0f3; color: #4b5262; }
.badge-draft { background: var(--warn-bg); color: var(--warn); }
.badge-access-public { background: var(--info-bg); color: var(--info); }
.badge-access-request { background: #f1edfb; color: #5b34b5; }
.badge-sample { background: #fff8db; color: #7a5600; border-color: #efd98a; }
.badge-sample::before, .badge-neutral::before { display: none; }
.badge-neutral { background: var(--inset); color: var(--c-ink); }
.tag { display: inline-block; font-size: .72rem; border: 1px solid var(--border-strong); border-radius: 999px; padding: .05rem .55rem; margin-right: .5rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--c-surface); margin-top: .75rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th, .data-table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table thead th { font-size: .78rem; font-weight: 600; color: var(--c-ink); background: var(--c-surface); }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody th { font-weight: 500; }
.sub-table tbody th { border-right: 3px solid var(--inset); }
.sub-name { display: inline-flex; align-items: center; gap: .6rem; }
.sub-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; background: var(--inset); font-size: .75rem; font-weight: 700; }
@media (max-width: 640px) {
  .sub-table thead { display: none; }
  .sub-table tr { display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
  .sub-table tbody tr:last-child { border-bottom: 0; }
  .sub-table th, .sub-table td { display: grid; grid-template-columns: 96px 1fr; gap: .5rem; padding: .2rem 0; border: 0 !important; }
  .sub-table td::before, .sub-table th::before { content: attr(data-label); color: var(--c-muted); font-size: .78rem; font-weight: 400; }
}

/* Updates */
.update-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.update { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem; }
.update time { font-size: .78rem; color: var(--c-muted); }
.update h3 { font-size: .95rem; margin: .55rem 0 .35rem; }
.update h3 a { color: var(--c-ink); }
.update p { font-size: .875rem; margin: 0; }
.feed-link { margin: .85rem 0 0; }

/* Security practices */
.controls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.controls-grid .panel-head h2 { font-size: 1.1rem; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; }
.check-ico { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; flex-shrink: 0; margin-top: .1rem; }
.check-ico .i { width: 14px; height: 14px; stroke-width: 2.6; }
.check-title { display: block; }
.check-desc { display: block; color: var(--c-muted); font-size: .8rem; margin-top: .1rem; }

/* Contact */
.contact-panel { width: min(640px, 100%); justify-self: center; display: grid; gap: .5rem; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.contact-row p { margin: 0; font-size: .875rem; }
.contact-emails { margin: .25rem 0 0; }
.contact-emails:empty { display: none; }
@media (max-width: 520px) { .contact-row { flex-direction: column; align-items: flex-start; } }

/* Footer */
.site-footer { background: #eeeeec; border-top: 1px solid var(--border); padding: 2.25rem 0 2.5rem; }
.footer-inner { display: grid; justify-items: center; gap: .4rem; text-align: center; }
.footer-inner p { margin: 0; }
.attribution { font-size: .9rem; }
.attribution a, .attribution strong { color: var(--c-ink); font-weight: 600; }

/* Forms */
.field { margin-bottom: .9rem; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .3rem; }
.optional { font-weight: 400; color: var(--c-muted); }
.req { color: var(--err); }
input, select, textarea { width: 100%; font: inherit; font-size: .9rem; color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .7rem; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-ink); box-shadow: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--c-primary); }
.field-error { color: var(--err); font-size: .8rem; margin: .3rem 0 0; }
.field-error:empty { display: none; }
.check, .radio { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; font-size: .9rem; margin-bottom: .5rem; }
.check input, .radio input { margin-top: .3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .9rem; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.form-card h3 { margin-bottom: .35rem; }

.alert { border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .875rem; margin: .9rem 0 0; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }

/* Timeline (admin) */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.timeline-item { border-left: 3px solid var(--border-strong); padding: .1rem 0 .3rem 1rem; }
.timeline-item h3 { margin: .3rem 0; font-size: .95rem; }
.timeline-item p { margin: 0; font-size: .875rem; }
.timeline-meta { display: flex; gap: .6rem; align-items: center; font-size: .8rem; color: var(--c-muted); }

/* Meta list (document dialog) */
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem 1rem; margin: 0 0 1rem; font-size: .85rem; padding: .9rem; background: var(--inset); border-radius: var(--radius-sm); }
.meta:empty { display: none; }
.meta dt { color: var(--c-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.meta dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Dialog */
.dialog { border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; width: min(600px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; box-shadow: var(--shadow-lg); color: var(--c-ink); background: var(--c-surface); }
.dialog-sm { width: min(440px, calc(100% - 2rem)); }
.dialog-wide { width: min(760px, calc(100% - 2rem)); }
.dialog::backdrop { background: rgb(15 15 15 / 45%); }
.dialog-close-form { position: absolute; right: .8rem; top: .8rem; margin: 0; }
.dialog h2 { padding-right: 2.5rem; font-size: 1.2rem; }
.dialog .badges { margin-bottom: 1rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }

/* Simple centered page (login, unsubscribe) */
.login-wrap { min-height: 70vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-card { width: min(420px, 100%); }

/* Layout refinements */
.review-banner > div { flex: 1 1 380px; }
.controls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .controls-grid { grid-template-columns: 1fr; } }
.sub-table thead th:first-child { width: 30%; }
