/* The Journey Within (mazwiz.com/learn/). On top of /Devvit/hangout-map.css (colours, font, cards), the same look
   as the DTI pages. Dark only. */

:root { --lavender: #B4A6FF; --topbar: 56px; }
html { scroll-padding-top: calc(var(--topbar) + 12px); }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top bar: the book, the reader's type, the contents */
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
    min-height: var(--topbar); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    background: rgba(20, 23, 27, 0.92); border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.book-mark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; color: var(--text); font-weight: 800; }
.book-mark:hover { text-decoration: none; }
.book-mark .mark {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}
.book-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.read-as { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; font-weight: 700; }
.read-as select {
    min-height: 36px; padding: 0 28px 0 12px; border-radius: 999px; border: 1px solid var(--border); background-color: var(--surface-2);
    color: var(--text); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A9B0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.read-as select.has-type { border-color: var(--accent); }
.toc-btn, .toc-close {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.toc-btn svg, .toc-close svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
    .read-as > span, .toc-btn span { display: none; }
    .toc-btn { width: 36px; padding: 0; }
}
@media (max-width: 380px) { .book-name { display: none; } }

/* ---- The page */
.book { padding-top: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--accent-text); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.lead { margin: 0 0 18px; font-size: 18px; color: var(--text-2); }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.section-title { margin: 36px 0 12px; color: var(--text); font-size: 22px; font-weight: 800; }
.book h3 { margin: 18px 0 6px; color: var(--text); font-size: 17px; }
.book strong { color: var(--text); }

/* A glossary word: dotted, opens its definition */
.term { color: inherit; border-bottom: 1.5px dotted var(--text-muted); cursor: help; }
.term:hover { text-decoration: none; border-bottom-color: var(--accent); color: var(--text); }
.soon { color: var(--text-muted); }

/* Who an idea comes from */
.srcs { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: 2px; }
.src {
    display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2);
    border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1;
}
a.src:hover { text-decoration: none; color: var(--text); }
.src-mazwiz { border-style: dashed; border-color: var(--lavender); color: var(--lavender); }

/* A function filled in for the reader's type */
.fn.filled {
    display: inline-block; padding: 0 7px; border-radius: 7px; background: var(--fc-soft, var(--surface-2));
    color: var(--fc, var(--text)); font-weight: 800; line-height: 1.5;
}

/* ---- Glossary pop-up */
.term-pop {
    position: absolute; z-index: 30; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 16px;
    background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); font-size: 15px;
}
.term-pop .pop-term { margin: 0 0 4px; color: var(--text); font-weight: 800; }
.term-pop p { margin: 0 0 8px; }
.term-pop .pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.term-pop .pop-foot a:not(.src) { font-size: 14px; font-weight: 700; }

