/* css/app.css: the app pages (Ask, Wiki, entries, Docs). Loaded after site.css; uses its tokens and porcelain glass. */

/* ============================================================================================ Markdown (.md) */

.md { font-size: 15.5px; line-height: 1.68; color: var(--ink); overflow-wrap: break-word; min-width: 0; }
.md > * { margin: 0; }
.md > * + * { margin-top: .85em; }
.md h2, .md h3, .md h4, .md h5, .md h6 { font-family: var(--display); color: var(--ink); text-wrap: balance; }
.md h2 { font-size: 1.3em; line-height: 1.25; font-weight: 700; letter-spacing: -0.025em; margin-top: 1.35em; }
.md h3 { font-size: 1.12em; line-height: 1.3; font-weight: 650; letter-spacing: -0.015em; margin-top: 1.2em; }
.md h4, .md h5, .md h6 { font-size: 1em; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; margin-top: 1.05em; }
.md > h2:first-child, .md > h3:first-child, .md > h4:first-child, .md > h5:first-child, .md > h6:first-child { margin-top: 0; }
.md h2 + *, .md h3 + *, .md h4 + *, .md h5 + *, .md h6 + * { margin-top: .45em; }
.md ul, .md ol { padding-left: 1.35em; display: grid; gap: .35em; }
.md li { padding-left: .15em; }
.md li > ul, .md li > ol { margin-top: .35em; }
.md li > p { margin: 0; }
.md li > p + p, .md li > p + .code, .md li > .code + p { margin-top: .5em; }
.md ul li::marker { color: var(--bronze-600); }
.md ol li::marker { font: 500 .92em var(--mono); color: var(--bronze-700); }
.md a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--bronze-500); text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.md a:hover { text-decoration-color: var(--ink); }
.md strong { font-weight: 650; color: var(--ink); }
.md del { color: var(--ink-3); }
.md :not(pre) > code { font: 400 .88em/1.4 var(--mono); color: var(--ink); background: var(--surface-3); border-radius: 6px; padding: .1em .38em; overflow-wrap: anywhere; }
.md blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--bronze-300); color: var(--ink-2); }
.md blockquote > * { margin: 0; }
.md blockquote > * + * { margin-top: .6em; }
.md hr { border: 0; height: 1px; background: var(--line-strong); margin-top: 1.4em; margin-bottom: .6em; }
.md .code { border-radius: 14px; }
.md .code pre { font-size: 12.75px; line-height: 1.65; }
.md .code pre code { font: inherit; background: none; padding: 0; color: inherit; }
.md .code-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.md-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); }
.md table { border-collapse: collapse; width: 100%; font-size: .9em; line-height: 1.45; }
.md th { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.md td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 6em; }
.md tr:last-child td { border-bottom: 0; }
.md-caret { display: inline-block; width: .5em; height: 1.05em; margin-left: 2px; vertical-align: -0.16em; border-radius: 2px; background: var(--bronze-600); animation: md-blink 1s steps(2, start) infinite; }
@keyframes md-blink { to { visibility: hidden; } }

/* ============================================================================================ Ask */

.page-ask .site-footer { margin-top: 0; }
/* while the phone chat list is open: no page scroll, and the header and banner (which sit above main, where the sheet
   lives) are dimmed like the backdrop and let taps fall through to it */
body.ask-locked { overflow: hidden; }
body.ask-locked .site-header, body.ask-locked .banner { pointer-events: none; }
body.ask-locked .site-header::after, body.ask-locked .banner::before { content: ''; position: absolute; inset: 0; z-index: 2; background: rgba(20, 17, 14, .28); }

.ask { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 22px; align-items: start; padding-top: 18px; }
.ask-main { display: flex; flex-direction: column; min-width: 0; min-height: calc(100svh - 112px); }
@media (min-width: 1000px) {
  .ask { grid-template-columns: 248px minmax(0, 1fr); padding-top: 22px; }
  .ask-main { min-height: calc(100svh - 122px); }
}

