/* SPAWN v7 inner pages: docs and the coin page. Loaded after v7.css. */
.mono { font-family: var(--mono); }
.back-link { display: inline-flex; gap: 6px; margin: 36px 0 24px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); transition: color 0.2s; }
.back-link:hover { color: var(--amber); }
code { padding: 1px 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); }
pre code, .kv code { padding: 0; border: 0; background: none; }

/* ======================= docs ======================= */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr) 200px; gap: 56px; max-width: 1240px; margin: 0 auto; padding: 40px 32px 0; align-items: start; }
.docs-side, .docs-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; }
.docs-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; margin-bottom: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color 0.2s; }
.docs-search:focus-within { border-color: var(--amber); }
.docs-search svg { width: 15px; height: 15px; fill: var(--dim); flex: none; }
.docs-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; }
.docs-search input::placeholder { color: var(--dim); }
.docs-search kbd { padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 6px; font: 400 11px var(--mono); color: var(--dim); }
.docs-group { margin-bottom: 22px; }
.docs-group h4, .docs-toc h4 { margin: 0 0 8px; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.docs-group a, .docs-toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); font-size: 14px; color: var(--soft); transition: color 0.2s, border-color 0.2s; }
.docs-group a:hover, .docs-toc a:hover { color: var(--ink); }
.docs-group a.active { color: var(--amber); border-left-color: var(--amber); }
.docs-group a.hidden { display: none; }
.docs-toc a { font-size: 13px; }
.docs-toc a:first-of-type { color: var(--ink); }

.docs-main { min-width: 0; }
.docs-main article { padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.docs-main article.hidden { display: none; }
.docs-main .eyebrow { margin-bottom: 12px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.docs-main h1 { font: 700 clamp(34px, 4vw, 48px)/1.05 var(--display); letter-spacing: -0.03em; }
.docs-main h2 { font: 700 clamp(26px, 2.6vw, 32px)/1.15 var(--display); letter-spacing: -0.02em; }
.docs-main h3 { margin: 32px 0 10px; font-size: 18px; font-weight: 600; scroll-margin-top: 90px; }
.docs-main p, .docs-main li { color: var(--soft); }
.docs-main p { margin-top: 14px; max-width: 72ch; }
.docs-main .lead { font-size: 18px; color: var(--ink); }
.docs-main strong { color: var(--ink); font-weight: 600; }
.docs-main ul, .docs-main ol { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; max-width: 72ch; }
.docs-main ul { list-style: disc; }
.docs-main ol { list-style: decimal; }
.docs-main li::marker { color: var(--amber); }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0 8px; }
.flow span { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); font: 400 12px var(--mono); color: var(--ink); }
.flow i { font-style: normal; color: var(--amber); }

.doc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.doc-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.25s, transform 0.25s var(--ease); }
.doc-card:hover { border-color: rgba(255, 181, 71, 0.45); transform: translateY(-2px); }
.doc-card b { font: 700 17px var(--display); }
.doc-card span { font-size: 14px; color: var(--soft); }

.callout { display: flex; gap: 14px; margin-top: 22px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--amber); border-radius: 12px; }
.callout.warn { border-left-color: var(--red); }
.callout-icon { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 181, 71, 0.14); color: var(--amber); font: 600 12px var(--mono); }
.callout.warn .callout-icon { background: rgba(248, 113, 113, 0.14); color: var(--red); }
.callout b { color: var(--ink); }
.callout p { margin-top: 4px; }

.code { margin-top: 18px; overflow: hidden; background: #0d0d0f; border: 1px solid var(--line); border-radius: 12px; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font: 400 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.code-copy { padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; font: 400 11px var(--mono); color: var(--soft); transition: border-color 0.2s, color 0.2s; }
.code-copy:hover { border-color: var(--amber); color: var(--amber); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; font: 400 13px/1.7 var(--mono); color: var(--ink); }
.code .k { color: var(--amber); }
.code .s { color: var(--green); }
.code .c { color: var(--dim); }
.code .n { color: #7dd3fc; }

.doc-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 14px; }
.doc-table th { padding: 10px 12px; text-align: left; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); background: var(--panel); border-bottom: 1px solid var(--line); }
.doc-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--soft); vertical-align: top; }
.doc-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.doc-table tr:first-child th:first-child { border-top-left-radius: 10px; }
.doc-table tr:first-child th:last-child { border-top-right-radius: 10px; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.docs-pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color 0.2s; }
.docs-pager a:hover { border-color: rgba(255, 181, 71, 0.45); }
.docs-pager a.next { text-align: right; }
.docs-pager small { font: 400 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.docs-pager b { font-weight: 600; }
.docs-empty { display: none; padding: 40px; text-align: center; color: var(--soft); background: var(--panel); border: 1px dashed var(--line-2); border-radius: 14px; }
.docs-menu-btn { display: none; }

/* ======================= coin page ======================= */
.coin-main { padding-bottom: 20px; }
.coin-missing-box { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 72px 24px; text-align: center; color: var(--soft); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.coin-missing-box b { color: var(--ink); }
.empty-gem { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--amber-2), var(--amber) 45%, #6b3a05); box-shadow: 0 0 40px rgba(255, 181, 71, 0.45); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.92); box-shadow: 0 0 22px rgba(255, 181, 71, 0.3); } }

.coin-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: center; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; position: relative; overflow: hidden; }
.coin-hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 181, 71, 0.16), transparent 65%); pointer-events: none; }
.coin-hero-img { aspect-ratio: 1; border-radius: 14px; background: var(--panel-2) center / cover no-repeat; }
.coin-hero-img:not(.has-img) { background-image: radial-gradient(circle at 50% 45%, rgba(255, 181, 71, 0.5), transparent 60%); }
.coin-hero-info { position: relative; z-index: 1; min-width: 0; }
.coin-hero-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.coin-hero-title h1 { font: 700 clamp(30px, 3.6vw, 44px)/1.05 var(--display); letter-spacing: -0.03em; }
.coin-hero-ticker { font-size: 14px; color: var(--dim); }
.coin-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.coin-hero-tags span:not(:empty) { padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--soft); }
.coin-hero-tags .stage-pill { border-color: rgba(255, 181, 71, 0.5); color: var(--amber); }
.net-pill.devnet, .coin-hero-tags .net-pill.devnet { border-color: rgba(248, 113, 113, 0.5); color: var(--red); }
.coin-hero-desc { margin-top: 14px; max-width: 60ch; color: var(--soft); }
.coin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.coin-actions > .btn:first-child { height: 40px; padding: 0 18px; background: var(--amber); color: #1a1205; }
.coin-actions > .btn:first-child:hover { background: var(--amber-2); }
.ca-btn { height: 40px; gap: 10px; font-weight: 500; }
.ca-copy { padding-left: 10px; border-left: 1px solid var(--line-2); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--panel-2); transition: border-color 0.2s; }
.icon-btn:hover { border-color: var(--dim); }
.icon-btn svg { width: 16px; height: 16px; fill: var(--ink); }

