/* Shared layout for guides, research, policy and tool pages. */
.doc-page {
    --doc-accent: var(--green);
    --doc-accent-rgb: 130, 230, 186;
    --doc-body: #c4d8cc;
    --doc-heading: #f3fff8;
    --doc-card: rgba(255, 255, 255, 0.035);
    --doc-card-line: rgba(255, 255, 255, 0.08);
    background: #06110d;
}

.doc-page[data-section="research"] { --doc-accent: #5fd4d4; --doc-accent-rgb: 95, 212, 212; }
.doc-page[data-section="resources"] { --doc-accent: var(--amber); --doc-accent-rgb: 241, 199, 91; }
.doc-page[data-section="policy"] { --doc-accent: #a9c4b6; --doc-accent-rgb: 169, 196, 182; }

.doc-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 40;
    height: 2px;
    pointer-events: none;
}

.doc-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--doc-accent), #ffffff);
    transform: scaleX(var(--doc-progress, 0));
    transform-origin: left;
}

/* Hero */
.doc-hero {
    position: relative;
    padding: 120px 0 56px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--doc-card-line);
    background:
        radial-gradient(ellipse at 85% 20%, rgba(var(--doc-accent-rgb), 0.14), transparent 55%),
        repeating-linear-gradient(0deg, transparent 0 59px, rgba(130, 230, 186, 0.03) 60px),
        repeating-linear-gradient(90deg, transparent 0 59px, rgba(130, 230, 186, 0.03) 60px),
        #04100c;
}

.doc-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 56px;
    align-items: end;
}

.doc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 26px;
    color: #8eaa9b;
    font-size: 0.84rem;
}

.doc-breadcrumb a {
    color: #b9d7c8;
    text-decoration: none;
}

.doc-breadcrumb a:hover,
.doc-breadcrumb a:focus-visible {
    color: var(--doc-accent);
}

.doc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--doc-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.doc-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: currentColor;
}

.doc-title {
    max-width: 820px;
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(2.1rem, 4.2vw, 3.3rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.doc-lead {
    max-width: 760px;
    margin: 0;
    color: #b9d2c4;
    font-size: 1.06rem;
    line-height: 1.9;
}

.doc-hero .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 24px;
}

.doc-hero .meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #9fbcad;
    font-size: 0.84rem;
}

.doc-hero .meta-pill i {
    color: var(--doc-accent);
}

.doc-hero .meta-pill a {
    color: #d8ebe1;
}

.doc-hero .hero-actions,
.doc-hero .related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 0;
}

.hero-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    transition: border-color 200ms ease, background-color 200ms ease;
}

.hero-action.primary {
    border-color: transparent;
    background: var(--doc-accent);
    color: #04100b;
}

.hero-action:hover,
.hero-action:focus-visible {
    border-color: rgba(var(--doc-accent-rgb), 0.6);
}

.hero-action.primary:hover,
.hero-action.primary:focus-visible {
    background: #ffffff;
}

.doc-hero-card {
    position: relative;
    padding: 22px;
    border: 1px solid rgba(var(--doc-accent-rgb), 0.25);
    border-radius: 14px;
    background: rgba(5, 18, 13, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.doc-hero-icon {
    position: relative;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 16px;
    background: rgba(var(--doc-accent-rgb), 0.12);
    color: var(--doc-accent);
    font-size: 1.5rem;
}

.doc-hero-icon::before,
.doc-hero-icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border: 1px solid rgba(var(--doc-accent-rgb), 0.35);
    border-radius: 20px;
    opacity: 0;
}

.doc-hero-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.doc-hero-card dl div {
    min-width: 0;
}

.doc-hero-card dt {
    color: #7f9c8d;
    font-size: 0.72rem;
}

.doc-hero-card dd {
    margin: 2px 0 0;
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.doc-hero-card p {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--doc-card-line);
    color: #9fbcad;
    font-size: 0.8rem;
    line-height: 1.7;
}

/* Body layout */
.doc-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 56px;
    padding: 56px 0 80px;
}

.doc-toc {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    font-size: 0.86rem;
}

.doc-toc-title {
    margin: 0 0 12px;
    color: #7f9c8d;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.doc-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--doc-card-line);
}

.doc-toc a {
    display: block;
    margin-left: -1px;
    padding: 7px 0 7px 14px;
    border-left: 2px solid transparent;
    color: #93ae9f;
    line-height: 1.5;
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease;
}

.doc-toc a:hover,
.doc-toc a:focus-visible {
    color: var(--text);
}