/* the chat list: a column on wide screens, a sheet on phones */
.ask-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ask-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.ask-side-head b { font: 600 15px/1.2 var(--display); letter-spacing: -0.01em; }
.ask-side-close { width: 40px; height: 40px; }
.ask-new { justify-content: flex-start; }
.ask-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -6px; padding: 2px 6px; overscroll-behavior: contain; }
.ask-list-empty { margin: 4px 2px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.ask-item { display: flex; align-items: center; gap: 2px; border-radius: 10px; min-width: 0; transition: background .15s var(--ease); }
.ask-item:hover { background: var(--surface-2); }
.ask-item.on { background: var(--white); box-shadow: 0 0 0 1px var(--line), var(--shadow-soft); }
.ask-item-open { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; padding: 9px 4px 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left; min-height: 48px; }
.ask-item-title { font: 500 13.5px/1.3 var(--display); letter-spacing: -0.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-item-open small { font: 400 11px/1.2 var(--mono); color: var(--ink-3); letter-spacing: -0.01em; }
.ask-item-del { flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-right: 4px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); }
.ask-item-del:hover { background: var(--ask-tint); color: var(--ask); }
.ask-item-del .bd-icon { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) {
  .ask-item-del { opacity: 0; }
  .ask-item:hover .ask-item-del, .ask-item-del:focus-visible, .ask-item.on .ask-item-del { opacity: 1; }
}
.ask-side-note { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--ink-3); }

@media (min-width: 1000px) {
  .ask-side {
    position: sticky; top: 82px; max-height: calc(100svh - 104px); padding: 14px; border: 1px solid rgba(31, 27, 22, .1); border-radius: 20px;
    background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.12); backdrop-filter: blur(16px) saturate(1.12);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-soft);
  }
  .ask-side-close, .ask-chats-btn, .ask-new-btn, .ask-back { display: none !important; }
}
@media (max-width: 999px) {
  .ask-side {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: min(80svh, 680px);
    padding: 12px var(--gutter) calc(14px + var(--safe-b)); background: var(--paper); border-top: 1px solid var(--line);
    border-radius: 22px 22px 0 0; box-shadow: 0 -30px 60px -30px rgba(74, 52, 25, .45);
    transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .3s;
  }
  .ask-side.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.32, .72, 0, 1), visibility 0s; }
  .ask-side::before { content: ''; align-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin-bottom: 2px; }
  .ask-back { position: fixed; inset: 0; z-index: 44; background: rgba(20, 17, 14, .28); opacity: 0; transition: opacity .2s var(--ease); }
  .ask-back.open { opacity: 1; }
}

