/* ===================================================================== Inkwell — component CSS, base reset, layout helpers, accessibility. Version: 3.11.0 This file contains everything EXCEPT custom-property declarations and the dark-mode cascade (which live in inkwell-tokens.css). All rules in this file reference Inkwell tokens via var(...) and contain no literal hex codes — palettes are swappable by replacing the tokens file alone. Consumption: • Pure-CSS use: `inkwell.css` imports this file alongside inkwell-tokens.css. Link inkwell.css from . • Tailwind v4: inkwell-theme.css imports this file inside @layer components so Tailwind utilities can override component styles by default. The .select rule below has paired dark-mode background-image overrides in inkwell-tokens.css; the override selectors carry higher specificity, so the dark chevron always wins regardless of source order or cascade layering. ===================================================================== */ /* ===================================================================== Base reset & body ===================================================================== */ * { box-sizing: border-box; } @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } } body { margin: 0; background: var(--ivory); color: var(--slate); font-family: var(--sans); font-size: var(--t-body); line-height: 1.55; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; } /* ===================================================================== Type styles ===================================================================== */ .t-display, .t-h1, .t-h2, .t-h3, h1, h2, h3, h4 { min-inline-size: 0; overflow-wrap: anywhere; } /* Tracking tuned for Latin must not space joining scripts or Hebrew. :lang() follows language inheritance and respects nested opposite-language islands. */ :is(h1, h2, h3, h4, .t-display, .t-h1, .t-h2, .t-h3, .eyebrow, .eyebrow-serif, .badge, .pill, .tab, .byline, .callout-label, .tldr-label, .carousel-counter, .sec-head .idx, .sec-head .count, .tbl th, .code-block .copy, .stat-num, .stat-label, .finding-num, .finding-src, .avatar, .navbar .brand):is(:lang(ar), :lang(fa), :lang(ur), :lang(he)) { letter-spacing: normal; text-transform: none; line-height: 1.5; } :is(h1, h2, h3, h4, .t-display, .t-h1, .t-h2, .t-h3):is(:lang(ar), :lang(fa), :lang(ur)) { line-height: 1.45; } .icon-directional { display: inline-block; } .icon-directional:dir(rtl), .carousel-btn:dir(rtl) > svg { scale: -1 1; } .t-display { font-family: var(--serif); font-weight: 600; font-size: var(--t-display); line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; } .t-h1 { font-family: var(--serif); font-weight: 600; font-size: var(--t-h1); line-height: 1.2; letter-spacing: -0.018em; text-wrap: balance; } .t-h2 { font-family: var(--serif); font-weight: 600; font-size: var(--t-h2); line-height: 1.3; letter-spacing: -0.012em; text-wrap: balance; } .t-h3 { font-family: var(--serif); font-weight: 600; font-size: var(--t-h3); line-height: 1.22; letter-spacing: -0.01em; } .t-lede { font: 400 var(--t-lede)/1.5 var(--serif); font-style: italic; color: var(--gray-700); max-width: 60ch; text-wrap: pretty; } .t-body { font: 430 var(--t-body)/1.55 var(--sans); } .t-small { font: 430 var(--t-small)/1.5 var(--sans); color: var(--gray-700); } .t-caption { font: 500 var(--t-caption)/1.4 var(--sans); color: var(--gray-500); } /* Eyebrow — small uppercase mono label with leading accent rule. Use .eyebrow for product/dashboard contexts (signals technical metadata). Use .eyebrow-serif for editorial contexts (small italic serif, magazine kicker). */ .eyebrow { font-family: var(--mono); font-size: var(--t-eyebrow); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-500); display: inline-flex; align-items: center; gap: 12px; } .eyebrow::before { content: ""; width: 24px; height: 1.5px; background: var(--accent); } .eyebrow-serif { font-family: var(--serif); font-size: 0.8125rem; font-style: italic; letter-spacing: 0.02em; text-transform: none; /* defend against an uppercase ancestor */ color: var(--gray-700); display: inline-flex; align-items: center; gap: 12px; } .eyebrow-serif::before { content: ""; width: 24px; height: 1.5px; background: var(--accent); } /* ===================================================================== Editorial primitives Long-form/magazine patterns. Use inside prose contexts; they expect serif body and 60–65ch line-lengths. ===================================================================== */ .dropcap::first-letter { font: 600 4.2em/0.85 var(--serif); float: inline-start; padding-block: 6px 0; padding-inline: 0 10px; color: var(--accent-ink); } /* A separated initial would break joining-script word shapes. */ .dropcap:is(:lang(ar), :lang(fa), :lang(ur))::first-letter { float: none; font: inherit; padding: 0; color: inherit; } .pullquote { font: 500 clamp(1.375rem, 0.5rem + 2vw, 2rem)/1.35 var(--serif); font-style: italic; max-width: 32ch; margin: 32px auto; padding-inline-start: 24px; border-inline-start: 1.5px solid var(--accent); color: var(--slate); text-wrap: pretty; } .byline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; font: 0.75rem var(--mono); /* mono earns its place HERE — actual metadata */ text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); } .byline .author { font: italic 0.875rem/1.3 var(--serif); text-transform: none; letter-spacing: 0; color: var(--gray-700); } figure.figure { margin: 32px 0; } figure.figure img, figure.figure video { display: block; max-width: 100%; height: auto; border-radius: var(--r-md); border: var(--border); } figure.figure figcaption { font: italic 0.8125rem/1.5 var(--serif); color: var(--gray-500); margin-top: 10px; padding-inline-start: 12px; border-inline-start: 1.5px solid var(--gray-300); } /* Inline elements */ em.accent, .serif em { font-style: italic; color: var(--accent-ink); } a.link { color: var(--accent-ink); text-decoration-color: var(--oat); text-underline-offset: 3px; } a.link:hover { text-decoration-color: var(--accent-ink); } code, .code-inline { font-family: var(--mono); font-size: 0.86em; background: var(--gray-100); padding: 1.5px 5px; border-radius: var(--r-xs); overflow-wrap: anywhere; } /* ===================================================================== Components ===================================================================== */ /* ---------- Button ---------- */ .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; min-width: 0; max-width: 100%; padding: 8px 16px; font-family: var(--sans); font-size: 0.875rem; font-weight: 500; line-height: 1.4; text-align: center; overflow-wrap: anywhere; border-radius: var(--r-sm); border: 1.5px solid transparent; cursor: pointer; transition: background var(--t-fast) ease, border-color var(--t-fast) ease; } .btn-primary { background: var(--accent); color: var(--on-accent); } .btn-primary:hover { background: var(--accent-d); } .btn-secondary { background: var(--paper); color: var(--slate); border-color: var(--gray-300); } .btn-secondary:hover { background: var(--gray-100); } .btn-ghost { background: transparent; color: var(--gray-700); } .btn-ghost:hover { background: var(--gray-100); } .btn-danger { background: var(--rust); color: var(--paper); } .btn-danger:hover { background: var(--rust-d); } .btn:disabled, .btn.is-disabled { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-200); cursor: not-allowed; } .btn.is-disabled { pointer-events: none; } /* anchors styled as buttons; native :disabled keeps cursor feedback */ .btn-primary:active:not(:disabled) { background: var(--accent-d); } .btn-secondary:active:not(:disabled) { background: var(--gray-200); } .btn-ghost:active:not(:disabled) { background: var(--gray-200); } .btn-danger:active:not(:disabled) { background: var(--rust-d); } .btn-sm { min-height: 30px; padding: 4px 12px; font-size: 0.8125rem; } .btn[aria-busy="true"] { pointer-events: none; } .btn[aria-busy="true"]::before { box-sizing: border-box; content: ""; width: 12px; height: 12px; margin-inline-end: 8px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: btn-spin 0.7s linear infinite; } @keyframes btn-spin { to { transform: rotate(360deg); } } @media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::before { animation: none; border-top-color: currentColor; opacity: 0.5; } } /* ---------- Input / Textarea / Select ---------- */ .input, .textarea, .select { min-width: 0; max-width: 100%; padding: 0 12px; font: 0.875rem var(--sans); color: var(--slate); background: var(--paper); border: var(--control-border); border-radius: var(--r-sm); outline: none; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; } .input { min-height: 38px; } .select { min-height: 38px; appearance: none; overflow: hidden; text-overflow: ellipsis; background-image: url("data:image/svg+xml;utf8,"); background-repeat: no-repeat; background-position: right 12px center; padding-inline-end: 32px; } .textarea { padding: 10px 12px; min-height: 96px; line-height: 1.5; resize: vertical; font-family: var(--sans); } .select:dir(rtl) { background-position: left 12px center; } .input::placeholder, .textarea::placeholder { color: var(--gray-500); } .input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-focus-ring); } .input:disabled, .textarea:disabled, .select:disabled, .input.is-disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; } .input.is-error, .textarea.is-error, .select.is-error, .input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--rust); box-shadow: 0 0 0 3px var(--rust-focus-ring); } /* ---------- Field group (label + control + help/error) ---------- */ .field { display: flex; flex-direction: column; min-width: 0; gap: 6px; } .field > .input, .field > .textarea, .field > .select { width: 100%; } .field-label { font: 500 0.8125rem/1.2 var(--sans); color: var(--slate); } .field-help { font: 0.75rem/1.4 var(--sans); color: var(--gray-500); } .field-error { font: 500 0.75rem/1.4 var(--sans); color: var(--rust); } /* ---------- Checkbox ---------- */ .checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; } .checkbox input { appearance: none; width: 18px; height: 18px; border: var(--control-border); border-radius: 5px; background: var(--paper); position: relative; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); } .checkbox input:checked { background: var(--accent); border-color: var(--accent); } .checkbox input:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); } /* ---------- Radio ---------- */ .radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; } .radio input { appearance: none; width: 18px; height: 18px; border: var(--control-border); border-radius: 50%; background: var(--paper); position: relative; cursor: pointer; transition: border-color var(--t-fast); } .radio input:checked { border-color: var(--accent); } .radio input:checked::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); } /* ---------- Switch ---------- */ .switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; } .switch input { appearance: none; width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--gray-400); position: relative; cursor: pointer; transition: background var(--t-fast); } .switch input::after { content: ""; position: absolute; inset-inline-start: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-sm); transition: inset-inline-start var(--t-fast) var(--ease-out); } .switch input:checked { background: var(--accent); } .switch input:checked::after { inset-inline-start: 18px; } /* Long translations must wrap beside the control without shrinking its visible state indicator or creating a page-level overflow. */ .checkbox, .radio, .switch { min-width: 0; max-width: 100%; overflow-wrap: anywhere; } .checkbox input, .radio input, .switch input { flex-shrink: 0; } /* ---------- Keyboard chip () ---------- */ kbd, .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; min-height: 22px; padding: 0 6px; font: 500 0.6875rem/1.4 var(--mono); color: var(--gray-700); background: var(--paper); border: 1px solid var(--gray-300); border-bottom-width: 2px; border-radius: var(--r-xs); vertical-align: baseline; } /* ---------- Badge / Pill ---------- */ .badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; font-size: 0.75rem; font-weight: 500; border-radius: var(--r-pill); } .badge-neutral { background: var(--gray-100); color: var(--gray-700); } .badge-accent { background: var(--accent-tint); color: var(--accent-ink); } .badge-success { background: var(--olive-tint); color: var(--olive-dark); } .badge-warning { background: var(--warning-tint); color: var(--warning-dark); } .badge-danger { background: var(--rust); color: var(--paper); } .badge, .pill, .chip-dot { min-inline-size: 0; max-inline-size: 100%; white-space: normal; } /* ---------- Card ---------- */ .card { background: var(--paper); border: var(--border); border-radius: var(--r-lg); padding: var(--sp-5); transition: border-color var(--t-base) ease; } .card.is-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; cursor: pointer; } .card.is-link:hover { border-color: var(--gray-500); } /* ---------- Stat card ---------- */ .stat-card { container: inkwell-stat / inline-size; min-inline-size: 0; background: var(--paper); border: var(--border); border-radius: var(--r-md); padding: 20px 22px 18px; } .stat-card > * { min-inline-size: 0; overflow-wrap: anywhere; } .stat-card.is-primary { border-color: var(--accent); } .stat-num { font: 600 2.75rem/1 var(--serif); margin-bottom: var(--sp-2); color: var(--slate); letter-spacing: -0.018em; font-variant-numeric: tabular-nums; } /* The preceding font remains the fallback. Keep local sizing on direct children so unrelated stat-number markup does not acquire viewport units. */ .stat-card > .stat-num { font-size: clamp(2rem, 1.25rem + 9cqi, 2.75rem); } .stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); } .stat-delta { font-family: var(--mono); font-size: 0.6875rem; margin-top: 6px; font-variant-numeric: tabular-nums; } .stat-delta.up { color: var(--olive-dark); } .stat-delta.down { color: var(--rust); } .stat-delta.flat { color: var(--gray-500); } /* ---------- Cited findings ---------- Oversized stat + explanation + source, rule-divided. Editorial cousin of .stat-card (use that for a boxed KPI). Source uses the mono metadata convention; set .finding-src to var(--accent-ink) for an accent citation. */ .findings { display: flex; flex-direction: column; } .finding { container: inkwell-finding / inline-size; display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); column-gap: var(--sp-5); row-gap: var(--sp-2); align-items: start; padding: var(--sp-5) 0; border-top: var(--border-rule); } /* Query children rather than the container itself. The stacked default also remains usable below the supported container-query browser floor. */ .finding > * { grid-column: 1 / -1; min-inline-size: 0; overflow-wrap: anywhere; } @container inkwell-finding (width > 35rem) { .finding > * { grid-column: auto; } } .finding:first-child { border-top: none; padding-top: 0; } .finding-num { font: 600 clamp(2.75rem, 1rem + 5vw, 4rem)/0.95 var(--serif); letter-spacing: -0.02em; color: var(--accent-ink); } /* The preceding font is the safe fallback if cqi is unavailable. */ .finding > .finding-num { font-size: clamp(2.75rem, 1rem + 8cqi, 4rem); } .finding-text { font: 400 var(--t-lede)/1.45 var(--sans); color: var(--slate); text-wrap: pretty; margin: 0; } .finding-text strong { font-weight: 600; } .finding-src { display: block; margin-top: 12px; font: 500 var(--t-eyebrow)/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-500); } /* ---------- Table ---------- */ .tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: var(--border); border-radius: var(--r-md); overflow: hidden; } .tbl thead th { text-align: start; font: 600 0.6875rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-700); background: var(--gray-100); padding: 12px 16px; border-bottom: 1px solid var(--gray-300); } .tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); font-size: 0.875rem; } .tbl tbody tr:last-child td { border-bottom: none; } /* ---------- Dark TL;DR / callout panel ---------- */ .tldr { background: var(--slate); color: var(--ivory); border-radius: var(--r-md); padding: 22px 26px; } .tldr-label { font: 500 var(--t-eyebrow)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--oat); margin-bottom: 10px; } .tldr code { background: var(--tldr-code-tint); color: var(--ivory); } /* ---------- Severity pill ---------- */ .pill { display: inline-flex; align-items: baseline; gap: 6px; font: 600 0.75rem/1 var(--sans); border-radius: var(--r-pill); padding: 5px 12px; } .pill.sev { background: var(--accent); color: var(--on-accent); letter-spacing: 0.03em; } .pill.resolved { background: var(--olive-dark); color: var(--paper); } .pill.neutral { background: var(--gray-100); color: var(--gray-700); border: var(--border); } .pill.neutral .v { font-family: var(--mono); } /* ---------- Timeline ---------- */ .timeline { position: relative; padding-block: 4px; padding-inline: 16px 0; list-style: none; } .timeline::before { content: ""; position: absolute; inset-inline-start: 16px; top: 8px; bottom: 8px; width: 2px; background: var(--gray-300); } .tl-entry { position: relative; padding-block: 0 22px; padding-inline: 28px 0; } .tl-entry::before { content: ""; position: absolute; inset-inline-start: -7px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); } /* ---------- Section header ---------- */ .sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 10px; } .sec-head .idx { font: 600 0.8125rem/1 var(--mono); color: var(--accent-ink); width: 34px; flex-shrink: 0; } .sec-head :is(h1, h2) { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.6875rem; letter-spacing: -0.012em; } .sec-head .count { font: 0.6875rem/1 var(--mono); color: var(--gray-500); background: var(--gray-100); padding: 2px 8px; border-radius: var(--r-pill); } /* ---------- TOC pill nav ---------- */ .toc { display: flex; flex-wrap: wrap; gap: 8px; } .toc a { max-inline-size: 100%; font-size: 0.78125rem; padding: 7px 14px; border: var(--border); border-radius: var(--r-pill); text-decoration: none; color: var(--gray-700); background: var(--paper); transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast); display: inline-flex; align-items: center; gap: 7px; } .toc a .n { font: 0.625rem/1 var(--mono); color: var(--gray-500); } .toc a:hover { border-color: var(--slate); color: var(--slate); } .toc a:hover .n { color: var(--accent-ink); } /* ---------- Avatar (PR-style monogram) ---------- */ .avatar { min-width: 36px; min-height: 36px; border-radius: 50%; background: var(--oat); color: var(--slate); display: inline-flex; align-items: center; justify-content: center; font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.02em; border: var(--border); } /* ---------- Risk chip (with status dot) ---------- */ .chip-dot { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); border: var(--border); font: 0.78125rem var(--mono); color: var(--slate); background: var(--paper); } .chip-dot .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; } .chip-dot.safe { background: var(--olive-tint); border-color: var(--olive-strong-border); } .chip-dot.safe .dot { background: var(--olive); } .chip-dot.medium { background: var(--oat); } .chip-dot.medium .dot { background: var(--gray-500); } .chip-dot.attention { background: var(--accent-tint); border-color: var(--accent-strong-border); } .chip-dot.attention .dot { background: var(--accent); } /* ---------- Alert / banner ---------- */ .alert { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); border: var(--border); background: var(--paper); font-size: 0.875rem; line-height: 1.5; color: var(--slate); } .alert-title { font-weight: 600; margin: 0 0 2px; font-size: 0.875rem; color: var(--slate); } .alert > :not(svg) { min-inline-size: 0; } .alert > svg { flex-shrink: 0; } .alert-body { color: var(--gray-700); } /* Semantic is carried by tinted bg + border. The title stays slate so the info/success/warning/danger variants read as one component rather than "colored heading + body". Pair with an icon or role="alert" if a third signal is needed. */ .alert.is-info { background: var(--info-tint); border-color: var(--info-strong-border); } .alert.is-success { background: var(--olive-tint); border-color: var(--olive-strong-border); } .alert.is-warning { background: var(--warning-tint); border-color: var(--warning-strong-border); } .alert.is-danger { background: var(--rust-tint); border-color: var(--rust-tint-border); } /* ---------- Contrast callout ---------- Two-tier "current vs desired" block. Neutral base = the reality now; .is-accent = the target. Serif statement body, uppercase kicker, accent left spine. Set --_bar: 1.5px for a strict hairline instead of 3px. */ .callout { --_bar: 3px; background: var(--gray-100); border: var(--border); border-inline-start-width: var(--_bar); border-inline-start-color: var(--gray-400); border-radius: var(--r-md); padding: 18px 22px; } .callout + .callout { margin-top: var(--sp-4); } .callout-label { font: 600 var(--t-caption)/1 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); margin: 0 0 10px; } .callout-body { font: 500 var(--t-lede)/1.4 var(--serif); color: var(--slate); text-wrap: pretty; margin: 0; } .callout-body strong { font-weight: 700; } .callout.is-accent { background: var(--accent-tint); border-inline-start-color: var(--accent); } .callout.is-accent .callout-label { color: var(--accent-ink); } /* ---------- Multi-line code block ---------- */ .code-block { position: relative; background: var(--gray-100); border: var(--border); border-radius: var(--r-md); padding: 14px 16px; font: 0.8125rem/1.55 var(--mono); color: var(--slate); overflow-x: auto; } .code-block pre, pre.code-block { margin: 0; font: inherit; color: inherit; white-space: pre; } .code-block:has(> .copy) { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); } .code-block:has(> .copy) > pre { overflow-x: auto; } .code-block .copy { justify-self: end; max-inline-size: 100%; min-height: 26px; padding: 0 10px; font: 500 0.6875rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-700); background: var(--paper); border: var(--border); border-radius: var(--r-xs); cursor: pointer; } .code-block .copy:hover { border-color: var(--slate); color: var(--slate); } /* ---------- Action menu (enhanced by inkwell-interactions.js) ---------- */ .menu { display: inline-block; min-inline-size: 0; max-inline-size: 100%; } .menu > [data-menu-trigger][hidden], .menu-panel[hidden], .menu-item[hidden] { display: none !important; } .menu-panel[data-inkwell-menu-position="pending"] { opacity: 0; pointer-events: none; } .menu-panel { box-sizing: border-box; inline-size: max-content; min-inline-size: min(12rem, 100%); max-inline-size: 100%; padding: var(--sp-1); margin: 0; background: var(--paper); color: var(--slate); border: var(--border); border-radius: var(--r-sm); } .menu-panel[data-inkwell-menu-ready="true"] { position: fixed; inset: auto; z-index: var(--z-overlay); min-inline-size: min(12rem, var(--_menu-max-inline, calc(100vw - 16px))); max-inline-size: var(--_menu-max-inline, calc(100vw - 16px)); max-block-size: var(--_menu-max-block, calc(100dvh - 16px)); overflow: hidden auto; overscroll-behavior: contain; } .menu-panel[data-inkwell-menu-position="manual"] { left: var(--_menu-left); top: var(--_menu-top); } @supports (position-area: block-end span-inline-end) { .menu-panel[data-inkwell-menu-position="anchor"] { position-area: block-end span-inline-end; justify-self: start; align-self: start; position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; margin-block: var(--sp-2); } } .menu-item { display: flex; align-items: center; gap: var(--sp-2); inline-size: 100%; min-inline-size: 0; min-block-size: 32px; padding: var(--sp-2) var(--sp-3); border: 0; border-radius: var(--r-xs); background: transparent; color: var(--slate); font: 430 0.875rem/1.4 var(--sans); text-align: start; text-decoration: none; white-space: normal; overflow-wrap: anywhere; cursor: pointer; } .menu-item:focus-visible { background: var(--gray-100); outline-offset: -2px; } @media (hover: hover) { .menu-item:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--gray-100); } } .menu-item:disabled, .menu-item[aria-disabled="true"] { color: var(--gray-500); cursor: not-allowed; } .menu-separator { border: 0; border-block-start: var(--border-hair); margin: var(--sp-1) 0; } [data-menu-trigger][aria-expanded="true"] { border-color: var(--accent-ink); } /* ---------- Dialog (native ) ---------- */ .dialog { background: var(--paper); color: var(--slate); border: var(--border); border-radius: var(--r-lg); padding: 0; box-shadow: var(--shadow-lg); max-width: 480px; width: calc(100% - 32px); } .dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); } .dialog[open] { animation: dialog-pop var(--t-base) var(--ease-pop); } @keyframes dialog-pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } } .dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 12px; border-bottom: var(--border-hair); } .dialog-head h2 { margin: 0; font: 600 1.125rem/1.3 var(--serif); letter-spacing: -0.01em; } .dialog-body { padding: 16px 22px; line-height: 1.55; } .dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 22px 16px; border-top: var(--border-hair); } .dialog-close { background: transparent; border: none; min-width: 28px; min-height: 28px; padding: 0 4px; border-radius: var(--r-xs); color: var(--gray-500); font: 1.125rem/1 var(--sans); cursor: pointer; } .dialog-close:hover { background: var(--gray-100); color: var(--slate); } /* ---------- Tabs ---------- */ .tabs { display: flex; gap: 4px; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; border-bottom: var(--border-rule); margin-bottom: var(--sp-5); } .tab { position: relative; flex: 0 0 auto; padding: 10px 16px; font: 500 0.875rem/1 var(--sans); color: var(--gray-700); background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1.5px; cursor: pointer; transition: color var(--t-fast), border-color var(--t-fast); } .tab:hover { color: var(--slate); } .tab[aria-selected="true"], .tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); } .tab-panel { display: block; } .tab-panel[hidden] { display: none; } .tabs[aria-orientation="vertical"] { flex-direction: column; border-bottom: none; border-inline-end: var(--border-rule); } .tabs[aria-orientation="vertical"] > .tab { text-align: start; margin-bottom: 0; border-bottom: none; border-inline-end: 2px solid transparent; } .tabs[aria-orientation="vertical"] > .tab[aria-selected="true"] { border-inline-end-color: var(--accent); } .tab:disabled, .tab[aria-disabled="true"] { color: var(--gray-500); cursor: not-allowed; } /* ---------- Segmented control ---------- A pill-shaped group of mutually-exclusive options sharing one outer border. Mark the active option with aria-pressed="true" (toggle buttons) or .is-active. Use for 2–4 short labels: theme toggle, view modes, filters. */ .segmented { display: inline-flex; max-width: 100%; align-items: center; background: var(--paper); border: var(--border); border-radius: var(--r-sm); padding: 2px; gap: 2px; } .segmented > button, .segmented > .seg { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; min-width: 0; padding: 6px 12px; overflow-wrap: anywhere; font: 500 0.8125rem/1.2 var(--sans); color: var(--gray-700); background: transparent; border: none; border-radius: 6px; cursor: pointer; transition: background var(--t-fast) ease, color var(--t-fast) ease; } .segmented > button:hover, .segmented > .seg:hover { color: var(--slate); } .segmented > button[aria-pressed="true"], .segmented > button.is-active, .segmented > .seg.is-active { background: var(--gray-100); color: var(--slate); } /* ---------- Tooltip ([data-tooltip] on any element) ---------- */ .tooltip { position: relative; display: inline-flex; } .tooltip[data-tooltip]::after { box-sizing: border-box; /* An invisible off-screen bubble must not expand the page's scroll area. */ display: none; content: attr(data-tooltip); content: attr(data-tooltip) / ""; position: absolute; bottom: 100%; left: var(--_tooltip-left, 50%); transform: var(--_tooltip-transform, translateX(-50%)); background: var(--slate); background-clip: padding-box; /* Transparent border bridges the hover gap without taking ::before, which remains available to the button's loading spinner. */ border-bottom: 6px solid transparent; color: var(--ivory); font: 500 0.6875rem/1.4 var(--sans); padding: 5px 9px; border-radius: var(--r-xs); width: max-content; max-width: min(32ch, var(--_tooltip-max-width, calc(100vw - 32px))); white-space: normal; overflow-wrap: anywhere; pointer-events: none; opacity: 0; transition: opacity var(--t-fast); z-index: var(--z-overlay); } .tooltip[data-tooltip]:hover::after, .tooltip[data-tooltip]:focus-within::after { display: block; opacity: 1; pointer-events: auto; } .tooltip[data-tooltip][data-inkwell-tooltip-dismissed]::after { display: none; opacity: 0; pointer-events: none; } .tooltip[data-inkwell-tooltip-side="below"]::after { top: 100%; bottom: auto; border-bottom: none; border-top: 6px solid transparent; } /* ---------- Breadcrumbs ---------- */ .breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font: 0.8125rem/1.4 var(--sans); color: var(--gray-500); } .breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; } .breadcrumbs li + li::before { content: "/"; color: var(--gray-300); font: 0.8125rem/1 var(--mono); } .breadcrumbs a { color: var(--gray-700); text-decoration: none; transition: color var(--t-fast); } .breadcrumbs a:hover { color: var(--accent-ink); } .breadcrumbs [aria-current="page"] { color: var(--slate); font-weight: 500; } /* ---------- Pagination ---------- */ .pagination { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: thin; list-style: none; margin: 0; padding: 0; } .pagination .page, .pagination a, .pagination button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 7px 10px; font: 500 0.8125rem/1 var(--mono); color: var(--gray-700); background: var(--paper); border: var(--border); border-radius: var(--r-sm); text-decoration: none; cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); } .pagination a:hover, .pagination button:hover { border-color: var(--slate); color: var(--slate); } .pagination [aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); } .pagination .ellipsis { min-width: 24px; border: none; background: transparent; color: var(--gray-500); cursor: default; } /* ---------- Native progress and meter ---------- Use for tasks and for measurements. Keep labels and value/status text outside the bar. These are read-only indicators, not keyboard stops. */ progress.progress, meter.meter { display: block; inline-size: 100%; min-inline-size: 0; block-size: 0.75rem; box-sizing: border-box; padding: 0; border: var(--control-border); border-radius: var(--r-pill); background: var(--gray-100); overflow: clip; } progress.progress { appearance: none; container-type: inline-size; --progress-bar-indeterminate-size: 30%; --progress-bar-indeterminate-duration: 1.5s; --_progress-animation: none; --_progress-play-state: running; --_progress-delay: 0s; } progress.progress:indeterminate { --_progress-animation: inkwell-progress var(--progress-bar-indeterminate-duration) linear infinite; } progress.progress:dir(rtl) { --_progress-direction: reverse; } progress.progress::-webkit-progress-bar { background: transparent; } /* Keep engine pseudo-elements separate: an unknown one invalidates a list. */ progress.progress::-webkit-progress-value { background: var(--accent-ink); border-radius: var(--r-pill); animation: var(--_progress-animation); animation-direction: var(--_progress-direction, normal); animation-play-state: var(--_progress-play-state); animation-delay: var(--_progress-delay); } progress.progress::-moz-progress-bar { background: var(--accent-ink); border-radius: var(--r-pill); animation: var(--_progress-animation); animation-direction: var(--_progress-direction, normal); animation-play-state: var(--_progress-play-state); animation-delay: var(--_progress-delay); } @keyframes inkwell-progress { from, to { inline-size: var(--progress-bar-indeterminate-size); /* Physical origin before translate; logical margins jump in RTL. */ margin-right: auto; } from { translate: -100%; } to { translate: 100cqi; } } /* Pausing midway keeps Chromium's otherwise zero-width indeterminate fill visible, without continuing motion or claiming a numeric completion. */ @media (prefers-reduced-motion: reduce), print { progress.progress:indeterminate { --_progress-play-state: paused; --_progress-delay: calc(var(--progress-bar-indeterminate-duration) / -2); } } /* Blink requires native appearance to keep the meter's inner box painted. Firefox and Safari require none for custom fills. Feature queries keep that engine difference in CSS, without a script or user-agent sniff. */ meter.meter { appearance: auto; } @supports selector(::-moz-meter-bar) { meter.meter { appearance: none; } } @supports (-webkit-touch-callout: none) { meter.meter { appearance: none; } } meter.meter::-webkit-meter-bar { block-size: 100%; /* Blink's native inner grid otherwise reserves half the height for air. */ grid-row: 1 / -1; border: 0; border-radius: var(--r-pill); background: transparent; box-shadow: none; } meter.meter::-webkit-meter-optimum-value { background: var(--olive-dark); border-radius: var(--r-pill); } meter.meter::-webkit-meter-suboptimum-value { background: var(--warning-dark); border-radius: var(--r-pill); } meter.meter::-webkit-meter-even-less-good-value { background: var(--rust); border-radius: var(--r-pill); } meter.meter::-moz-meter-bar { background: var(--olive-dark); border-radius: var(--r-pill); } meter.meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warning-dark); } meter.meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--rust); } /* ---------- Skeleton loader ---------- */ .skeleton { display: block; background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%); background-size: 200% 100%; border-radius: var(--r-xs); height: 12px; animation: skeleton-shimmer 1.5s linear infinite; } .skeleton.is-text { height: 14px; margin: 6px 0; } .skeleton.is-title { height: 24px; border-radius: var(--r-sm); } .skeleton.is-block { height: 80px; border-radius: var(--r-md); } .skeleton.is-circle { height: 36px; width: 36px; border-radius: 50%; } @keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } } @media (prefers-reduced-motion: reduce) { .skeleton { animation: none; background: var(--gray-200); } } /* ---------- Empty state ---------- */ .empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-7) var(--sp-5); color: var(--gray-700); } .empty-state-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--gray-100); border: var(--border); display: inline-grid; place-items: center; margin-bottom: var(--sp-4); color: var(--gray-500); } .empty-state h3 { margin: 0 0 8px; font: 600 1.1875rem/1.3 var(--serif); letter-spacing: -0.01em; color: var(--slate); } .empty-state p { margin: 0 0 var(--sp-4); max-width: 42ch; font: var(--t-small)/1.55 var(--sans); } /* ---------- Disclosure / accordion item ---------- Native
keeps keyboard and expanded-state behavior without JS. Use one .disclosure per question/section; group siblings in a plain div. */ .disclosure { padding: var(--sp-4) 0; border-bottom: var(--border-hair); } .disclosure:first-child { border-top: var(--border-hair); } .disclosure > summary { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); color: var(--slate); font: 500 var(--t-body)/1.4 var(--sans); cursor: pointer; list-style: none; } .disclosure > summary::-webkit-details-marker { display: none; } .disclosure > summary::after { content: "+"; flex: 0 0 auto; color: var(--gray-500); font-family: var(--mono); } .disclosure[open] > summary { color: var(--accent-ink); } .disclosure[open] > summary::after { content: "−"; } .disclosure > :not(summary) { max-width: 64ch; margin: var(--sp-3) 0 0; color: var(--gray-700); } /* ---------- Editorial carousel ---------- A swipeable series of full-width slides — "chapters" a reader pages through. The core is CSS-only: scroll-snap, one slide per view; swipe, trackpad, and the scrollbar all work with JS disabled. Prev/next buttons, dot indicators, and arrow-key navigation are progressive enhancement: author .carousel-controls with [hidden] and let inkwell-interactions.js populate .carousel-dots and reveal controls. Accessibility contract: .carousel is a named region (prefer a
with aria-label; role="region" is the generic fallback) + aria-roledescription="carousel"; each slide gets role="group" + aria-roledescription="slide" + aria-label="N of M". Give .carousel-track tabindex="0" so keyboard users can scroll it even before (or without) the enhancement script. No autoplay. */ .carousel { position: relative; } .carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; background: var(--paper); border: var(--border); border-radius: var(--r-lg); scrollbar-width: thin; /* quieter, but still a visible no-JS affordance */ } @media (prefers-reduced-motion: no-preference) { .carousel-track { scroll-behavior: smooth; } } .carousel-slide { scroll-snap-align: start; scroll-snap-stop: always; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6) var(--sp-6) var(--sp-5); } .carousel-slide + .carousel-slide { border-inline-start: var(--border-hair); } /* visible mid-swipe */ /* Slide chrome: kicker + page counter up top, byline-style footer pinned to the bottom so short slides keep the series' shared frame. */ .carousel-slide-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); } .carousel-counter { font: 500 var(--t-eyebrow)/1 var(--mono); letter-spacing: 0.1em; color: var(--gray-500); font-variant-numeric: tabular-nums; } .carousel-slide-foot { margin-top: auto; padding-top: var(--sp-4); border-top: var(--border-hair); } /* Controls (JS-revealed): prev/next share the .pagination button look; dots are 24px targets drawing a 9px indicator on --control-border. */ .carousel-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-3); } .carousel-controls[hidden] { display: none; } .carousel-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 0; color: var(--gray-700); background: var(--paper); border: var(--border); border-radius: var(--r-sm); cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); } .carousel-btn:hover:not(:disabled) { border-color: var(--slate); color: var(--slate); } .carousel-btn:disabled { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-200); cursor: not-allowed; } .carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; min-width: 0; align-items: center; gap: var(--sp-1); } .carousel-dot { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; background: transparent; border: none; cursor: pointer; } .carousel-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: transparent; border: var(--control-border); transition: background var(--t-fast), border-color var(--t-fast); } .carousel-dot:hover::before { border-color: var(--slate); } .carousel-dot[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); } /* ===================================================================== App shell & layout patterns ===================================================================== */ /* ---------- Navbar (promoted from index.html in 2.1.0) ---------- */ .navbar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--ivory); border-bottom: var(--border-rule); } .navbar-inner { max-width: var(--content-default); margin: 0 auto; padding: 14px var(--page-pad-x); display: flex; flex-wrap: wrap; align-items: center; gap: 18px; } .navbar .brand { font: 600 0.875rem/1 var(--serif); letter-spacing: -0.01em; color: var(--slate); text-decoration: none; } .navbar .brand .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: middle; } .navbar nav { display: flex; flex-wrap: wrap; gap: 22px; margin-inline-start: auto; font: 500 0.8125rem/1 var(--sans); } .navbar nav a { color: var(--gray-700); text-decoration: none; transition: color var(--t-fast); } .navbar nav a:hover { color: var(--accent-ink); } /* ---------- Inline field row ---------- */ .field-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; } /* ---------- Responsive card grid ---------- */ .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; } /* ---------- Table overflow wrapper ---------- */ .tbl-scroll { min-width: 0; max-width: 100%; overflow-x: auto; } /* floor so wide tables scroll instead of crushing columns; override per-table if yours is genuinely narrow */ .tbl-scroll > .tbl { min-width: 560px; } /* Keep compact desktop rhythm while meeting the 44px target floor on coarse-pointer devices. The control itself grows, not only its hit area, so the interactive boundary remains visible and testable. */ @media (pointer: coarse) { .btn, .btn-sm, .input, .select, .tab, .segmented > button, .segmented > .seg, .code-block .copy, .dialog-close, .menu-item, .pagination a, .pagination button, .carousel-btn, .carousel-dot { min-width: 44px; min-height: 44px; } .checkbox, .radio, .switch, .disclosure > summary { min-height: 44px; } } /* ===================================================================== Layout helpers ===================================================================== */ .wrap { max-width: var(--content-default); margin: 0 auto; padding: 0 var(--page-pad-x); } .wrap-narrow { max-width: var(--content-narrow); margin: 0 auto; padding: 0 var(--page-pad-x); } .wrap-wide { max-width: var(--content-wide); margin: 0 auto; padding: 0 var(--page-pad-x); } hr.rule { border: none; border-top: var(--border-rule); margin: 0 0 22px; } /* ===================================================================== Accessibility ===================================================================== */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; } .skip-link { position: absolute; inset-inline-start: -9999px; z-index: var(--z-modal); background: var(--accent); color: var(--on-accent); padding: 10px 18px; border-radius: var(--r-pill); font: 500 0.875rem/1 var(--sans); text-decoration: none; } .skip-link:focus-visible { inset-inline-start: 16px; top: 16px; } ::selection { background: var(--oat); color: var(--slate); } *:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; } /* Preserve native affordances when the user replaces our palette. Custom background fills and shadows cannot reliably communicate selection here. */ @media (forced-colors: active) { .menu-panel { background: Canvas; color: CanvasText; border-color: CanvasText; } .menu-item { color: ButtonText; } .menu-item:focus-visible { background: Highlight; color: HighlightText; } .menu-item:disabled, .menu-item[aria-disabled="true"] { color: GrayText; } .menu-separator { border-color: CanvasText; } .checkbox input, .radio input, .switch input, .select { appearance: auto; } progress.progress, meter.meter { all: revert; display: block; inline-size: 100%; min-inline-size: 0; block-size: 0.75rem; appearance: auto; } progress.progress::-webkit-progress-bar { all: revert; } progress.progress::-webkit-progress-value { all: revert; } progress.progress::-moz-progress-bar { all: revert; } meter.meter::-webkit-meter-bar { all: revert; } meter.meter::-webkit-meter-optimum-value { all: revert; } meter.meter::-webkit-meter-suboptimum-value { all: revert; } meter.meter::-webkit-meter-even-less-good-value { all: revert; } meter.meter::-moz-meter-bar { all: revert; } meter.meter:-moz-meter-sub-optimum::-moz-meter-bar { all: revert; } meter.meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { all: revert; } .checkbox input, .radio input, .switch input { background: revert; } .checkbox input::after, .radio input::after, .switch input::after { content: none; } /* !important overrides unlayered palette chevron rules, including dark. */ .select { background-image: none !important; } .tab { border-bottom-color: Canvas; } .tab[aria-selected="true"] { border-bottom-color: Highlight; } .tabs[aria-orientation="vertical"] > .tab { border-inline-end-color: Canvas; } .tabs[aria-orientation="vertical"] > .tab[aria-selected="true"] { border-inline-end-color: Highlight; } .carousel-dot[aria-current="true"]::before { background: Highlight; border-color: Highlight; } *:focus-visible { outline-color: Highlight; } } /* ===================================================================== Print ===================================================================== */ @media print { .menu, .menu-panel[data-inkwell-menu-ready="true"] { display: none !important; } .card, .stat-card, .callout, .finding, .tbl, .disclosure, figure.figure, .alert, .code-block { break-inside: avoid; } /* Stack carousel slides so every one prints instead of clipping to the snapped slide. */ .carousel-track { display: block; overflow: visible; } .carousel-slide { break-inside: avoid; } .carousel-slide + .carousel-slide { border-inline-start: none; border-top: var(--border-hair); } .carousel-controls { display: none; } .tldr { background: transparent; color: inherit; border: var(--border-strong); } .tldr-label, .tldr code { color: inherit; background: transparent; } .skeleton { animation: none; background: var(--gray-100); } .skip-link { display: none; } }