/* ==========================================================================
   Knowledge Index v2 - FLUID stylesheet (doc 17 D1: the KI is a reading
   instrument - fixed type sizes, reflowing containers; shares tokens with
   the landing, not its poster-scale rig). New file: touches nothing in the
   landing's CSS. Greyscale system from ki2-index-v3.
   ========================================================================== */

:root {
  --ki-serif: "Playfair Display", Georgia, serif;
  --ki-sans: "IBM Plex Sans", system-ui, sans-serif;
  --ki-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ki-ink: #0b0b0b;
  --ki-grey-card: #f2f2f2;
  --ki-grey-band: #f5f5f5;
  --ki-meta: #7d7d7d;
  --ki-body: #5f5f5f;
  --ki-rule: #eeeeee;
  --ki-hairline: #c9c9c9;
  --ki-coming: #afafaf;
  --ki-wrap: 1172px;
  --ki-mobile-body-size: 15px;
  --ki-mobile-body-leading: 1.55;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--ki-sans); color: var(--ki-ink); background: #fff; }
.ki-wrap { max-width: var(--ki-wrap); margin: 0 auto; padding: 0 28px; }

/* --- hero ------------------------------------------------------------------ */
.ki-hero { padding: 52px 0 56px; }
.ki-hero-grid { display: grid; grid-template-columns: minmax(0, 540px) 488px; gap: 70px; align-items: start; justify-content: space-between; }
/* min-height sets where the search lands (it is margin-top:auto). Reduced by
   the height of the removed .ki-label so hero spacing stays even. */