/* the bar: model, balance, sign in */
.ask-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); min-width: 0; }
@media (min-width: 1000px) {
  .ask-bar {
    position: sticky; top: 64px; z-index: 6; padding-top: 10px; margin-top: -10px;
    background: color-mix(in oklab, var(--paper) 78%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
}
.ask-chats-btn, .ask-new-btn { flex: none; }
.ask-model {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; min-height: 48px; padding: 6px 12px 6px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--glass-strong); color: var(--ink); text-align: left;
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-soft); transition: border-color .15s var(--ease);
}
.ask-model:hover { border-color: var(--bronze-500); }
.ask-model > .bd-icon { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.ask-model-text { display: grid; gap: 3px; min-width: 0; }
.ask-model-text b { font: 600 14.5px/1.15 var(--display); letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-model-text small { font: 400 11.5px/1.2 var(--mono); letter-spacing: -0.02em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-meter { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.ask-pill, .ask-who {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--glass-strong); font: 400 12.5px/1 var(--display); color: var(--ink-2); white-space: nowrap; max-width: 100%;
}
.ask-pill .bd-icon { width: 14px; height: 14px; flex: none; color: var(--bronze-600); }
.ask-pill b { font: 500 13px/1 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.ask-pill .skeleton { min-width: 2em; }
a.ask-pill:hover { border-color: var(--bronze-500); }
.ask-pill.is-prelim b { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.ask-pill.is-prelim > span:last-child { padding: 3px 7px; border-radius: 999px; background: var(--bronze-100); color: var(--bronze-800); font-size: 11.5px; }
.ask-who { gap: 8px; font-family: var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.ask-who:hover { background: var(--white); }
.ask-who .addr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(157, 229, 0, .18); }
.ask-signin { min-height: 34px; }
@media (max-width: 560px) { .ask-pill .long { display: none; } }
@media (max-width: 999px) {
  .ask-model { flex: 1 1 0; }
  .ask-meter { width: 100%; margin-left: 0; justify-content: flex-start; }
}

/* the conversation */
.ask-log { flex: 1 1 auto; padding: 22px 0 10px; min-width: 0; }
.ask-hello { display: grid; justify-items: center; gap: 12px; max-width: 700px; margin: clamp(8px, 5vh, 56px) auto 0; text-align: center; }
.ask-hello .h-page { font-size: clamp(1.85rem, 5.6vw, 2.75rem); margin-top: 4px; }
.ask-hello .lede { margin: 0 auto; max-width: 36rem; }
.ask-ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 16px; }
@media (max-width: 560px) { .ask-ideas { grid-template-columns: minmax(0, 1fr); } }
.ask-idea {
  min-height: 62px; padding: 13px 16px; border: 1px solid rgba(31, 27, 22, .12); border-radius: 14px; text-align: left;
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-soft);
  font: 400 14px/1.45 var(--display); color: var(--ink-2); transition: border-color .15s var(--ease), color .15s var(--ease);
}
.ask-idea:hover { border-color: var(--bronze-500); color: var(--ink); }
@media (pointer: coarse) { .ask-idea, .ask-model, .ask-composer { -webkit-backdrop-filter: none; backdrop-filter: none; } }

.ask-thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; width: 100%; max-width: 780px; margin: 0 auto; }
.ask-thread:empty { display: none; }
.msg { min-width: 0; }
.msg-me { display: flex; justify-content: flex-end; }
.msg-bubble {
  max-width: min(86%, 620px); padding: 11px 15px; border-radius: 18px 18px 6px 18px; background: var(--bronze-100); border: 1px solid var(--line-bronze);
  color: var(--ink); font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-ai { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.msg-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.msg-av { width: 22px; height: 22px; border-radius: 6px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.msg-model { font: 500 12.5px/1.2 var(--display); color: var(--ink-3); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-wait { display: inline-flex; gap: 5px; padding: 10px 2px; }
.msg-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--bronze-500); animation: msg-dot 1.2s var(--ease) infinite; }
.msg-wait i:nth-child(2) { animation-delay: .15s; }
.msg-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes msg-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.msg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; min-width: 0; }
.msg-act {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; font: 500 12.5px/1 var(--display); color: var(--ink-3); white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease);
}
.msg-act:hover { background: var(--surface-2); color: var(--ink); }
.msg-act .bd-icon { width: 14px; height: 14px; }
.msg-act.msg-pub { color: var(--accent); background: var(--accent-tint); border-color: rgba(72, 103, 32, .22); }
.msg-act.msg-pub:hover { background: #e7f6c4; color: #36501a; }
.msg-act.is-done { color: var(--bid); }
.msg-meta { margin-left: 4px; font: 400 11.5px/1.3 var(--mono); letter-spacing: -0.02em; color: var(--ink-4); }
.msg-hint { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.msg-err { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--ask-tint); color: var(--ask); border: 1px solid rgba(176, 72, 60, .18); }
.msg-err > .bd-icon { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.msg-err.is-off { background: var(--bronze-100); color: var(--bronze-900); border-color: var(--line-bronze); }
.msg-err-in { min-width: 0; }
.msg-err p { margin: 0; font-size: 14px; line-height: 1.55; }
.msg-err-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* the composer stays at the bottom of the window */
.ask-dock { position: sticky; bottom: 0; z-index: 5; isolation: isolate; width: 100%; max-width: 780px; margin: 0 auto; padding: 18px 0 calc(10px + var(--safe-b)); }
/* an opaque porcelain band behind the composer, faded at the top (and at the sides on wide screens), so the
   conversation never shows through as it scrolls under */
.ask-dock::before {
  content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); background: #edeae4;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20px); mask-image: linear-gradient(to bottom, transparent, #000 20px);
}
@media (min-width: 1000px) {
  .ask-dock::before {
    left: -36px; right: -36px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20px), linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, transparent, #000 20px), linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
    mask-composite: intersect;
  }
}
.ask-off { margin-bottom: 8px; }
.ask-composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 16px; border: 1px solid var(--line-strong); border-radius: 20px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 20px 40px -28px rgba(74, 52, 25, .45); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.ask-composer:focus-within { border-color: var(--bronze-600); box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 4px rgba(201, 255, 63, .3), 0 20px 40px -28px rgba(74, 52, 25, .45); }
.ask-composer textarea {
  flex: 1 1 auto; min-width: 0; min-height: 42px; max-height: 40svh; padding: 9px 0; border: 0; outline: none; background: transparent; resize: none;
  font: 400 16px/1.5 var(--sans); color: var(--ink); overflow-y: hidden;
}
.ask-composer textarea::placeholder { color: var(--ink-4); }
.ask-composer textarea:focus-visible { outline: none; }
.ask-send, .ask-stop { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 13px; transition: transform .15s var(--ease), background .15s var(--ease); }
.ask-send { background: var(--neon); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 20px -10px rgba(157, 229, 0, .9); }
.ask-send:hover { background: var(--neon-2); }
.ask-stop { background: var(--ink); color: var(--paper); }
.ask-send:active, .ask-stop:active { transform: scale(.96); }
.ask-send .bd-icon { width: 19px; height: 19px; }
.ask-stop .bd-icon { width: 14px; height: 14px; }
.ask-hint { margin: 8px 0 0; text-align: center; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
@media (pointer: coarse) { .hide-touch { display: none; } }

/* model picker */
.bd-modal.mp-modal { width: min(600px, calc(100vw - 24px)); padding: 20px; }
.bd-modal.mp-modal[open] { display: flex; flex-direction: column; max-height: min(740px, calc(100svh - 32px)); overflow: hidden; }
.mp-modal h2 { margin-bottom: 12px; }
.mp-search { flex: none; min-height: 46px; }
.mp-count { flex: none; margin: 8px 2px 6px; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.mp-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -10px; padding: 0 10px 4px; overscroll-behavior: contain; }
.mp-group { margin-bottom: 8px; }
.mp-lab { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 4px 6px; background: var(--paper); font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bronze-700); }
.mp-lab span { color: var(--ink-4); letter-spacing: 0; }
.mp-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--ink); }
.mp-opt:hover, .mp-opt:focus-visible { background: var(--white); }
.mp-opt[aria-current='true'] { background: var(--white); box-shadow: 0 0 0 1px var(--line-strong); }
.mp-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.mp-name b { font: 500 14px/1.3 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.mp-tag { padding: 3px 7px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font: 500 10.5px/1 var(--display); }
.mp-tag.soft { background: var(--surface-3); color: var(--ink-3); }
.mp-price { display: grid; justify-items: end; gap: 2px; font: 500 12.5px/1.2 var(--mono); letter-spacing: -0.02em; color: var(--ink-2); white-space: nowrap; }
.mp-price small { font: 400 10.5px/1.2 var(--mono); color: var(--ink-4); }
.mp-check { width: 18px; height: 18px; color: var(--accent); }
@media (max-width: 420px) {
  .bd-modal.mp-modal { padding: 18px 14px; }
  .mp-opt { gap: 8px; padding: 8px 6px; }
  .mp-list { margin: 0 -6px; padding: 0 6px 4px; }
}

/* publish dialog */
.bd-modal.pub-modal { width: min(520px, calc(100vw - 24px)); }
.pub-form .field-label { font: 500 13px/1.3 var(--display); }
.pub-count { font: 400 12px/1.3 var(--mono); color: var(--ink-3); }
.pub-count.neg { color: var(--ask); }
.pub-kv { padding: 2px 14px; border-radius: 12px; background: var(--surface-2); }
.pub-form .link-box code { font-size: 12px; }

/* ============================================================================================ Wiki */

.wiki-note { margin-bottom: 18px; }
.wiki-note a { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.wiki-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wiki-seg { flex: 0 1 460px; min-width: 0; background: var(--glass-strong); }
.wiki-search { position: relative; display: block; flex: 1 1 260px; max-width: 380px; }
.wiki-search .bd-icon { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.wiki-search .input { padding-left: 40px; background: var(--glass-strong); }
@media (max-width: 720px) { .wiki-seg, .wiki-search { flex: 1 1 100%; max-width: none; } }
.wiki-count { margin: 14px 0 0; min-height: 1.4em; font: 400 12.5px/1.4 var(--mono); letter-spacing: -0.02em; color: var(--ink-3); }
.wiki-body { margin-top: 12px; }
.wiki-sec { margin: 30px 0 12px; }
.wiki-sec:first-child { margin-top: 4px; }
.wiki-sec .meta { font: 400 12.5px/1 var(--mono); color: var(--ink-3); }
.wiki-card { min-width: 0; }
.wiki-card h3 { overflow-wrap: break-word; }
.entry-kicker.is-model { color: var(--patina); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding-top: 6px; font: 400 11.5px/1.3 var(--mono); letter-spacing: -0.02em; color: var(--ink-3); }
.wiki-card-foot > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.wiki-card-foot .more { display: inline-flex; align-items: center; gap: 4px; flex: none; font: 500 13px/1 var(--display); letter-spacing: -0.01em; color: var(--accent); }
.wiki-card-foot .more .bd-icon { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.wiki-card:hover .more .bd-icon { transform: translateX(3px); }
.wiki-skel { gap: 12px; min-height: 180px; align-content: start; }
.wiki-skel .skeleton { display: block; }
.wiki-skel .skeleton:nth-child(1) { width: 72px; height: 10px; }
.wiki-skel .skeleton:nth-child(2) { width: 80%; height: 22px; }
.wiki-skel .skeleton:nth-child(3) { width: 100%; height: 44px; }
.wiki-empty { padding: 44px 18px; }
.wiki-empty > span { max-width: 30rem; line-height: 1.5; }
.wiki-empty .btn { margin-top: 8px; }
.wiki-more-row { display: flex; justify-content: center; margin-top: 20px; }

/* ============================================================================================ Entry */

.entry-page { padding-top: 24px; }
@media (min-width: 960px) { .entry-page { padding-top: 40px; } }
.entry-crumbs { display: flex; align-items: center; gap: 8px; min-height: 32px; min-width: 0; font: 500 13px/1.2 var(--display); color: var(--ink-3); }
.entry-crumbs a { flex: none; min-height: 32px; display: inline-flex; align-items: center; }
.entry-crumbs a:hover { color: var(--ink); }
.entry-crumb-here { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.entry-head { display: grid; gap: 12px; max-width: 860px; padding: 16px 0 24px; border-bottom: 1px solid var(--line); }
.entry-head .entry-kicker { overflow-wrap: anywhere; }
.entry-title { font-size: clamp(2.05rem, 7vw, 3.35rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: break-word; }
.entry-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entry-badges .badge .bd-icon { width: 12px; height: 12px; }
.entry-pub, .entry-ed { background: var(--glass-strong); border: 1px solid var(--line); }
.entry-when { font: 400 12px/1.3 var(--mono); letter-spacing: -0.02em; color: var(--ink-3); }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 28px; align-items: start; }
@media (min-width: 1000px) {
  .entry-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
  .entry-aside { position: sticky; top: 88px; }
}
.entry-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; max-width: 720px; }
.entry-md { font-size: 17px; line-height: 1.72; color: var(--ink-2); }
.entry-md > * + * { margin-top: 1em; }
.entry-md h2 { font-size: clamp(1.35rem, 4.4vw, 1.6rem); margin-top: 1.4em; }
.entry-md h3 { font-size: 1.15rem; }
.entry-q { margin: 0; padding: 16px 18px 18px; border-radius: 16px; background: var(--bronze-100); border: 1px solid var(--line-bronze); }
.entry-q figcaption { margin-bottom: 8px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bronze-700); }
.entry-q blockquote { margin: 0; font: italic 400 18px/1.5 var(--serif); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.entry-aside .card { padding: 18px; }
.entry-aside .card-head { margin-bottom: 8px; }
.entry-aside .kv dd { font-size: 12.5px; }
.entry-addr { display: inline-flex; align-items: center; gap: 5px; text-decoration: underline; text-decoration-color: var(--bronze-500); text-underline-offset: 3px; }
.entry-addr .bd-icon { width: 12px; height: 12px; flex: none; }
.entry-model { font-family: var(--display); letter-spacing: -0.01em; }
.entry-prov-note { margin-top: 10px; }
.entry-prov-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 500 13px/1.2 var(--display); color: var(--accent); }
.entry-prov-link .bd-icon { width: 14px; height: 14px; }
.entry-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.entry-state { margin-top: 26px; padding: 44px 18px; }
.entry-state-title { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.entry-state > span { max-width: 32rem; line-height: 1.5; }
.entry-state-act { justify-content: center; margin-top: 10px; }
.entry-load { display: grid; gap: 14px; max-width: 720px; padding: 18px 0; }
.entry-load .skeleton { display: block; }
.entry-skel-k { width: 90px; height: 11px; }
.entry-skel-t { width: min(520px, 90%); height: 46px; }
.entry-skel-l { width: 100%; height: 14px; }
.entry-skel-s { width: 62%; height: 14px; }

/* ============================================================================================ Docs */

.doc-nav a[aria-current] { background: var(--surface-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--lime); }
.doc-toc { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--glass-strong); }
@media (min-width: 1000px) { .doc-toc { display: none; } }
.doc-toc summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 0 16px; font: 500 14.5px/1.2 var(--display); cursor: pointer; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc summary .bd-icon { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s var(--ease); }
.doc-toc[open] summary .bd-icon { transform: rotate(180deg); }
.doc-toc nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 14px; }
.doc-toc nav a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); font: 500 13px/1 var(--display); color: var(--ink-2); }
.doc-body h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.doc-body h2 .badge { font-size: 11.5px; letter-spacing: 0; }
.doc-body b { color: var(--ink); font-weight: 600; }
.doc-link, .doc-body p a, .doc-body li a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--bronze-500); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.doc-body .note { margin-top: 2px; }
.doc-body .code pre { font-size: 12.5px; }
.doc-body .code-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.doc-tbl td { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.doc-tbl td:first-child { white-space: nowrap; }
.doc-tbl code.inl { white-space: nowrap; }
@media (max-width: 640px) {
  .doc-tbl.cards td { display: grid; gap: 3px; justify-content: stretch; text-align: left; white-space: normal; }
  .doc-tbl code.inl { white-space: normal; }
}
.doc-kv { max-width: 560px; }
.doc-kv dd { overflow-wrap: anywhere; }
.doc-group td { padding: 10px 14px; background: var(--surface-2); font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bronze-700); }
.doc-cname { display: grid; gap: 2px; white-space: normal; }
.doc-cname b { font: 600 14px/1.3 var(--display); }
.doc-cname small { font-size: 12px; line-height: 1.35; color: var(--ink-3); }
.doc-addr { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.doc-addr a { font: 400 12.5px/1.3 var(--mono); letter-spacing: -0.02em; color: var(--ink); text-decoration: underline; text-decoration-color: var(--bronze-300); text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc-addr-short { display: none; }
@media (max-width: 640px) { .doc-addr-full { display: none; } .doc-addr-short { display: inline; } }
.doc-copy { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--white); color: var(--ink-3); }
.doc-copy:hover { color: var(--ink); }
.doc-copy .bd-icon { width: 14px; height: 14px; }
.doc-pending { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
@media (max-width: 640px) {
  .doc-contracts.cards td::before { display: none; }
  .doc-tbl.cards tr.doc-group { padding: 0; }
  .doc-tbl.cards tr.doc-group td { padding: 10px 14px; }
}

/* ------------------------------------------------------------------------------------------- post-quantum */

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pq-chip { color: var(--ink); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.pq-chip .bd-icon { width: 15px; height: 15px; color: var(--accent); }
.pq-chip:hover { border-color: var(--bronze-500); transform: translateY(-1px); }
.pq-points { margin: 4px 0 6px; padding: 0; list-style: none; display: grid; gap: 10px; }
.pq-points li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.pq-points li::before { content: ''; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(157, 229, 0, .18); }
.pq-points b, .pq-list b { color: var(--ink); font-weight: 600; }
.btn .bd-icon { flex: none; }

.pq-probes { display: grid; gap: 8px; }
.pq-probe { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 249, .55); }
.pq-live .pq-probe { grid-template-columns: minmax(0, 1fr) auto; }
.pq-probe-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-tint); color: var(--accent); }
.pq-probe.no .pq-probe-ic { background: var(--bronze-100); color: var(--bronze-800); }
.pq-probe-ic .bd-icon { width: 17px; height: 17px; }
.pq-probe-main { display: grid; gap: 2px; min-width: 0; }
.pq-probe-main b { font: 600 13.5px/1.25 var(--display); }
.pq-probe-main .mono { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pq-probe-res { display: grid; justify-items: end; gap: 3px; }
.pq-probe-res small { font-size: 11px; color: var(--ink-3); }
.pq-live-key { margin-top: 14px; }

.pq-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pq-wide { grid-column: 1 / -1; } }
.pq-card .help { margin: 0 0 14px; }
.pq-card .help b { color: var(--ink-2); }
.pq-browser { margin: 14px 0 0 !important; }
.pq-key-act { margin-top: 14px; }
.pq-verify { display: grid; gap: 8px; }
.pq-v { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 249, .55); }
.pq-v-main { display: grid; gap: 3px; min-width: 0; }
.pq-v-main a { font: 600 14px/1.25 var(--display); color: var(--ink); }
.pq-v-detail { font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.pq-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.pq-list a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--bronze-500); text-underline-offset: 3px; }
.entry-pq .kv dd.mono { font-size: 12.5px; }
@media (max-width: 520px) {
  .pq-probe { grid-template-columns: auto minmax(0, 1fr); }
  .pq-probe-res { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
  .pq-v { flex-direction: column; align-items: flex-start; }
}
