/* Tablio / Codivra components. Requires tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-synthesis: none; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-press); }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

/* Layout */
.wrap { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding: var(--s-8) 0; }
.section--ruled { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 40px; }
.section-head .body { max-width: 38ch; }

/* Type */
.display { font-size: clamp(42px, 7vw, 84px); line-height: 1.06; letter-spacing: -3.6px; font-weight: 600; text-wrap: balance; }
.h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.12; letter-spacing: -2.4px; font-weight: 500; }
.h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -1.7px; font-weight: 530; }
.h3 { font-size: 24px; line-height: 1.3; letter-spacing: -.8px; font-weight: 560; }
.h4 { font-size: 19px; line-height: 1.4; letter-spacing: -.55px; font-weight: 560; }
.lead { font-size: 15px; line-height: 1.8; color: var(--muted); max-width: 52ch; text-wrap: pretty; }
.body { font-size: 13px; line-height: 1.85; color: var(--muted); text-wrap: pretty; }
.caption { font-size: 11px; line-height: 1.7; color: var(--muted); }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.mono-label { font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.aside-serif { font-family: var(--serif-aside); font-style: italic; }

/* Buttons: square, one primary per view */
.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 49px; padding: 14px 22px; font-size: 12px; font-weight: 550; border: 1px solid transparent; border-radius: 0; transition: background var(--d-color) var(--ease), border-color var(--d-color) var(--ease), transform var(--d-transform) var(--ease); }
.btn svg { transition: transform var(--d-transform) var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--sm { min-height: 39px; padding: 11px 16px; font-size: 11px; gap: 20px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-press); color: #fff; transform: translateY(-2px); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #34343b; color: #fff; }
.btn--outline { border-color: var(--line-strong); color: var(--ink); }
.btn--outline:hover { border-color: var(--ink); background: #efefeb; color: var(--ink); }
.btn--on-accent { background: #fff; color: var(--accent); }
.btn--on-accent:hover { background: #edf0ff; transform: translateY(-2px); }
.btn[disabled] { color: #b4b4ba; border-color: var(--line-strong); cursor: default; transform: none; }
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* Badges & tags */
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; line-height: 1; font-size: 9px; border-radius: var(--r-control); }
.status::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.status--ok { color: var(--ok-fg); background: var(--ok-bg); }
.status--warn { color: var(--warn-fg); background: var(--warn-bg); }
.status--info { color: var(--info-fg); background: var(--info-bg); }
.edition-tag { font-size: 9px; letter-spacing: .04em; padding: 4px 6px; border: 1px solid #b9c2dc; color: var(--info-fg); }
.type-tag { font-size: 9px; letter-spacing: .05em; color: var(--ink-2); border: 1px solid #d7d7d1; padding: 4px 7px; }
.badge { font-size: 9px; letter-spacing: .08em; font-weight: 650; background: var(--accent); color: #fff; padding: 5px 8px; }
.chip { font-size: 10.5px; letter-spacing: .02em; padding: 8px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.filed-tag { font-size: 10px; color: var(--ink-2); border: 1px solid var(--line); background: #fff; padding: 6px 10px; }

/* Product chip: every post/doc page, one per page */
.product-chip { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: #fff; padding: 4px 10px 4px 4px; color: var(--ink); transition: border-color .18s; }
.product-chip:hover { border-color: var(--accent); color: var(--ink); }
.product-mark { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; padding: 4px; width: 22px; height: 22px; background: var(--accent); flex-shrink: 0; }
.product-mark i { display: block; background: #fff; }
.product-mark--lg { width: 28px; height: 28px; padding: 5px; }
.product-name { font-size: 12px; font-weight: 600; letter-spacing: -.2px; }
.product-line { font-size: 9px; letter-spacing: .1em; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); padding-left: 9px; }

/* Forms */
.label { font: 9px var(--mono); letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.input, .select { height: 42px; padding: 0 14px; font: 12.5px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--field); border-radius: var(--r-control); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

/* Cards */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.feature-grid > * { padding: 28px; box-shadow: 1px 0 0 0 var(--line), 0 1px 0 0 var(--line); }
.record-card { background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--accent); padding: 24px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 650; width: 26px; height: 26px; border-radius: var(--r-avatar); background: #e5e9f5; color: #3d4c73; flex-shrink: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-value { font-size: clamp(32px, 4vw, 50px); letter-spacing: -2.4px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 10px; }

/* Tables */
.table-wrap { background: #fff; border: 1px solid var(--line); overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; text-align: left; font-size: 11px; }
.table th { font-size: 9px; font-weight: 550; padding: 11px 10px; background: color-mix(in srgb, var(--accent) 6%, #fff); color: color-mix(in srgb, var(--accent) 65%, #333); border-block: 1px solid color-mix(in srgb, var(--accent) 12%, #fff); }
.table td { padding: 15px 10px; border-bottom: 1px solid #eeedf0; color: var(--ink-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Accordion */
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item button { display: flex; justify-content: space-between; align-items: center; gap: 20px; width: 100%; text-align: left; padding: 21px 0; font-size: 13px; font-weight: 500; transition: color var(--d-color) var(--ease); }
.faq-item button:hover, .faq-item button[aria-expanded="true"] { color: var(--accent); }

/* Callouts: max two per article */
.callout { padding: 22px 24px; border: 1px solid; }
.callout-title { font-size: 9px; letter-spacing: .1em; font-weight: 650; text-transform: uppercase; }
.callout p:not(.callout-title) { font-size: 15px; line-height: 1.8; margin-top: 10px; text-wrap: pretty; }
.callout--info { border-color: var(--info-line); background: var(--info-bg); }
.callout--info .callout-title { color: var(--info-fg); } .callout--info p { color: var(--info-text); }
.callout--warn { border-color: var(--warn-line); background: var(--warn-bg); }
.callout--warn .callout-title { color: var(--warn-fg); } .callout--warn p { color: var(--warn-text); }

/* Article */
.prose { font-size: 16px; line-height: 1.8; color: var(--read); max-width: 68ch; }
.prose h2 { font-size: 28px; letter-spacing: -1.1px; font-weight: 560; color: var(--ink); margin-top: 56px; }
.prose p + p { margin-top: 18px; }
.summary { border: 1px solid var(--line); background: #fff; padding: 24px 26px; }
.summary ul { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.summary li { display: flex; gap: 12px; font-size: 15px; line-height: 1.7; }
.summary li::before { content: ""; width: 6px; height: 6px; background: var(--accent); margin-top: 10px; flex-shrink: 0; }
.pullquote { padding: 34px 0 30px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.pullquote blockquote { margin: 0; font-size: clamp(21px, 2.6vw, 27px); line-height: 1.45; letter-spacing: -.7px; font-weight: 500; color: var(--ink); }
.figure figcaption { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin-top: 10px; display: flex; gap: 10px; }
.product-card { border: 1px solid var(--ink); background: #fff; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.product-card-specs { background: #f4f4f1; border-left: 1px solid var(--line); padding: 26px; }

/* Code */
.code { background: var(--night); color: #e7e7ec; border: 1px solid var(--night-rule); }
.code-bar { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--night-rule); background: #1a1b21; }
.code pre { margin: 0; padding: 20px 18px; overflow-x: auto; font: 13px/1.85 var(--mono); }
.tok-cmd { color: #9fe3c4; } .tok-flag { color: #a8b7f0; } .tok-val { color: var(--spot); } .tok-comment { color: #7c7d8a; }
code:not(pre code) { font: 12px var(--mono); background: var(--sunken); border: 1px solid var(--line); padding: 2px 6px; }
kbd { font: 10px var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; padding: 2px 6px; background: #fff; color: var(--ink-2); }

/* TOC rail */
.toc a { display: block; font-size: 11.5px; line-height: 1.5; padding: 7px 0 7px 12px; border-left: 2px solid #e4e4e0; color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { border-left-color: var(--accent); color: var(--ink); }

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--ink); }

/* Night surface: one per page, spot replaces accent */
.night { background: var(--night); color: #fff; padding: var(--s-8) 0; }
.night .body { color: var(--night-muted); }
.night .mono-label { color: #8f909c; }

/* Modal */
.scrim { position: fixed; inset: 0; background: rgb(21 21 24 / .45); }
.window { background: #fff; border-radius: var(--r-window); box-shadow: var(--shadow-window); }

@media (max-width: 680px) {
  :root { --gutter: 20px; }
  .section { padding: 56px 0; }
  .product-card-specs { border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