.ki-hero-copy { display: flex; flex-direction: column; min-height: 314px; padding-top: 3px; }
.ki-label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ki-body); margin-bottom: 18px; }
.ki-label .ld { width: 16px; height: 16px; background: var(--ki-body); }
.ki-hero-copy h1 { font-family: var(--ki-serif); font-weight: 400; font-size: 42px; line-height: 1.18; margin-bottom: 20px; white-space: nowrap; }
.ki-sub { max-width: 540px; margin-bottom: 0; font-size: 16px; line-height: 1.55; color: var(--ki-body); }
.ki-search { position: relative; max-width: 460px; margin-bottom: 16px; }
.ki-search input { width: 100%; height: 46px; border: 1px solid var(--ki-hairline); border-radius: 8px; padding: 0 42px 0 16px; font-family: var(--ki-sans); font-size: 15px; color: var(--ki-ink); background: #fff; }
.ki-search input::placeholder { color: #9a9a9a; }
.ki-search-ic { position: absolute; right: 15px; top: 14px; width: 13px; height: 13px; border: 1.6px solid #9a9a9a; border-radius: 50%; }
.ki-search-ic::after { content: ""; position: absolute; left: 11px; top: 12px; width: 7px; height: 1.6px; background: #9a9a9a; transform: rotate(45deg); }
.ki-ask { width: 100%; max-width: 540px; margin-bottom: 18px; }
.ki-ask-form { display: flex; width: 100%; height: 46px; border: 1px solid var(--ki-hairline); border-radius: 8px; background: #fff; transition: border-color 150ms ease, box-shadow 150ms ease; }
.ki-ask-form:focus-within { border-color: #777; box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.05); }
.ki-ask-form input { flex: 1; min-width: 0; border: 0; border-radius: 8px 0 0 8px; padding: 0 16px; font-family: var(--ki-sans); font-size: 15px; color: var(--ki-ink); background: transparent; outline: 0; }
.ki-ask-form input::placeholder { color: #8d8d8d; }
.ki-ask-form button { width: 48px; border: 0; border-left: 1px solid var(--ki-rule); border-radius: 0 7px 7px 0; font-family: var(--ki-mono); font-size: 16px; color: #6f6f6f; background: #fff; cursor: pointer; transition: color 140ms ease, background 140ms ease; }
.ki-ask-form button:hover { color: #fff; background: var(--ki-ink); }
.ki-ask-form button:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 3px; }
.ki-ask-note { margin: 8px 0 0 2px; font-family: var(--ki-mono); font-size: 8.5px; line-height: 1.4; letter-spacing: 0.08em; color: #999; }
.ki-ask-prompts { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 0 1px; }
.ki-ask-prompts button { min-height: 27px; padding: 0 10px; border: 1px solid #dedede; border-radius: 999px; font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.03em; color: #6f6f6f; background: #fafafa; cursor: pointer; transition: color 140ms ease, border-color 140ms ease, background 140ms ease; }
.ki-ask-prompts button:hover { color: #fff; border-color: var(--ki-ink); background: var(--ki-ink); }
.ki-ask-prompts button:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 2px; }
.ki-chat-active .ki-ask-prompts { display: none; }
.ki-ask-response { overflow: hidden; max-height: 0; margin-top: 0; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; background: #f5f5f5; opacity: 0; transform: translateY(-4px); transition: max-height 240ms cubic-bezier(0.25, 0.75, 0.25, 1), margin 180ms ease, padding 180ms ease, opacity 160ms ease, transform 180ms ease, border-color 180ms ease; }
.ki-ask-response.is-visible { max-height: 900px; margin-top: 14px; padding: 17px 18px 18px; border-color: #e1e1e1; opacity: 1; transform: translateY(0); }
.ki-ask-response-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; margin-bottom: 13px; border-bottom: 1px solid #dfdfdf; }
.ki-ask-response-head p { font-family: var(--ki-mono); font-size: 9px; font-weight: 500; line-height: 1.4; letter-spacing: 0.08em; color: #747474; }
.ki-ask-response-head button { width: 22px; height: 22px; border: 0; padding: 0; font-family: var(--ki-sans); font-size: 18px; line-height: 20px; color: #8a8a8a; background: transparent; cursor: pointer; }
.ki-ask-response-head button:hover { color: #000; }
.ki-ask-response-head button:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 2px; }
.ki-ask-answer { font-size: 14px; line-height: 1.55; color: #2e2e2e; white-space: pre-line; }
.ki-ask-depth { display: flex; align-items: center; gap: 4px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #dfdfdf; }
.ki-ask-depth[hidden] { display: none; }
.ki-ask-depth > span { margin-right: 5px; font-family: var(--ki-mono); font-size: 8.5px; line-height: 1; letter-spacing: 0.08em; color: #8a8a8a; }
.ki-ask-depth button { min-height: 27px; padding: 0 9px; border: 1px solid #d4d4d4; border-radius: 999px; font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.04em; color: #6f6f6f; background: transparent; cursor: pointer; transition: color 140ms ease, background 140ms ease, border-color 140ms ease; }
.ki-ask-depth button:hover { color: #111; border-color: #8a8a8a; }
.ki-ask-depth button.is-active { color: #fff; border-color: #151515; background: #151515; }
.ki-ask-depth button:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 2px; }
.ki-ask-sources { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 14px; }
.ki-ask-sources:empty { display: none; }
.ki-ask-sources a { font-family: var(--ki-mono); font-size: 9.5px; line-height: 1.45; letter-spacing: 0.01em; color: #656565; text-decoration: none; border-bottom: 1px solid #c8c8c8; }
.ki-ask-sources a:hover { color: #000; border-color: #000; }
.ki-ask-cta { display: inline-flex; align-items: center; min-height: 34px; margin-top: 16px; padding: 0 13px; border: 1px solid #151515; border-radius: 6px; font-family: var(--ki-serif); font-size: 13px; color: #fff; background: #151515; text-decoration: none; transition: color 140ms ease, background 140ms ease; }
.ki-ask-cta[hidden] { display: none; }
.ki-ask-cta:hover { color: #151515; background: #fff; }
/* position:relative anchors the results OVERLAY below. The panel used to sit in
   normal flow, so opening it grew this section and shoved the form upward - the
   search bar visibly jumped the moment you typed (Tarak 2026-07-28). An overlay
   changes no layout, so the form cannot move. */
.ki-index-search { position: relative; width: 100%; max-width: 540px; margin-top: auto; margin-bottom: 20px; }
.ki-search-form { display: flex; width: 100%; height: 46px; border: 1px solid var(--ki-hairline); border-radius: 8px; background: #fff; transition: border-color 150ms ease, box-shadow 150ms ease; }
.ki-search-form:focus-within { border-color: #777; box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.05); }
.ki-search-form input { flex: 1; min-width: 0; border: 0; border-radius: 8px 0 0 8px; padding: 0 16px; font-family: var(--ki-sans); font-size: 15px; color: var(--ki-ink); background: transparent; outline: 0; }
.ki-search-form input::placeholder { color: #8d8d8d; }
/* Chrome draws its own rounded blue cancel control on type=search; it belongs
   to the browser, not to this UI. Ours is .ki-search-clear below. */
.ki-search-form input::-webkit-search-cancel-button,
.ki-search-form input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.ki-search-form .ki-search-clear { width: 34px; border: 0; border-left: 0; border-radius: 0; font-family: var(--ki-sans); font-size: 17px; line-height: 1; color: #8d8d8d; background: transparent; cursor: pointer; transition: color 140ms ease; }
.ki-search-form .ki-search-clear:hover { color: var(--ki-ink); background: transparent; }
.ki-search-form .ki-search-clear[hidden] { display: none; }
.ki-search-form button { width: 48px; border: 0; border-left: 1px solid var(--ki-rule); border-radius: 0 7px 7px 0; font-family: var(--ki-mono); font-size: 16px; color: #6f6f6f; background: #fff; cursor: pointer; transition: color 140ms ease, background 140ms ease; }
.ki-search-form button:hover { color: #fff; background: var(--ki-ink); }
.ki-search-form button:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 3px; }
.ki-search-note { margin: 8px 0 0 2px; font-family: var(--ki-mono); font-size: 8.5px; line-height: 1.4; letter-spacing: 0.08em; color: #999; }
.ki-search-results[hidden] { display: none; }
.ki-search-results { position: absolute; z-index: 30; top: calc(100% + 14px); right: 0; left: 0; overflow: hidden; border: 1px solid #dedede; border-radius: 9px; background: #fff; opacity: 0; transform: translateY(-4px); transition: opacity 160ms ease, transform 180ms ease; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08); }
.ki-search-results.is-visible { opacity: 1; transform: translateY(0); }
.ki-search-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--ki-rule); background: #f6f6f6; }
.ki-search-results-head p { font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.08em; color: #777; }
.ki-search-results-head button { width: 22px; height: 22px; border: 0; background: transparent; font-size: 18px; line-height: 1; color: #888; cursor: pointer; }
/* The list scrolls, the header does not. Results ran the full length of the
   match set, so a five-hit query pushed the last results below the fold and
   the reader could not see there was more (Tarak 2026-07-28). 300px shows
   three results at typical heights (they vary 85-107px) and leaves the fourth
   half-visible, which is what signals the list continues. */
[data-ki-search-list] { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d2d2d2 transparent; }
[data-ki-search-list]::-webkit-scrollbar { width: 6px; }
[data-ki-search-list]::-webkit-scrollbar-thumb { border-radius: 3px; background: #d2d2d2; }

.ki-search-result { position: relative; display: grid; gap: 5px; padding: 14px 72px 14px 16px; border-bottom: 1px solid var(--ki-rule); color: var(--ki-ink); text-decoration: none; transition: background 140ms ease; }
.ki-search-result:last-child { border-bottom: 0; }
.ki-search-result:hover { background: #f7f7f7; }
.ki-search-result:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: -3px; }
.ki-search-result-meta { font-family: var(--ki-mono); font-size: 8px; letter-spacing: 0.06em; color: var(--ki-meta); text-transform: uppercase; }
.ki-search-result strong { font-family: var(--ki-serif); font-size: 16px; font-weight: 400; line-height: 1.3; }
.ki-search-result-takeaway { overflow: hidden; font-size: 11.5px; line-height: 1.45; color: var(--ki-body); text-overflow: ellipsis; white-space: nowrap; }
.ki-search-result-arrow { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.06em; color: #777; }
.ki-search-empty { padding: 18px 16px; font-size: 13px; line-height: 1.5; color: var(--ki-body); }
.ki-return a { font-size: 14px; color: var(--ki-body); text-decoration: none; border-bottom: 1px solid var(--ki-rule); }
.ki-return a:hover { color: #000; border-color: #000; }

/* Mobile deliberately introduces the full-story route before search. On the
   wider two-column hero, keep the established search-first rhythm: the search
   owns the flexible alignment space and the quiet route closes the column. */
@media (min-width: 901px) {
  .ki-index-search { order: 1; }
  .ki-return { order: 2; }
}

/* --- lattice (V3 mock formatting: boxed tray, 190px label column, 8-wide
   atom grid, THE MAP + legend aligned to the atom column, text BELOW bar) --- */
.ki-lattice { position: relative; width: 488px; justify-self: end; }
.ki-lat-head { width: 276px; margin: 0 0 26px 210px; font-family: var(--ki-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ki-meta); text-align: center; }
.ki-lat-row { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.ki-lat-label { flex: 0 0 190px; font-family: var(--ki-mono); font-size: 9.5px; letter-spacing: 0.05em; color: var(--ki-meta); line-height: 1.4; white-space: nowrap; text-align: right; text-decoration: none; transition: color 140ms ease; }
.ki-lat-label:hover { color: var(--ki-ink); }
.ki-lat-label:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 4px; }
.ki-lat-atoms { display: grid; grid-template-columns: repeat(8, 26px); gap: 10px; justify-content: start; align-self: flex-start; }
.ki-lat-row:has(.ki-lat-atoms > :nth-child(9)) { align-items: flex-start; }
.ki-lat-row:has(.ki-lat-atoms > :nth-child(9)) .ki-lat-label { padding-top: 7px; }
.ki-atom { width: 26px; height: 26px; border-radius: 6px; display: block; transition: opacity 170ms ease, transform 170ms ease, box-shadow 170ms ease; }
.ki-lattice.is-relating .ki-atom[data-slug] { opacity: 0.16; }
.ki-lattice.is-relating .ki-atom.is-active-link,
.ki-lattice.is-relating .ki-atom.is-related-link { opacity: 1; }
.ki-lattice.is-relating .ki-atom.is-active-link { transform: scale(1.08); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ki-ink); }
.ki-lattice.is-relating .ki-atom.is-related-link { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #777; }
.ki-atom[data-light] { border: 1px solid var(--ki-hairline); }
.ki-atom:hover, .ki-atom:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 2px; }
.ki-atom-coming { border: 1.3px dashed var(--ki-coming); border-radius: 6px; background: none; }
.ki-atom-pad { border-color: #d9d9d9; pointer-events: none; }
.ki-atom-coming:hover { outline: 2px solid var(--ki-coming); outline-offset: 2px; }
.ki-lat-legend { margin-top: 28px; margin-left: 210px; }
.ki-legend-grad { display: block; width: 276px; height: 10px; border-radius: 5px; border: 1px solid var(--ki-hairline); background: linear-gradient(90deg, #fff, #141414); }
.ki-legend-text { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 276px; font-family: var(--ki-mono); font-size: 8px; line-height: 1.4; letter-spacing: 0.035em; color: var(--ki-meta); margin-top: 9px; white-space: nowrap; }
.ki-legend-text span:nth-child(2) { padding: 0 7px; text-align: center; }
.ki-legend-text span:last-child { text-align: right; }
.ki-hover-slot { height: 0; margin-top: 0; overflow: hidden; transition: height 190ms cubic-bezier(0.25, 0.75, 0.25, 1), margin-top 190ms cubic-bezier(0.25, 0.75, 0.25, 1); }
.ki-hover-slot.is-visible { height: 80px; margin-top: 22px; }
.ki-hover-card[hidden] { display: none; }
.ki-hover-card { position: static; display: block; width: 100%; min-height: 64px; padding: 14px 0 13px; border-top: 1px solid #9d9d9d; border-bottom: 1px solid var(--ki-rule); color: var(--ki-ink); text-decoration: none; pointer-events: none; }
.ki-hover-main { min-width: 0; }
.ki-hover-eyebrow { margin-bottom: 7px; font-family: var(--ki-mono); font-size: 7.5px; line-height: 1.4; letter-spacing: 0.1em; color: #8a8a8a; }
/* the question is the whole readout, so it gets the whole width - the old
   310px cap was sized for a two-column card that no longer exists
   (Tarak 2026-07-27) */
.ki-hover-card .ki-hover-q { max-width: none; font-family: var(--ki-serif); font-size: 17px; line-height: 1.3; }
.ki-hover-read { display: inline-block; margin-top: 10px; font-family: var(--ki-mono); font-size: 8px; line-height: 1.4; letter-spacing: 0.08em; color: var(--ki-ink); text-decoration: none; }
.ki-hover-read[hidden] { display: none; }
.ki-hover-detail { align-self: end; padding-left: 15px; border-left: 1px solid var(--ki-rule); }
.ki-hover-card .ki-hover-tag { font-family: var(--ki-mono); font-size: 7.5px; line-height: 1.55; letter-spacing: 0.06em; color: var(--ki-meta); }
.ki-hover-links { position: relative; margin-top: 8px; padding-left: 13px; font-family: var(--ki-mono); font-size: 7.5px; line-height: 1.45; letter-spacing: 0.05em; color: #333; }
.ki-hover-links::before { content: ""; position: absolute; top: 0.36em; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--ki-ink); }
/* --- trails band (V3 mock: title line ABOVE the pill row) ------------------ */
.ki-trails { scroll-margin-top: 84px; background: var(--ki-grey-band); border-top: 1px solid var(--ki-rule); border-bottom: 1px solid var(--ki-rule); }
.ki-trails .ki-wrap { padding-top: 26px; padding-bottom: 28px; }
.ki-trails-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.ki-trails-label { font-family: var(--ki-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; }
.ki-trails-sub { font-family: var(--ki-mono); font-size: 9.5px; letter-spacing: 0.06em; color: var(--ki-meta); }
.ki-trails-pills { display: flex; flex-wrap: wrap; gap: 14px; }
.ki-pill { display: inline-flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--ki-hairline); border-radius: 999px; padding: 10px 18px; font-family: var(--ki-sans); font-size: 14px; color: var(--ki-ink); cursor: pointer; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; }
.ki-pill:hover, .ki-pill.is-active { color: #fff; border-color: var(--ki-ink); background: var(--ki-ink); }
.ki-pill:hover .ki-pill-meta, .ki-pill.is-active .ki-pill-meta { color: #bdbdbd; }
.ki-pill:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 3px; }
.ki-pill-meta { font-family: var(--ki-mono); font-size: 9px; letter-spacing: 0.06em; color: var(--ki-meta); }
.ki-trail-stage { position: relative; height: 0; margin-top: 0; overflow: hidden; overflow-anchor: none; transition: height 340ms cubic-bezier(0.22, 0.75, 0.24, 1), margin-top 260ms cubic-bezier(0.22, 0.75, 0.24, 1); }
.ki-trail-stage.is-open { margin-top: 20px; }
.ki-trail-panel[hidden] { display: none; }
.ki-trail-panel { position: absolute; top: 0; right: 0; left: 0; width: 100%; padding: 24px 26px 26px; border: 1px solid #d8d8d8; border-radius: 12px; background: #fff; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 180ms ease, transform 260ms cubic-bezier(0.22, 0.75, 0.24, 1); }
.ki-trail-panel.is-active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ki-trail-panel.is-leaving { opacity: 0; transform: translateY(-6px); }
.ki-trail-panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid var(--ki-rule); }
.ki-trail-kicker { margin-bottom: 6px; font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.08em; color: var(--ki-meta); }
.ki-trail-panel-head h3 { margin-bottom: 6px; font-family: var(--ki-serif); font-size: 24px; font-weight: 400; }
.ki-trail-panel-head > div > p:last-child { max-width: 580px; font-size: 13px; line-height: 1.5; color: var(--ki-body); }
.ki-trail-start { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 38px; padding: 0 15px; border: 1px solid var(--ki-ink); border-radius: 7px; font-family: var(--ki-serif); font-size: 14px; color: #fff; background: var(--ki-ink); text-decoration: none; transition: color 140ms ease, background 140ms ease; }
.ki-trail-start:hover { color: var(--ki-ink); background: #fff; }
.ki-trail-start:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 3px; }
.ki-trail-steps { --trail-stops: 5; position: relative; display: grid; grid-template-columns: repeat(var(--trail-stops), minmax(0, 1fr)); list-style: none; }
.ki-trail-steps::before { content: ""; position: absolute; z-index: 0; top: 9px; left: 9px; right: calc((100% / var(--trail-stops)) - 9px); height: 1px; background: #d2d2d2; }
.ki-trail-steps li { position: relative; min-width: 0; }
.ki-trail-steps li::after { display: none; }
.ki-trail-steps a { display: block; padding-right: 20px; color: var(--ki-ink); text-decoration: none; }
.ki-trail-steps span { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; margin-bottom: 9px; border: 1px solid #adadad; border-radius: 50%; font-family: var(--ki-mono); font-size: 7.5px; color: #666; background: #fff; transition: color 140ms ease, background 140ms ease, border-color 140ms ease; }
.ki-trail-steps strong { display: block; font-family: var(--ki-serif); font-size: 13px; font-weight: 400; line-height: 1.35; color: #454545; transition: color 140ms ease; }
.ki-trail-steps a:hover span { color: #fff; border-color: var(--ki-ink); background: var(--ki-ink); }
.ki-trail-steps a:hover strong { color: var(--ki-ink); }
.ki-trail-steps a:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 4px; }

/* --- shelves + record ------------------------------------------------------ */
.ki-record { padding: 56px 0 64px; scroll-margin-top: 84px; }
.ki-shelf { padding: 56px 0 64px; scroll-margin-top: 84px; }
.ki-shelf:nth-of-type(odd) { background: #fbfbfb; }
.ki-roman { font-family: var(--ki-mono); font-size: 11px; color: var(--ki-meta); }
.ki-shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.ki-shelf-title { display: flex; align-items: baseline; min-width: 0; gap: 14px; }
.ki-shelf-head h2 { font-family: var(--ki-serif); font-weight: 400; font-size: 30px; }
.ki-entries { font-family: var(--ki-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--ki-meta); }
.ki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }

/* --- cards (summary-on-front, per Tarak 2026-07-17; flip experiment retired) */
.ki-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ki-rule); border-radius: 10px; padding: 22px 24px 18px; text-decoration: none; color: var(--ki-ink); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05); transition: box-shadow 180ms ease, transform 180ms ease; }
.ki-card:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.09); transform: translateY(-1px); }
.ki-card:hover .ki-read { text-decoration: underline; }
.ki-meta { display: flex; align-items: center; gap: 10px; font-family: var(--ki-mono); font-size: 9.5px; letter-spacing: 0.07em; color: var(--ki-meta); margin-bottom: 14px; }
.ki-meta > span:first-child { flex: 1; }
.ki-card h3 { font-family: var(--ki-serif); font-weight: 400; font-size: 21.5px; line-height: 1.3; margin-bottom: 10px; }
.ki-takeaway { font-size: 13.5px; line-height: 1.5; color: var(--ki-body); margin-bottom: 18px; }
.ki-rule { display: block; height: 1px; background: var(--ki-rule); margin-top: auto; margin-bottom: 12px; }
.ki-read { font-family: var(--ki-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.05em; }
.ki-held { font-family: var(--ki-mono); font-size: 9px; letter-spacing: 0.07em; color: #a9a9a9; margin-bottom: 10px; }
.ki-draft { font-family: var(--ki-mono); font-size: 8.5px; color: #b05a00; border: 1px solid #e2c9a8; border-radius: 3px; padding: 1px 5px; }

.ki-card-controlled { background: var(--ki-grey-card); }
.ki-card-closed { background: var(--ki-ink); border-color: #222; color: #fff; }
.ki-card-closed .ki-takeaway { color: var(--ki-hairline); }
.ki-card-closed .ki-meta { color: #a9a9a9; }
.ki-card-closed .ki-rule { background: #3a3a3a; }
.ki-card-report { border-style: dashed; border-color: var(--ki-hairline); }

/* --- disclosure bar (variant B, locked) ------------------------------------ */
.ki-bar { position: relative; width: 64px; height: 6px; border-radius: 3px; border: 1px solid var(--ki-hairline); background: linear-gradient(90deg, #fff, #141414); flex: 0 0 auto; }
.ki-bar-tick { position: absolute; top: -4px; width: 2.5px; height: 12px; border-radius: 1px; background: var(--ki-ink); transform: translateX(-1.25px); }
.ki-bar-dark .ki-bar-tick { background: #fff; }

/* --- desk ------------------------------------------------------------------ */
.ki-desk { background: #000; color: #fff; margin-top: 24px; }
.ki-desk-row { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-top: 64px; padding-bottom: 64px; flex-wrap: wrap; }
.ki-desk h2 { font-family: var(--ki-serif); font-weight: 400; font-size: 28px; max-width: 560px; margin-bottom: 10px; }
.ki-desk p { font-size: 15px; line-height: 1.55; color: #b9b9b9; max-width: 660px; text-wrap: pretty; }
.ki-desk-actions { display: flex; align-items: center; gap: 12px; }
/* Pills, matching the landing (Tarak 2026-07-27): the 46px rounded-rect blocks
   read as heavy web-app buttons next to the rest of this page. */
.ki-desk-cta { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; background: #fff; color: #000; border: 1px solid #fff; border-radius: 999px; font-family: var(--ki-serif); font-size: 15px; text-decoration: none; white-space: nowrap; transition: background 180ms ease, color 180ms ease; }
.ki-desk-cta:hover { background: transparent; color: #fff; }
.ki-desk-story { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px; font-family: var(--ki-serif); font-size: 15px; color: #fff; text-decoration: none; white-space: nowrap; transition: background 180ms ease, color 180ms ease, border-color 180ms ease; }
.ki-desk-story:hover { background: #fff; color: #000; border-color: #fff; }

/* --- responsive (doc 17 §7) ------------------------------------------------ */
@media (max-width: 1199px) {
  .ki-hero-grid { grid-template-columns: 1fr; gap: 48px; align-items: start; }
  .ki-hero-copy { min-height: 0; }
  .ki-sub { margin-bottom: 26px; }
  .ki-index-search { margin-top: 0; }
  .ki-lattice { justify-self: center; }
}
@media (max-width: 560px) {
  /* The map data is authored and padded in eight-atom rows. The previous
     six-column mobile override split every shelf at arbitrary points and made
     the map look corrupted. Stack each shelf label above the intact row so the
     real eight-column structure survives at a touch-legible 24px. */
  .ki-lattice { width: 100%; padding: 12px 0 8px; }
  .ki-lat-head {
    width: 248px;
    margin: 0 auto 28px;
    font-size: 9px;
    text-align: left;
  }
  .ki-lat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 9px;
    margin-bottom: 22px;
  }
  .ki-lat-label {
    width: 248px;
    padding-top: 0 !important;
    font-size: 9px;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
  }
  .ki-lat-atoms {
    width: 248px;
    grid-template-columns: repeat(8, 24px);
    gap: 8px;
  }
  .ki-atom,
  .ki-atom-coming {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }
  .ki-lat-legend {
    width: 248px;
    margin: 30px auto 0;
  }
  .ki-legend-grad,
  .ki-legend-text { width: 248px; }
  .ki-legend-text { font-size: 7.5px; letter-spacing: 0.025em; }
  .ki-hover-slot { display: block; }
  .ki-grid { grid-template-columns: minmax(0, 1fr); }
  .ki-card { min-width: 0; }
}
@media (max-width: 760px) {
  .ki-hero { padding: 40px 0 48px; }
  .ki-hero-grid { gap: 36px; }
  .ki-hero-copy h1 { font-size: 34px; white-space: normal; }
  .ki-sub {
    font-size: var(--ki-mobile-body-size);
    line-height: var(--ki-mobile-body-leading);
  }
  .ki-shelf-head { flex-wrap: wrap; row-gap: 8px; }
  .ki-shelf-title { flex: 1 0 100%; }
  .ki-entries { margin-left: 25px; }
  .ki-index-search { max-width: none; }
  .ki-ask-response.is-visible { max-height: 1100px; }
  .ki-ask-depth { flex-wrap: wrap; }
  .ki-trails-row { align-items: flex-start; }
  .ki-desk-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .ki-card { transition: none; }
  .ki-card:hover { transform: none; }
  .ki-ask-form, .ki-ask-response, .ki-ask-form button, .ki-ask-depth button, .ki-ask-cta { transition: none; }
  .ki-view-toggle { transition: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Object pages (T2, open register - doc 17 §5b). kio-* namespace.
   ========================================================================== */
.kio { padding: 44px 0 90px; }
.kio .ki-wrap { max-width: 880px; }
.kio-trail-progress[hidden] { display: none; }
.kio-trail-progress { position: sticky; top: calc(84 * ((100vw - 140px) / 1440) + 12px); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 54px; padding: 10px 14px 13px; margin: -14px 0 30px; border: 1px solid rgba(222, 222, 222, 0.94); border-radius: 10px; background: rgba(250, 250, 250, 0.94); backdrop-filter: blur(12px) saturate(1.08); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); }
.kio-trail-progress-copy { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.kio-trail-progress-label, .kio-trail-progress-copy > span:last-child { font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.07em; color: var(--ki-meta); white-space: nowrap; }
.kio-trail-progress-copy strong { overflow: hidden; font-family: var(--ki-serif); font-size: 14px; font-weight: 400; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.kio-trail-progress-actions { display: flex; align-items: center; gap: 15px; flex: 0 0 auto; }
.kio-trail-progress-actions a { font-family: var(--ki-mono); font-size: 8.5px; letter-spacing: 0.04em; color: #666; text-decoration: none; white-space: nowrap; }
.kio-trail-progress-actions a:hover { color: var(--ki-ink); }
.kio-trail-progress-actions a:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 3px; }
.kio-trail-progress-actions .kio-trail-exit { display: inline-flex; align-items: center; gap: 5px; min-height: 29px; padding: 0 9px; border: 1px solid #cfcfcf; border-radius: 999px; color: #4d4d4d; background: #fff; transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
.kio-trail-progress-actions .kio-trail-exit:hover { border-color: var(--ki-ink); color: #fff; background: var(--ki-ink); }
.kio-trail-progress-rail { position: absolute; right: 10px; bottom: 0; left: 10px; height: 2px; overflow: hidden; border-radius: 2px; background: #e0e0e0; }
.kio-trail-progress-rail > span { display: block; width: 0; height: 100%; background: var(--ki-ink); transition: width 360ms cubic-bezier(0.25, 0.75, 0.25, 1); }
[data-ki-object-content] { opacity: 1; transition: opacity 150ms ease, transform 180ms cubic-bezier(0.25, 0.75, 0.25, 1); }
[data-ki-object-content].is-switching { opacity: 0; transform: translateY(4px); }
.kio-crumb { font-family: var(--ki-mono); font-size: 10px; letter-spacing: 0.07em; color: var(--ki-meta); margin-bottom: 26px; }
.kio-crumb a { color: var(--ki-meta); text-decoration: none; }
.kio-crumb a:hover { color: #000; }
.kio-title { font-family: var(--ki-serif); font-weight: 400; font-size: 38px; line-height: normal; margin-bottom: 16px; max-width: 780px; }
.kio-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--ki-rule); margin-bottom: 30px; }
.kio-meta { font-family: var(--ki-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ki-meta); }
.kio-bar { width: 96px; height: 8px; border-radius: 4px; }
.kio-bar .ki-bar-tick { height: 16px; top: -5px; }
.kio-answer-first { border-left: 3px solid var(--ki-ink); padding: 0 0 0 25px; margin-bottom: 42px; }
.kio-answer-first p { font-size: 18px; line-height: 1.5; color: var(--ki-ink); max-width: none; }
.kio-body { max-width: 824px; margin-bottom: 0; }
.kio-body p { font-size: 16px; line-height: 1.55; color: #333; margin-bottom: 17px; max-width: none; }
.kio-body h2 { font-family: var(--ki-serif); font-weight: 400; font-size: 24px; margin: 28px 0 16px; }
.kio-body ul { margin: 0 0 16px 20px; }
.kio-body ol { margin: 0 0 16px 24px; }
.kio-body li { font-size: 16px; line-height: 1.55; color: #333; margin-bottom: 8px; max-width: none; }
.kio-body strong { font-weight: 500; color: var(--ki-ink); }
.kio-body code { padding: 0.08em 0.28em; border-radius: 3px; font-family: var(--ki-mono); font-size: 0.86em; background: #f1f1f1; }
.kio-table-wrap { overflow-x: auto; max-width: 824px; margin: 8px 0 24px; border: 1px solid #dedede; border-radius: 8px; }
.kio-body table { width: 100%; min-width: 620px; border-collapse: collapse; background: #fff; }
.kio-body th, .kio-body td { padding: 12px 14px; border-right: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4; text-align: left; vertical-align: top; }
.kio-body th:last-child, .kio-body td:last-child { border-right: 0; }
.kio-body tbody tr:last-child td { border-bottom: 0; }
.kio-body th { font-family: var(--ki-mono); font-size: 9.5px; font-weight: 500; line-height: 1.4; letter-spacing: 0.05em; color: #666; background: #f4f4f4; }
.kio-body td { font-size: 13.5px; line-height: 1.5; color: #3f3f3f; }
.kio-block-label { font-family: var(--ki-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.06em; color: var(--ki-meta); margin-bottom: 14px; }

.kio-return a { font-size: 14px; color: var(--ki-body); text-decoration: none; }
.kio-return a:hover { color: #000; }
@media (max-width: 760px) {
  .kio-title { font-size: 28px; }
  .kio-boundary { grid-template-columns: 1fr; }
  .kio-type-source_record .kio-body table { min-width: 0; table-layout: fixed; }
  .kio-type-source_record .kio-body th,
  .kio-type-source_record .kio-body td { padding: 10px 9px; overflow-wrap: anywhere; }
  .kio-type-source_record .kio-body th:first-child,
  .kio-type-source_record .kio-body td:first-child { width: 34%; }
}

/* --- v2: toggle, machine pane, byline, family ladder, access-path band ----- */
/* floating view toggle: sliding-thumb, fixed bottom-center */
.ki-view-toggle { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; width: 204px; padding: 3px; border: 0; border-radius: 8px; background: rgba(21, 21, 21, 0.94); backdrop-filter: blur(10px); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.08); cursor: pointer; font-family: var(--ki-mono); font-size: 11.5px; letter-spacing: 0.05em; transition: opacity 160ms ease, transform 200ms ease; }
.ki-search-active .ki-view-toggle,
.ki-footer-active .ki-view-toggle,
.ki-trail-active .ki-view-toggle { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(14px); }
.ki-vt-thumb { position: absolute; left: 3px; top: 3px; width: 96px; height: 31px; border-radius: 6px; background: #f5f5f4; transition: transform 300ms cubic-bezier(0.32, 0.9, 0.35, 1); }
.ki-view-toggle.is-machine .ki-vt-thumb { transform: translateX(99px); }
.ki-vt-opt { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 96px; height: 31px; color: rgba(245, 245, 244, 0.55); transition: color 300ms ease; }
.ki-vt-opt::before { content: ""; width: 8px; height: 8px; border: 1.6px solid currentColor; border-radius: 50%; transition: background 300ms ease; }
.ki-view-toggle:not(.is-machine) .ki-vt-human { color: var(--ki-ink); }
.ki-view-toggle:not(.is-machine) .ki-vt-human::before { background: currentColor; }
.ki-view-toggle.is-machine .ki-vt-machine { color: var(--ki-ink); }
.ki-view-toggle.is-machine .ki-vt-machine::before { background: currentColor; }
.ki-machine-pane { background: var(--ki-ink); min-height: calc(100vh - 84px); padding: 34px 0 60px; opacity: 0; visibility: hidden; position: absolute; left: 0; right: 0; transition: opacity 300ms ease, visibility 0s 300ms; }
.ki-machine-pane.is-open { position: static; opacity: 1; visibility: visible; transition: opacity 300ms ease 40ms; }
[data-ki-human] { transition: opacity 260ms ease; }
[data-ki-human].is-faded { opacity: 0; }
.ki-machine-boot [data-ki-human] { display: none; }
.ki-machine-world, .ki-machine-world body { min-height: 100%; background: var(--ki-ink); overscroll-behavior-y: none; }
.ki-machine-note { font-family: var(--ki-mono); font-size: 9.5px; letter-spacing: 0.07em; color: #8a8a8a; margin-bottom: 18px; }
.ki-machine-note a { color: #c9c9c9; text-decoration: none; }
.ki-machine-pane pre { font-family: var(--ki-mono); font-size: 12px; line-height: 1.65; color: #d4d4d4; white-space: pre-wrap; }
.ki-machine-pane pre a { color: #fff; text-decoration-color: #666; text-underline-offset: 3px; }
.ki-machine-pane pre a:hover { text-decoration-color: #fff; }
.kio-byline { font-size: 13.5px; color: var(--ki-body); margin: 0 0 29px; }
.kio-byline strong { color: var(--ki-ink); font-weight: 500; }
@media (max-width: 900px) { .kio-access { grid-template-columns: 1fr; } }

/* --- v2: sources block ----------------------------------------------------- */
.kio-sources { max-width: 720px; margin-bottom: 40px; }
.kio-sources ol { margin-left: 18px; }
.kio-sources li { font-size: 13px; line-height: 1.6; color: var(--ki-body); margin-bottom: 5px; }
.kio-link { color: var(--ki-ink); text-decoration: none; border-bottom: 1px solid var(--ki-hairline); }
.kio-link:hover { border-color: var(--ki-ink); }


/* ==========================================================================
   Object page - approved layout v3 (Tarak Figma 234:253, 2026-07-18)
   ========================================================================== */
.kio-crumb-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.kio-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.kio-sec-head h2, .kio-sources h2, .kio-next > h2 { font-family: var(--ki-serif); font-weight: 400; font-size: 24px; }

/* Directional links keep the Figma gradient at rest, then resolve uniformly
   to ink. The only movement is a restrained two-pixel arrow cue. */
.ki-dir-link { display: inline-flex; align-items: center; gap: 0.42em; font-family: var(--ki-mono); font-size: 14px; line-height: 1.45; color: var(--ki-ink); text-decoration: none; }
.ki-dir-text { position: relative; display: inline-block; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; transition: opacity 140ms ease; }
.ki-dir-text::after { content: attr(data-text); position: absolute; inset: 0; color: var(--ki-ink); -webkit-text-fill-color: var(--ki-ink); opacity: 0; pointer-events: none; transition: opacity 140ms ease; }
.ki-dir-right .ki-dir-text { background-image: linear-gradient(90deg, #000 0%, #525252 68%, #a4a4a4 100%); }
.ki-dir-left .ki-dir-text { background-image: linear-gradient(90deg, #525252 0%, #000 42%, #000 100%); }
.ki-dir-arrow { display: inline-block; color: #8f8f8f; transition: color 140ms ease, transform 140ms ease; }
.ki-dir-link:hover .ki-dir-text::after, .ki-dir-link:focus-visible .ki-dir-text::after { opacity: 1; }
.ki-dir-link:hover .ki-dir-arrow, .ki-dir-link:focus-visible .ki-dir-arrow { color: var(--ki-ink); }
.ki-dir-right:hover .ki-dir-arrow, .ki-dir-right:focus-visible .ki-dir-arrow { transform: translateX(2px); }
.ki-dir-left:hover .ki-dir-arrow, .ki-dir-left:focus-visible .ki-dir-arrow { transform: translateX(-2px); }
.ki-dir-link:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 4px; border-radius: 2px; }

/* family rungs */
.kio-family { max-width: 824px; margin: 48px 0 32px; }
.kio-family-rungs { list-style: none; margin: 0; }
.kio-family-rungs li { font-size: 15px; line-height: 21px; color: #626262; padding: 9px 0; border-bottom: 1px solid var(--ki-rule); }
.kio-family-rungs li:last-child { border-bottom: 0; }
.kio-family-rungs strong { font-weight: 700; font-family: var(--ki-sans); font-size: 15px; color: var(--ki-ink); margin-right: 2px; }

/* sources */
.kio-sources { max-width: 824px; margin-bottom: 48px; }
.kio-sources h2 { margin-bottom: 16px; }
.kio-sources ul { margin-left: 24px; }
.kio-sources li { font-size: 15px; line-height: 21px; color: var(--ki-body); margin-bottom: 12px; }
.kio-sources li:last-child { margin-bottom: 0; }

/* next steps: CTA widget + browseable next-read, ALWAYS equal height (grid stretch) */
.kio-next { margin-bottom: 28px; }
.kio-next > h2 { margin-bottom: 20px; }
.kio-next-grid { display: grid; grid-template-columns: minmax(0, 492fr) minmax(0, 298fr); gap: 34px; align-items: start; max-width: 824px; }
.kio-next-col { display: flex; min-width: 0; flex-direction: column; }
.kio-cta-card { position: relative; width: 100%; height: 238px; border-radius: 12px; background: linear-gradient(90deg, #3e3e3e 0%, #313131 3.4%, #252525 11%, #0b0b0b 24%); box-shadow: -1px 1px 2.5px rgba(0, 0, 0, 0.85); }
.kio-cta-card h3 { position: absolute; top: 25px; left: 34px; right: 34px; max-width: 424px; margin: 0; font-family: var(--ki-serif); font-weight: 400; font-size: 24px; line-height: 28px; color: #fff; white-space: nowrap; }
.kio-cta-card > p:not(.kio-cta-err) { position: absolute; top: 73px; left: 34px; right: 34px; max-width: 424px; margin: 0; font-size: 13px; line-height: 17px; color: #d2d2d2; }
.kio-cta-card p strong { font-weight: 700; color: #d2d2d2; }
.kio-cta-form { position: absolute; top: 147px; left: 34px; right: 34px; display: flex; gap: 15px; height: 45px; }
.kio-cta-form input { flex: 1; height: 45px; border: 1px solid #afafaf; border-radius: 10px; padding: 0 18px; font-family: var(--ki-sans); font-size: 14px; background: #fff; color: var(--ki-ink); }
.kio-cta-form input::placeholder { color: #979797; }
.kio-cta-form input[aria-invalid="true"] { border-color: #c96a5a; box-shadow: 0 0 0 2px rgba(201, 106, 90, 0.25); }
.ki-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
/* Confirmation for the in-place AO submit. Small, in normal flow BELOW the
   card, so it nudges the back-to-index link down rather than overprinting the
   card's copy (Tarak 2026-07-28). */
.kio-cta-sent {
  margin: 11px 0 0;
  font-family: var(--ki-mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--ki-meta);
}

.kio-cta-err { position: absolute; left: 35px; bottom: 4px; font-family: var(--ki-mono); font-size: 9px !important; letter-spacing: 0.02em; color: #dfa198 !important; }
.kio-suggest-head { display: flex; align-items: center; justify-content: space-between; }
.kio-suggest-head > .kio-block-label { margin-bottom: 14px; }
.kio-suggest-controls { display: flex; align-items: center; gap: 7px; margin: 0 0 14px; }
.kio-suggest-shell { position: relative; height: 238px; border-radius: 8px; outline: none; }
.kio-suggest-shell:focus-visible { box-shadow: 0 0 0 2px var(--ki-ink), 0 0 0 5px #fff; }
.kio-suggest-viewport { overflow: hidden; width: 100%; height: 100%; border-radius: 8px; opacity: 1; transition: opacity 120ms ease; }
.kio-suggest-shell.is-switching .kio-suggest-viewport { opacity: 0; }
.kio-suggest-track { position: relative; width: 100%; height: 100%; }
.kio-suggest-card { position: absolute; inset: 0; width: 100%; height: 238px; display: none; flex-direction: column; background: #fff; border: 0; border-radius: 8px; padding: 22px 24px 18px; box-shadow: inset 0 0 0 1px rgba(11, 11, 11, 0.04), -1px 1px 5px rgba(0, 0, 0, 0.18); transition: box-shadow 160ms ease; }
.kio-suggest-card.is-active { display: flex; }
.kio-suggest-card:hover { transform: none; box-shadow: inset 0 0 0 1px rgba(11, 11, 11, 0.1), -1px 1px 5px rgba(0, 0, 0, 0.18); }
.kio-sg-arrow { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; font-family: var(--ki-mono); font-size: 11px; line-height: 1; color: #777; cursor: pointer; }
.kio-sg-arrow:hover:not(:disabled) { color: var(--ki-ink); }
.kio-sg-arrow:focus-visible { outline: 2px solid var(--ki-ink); outline-offset: 2px; }
.kio-sg-arrow:disabled { opacity: 0.24; cursor: default; }
.kio-suggest-count { min-width: 28px; margin: 0; font-size: 9px; line-height: 14px; text-align: center; }
.kio-suggest-card .ki-meta { font-size: 10px; letter-spacing: 0.8px; color: #807c7c; margin-bottom: 12px; }
.kio-suggest-card h3 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-family: var(--ki-serif); font-weight: 400; font-size: 22px; line-height: 28px; color: #000; margin-bottom: 8px; }
.kio-suggest-card .ki-takeaway { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; line-height: 18px; color: var(--ki-body); margin-bottom: 8px; }
.kio-suggest-card.is-long-title h3 { -webkit-line-clamp: 4; font-size: 18.5px; line-height: 22px; margin-bottom: 6px; }
.kio-suggest-card.is-long-title .ki-takeaway { font-size: 12.5px; line-height: 17px; margin-bottom: 6px; }

.kio-suggest-card .ki-rule { background: #efeee9; }
.kio-suggest-card .ki-read { font-size: 10px; letter-spacing: 0.6px; color: #6a6a6a; transition: color 140ms ease; }
.kio-suggest-card:hover .ki-read, .kio-suggest-card:focus-visible .ki-read { color: #000; text-decoration: none; }

/* Figma V3 button: fixed gradient, no travelling or positional animation. */
.ki-btn-pop { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 45px; min-width: 138px; padding: 0 18px; border: 0; border-radius: 10px; font-family: var(--ki-serif); font-size: 15px; color: #fff; cursor: pointer; background: linear-gradient(90deg, #b4b4b4 0%, #878686 8.2%, #5a5959 20.2%, #444343 31.3%, #2d2c2c 52%); transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.ki-btn-pop > span { position: relative; z-index: 1; }
.ki-btn-pop:hover { color: var(--ki-ink); background: #fff; box-shadow: inset 0 0 0 1px rgba(11, 11, 11, 0.1); }
.ki-btn-pop:active { color: var(--ki-ink); background: #e9e8e4; box-shadow: inset 0 0 0 1px rgba(11, 11, 11, 0.14); }
.ki-btn-pop:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.kio-return { margin: 28px 0 56px; }
@media (max-width: 900px) { .kio-next-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .kio-cta-card { height: auto; min-height: 270px; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
  .kio-cta-card > * { min-width: 0; }
  .kio-cta-card h3 { position: static; max-width: none; margin: 0; white-space: normal; }
  .kio-cta-card > p:not(.kio-cta-err) { position: static; max-width: none; margin: 0; }
  .kio-cta-form { position: static; height: 45px; gap: 10px; margin-top: auto; }
  .kio-cta-form input { min-width: 0; padding: 0 14px; }
  .ki-btn-pop { min-width: 112px; padding: 0 12px; }
  .kio-cta-err { left: 24px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { .ki-dir-link, .ki-dir-text::after, .ki-dir-arrow, .ki-btn-pop, .kio-suggest-viewport { animation: none; transition: none; } }


/* --- v3.1 fidelity: rule under H1 --- */
.kio-h1-rule { display: block; width: 100%; max-width: 824px; height: 1px; background: var(--ki-rule); margin-bottom: 14px; }


/* sources links + audit'd measure */
.kio-sources li a { color: var(--ki-body); text-decoration: none; border-bottom: 1px solid var(--ki-hairline); }
.kio-sources li a:hover { color: #000; border-color: #000; }

/* ==========================================================================
   T3 registers: one AO composition, three disclosure behaviours.
   ========================================================================== */

/* Pending research is deliberately present but inert. It should read as a
   real programme in review, never as a dead link or a disabled button. */
.ki-card-pending { cursor: default; box-shadow: none; border-style: dashed; }
.ki-card-pending:hover { transform: none; box-shadow: none; }
.ki-card-pending .ki-read { color: #969696; text-decoration: none; }
.ki-card-preview { outline: 1px dashed #8a8a8a; outline-offset: -5px; }
.ki-atom-review { background: #dedede; border-style: dotted; }

/* Controlled and closed records preserve the approved type and spacing. The
   answer itself changes register before the boundary explains why. */
.kio-register-controlled .kio-answer-first,
.kio-register-report .kio-answer-first {
  padding: 22px 26px;
  border-left-width: 2px;
  background: #f3f3f3;
}
.kio-register-closed .kio-answer-first {
  padding: 26px 28px;
  border-left: 0;
  border-radius: 10px;
  background: var(--ki-ink);
}
.kio-register-closed .kio-answer-first p { color: #fff; }

.kio-boundary {
  max-width: 824px;
  margin: 44px 0 48px;
  padding: 22px 24px 25px;
  border: 1px solid #dedede;
  border-radius: 10px;
  background: #f3f3f3;
}
.kio-boundary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #d9d9d9;
}
.kio-boundary-head .kio-block-label { margin: 0; }
.kio-boundary-head .ki-bar { width: 96px; height: 8px; }
.kio-boundary-head .ki-bar-tick { top: -5px; height: 16px; }
.kio-boundary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px; }
.kio-boundary-label {
  margin-bottom: 8px;
  font-family: var(--ki-mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.07em;
  color: #737373;
}
.kio-boundary-grid > div > p:last-child { font-size: 14px; line-height: 1.55; color: #333; }

.kio-boundary-closed {
  border-color: #222;
  background: var(--ki-ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.kio-boundary-closed .kio-boundary-head { border-color: #343434; }
.kio-boundary-closed .kio-block-label,
.kio-boundary-closed .kio-boundary-label { color: #929292; }
.kio-boundary-closed .kio-boundary-grid > div > p:last-child { color: #e3e3e3; }

/* Report register: editorial hierarchy inside the same AO measure. */
.kio-preview-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 10px 14px;
  margin: -14px 0 30px;
  border: 1px dashed #858585;
  font-family: var(--ki-mono);
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: #5e5e5e;
}
.kio-preview-note strong { color: var(--ki-ink); font-weight: 500; }
.kio-report-kicker {
  margin-bottom: 12px;
  font-family: var(--ki-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ki-meta);
  text-transform: uppercase;
}
.kio-report-title { max-width: 824px; margin-bottom: 12px; font-size: 44px; line-height: 1.12; }
.kio-report-subtitle { max-width: 720px; margin-bottom: 20px; font-family: var(--ki-serif); font-size: 20px; line-height: 1.35; color: #555; }
.kio-report-body h2 { margin-top: 40px; }
.kio-boundary-report { background: linear-gradient(100deg, #eeeeee 0%, #f7f7f7 100%); }

@media (max-width: 760px) {
  .ki-wrap { padding-left: 16px; padding-right: 16px; }
  .ki-trails-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ki-trails-pills { gap: 8px; }
  .ki-pill { width: 100%; justify-content: space-between; }
  .ki-trail-panel { padding: 20px; }
  .ki-trail-panel-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .ki-trail-steps { grid-template-columns: 1fr; gap: 0; }
  .ki-trail-steps::before { display: none; }
  .ki-trail-steps li { padding-bottom: 18px; }
  .ki-trail-steps li:not(:last-child)::after { content: ""; position: absolute; display: block; top: 19px; bottom: 0; left: 9px; right: auto; width: 1px; height: auto; background: #d2d2d2; }
  .ki-trail-steps a { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; padding: 0; }
  .ki-trail-steps span { grid-column: 1; margin: 0; }
  .ki-trail-steps strong { grid-column: 2; padding-top: 1px; }
  .kio-trail-progress { top: 12px; align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 14px 15px; }
  .kio-trail-progress-copy { width: 100%; }
  .kio-trail-progress-actions { width: 100%; justify-content: space-between; gap: 9px; }
  .kio-trail-progress-actions a { font-size: 8px; }
  .kio-register-controlled .kio-answer-first,
  .kio-register-report .kio-answer-first,
  .kio-register-closed .kio-answer-first { padding: 20px; }
  .kio-boundary { padding: 20px; }
  .kio-boundary-grid { grid-template-columns: 1fr; gap: 22px; }
  .kio-preview-note { align-items: flex-start; flex-direction: column; gap: 5px; }
  .kio-report-title { font-size: 32px; }
  .kio-report-subtitle { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ki-hover-card { animation: none; }
  .ki-search-form, .ki-search-results, .ki-search-result, .ki-lat-label, .ki-pill, .ki-trail-stage, .ki-trail-panel, .ki-trail-start, .ki-trail-steps span, .ki-trail-steps strong, .kio-trail-progress, .kio-trail-progress-rail > span { transition: none; }
}