.doc-toc a[aria-current="true"] {
    border-left-color: var(--doc-accent);
    color: var(--doc-accent);
    font-weight: 700;
}

.doc-toc-cta {
    display: grid;
    gap: 8px;
    margin-top: 22px;
    padding: 14px;
    border: 1px solid var(--doc-card-line);
    border-radius: 10px;
    background: var(--doc-card);
}

.doc-toc-cta strong {
    color: var(--text);
    font-size: 0.86rem;
}

.doc-toc-cta a {
    padding: 0;
    border: 0;
    color: var(--doc-accent);
    font-weight: 700;
}

.doc-body {
    min-width: 0;
    max-width: 840px;
    counter-reset: doc-section;
    color: var(--doc-body);
    font-size: 1rem;
    line-height: 1.9;
}

.doc-body [id] {
    scroll-margin-top: 96px;
}

.doc-body .content-band {
    margin: 0;
}

.doc-body .content-section,
.doc-body .two-column,
.doc-body .matrix-section {
    margin: 0;
    padding: 0 0 48px;
    border: 0;
    border-radius: 0;
    background: none;
}

.doc-body .content-section + .content-section,
.doc-body .content-section + .two-column,
.doc-body .two-column + .content-section,
.doc-body .two-column + .two-column {
    padding-top: 44px;
    border-top: 1px solid var(--doc-card-line);
}

.doc-body .two-column > .content-section {
    padding: 0;
    border: 0;
}

.doc-body h2 {
    counter-increment: doc-section;
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 18px;
    color: var(--doc-heading);
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    font-weight: 800;
    line-height: 1.32;
}

.doc-body h2::before {
    content: counter(doc-section, decimal-leading-zero);
    flex: none;
    color: var(--doc-accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    transform: translateY(-3px);
}

.doc-body h3 {
    margin: 0 0 8px;
    color: var(--doc-heading);
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.45;
}

.doc-body p {
    margin: 0 0 14px;
}

.doc-body p:last-child {
    margin-bottom: 0;
}

.doc-body strong {
    color: #e6f6ed;
}

.doc-body a:not(.hero-action):not(.related-links a):not(.tool-link-row a) {
    color: var(--doc-accent);
    text-decoration: underline;
    text-decoration-color: rgba(var(--doc-accent-rgb), 0.4);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.doc-body a:not(.hero-action):hover {
    text-decoration-color: currentColor;
}

.doc-body code {
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    color: #e6f6ed;
    font-size: 0.88em;
    overflow-wrap: anywhere;
}

.doc-body ul:not([class]),
.doc-body ol:not([class]) {
    margin: 0 0 14px;
    padding-left: 1.3em;
}

.doc-body ul:not([class]) li,
.doc-body ol:not([class]) li {
    margin-bottom: 6px;
}

/* Cards */
.panel-grid,
.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.trust-panel,
.decision-card {
    position: relative;
    padding: 20px 20px 18px;
    border: 1px solid var(--doc-card-line);
    border-radius: 12px;
    background: var(--doc-card);
    font-size: 0.94rem;
    line-height: 1.8;
    transition: border-color 200ms ease, background-color 200ms ease;
}

.trust-panel::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    width: 28px;
    height: 2px;
    background: var(--doc-accent);
    opacity: 0.8;
}

.trust-panel:hover,
.decision-card:hover {
    border-color: rgba(var(--doc-accent-rgb), 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.trust-panel > a,
.doc-body .trust-panel > a {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
    text-decoration: none !important;
}

.content-section > .trust-panel + .trust-panel {
    margin-top: 12px;
}

.decision-card {
    --card-tone: var(--doc-accent);
    border-top: 2px solid var(--card-tone);
}

.decision-card.positive { --card-tone: var(--green); }
.decision-card.caution { --card-tone: var(--amber); }
.decision-card.limit { --card-tone: var(--coral); }

.decision-label {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--card-tone);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.decision-summary h2 {
    color: #ffffff;
}

.wallet-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.wallet-chip-row span {
    padding: 4px 11px;
    border: 1px solid var(--doc-card-line);
    border-radius: 999px;
    color: #d0e4d9;
    font-size: 0.84rem;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
    gap: 28px;
    align-items: start;
}

.two-column > aside {
    position: sticky;
    top: 96px;
}

/* Lists */
.check-list,
.number-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 30px;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(var(--doc-accent-rgb), 0.14);
}

.check-list li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: calc(0.5em + 4px);
    width: 5px;
    height: 8px;
    border: solid var(--doc-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.number-list {
    counter-reset: step;
}

.number-list li {
    counter-increment: step;
    position: relative;
    padding: 0 0 22px 52px;
}

.number-list li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(var(--doc-accent-rgb), 0.45);
    border-radius: 10px;
    background: rgba(var(--doc-accent-rgb), 0.08);
    color: var(--doc-accent);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.number-list li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: 6px;
    border-left: 1px dashed rgba(var(--doc-accent-rgb), 0.3);
}

.number-list li:last-child {
    padding-bottom: 0;
}

.number-list strong {
    color: #ffffff;
}

.notice-box {
    position: relative;
    padding: 18px 20px 18px 52px;
    border: 1px solid rgba(241, 199, 91, 0.3);
    border-radius: 12px;
    background: rgba(241, 199, 91, 0.06);
    color: #f1e3b5;
    font-size: 0.94rem;
    line-height: 1.8;
}

.notice-box::before {
    content: "!";
    position: absolute;
    left: 18px;
    top: 18px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--amber);
    color: #1a1406;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.related-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--doc-card-line);
    border-radius: 999px;
    background: var(--doc-card);
    color: #d8ebe1;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 160ms ease, color 160ms ease;
}

.related-links a::after {
    content: "→";
    color: var(--doc-accent);
    transition: transform 160ms ease;
}

.related-links a:hover,
.related-links a:focus-visible {
    border-color: rgba(var(--doc-accent-rgb), 0.5);
    color: #ffffff;
}

.related-links a:hover::after {
    transform: translateX(3px);
}

.doc-hero .related-links a {
    background: rgba(0, 0, 0, 0.2);
}

/* Guided flows */
.doc-page .guided-flow {
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--doc-card-line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
}

.doc-page .guided-flow__steps {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px;
}

.doc-page .guided-flow__step {
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid var(--doc-card-line);
    border-radius: 9px;
    background: var(--doc-card);
    color: #b9d2c4;
    font-size: 0.9rem;
    box-shadow: none;
}

.doc-page .guided-flow__step:hover {
    border-color: rgba(var(--doc-accent-rgb), 0.4);
    color: #ffffff;
}

.doc-page .guided-flow__step[aria-pressed="true"] {
    border-color: var(--doc-accent);
    background: rgba(var(--doc-accent-rgb), 0.12);
    color: #ffffff;
}

.doc-page .guided-flow__step-index {
    color: var(--doc-accent);
    font-weight: 800;
}

.doc-page .guided-flow__scene {
    border: 1px solid rgba(var(--doc-accent-rgb), 0.28);
    border-left: 1px solid rgba(var(--doc-accent-rgb), 0.28);
}

.doc-page .guided-flow .motion-controls {
    margin-top: 2px;
}

/* Tables and definition grids */
.matrix-wrap,
.test-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--doc-card-line);
    border-radius: 12px;
}