.coin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.coin-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.coin-stat small { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.coin-stat b { font: 700 24px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.coin-stat span { font-size: 11.5px; color: var(--dim); overflow-wrap: anywhere; }
.stage-bar { height: 6px; border-radius: 99px; background: #1f1f23; overflow: hidden; }
.stage-bar div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b26b10, var(--amber)); transition: width 0.6s var(--ease); }

.coin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.coin-panel { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.coin-panel .panel-head h3 { font: 700 18px var(--display); }
.coin-panel .panel-head span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.wake-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.wake-note { margin-top: 10px; font-size: 14px; color: var(--soft); }
.coin-page .traits { display: grid; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.coin-page .trait { display: block; }
.trait-head { display: flex; justify-content: space-between; margin-bottom: 6px; font: 400 12px var(--mono); color: var(--dim); }
.trait-head span:first-child { font: 500 14px var(--text) !important; color: var(--ink) !important; }
.trait-bar { height: 5px; border-radius: 99px; background: #1f1f23; overflow: hidden; }
.trait-bar div { height: 100%; border-radius: inherit; background: var(--amber); }
.lesson { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.lesson small { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.lesson blockquote { margin: 8px 0 0; padding: 12px 14px; border-left: 2px solid var(--amber); border-radius: 0 10px 10px 0; background: var(--panel-2); color: var(--ink); font-size: 15px; }
.cert { display: flex; flex-direction: column; }
.cert .lm-row { padding: 9px 0; border-bottom: 1px solid var(--line); font: 400 12px var(--mono); }
.cert .lm-row:last-child { border-bottom: 0; }
.cert .lm-row b { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert a { color: var(--amber); }

.chat { display: flex; flex-direction: column; margin-top: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-head small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--amber-2), var(--amber) 50%, #6b3a05) center / cover no-repeat; box-shadow: 0 0 16px rgba(255, 181, 71, 0.35); }
.chat-body { display: flex; flex-direction: column; gap: 10px; min-height: 120px; max-height: 420px; overflow-y: auto; padding: 20px; }
.chat-body:empty { display: none; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; animation: rise 0.35s var(--ease); }
.msg.it { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--amber); color: #1a1205; border-bottom-right-radius: 4px; }
.msg.err { align-self: center; color: var(--red); font-size: 13px; background: none; }
.msg.typing { display: flex; gap: 4px; }
.msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); animation: blink 1s infinite; }
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
.fs-gate { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 20px; color: var(--soft); }
.fs-gate .btn { background: var(--amber); color: #1a1205; height: 40px; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); outline: none; transition: border-color 0.2s; }
.chat-form input:focus { border-color: var(--amber); }
.chat-form .btn { height: 42px; background: var(--amber); color: #1a1205; }

/* ======================= responsive ======================= */
@media (max-width: 1100px) {
  .docs { grid-template-columns: 210px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); padding: 24px 20px 0; }
  .docs-side { position: fixed; inset: 64px 0 0; z-index: 60; max-height: none; padding: 20px; background: var(--bg); transform: translateY(8px); opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.2s, visibility 0.2s; }
  .docs-nav-open .docs-side { opacity: 1; visibility: visible; transform: none; }
  .docs-menu-btn { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 70; height: 40px; background: var(--amber); color: #1a1205; }
  .doc-cards, .docs-pager { grid-template-columns: 1fr; }
  .doc-table { display: block; overflow-x: auto; }
  .coin-hero { grid-template-columns: minmax(0, 1fr); }
  .coin-hero-img { max-width: 220px; }
  .coin-stats { grid-template-columns: 1fr 1fr; }
  .coin-cols { grid-template-columns: minmax(0, 1fr); }
}