/* ---- Contents */
.toc-part { margin: 0 0 18px; }
.toc-part-title { margin: 0 0 6px; color: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.toc-rows { margin: 0; padding: 0; list-style: none; }
.toc-row { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toc-row:last-child { border-bottom: 0; }
.toc-link { display: block; color: var(--text); font-weight: 800; }
.toc-row.is-soon .toc-link, .toc-row.is-soon > .soon { color: var(--text-muted); font-weight: 700; }
.toc-row.on > .toc-link { color: var(--accent-text); }
.toc-short { display: block; color: var(--text-muted); font-size: 14px; }
.toc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.toc-chip {
    display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border-radius: 999px; background: var(--surface-2);
    border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 800;
}
a.toc-chip:hover { text-decoration: none; border-color: var(--accent); }
.toc-chip.soon { color: var(--text-muted); font-weight: 700; border-style: dashed; }
.toc-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.book > .toc { padding: 18px 20px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.book > .toc .toc-part:last-child { margin-bottom: 0; }

.toc-panel { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); }
.toc-panel[hidden] { display: none; }
.toc-sheet {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); overflow-y: auto; overscroll-behavior: contain;
    padding: calc(14px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); border-left: 1px solid var(--border);
}
.toc-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.toc-title { margin: 0; color: var(--text); font-size: 19px; font-weight: 800; }
.toc-close { width: 36px; padding: 0; }
.toc-compact .toc-row { padding: 8px 0; }

/* ---- Previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 40px 0 0; }
.pager a {
    display: block; padding: 12px 16px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border);
    color: var(--text); font-weight: 800; line-height: 1.3;
}
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager a span { display: block; margin: 0 0 2px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.pager-next { text-align: right; }

.book-foot {
    max-width: 760px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 14px;
}
.book-foot p { margin: 0 0 4px; }

/* ---- Read as: the reader's eight seats (cover) */
.diagram { margin: 0 0 14px; }
.reader { padding: 18px 20px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.reader-title { margin: 0 0 4px; color: var(--text); font-size: 17px; font-weight: 800; }
.reader-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0 10px; }
.reader-pick button {
    min-height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.reader-pick button:hover { border-color: var(--accent); }
.seats-label { margin: 14px 0 6px; color: var(--text-muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 0; font-size: 14px; font-weight: 700; }
.linkish { padding: 0; border: 0; background: none; color: var(--info); font: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* ---- Glossary and sources */
.gloss { margin: 0; }
.gloss-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.gloss-item:target { margin: 0 -12px; padding: 14px 12px; border-radius: 14px; background: var(--accent-soft); border-bottom-color: transparent; }
.gloss dt { color: var(--text); font-size: 17px; font-weight: 800; }
.gloss .also { margin-left: 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.gloss dd { margin: 2px 0 0; }
.gloss dd p { margin: 0 0 6px; }
.gloss .more { margin-left: 4px; font-weight: 700; }
.source h2 { margin: 6px 0 6px; }
.source-label { margin: 0; }
.works { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.works li { margin: 0 0 4px; }

/* ---- Function pages */
.section-sub { margin: -4px 0 12px; color: var(--text-muted); font-size: 15px; }
.note { margin: 10px 0 0; color: var(--text-muted); font-size: 13px; }
.fnhead {
    display: flex; align-items: center; gap: 16px; margin: 0 0 16px; padding: 14px 16px; border-radius: 20px;
    background: linear-gradient(var(--c-soft), var(--c-soft)), var(--surface-1); border: 1.5px solid var(--c);
}
.fn-code {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 64px; height: 64px; border-radius: 18px;
    background: var(--c); color: #14171B; font-size: 26px; font-weight: 800;
}
.fnhead p { margin: 0; }
.fnhead .fn-question { color: var(--text); font-size: 19px; font-weight: 800; }
.fnhead .fn-meta { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.fn-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .fn-list { grid-template-columns: 1fr; } }
.fn-card {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 18px; color: inherit;
    background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--c);
}
a.fn-card:hover { text-decoration: none; border-color: var(--c); }
.fn-card .fn-code { width: 44px; height: 44px; border-radius: 12px; font-size: 17px; }
.fn-card.is-soon { opacity: 0.6; }
.fn-list-body span { display: block; }
.fn-list-body .fn-name { color: var(--text); font-weight: 800; }
.fn-list-body .fn-question { color: var(--c); font-size: 14px; font-weight: 800; }
.fn-list-body .fn-gist { color: var(--text-muted); font-size: 14px; line-height: 1.4; }
.traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 420px) { .traits { grid-template-columns: 1fr; } }
.traits li { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); font-size: 14px; line-height: 1.4; }
.traits b { display: block; color: var(--text); font-size: 15px; }
.traits.letters { grid-template-columns: 1fr; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }
.pair .card { margin: 0; }
.pair h3 { margin-top: 0; }
.pair ul { margin: 0; }

/* A function in each of the eight seats */
.seat-table .seats-label:first-child { margin-top: 0; }
.seat-row {
    display: flex; gap: 12px; margin: 0 0 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border);
}
.seat-row.is-shadow { border-style: dashed; }
.seat-row.is-you { border: 1.5px solid var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-1); }
.seat-n {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 999px;
    background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 800;
}
.seat-body p { margin: 0; font-size: 15px; }
.seat-body .seat-role { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 2px 0 4px; }
.seat-arch { color: var(--text); font-weight: 800; }
.seat-types { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.seat-types a, .seat-types span { margin-right: 6px; }
.you-tag { display: none; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.is-you .you-tag { display: inline-block; }

.steps-list { margin: 0 0 10px; padding-left: 22px; }
.steps-list li { margin: 0 0 8px; }

/* ---- Diagrams: the wheel, the stack builder */
.diagram-caption { margin: 8px 0 0; color: var(--text-2); font-size: 15px; text-align: center; }
.wheel { padding: 12px 12px 16px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.wheel svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; font-family: inherit; }
.wheel .axis { stroke: var(--border); stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; }
.wheel .node circle:first-child { fill: var(--surface-2); stroke: var(--c); stroke-width: 3; }
.wheel .node .code { fill: var(--text); font-size: 22px; font-weight: 800; text-anchor: middle; }
.wheel .node .short { fill: var(--c); font-size: 13px; font-weight: 800; text-anchor: middle; stroke: var(--surface-1); stroke-width: 5px; paint-order: stroke; }
.wheel .node.is-shadow circle:first-child { stroke-dasharray: 6 5; }
.wheel .node.is-shadow .code { fill: var(--text-muted); }
.wheel .badge { fill: var(--text); }
.wheel .badge-n { fill: var(--bg); font-size: 12px; font-weight: 800; text-anchor: middle; }
.wheel a:hover circle:first-child { fill: var(--c-soft); }

.builder { padding: 16px 18px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.builder-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
@media (max-width: 560px) { .builder-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.builder-pick button {
    min-height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
    font: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
}
.builder-pick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.builder-type { display: flex; gap: 6px; margin: 16px 0 8px; }
.builder-type span {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 48px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 24px; font-weight: 800;
}
.builder-steps { margin: 0; padding: 0; list-style: none; counter-reset: b; }
.builder-steps li { counter-increment: b; position: relative; margin: 0; padding: 10px 0 10px 38px; border-bottom: 1px solid var(--border); }
.builder-steps li::before {
    content: counter(b); position: absolute; left: 0; top: 10px; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 800;
}
.builder-steps p { margin: 0; font-size: 15px; }
.builder-step-title { color: var(--text); font-weight: 800; }
.fchip {
    display: inline-block; min-width: 30px; padding: 0 7px; border-radius: 7px; background: var(--c-soft); color: var(--c);
    font-weight: 800; text-align: center;
}

/* A type's stack: the light on the left, each shadow function in front of its partner */
.stackpair { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); gap: 6px 4px; align-items: center; margin: 12px 0 0; }
.sp-head { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.sp-seat {
    display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border-radius: 12px;
    border: 1.5px solid var(--c); background: linear-gradient(var(--c-soft), var(--c-soft)), var(--surface-2);
}
.sp-seat.is-shadow { border-style: dashed; background: var(--surface-2); }
.sp-seat b { color: var(--text); font-size: 19px; line-height: 1; }
.sp-seat.is-shadow b { color: var(--text-2); }
.sp-n {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px;
    background: var(--surface-1); color: var(--text-muted); font-size: 11px; font-weight: 800;
}
.sp-role { color: var(--text-muted); font-size: 12px; font-weight: 700; line-height: 1.2; text-align: right; }
.sp-face { height: 2px; background: repeating-linear-gradient(90deg, var(--text-muted) 0 3px, transparent 3px 6px); }
@media (max-width: 420px) {
    .sp-seat { grid-template-columns: auto 1fr; gap: 6px; padding: 6px 8px; }
    .sp-n { display: none; }
    .sp-role { font-size: 11px; }
}
.wheel .stackpair { max-width: 520px; margin: 14px auto 0; }

/* ---- Archetypes */
.sp-seat.is-blank { --c: var(--border); background: var(--surface-2); }
.sp-seat.is-blank b { color: var(--text-muted); }
.archhead {
    display: flex; align-items: center; gap: 16px; margin: 0 0 16px; padding: 14px 16px; border-radius: 20px;
    background: var(--surface-1); border: 1.5px solid var(--accent);
}
.archhead.is-shadow { border: 1.5px dashed var(--lavender); }
.arch-n {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 999px;
    background: var(--accent); color: var(--on-accent); font-size: 22px; font-weight: 800;
}
.is-shadow .arch-n, .arch-list.is-shadow .arch-n { background: var(--surface-2); color: var(--lavender); border: 1.5px dashed var(--lavender); }
.archhead p { margin: 0; }
.arch-place { color: var(--text); font-weight: 800; }
.arch-also, .arch-partner { color: var(--text-muted); font-size: 14px; }
.arch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .arch-list { grid-template-columns: 1fr; } }
.arch-list > a, .arch-list > span {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface-1);
    border: 1px solid var(--border); color: var(--text-2); font-size: 14px; line-height: 1.4;
}
.arch-list > a:hover { text-decoration: none; border-color: var(--accent); }
.arch-list.is-shadow > a, .arch-list.is-shadow > span { border-style: dashed; }
.arch-list .arch-n { width: 36px; height: 36px; font-size: 16px; }
.arch-list b { display: block; color: var(--text); font-size: 16px; }
.seat-row .fchip { flex-shrink: 0; align-self: flex-start; margin-top: 2px; }

/* ---- The 16 by 8 matrix */
.matrix { margin: 0 0 8px; }
.matrix-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.matrix-filter button {
    min-height: 34px; min-width: 44px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--c, var(--border)); background: var(--surface-2);
    color: var(--c, var(--text)); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.matrix-filter button[aria-pressed="true"] { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); color: #14171B; }
.matrix-scroll { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-1); -webkit-overflow-scrolling: touch; }
.matrix table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrix th, .matrix td { padding: 7px 5px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.matrix thead th { color: var(--text); font-weight: 800; }
.matrix thead th a { color: inherit; }
.matrix tbody th {
    position: sticky; left: 0; z-index: 1; padding-left: 10px; text-align: left; background: var(--surface-1); color: var(--text-2); font-weight: 700;
}
.matrix tbody th a { color: inherit; }
.matrix td { color: var(--c); font-weight: 800; background: var(--c-soft); transition: opacity 0.15s; }
.matrix td.is-shadow { background: transparent; }
.matrix tr.shadow-start > * { border-top: 2px dashed var(--border); }
.matrix td.dim { opacity: 0.15; }
.matrix .is-you { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.matrix thead th.is-you { color: var(--accent-text); }
.matrix tr:last-child > * { border-bottom: 0; }

/* ---- The hero's journey circle and its stages */
.journey { padding: 8px 8px 16px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.journey svg { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto; font-family: inherit; }
.journey .threshold { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 6; }
.journey .arc { fill: none; stroke: var(--accent); stroke-width: 3; opacity: 0.55; }
.journey .arc.is-shadow { stroke: var(--lavender); stroke-dasharray: 8 7; }
.journey .world { fill: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: 2px; text-anchor: middle; }
.journey .world.is-shadow { fill: var(--lavender); }
.journey .stage-node circle { fill: var(--c-soft, var(--surface-2)); stroke: var(--c, var(--accent)); stroke-width: 3; }
.journey .stage-node.is-shadow circle { stroke: var(--c, var(--lavender)); stroke-dasharray: 5 4; fill: var(--surface-2); }
.journey .stage-in { fill: var(--text); font-size: 16px; font-weight: 800; text-anchor: middle; }
.journey .stage-label { fill: var(--text-2); font-size: 12.5px; font-weight: 700; }
.journey a:hover circle { stroke-width: 5; }
.stages { margin: 0; padding: 0; list-style: none; }
.stage { margin: 0 0 10px; padding: 14px 16px; border-radius: 18px; background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.stages.is-shadow .stage { border-left: 4px dashed var(--lavender); }
.stage:target { border-color: var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-1); }
.stage p { margin: 0 0 4px; }
.stage-name { color: var(--text); font-size: 17px; font-weight: 800; }
.stage-name span { display: block; color: var(--text-muted); font-size: 13px; font-weight: 700; }

/* ---- Four sides, pairs, compare */
.four-sides, .compare { padding: 16px 18px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.fs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.fs-side { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1.5px solid var(--accent); }
.fs-side.is-shadow { border: 1.5px dashed var(--lavender); }
.fs-side p { margin: 0; }
.fs-name { color: var(--text-muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.fs-type { color: var(--text); font-size: 28px; font-weight: 800; line-height: 1.2; }
.fs-how { color: var(--text-muted); font-size: 13px; line-height: 1.35; }
.fs-stack { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .sides { grid-template-columns: 1fr; } }
.sides .card { margin: 0; }
.side.is-shadow { border-style: dashed; }
.side-name { color: var(--text); font-size: 17px; font-weight: 800; }
.pair-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
@media (max-width: 560px) { .pair-list { grid-template-columns: 1fr; } }
.pair-item { padding: 12px 14px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border); font-size: 14px; }
.pair-item.is-you { border: 1.5px solid var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-1); }
.pair-item p { margin: 0; }
.pair-types { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--text); font-size: 17px; font-weight: 800; }
.pair-and { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.pair-mission { margin: 4px 0 2px !important; color: var(--accent-text); font-weight: 800; }
.cmp-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-pick { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-pick select {
    min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text); font: inherit; font-size: 16px; font-weight: 800; text-transform: none; letter-spacing: 0;
}
.cmp-kind { margin: 12px 0 0; font-size: 15px; }
.cmp-badge { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800; }
.cmp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .cmp-cols { grid-template-columns: 1fr; } }
.cmp-where { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.cmp-where li { margin: 0 0 6px; }

/* ---- Stories decoded */
.story { margin: 0 0 12px; padding: 16px 18px; border-radius: 20px; background: var(--surface-1); border: 1px solid var(--border); }
.story.is-you { border: 1.5px solid var(--accent); }
.story p { margin: 0 0 8px; }
.story-kind { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.story-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px !important; color: var(--text); font-size: 21px; }
.story-spine { font-size: 14px; color: var(--text-2); }
.story-spine .fchip { margin-right: 2px; }
a.fchip:hover { text-decoration: none; filter: brightness(1.15); }
.story-journey { margin: 8px 0 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.story-journey summary { padding: 10px 14px; color: var(--text); font-weight: 800; cursor: pointer; }
.story-beats { margin: 0; padding: 0 14px 10px; list-style: none; }
.story-beats li { margin: 0 0 8px; font-size: 15px; }
.beat-stage { display: block; color: var(--accent-text); font-size: 13px; font-weight: 800; }
.story-lesson { margin: 0 !important; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text); font-weight: 600; }
.more-stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .more-stories { grid-template-columns: 1fr; } }
.more-stories .card { margin: 0; padding: 14px 16px; }
.more-head { margin: 0 0 6px; color: var(--text); font-weight: 800; }
.more-stories ul { margin: 0; font-size: 14px; }
.more-stories li { margin: 0 0 4px; }

/* ---- Type chapters */
.type-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .type-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.type-facts span { padding: 10px 12px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text); font-weight: 800; font-size: 15px; }
.type-facts b { display: block; color: var(--text-muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tprof-top { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; margin: 0 0 12px; }
.tprof-stack { width: 150px; height: 159px; }
.tprof-stack text { font-family: inherit; }
.tprof-essence { margin: 0; color: var(--text); font-size: 18px; font-weight: 700; }
@media (max-width: 420px) { .tprof-top { grid-template-columns: 120px 1fr; } .tprof-stack { width: 120px; height: 127px; } .tprof-essence { font-size: 16px; } }
.tprof-role { margin: 0 0 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border-left: 4px solid var(--c); }
.tprof-role h3, .tprof-box h3 { margin: 4px 0 4px; color: var(--text); font-size: 17px; }
.tprof-role p, .tprof-box p, .tprof-tip p { margin: 0; }
.tprof-lab { margin: 0 0 2px; color: var(--text-muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.tprof-lab span { color: var(--c, var(--text)); margin-right: 4px; }
.tprof-lab b { color: var(--text-2); }
.tprof-lab .fchip { text-transform: none; letter-spacing: 0; }
.tprof .pair { margin: 0 0 10px; }
.tprof-box, .tprof-tip { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.tprof-box.is-trap { border: 1.5px dashed #5A4A4E; }
.tpic { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.tpic img { width: 120px; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.tpic-title { margin: 0 0 2px; color: var(--text); font-weight: 800; }
.btn-save {
    display: inline-flex; align-items: center; min-height: 40px; margin-top: 8px; padding: 0 16px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 800;
}
.btn-save:hover { text-decoration: none; border-color: var(--accent); }
.shows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
@media (max-width: 640px) { .shows { grid-template-columns: 1fr; } }
.shows .card { margin: 0; padding: 14px 16px; }
.shows .card p:last-child { margin: 0; font-size: 15px; }
.stage.is-dark { border-left: 4px dashed var(--lavender); }
.stage-name a { color: inherit; }
.tsuccess .mantra { margin: 0 0 8px; color: var(--accent-text); font-size: 24px; font-weight: 800; line-height: 1.2; }
.false-summit { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.way { margin: 0 0 12px; padding: 0; list-style: none; }
.way li { margin: 0 0 6px; }
.questions { margin: 0 0 10px; }
.questions li { color: var(--text); font-weight: 600; }
.type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
@media (max-width: 640px) { .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tg-cell { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text-2); }
a.tg-cell:hover { text-decoration: none; border-color: var(--accent); }
.tg-cell.is-you { border: 1.5px solid var(--accent); }
.tg-cell.is-soon { opacity: 0.55; }
.tg-top { display: flex; align-items: baseline; justify-content: space-between; }
.tg-top b { color: var(--text); font-size: 18px; }
.tg-top span, .tg-pop, .tg-soon { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.tg-tag { color: var(--text-2); font-size: 14px; font-weight: 700; line-height: 1.3; }

/* ---- Success, loops, who says what */
.succ-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
@media (max-width: 560px) { .succ-list { grid-template-columns: 1fr; } }
.succ-item { padding: 12px 14px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border); font-size: 14px; }
.succ-item.is-you { border: 1.5px solid var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-1); }
.succ-item p { margin: 0 0 4px; }
.succ-spine { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
@media (max-width: 560px) { .who { grid-template-columns: 1fr; } }
.who .card { margin: 0; padding: 14px 16px; }
.who .card p:last-child { margin: 0; font-size: 15px; }
.who-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.who-table th, .who-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.who-table thead th { color: var(--text); }
.who-table tbody th { color: var(--text); font-weight: 800; white-space: nowrap; }
.who-table td:nth-child(4) { color: var(--accent-text); font-weight: 700; }
.side ul { margin: 6px 0 0; font-size: 15px; }
.styles-box .fs-type { font-size: 20px; overflow-wrap: anywhere; }