.recovery-table,
.test-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.75;
}

.recovery-table {
    min-width: 940px;
    table-layout: fixed;
}

.recovery-table caption,
.test-table caption {
    padding: 16px 16px 12px;
    color: #e6f6ed;
    font-weight: 700;
    text-align: left;
}

.recovery-table th,
.recovery-table td,
.test-table th,
.test-table td {
    padding: 14px;
    border-top: 1px solid var(--doc-card-line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.recovery-table thead th,
.test-table thead th {
    background: rgba(var(--doc-accent-rgb), 0.08);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.recovery-table thead th:nth-child(1) { width: 19%; }
.recovery-table thead th:nth-child(2) { width: 14%; }
.recovery-table thead th:nth-child(3) { width: 19%; }
.recovery-table thead th:nth-child(4) { width: 18%; }
.recovery-table thead th:nth-child(5) { width: 20%; }
.recovery-table thead th:nth-child(6) { width: 10%; }

.recovery-table tbody th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 400;
}

.recovery-table tbody tr:hover td,
.recovery-table tbody tr:hover th {
    background: rgba(var(--doc-accent-rgb), 0.04);
}

.recovery-table tr:target {
    outline: 2px solid var(--doc-accent);
    outline-offset: -2px;
}

.row-anchor { display: inline-block; margin-bottom: 6px; font-weight: 700; }
.scenario-name { display: block; margin-bottom: 10px; color: #ffffff; font-weight: 700; }
.scope-label { display: block; color: #e6f6ed; font-size: 0.8rem; font-weight: 700; }
.scope-note { display: block; color: #9fbcad; font-size: 0.8rem; }
.evidence-label { display: block; margin-top: 10px; color: #e6f6ed; font-size: 0.76rem; }
.row-sources { margin: 0; padding: 0; list-style: none; }
.row-sources li { margin-bottom: 6px; }
.source-index { display: block; margin-top: 8px; font-size: 0.78rem; }
.source-list { padding-left: 1.4em; }
.source-list li { margin-bottom: 16px; padding-left: 4px; }
.source-list p { margin-top: 4px; font-size: 0.9rem; }
.download-note { font-size: 0.92rem; }

.matrix-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.doc-body .matrix-shortcuts a {
    padding: 4px 12px;
    border: 1px solid var(--doc-card-line);
    border-radius: 999px;
    font-size: 0.86rem;
    text-decoration: none;
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.terms-grid div {
    padding: 16px 18px;
    border: 1px solid var(--doc-card-line);
    border-radius: 12px;
    background: var(--doc-card);
}

.terms-grid dt {
    margin-bottom: 6px;
    color: #ffffff;
    font-weight: 700;
}

.terms-grid dd {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.8;
}

/* Tool index */
.tool-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.tool-index-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--doc-card-line);
    border-radius: 14px;
    background: var(--doc-card);
    font-size: 0.92rem;
    line-height: 1.75;
    transition: border-color 200ms ease, transform 200ms ease;
}

.tool-index-card:hover {
    border-color: rgba(var(--doc-accent-rgb), 0.4);
}

.tool-index-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.tool-index-card p {
    margin: 0;
}

.tool-meta {
    color: #8eaa9b;
    font-size: 0.8rem;
}

.tool-index-card > .tool-meta:first-child {
    display: inline-flex;
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(var(--doc-accent-rgb), 0.1);
    color: var(--doc-accent);
    font-weight: 700;
}

.tool-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.tool-link-row a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(var(--doc-accent-rgb), 0.4);
    border-radius: 9px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.tool-link-row a:hover,
.tool-link-row a:focus-visible {
    background: rgba(var(--doc-accent-rgb), 0.12);
}

/* Keystore checker */
.checker-controls { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.checker-controls[hidden], .doc-page .checker-result[hidden] { display: none; }
.checker-controls input[type=file] { display: block; max-width: 100%; padding: 14px; border: 1px dashed rgba(var(--doc-accent-rgb), 0.45); border-radius: 12px; background: rgba(0, 0, 0, 0.25); color: var(--text); }
.checker-controls input::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 7px; background: var(--doc-accent); color: #04100b; font-weight: 700; cursor: pointer; }
.checker-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
button.checker-button { min-height: 42px; padding: 0 16px; border: 1px solid var(--doc-accent); border-radius: 9px; background: var(--doc-accent); color: #04100b; font: inherit; font-weight: 700; cursor: pointer; }
button.checker-button.secondary { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
button.checker-button:disabled { opacity: 0.5; cursor: default; }
button.checker-button:focus-visible, .checker-controls input:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.checker-result { margin-top: 20px; padding: 20px; border: 1px solid rgba(var(--doc-accent-rgb), 0.45); border-radius: 12px; background: var(--doc-card); overflow-wrap: anywhere; }
.checker-result[data-status=invalid] { border-color: var(--coral); }
.checker-result[data-status=warning], .checker-result[data-status=unsupported] { border-color: var(--amber); }
.checker-result ul { padding-left: 22px; }
.checker-result h3 { margin-top: 0; }
.checker-source { color: #9fbcad; }

/* Policy pages */
.policy-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: #9fbcad;
    font-size: 0.86rem;
}

.policy-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.policy-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--doc-card-line);
    border-radius: 10px;
    background: var(--doc-card);
}

.policy-contact i {
    color: var(--doc-accent);
}

/* Next-step band */
.doc-next {
    border-top: 1px solid var(--doc-card-line);
    background:
        radial-gradient(ellipse at 15% 50%, rgba(var(--doc-accent-rgb), 0.12), transparent 55%),
        #04100c;
}

.doc-next-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 52px 0;
}

.doc-next h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1.3;
}

.doc-next p {
    max-width: 620px;
    margin: 0;
    color: #b9d2c4;
    line-height: 1.8;
}

.doc-next-actions {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mobile-sticky-cta {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .doc-hero-icon::before { animation: doc-ring 3.2s ease-out infinite; }
    .doc-hero-icon::after { animation: doc-ring 3.2s ease-out 1.6s infinite; }
}

@keyframes doc-ring {
    0% { opacity: 0.8; transform: scale(0.9); }
    100% { opacity: 0; transform: scale(1.35); }
}

@media (max-width: 1080px) {
    .doc-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .doc-hero-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0 20px;
        max-width: 560px;
    }

    .doc-hero-icon {
        margin-bottom: 0;
    }

    .doc-hero-card p {
        grid-column: 1 / -1;
    }

    .doc-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 32px;
    }

    .doc-toc {
        position: static;
        max-height: none;
        margin-bottom: 36px;
        padding: 16px 18px;
        border: 1px solid var(--doc-card-line);
        border-radius: 12px;
        background: var(--doc-card);
    }

    .doc-toc ol {
        columns: 2;
        column-gap: 24px;
        border-left: 0;
    }

    .doc-toc li {
        break-inside: avoid;
    }

    .doc-toc a {
        padding-left: 0;
        border-left: 0;
    }

    .doc-toc-cta {
        display: none;
    }

    .doc-body {
        max-width: none;
    }
}

@media (max-width: 860px) {
    .two-column {
        grid-template-columns: minmax(0, 1fr);
    }

    .two-column > aside {
        position: static;
    }

    .doc-next-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .recovery-table,
    .recovery-table tbody,
    .recovery-table tr,
    .recovery-table th,
    .recovery-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .matrix-wrap {
        border: 0;
    }

    .recovery-table caption { display: block; padding-left: 0; }
    .recovery-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .recovery-table tr { margin-bottom: 16px; border: 1px solid var(--doc-card-line); border-radius: 12px; overflow: hidden; }
    .recovery-table tbody th, .recovery-table td { border: 0; border-bottom: 1px solid var(--doc-card-line); }
    .recovery-table td:last-child { border-bottom: 0; }
    .recovery-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--doc-accent); font-size: 0.78rem; font-weight: 700; }
}

@media (max-width: 640px) {
    .doc-hero {
        padding: 100px 0 40px;
    }

    .doc-title {
        font-size: 1.9rem;
    }

    .doc-lead {
        font-size: 0.98rem;
    }

    .doc-hero-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .doc-hero-icon {
        display: none;
    }

    .doc-hero-card p {
        margin-top: 12px;
    }

    .doc-hero .hero-actions {
        flex-direction: column;
    }

    .hero-action {
        width: 100%;
    }

    .doc-toc ol {
        columns: 1;
    }

    .terms-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .number-list li {
        padding-left: 46px;
    }

    .test-table, .test-table tbody, .test-table tr, .test-table td { display: block; width: 100%; }
    .test-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .test-table tr { border-top: 1px solid var(--doc-card-line); }
    .test-table td { border: 0; padding: 8px 14px; }
    .test-table td::before { content: attr(data-label); display: block; color: var(--doc-accent); font-size: 0.76rem; font-weight: 700; }

    .has-mobile-cta .doc-next {
        padding-bottom: 76px;
    }

    .mobile-sticky-cta {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 35;
        display: flex;
        gap: 8px;
        padding: 8px;
        border: 1px solid rgba(var(--doc-accent-rgb), 0.35);
        border-radius: 14px;
        background: rgba(4, 16, 12, 0.94);
        box-shadow: var(--shadow);
        backdrop-filter: blur(12px);
    }

    .mobile-sticky-cta a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 9px;
        font-weight: 800;
        text-decoration: none;
    }

    .mobile-sticky-cta-primary {
        flex: 1;
        background: var(--doc-accent);
        color: #04100b;
    }

    .mobile-sticky-cta-secondary {
        border: 1px solid rgba(255, 255, 255, 0.18);
        color: var(--text);
    }
}

/* Pages with wide data tables give the body the full width and move the TOC above it. */
@media (min-width: 1081px) {
    .doc-layout:has(.matrix-wrap) {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .doc-layout:has(.matrix-wrap) .doc-toc {
        position: static;
        max-height: none;
        margin-bottom: 40px;
        padding: 18px 22px;
        border: 1px solid var(--doc-card-line);
        border-radius: 12px;
        background: var(--doc-card);
    }

    .doc-layout:has(.matrix-wrap) .doc-toc ol {
        columns: 3;
        column-gap: 28px;
        border-left: 0;
    }

    .doc-layout:has(.matrix-wrap) .doc-toc li {
        break-inside: avoid;
    }

    .doc-layout:has(.matrix-wrap) .doc-toc a {
        padding-left: 0;
        border-left: 0;
    }

    .doc-layout:has(.matrix-wrap) .doc-toc-cta {
        display: none;
    }

    .doc-layout:has(.matrix-wrap) .doc-body {
        max-width: none;
    }
}
