:root {
    --compass-bg: #fffdf8;
    --compass-accent-1: #c44a3d;
    --compass-accent-2: #d06030;
    --compass-accent-3: #9f392e;
    --compass-accent-4: #7a4080;
    --compass-text: #23201c;
    --compass-muted: #72685a;
}

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg: #f4efe5;
    --paper: #fffdf8;
    --ink: #23201c;
    --muted: #72685a;
    --line: #d9d0c3;
    --banner: #c44a3d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    background: var(--bg);
}

a {
    color: inherit;
}

.top-banner {
    background: linear-gradient(180deg, #d05747 0%, var(--banner) 100%);
    color: #fff7ee;
    border-bottom: 1px solid rgba(35, 32, 28, 0.18);
}

.banner-inner {
    width: min(760px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 2.2rem;
}

.site-kicker {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.top-banner h1 {
    margin: 0;
    font-size: clamp(2.7rem, 7vw, 4.4rem);
    line-height: 0.95;
}

.site-title-link {
    text-decoration: none;
}

.site-intro {
    width: min(56ch, 100%);
    margin: 1rem 0 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.4rem;
}

.nav-link {
    padding: 0.48rem 0.8rem;
    border: 1px solid rgba(255, 247, 238, 0.36);
    color: #fff7ee;
    text-decoration: none;
    background: rgba(255, 247, 238, 0.08);
}

.nav-link.is-active {
    background: rgba(35, 32, 28, 0.18);
    border-color: rgba(35, 32, 28, 0.24);
}

.blog-shell {
    width: min(760px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.blog-shell-split {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
    gap: 1.1rem;
    width: min(1280px, calc(100vw - 2rem));
    align-items: start;
}

.page-intro {
    margin-bottom: 1.2rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.7);
}

.page-intro p {
    margin: 0;
    line-height: 1.7;
}

.content-column {
    display: grid;
    gap: 1.15rem;
}

.post-card {
    padding: 1.4rem 1.5rem 1.5rem;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 1px 0 rgba(35, 32, 28, 0.03);
}

.post-meta {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.post-card h2 {
    margin: 0 0 0.65rem;
    font-size: 1.8rem;
    line-height: 1.1;
}

.post-card p:last-child {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.7;
}

.post-action {
    margin-top: 1rem;
}

.post-action a {
    color: #9f392e;
    text-decoration-thickness: 1px;
}

.article-page {
    padding: 1.5rem;
    border: 1px solid var(--line);
    background: var(--paper);
}

.article-page-main {
    min-width: 0;
}

.article-lead {
    margin: 0 0 1.4rem;
    font-size: 1.08rem;
    line-height: 1.7;
}

.chapter-block h3 {
    margin: 0 0 0.8rem;
    font-size: 1.2rem;
}

.chapter-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.8;
}

.tool-grid-block {
    margin-top: 2rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

.tool-grid-block + .tool-grid-block {
    margin-top: 2.75rem;
}

.section-heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
}

.section-heading-row h3 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.section-note {
    max-width: 32ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.tool-card {
    padding: 1rem;
    border: 1px solid var(--line);
    background: #fffaf3;
}

.selector-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
    margin-bottom: 0.5rem;
}

.tool-selector {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 21.25rem;
    padding: 1.1rem 1.05rem 1rem;
    background: #fffefb;
    aspect-ratio: 0.72 / 1;
    box-shadow: 0 1px 0 rgba(35, 32, 28, 0.03);
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.tool-selector:hover,
.tool-selector:focus-within {
    border-color: #d2b19c;
    background: #fffaf4;
}

.tool-selector.is-selected {
    border-color: #c77d60;
    background: #fff7f0;
    box-shadow: 0 8px 20px rgba(159, 57, 46, 0.06);
}

.tool-selector-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-height: 12.4rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.tool-selector-main:focus-visible {
    outline: 2px solid rgba(196, 74, 61, 0.22);
    outline-offset: 6px;
}

.company-logo {
    display: block;
    width: 5.6rem;
    height: 5.6rem;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    margin-inline: auto;
}

.selector-name {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 2.95rem;
    margin: 0;
    font-size: 1.42rem;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
}

.selector-subtitle {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 1.4rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.2;
    text-align: center;
}

[data-tool-card="chatgpt"] .company-logo {
    width: 6.2rem;
    height: 6.2rem;
}

[data-tool-card="claude"] .company-logo {
    width: 6.4rem;
    height: 6.4rem;
    padding: 0.4rem;
    box-sizing: border-box;
}

[data-tool-card="gemini"] .company-logo {
    width: 6.6rem;
    height: 6.6rem;
}

[data-tool-card="copilot"] .company-logo {
    width: 5.1rem;
    height: 5.1rem;
}

[data-tool-card="meta"] .company-logo {
    width: 5.0rem;
    height: 5.0rem;
}

[data-tool-card="grok"] .company-logo {
    width: 4.8rem;
    height: 4.8rem;
}

[data-tool-card="deepseek"] .company-logo {
    width: 5.4rem;
    height: 5.4rem;
}

[data-tool-card="perplexity"] .company-logo {
    width: 5.0rem;
    height: 5.0rem;
}

[data-tool-card="github-copilot"] .company-logo {
    width: 5.4rem;
    height: 5.4rem;
}

.selector-topics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: auto;
}

.selector-topics > .selector-pill:last-child:nth-child(odd) {
    grid-column: auto;
}

.selector-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 2.55rem;
    padding: 0;
    border: 1px solid rgba(114, 104, 90, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    font: inherit;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.selector-pill:hover,
.selector-pill:focus-visible {
    border-color: #d2b19c;
    background: #fff8f1;
    outline: none;
}

.selector-pill.is-active {
    border-color: #c77d60;
    background: #fff3eb;
    box-shadow: inset 0 0 0 1px rgba(196, 74, 61, 0.06);
}

.use-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: rgba(196, 74, 61, 0.06);
    color: #9f392e;
    font-family: 'Space Mono', monospace;
    font-size: 0.64rem;
    font-weight: 700;
}

.use-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.detail-rail {
    position: sticky;
    top: 1.25rem;
}

.detail-panel {
    padding: 1.15rem;
    border: 1px solid var(--line);
    background: #fffdf9;
}

.detail-card {
    display: none;
}

.detail-card.is-active {
    display: block;
}

.detail-eyebrow {
    margin: 0 0 0.45rem;
    color: #9f392e;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.detail-panel h3 {
    margin: 0;
    font-size: clamp(1.55rem, 2vw, 2.05rem);
    line-height: 1;
}

.detail-summary {
    margin: 0.8rem 0 0;
    font-size: 0.98rem;
    line-height: 1.68;
}

.detail-group {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(114, 104, 90, 0.18);
}

.detail-list {
    margin: 0.35rem 0 0;
    padding-left: 1.2rem;
    line-height: 1.72;
}

.detail-copy {
    margin: 0.35rem 0 0;
    line-height: 1.66;
}

.tool-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.4rem;
    min-height: 2.6rem;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.85rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tool-brand-chatgpt {
    background: #d7f1e6;
    color: #195d45;
}

.tool-brand-claude {
    background: #f4ddc8;
    color: #7d4a1e;
}

.tool-brand-gemini {
    background: #dfe5fb;
    color: #3f4f95;
}

.tool-brand-copilot {
    background: #ddeffd;
    color: #1d5f93;
}

.tool-brand-meta {
    background: #e7dcfb;
    color: #5c3f8f;
}

.tool-brand-grok {
    background: #ece7e0;
    color: #43362c;
}

.tool-brand-deepl {
    background: #d4eaf8;
    color: #1a4f78;
}

.tool-brand-vscode {
    background: #d8edf8;
    color: #0f4a72;
}

.tool-brand-aichat {
    background: #dff3ea;
    color: #1f5c3f;
}

.tool-brand-notes {
    background: #e9e7fb;
    color: #3d3282;
}

.tool-brand-canva {
    background: #d4f4f1;
    color: #1a6b65;
}

.tool-name {
    margin: 0 0 0.9rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.tool-strength {
    margin: 0.85rem 0 0.25rem;
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tool-copy {
    margin: 0;
    line-height: 1.65;
}

/* ── Use-case section ──────────────────────────────────────────────── */

.usecase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.usecase-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0.9rem 0.85rem;
    border: 1px solid var(--line);
    background: #fffefb;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.usecase-card:hover,
.usecase-card:focus-within {
    border-color: #d2b19c;
    background: #fffaf4;
}

.usecase-card.is-selected {
    border-color: #c77d60;
    background: #fff7f0;
    box-shadow: 0 8px 20px rgba(159, 57, 46, 0.06);
}

.usecase-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.usecase-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    color: var(--ink);
}

.usecase-icon svg {
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
}

.usecase-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.usecase-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: auto;
}

.usecase-tool-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 253, 248, 0.7);
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease;
}

.usecase-tool-pill:hover {
    border-color: #c0856a;
    background: #fff5ec;
}

.usecase-tool-pill.is-active {
    border-color: #c44a3d;
    background: #fff0e8;
    box-shadow: 0 2px 6px rgba(196, 74, 61, 0.12);
}

.utp-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* ── Compass ────────────────────────────────────────────────────────── */

.compass-block {
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
}

.compass-panel {
    margin-top: 1rem;
    padding: 1.5rem;
    color: var(--compass-text);
    background: var(--compass-bg);
    border: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(35, 32, 28, 0.03);
    overflow: hidden;
}

.compass-header {
    margin-bottom: 1.8rem;
    text-align: center;
}

.compass-header h4 {
    margin: 0 0 0.5rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.compass-subtitle {
    margin: 0;
    color: var(--muted);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.compass-wrapper {
    position: relative;
    width: min(100%, 700px);
    margin: 0 auto;
    aspect-ratio: 1;
}

.ai-compass {
    position: relative;
    width: 100%;
    height: 100%;
    font-family: Georgia, 'Times New Roman', serif;
}

.axis-h,
.axis-v {
    position: absolute;
    background: var(--muted);
    opacity: 0.35;
}

.axis-h {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
}

.axis-v {
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
}

.compass-quadrant {
    position: absolute;
    width: 49%;
    height: 49%;
}

.quadrant-one {
    top: 1%;
    left: 51%;
    background: radial-gradient(ellipse at 100% 0%, rgba(232, 196, 58, 0.05) 0%, transparent 70%);
}

.quadrant-two {
    top: 1%;
    left: 0;
    background: radial-gradient(ellipse at 0% 0%, rgba(232, 120, 72, 0.05) 0%, transparent 70%);
}

.quadrant-three {
    bottom: 0;
    left: 0;
    background: radial-gradient(ellipse at 0% 100%, rgba(196, 74, 61, 0.06) 0%, transparent 70%);
}

.quadrant-four {
    bottom: 0;
    right: 0;
    background: radial-gradient(ellipse at 100% 100%, rgba(184, 68, 136, 0.05) 0%, transparent 70%);
}

.compass-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid var(--muted);
    border-radius: 50%;
    opacity: 0.18;
    transform: translate(-50%, -50%);
}

.axis-label {
    position: absolute;
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.label-top {
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
}

.label-bottom {
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
}

.label-left {
    top: 50%;
    left: 1%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: translateY(-50%) rotate(180deg);
}

.label-right {
    top: 50%;
    right: 1%;
    writing-mode: vertical-lr;
    transform: translateY(-50%);
}

.quadrant-label {
    position: absolute;
    opacity: 0.3;
    font-size: 0.58rem;
    line-height: 1.5;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
}

.quadrant-top-left {
    top: 6%;
    left: 4%;
    text-align: left;
}

.quadrant-top-right {
    top: 6%;
    right: 4%;
    text-align: right;
}

.quadrant-bottom-left {
    bottom: 6%;
    left: 4%;
    text-align: left;
}

.quadrant-bottom-right {
    right: 4%;
    bottom: 6%;
    text-align: right;
}

.compass-dot {
    position: absolute;
    z-index: 10;
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compass-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    opacity: 0.35;
    animation: compass-pulse 2.5s ease-in-out infinite;
}

.compass-dot:hover,
.compass-dot:focus-visible {
    z-index: 20;
    box-shadow: 0 0 20px currentColor;
    transform: translate(-50%, -50%) scale(1.5);
    outline: none;
}

@keyframes compass-pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(1.8);
    }
}

.compass-dot-label {
    position: absolute;
    opacity: 0.9;
    pointer-events: none;
    white-space: nowrap;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transform: translateY(-50%);
}

.compass-tooltip {
    position: absolute;
    z-index: 100;
    max-width: 210px;
    padding: 12px 14px;
    border: 1px solid #2e2418;
    border-radius: 6px;
    background: #100d0a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.7rem;
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.compass-tooltip.visible {
    opacity: 1;
}

.tt-name {
    margin-bottom: 5px;
    font-size: 0.8rem;
    font-weight: 700;
}

.tt-tag {
    display: inline-block;
    margin: 2px 2px 2px 0;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
}

.tt-desc {
    margin-top: 6px;
    color: #9e8e7e;
    font-size: 0.67rem;
}

.compass-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 28px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    background: rgba(255, 253, 248, 0.7);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.78rem;
    text-align: left;
}

.legend-item:hover,
.legend-item:focus-visible {
    border-color: #d2b19c;
    background: #fffaf4;
    outline: none;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-name,
.legend-use {
    display: block;
}

.legend-name {
    font-weight: 700;
}

.legend-use {
    color: var(--muted);
    font-size: 0.72rem;
}

.compass-footer {
    margin-top: 32px;
    color: var(--muted);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.78rem;
    line-height: 1.9;
    text-align: center;
}

.compass-footer span {
    color: var(--muted);
}

@media (max-width: 640px) {
    .blog-shell-split {
        grid-template-columns: 1fr;
    }

    .selector-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .tool-selector {
        min-height: 17rem;
        aspect-ratio: auto;
        padding: 0.9rem;
    }

    .tool-selector-main {
        min-height: 10.6rem;
    }

    .company-logo {
        width: 4.45rem;
        height: 4.45rem;
    }

    .selector-name {
        font-size: 1.15rem;
        min-height: 2.35rem;
    }

    .selector-subtitle {
        font-size: 0.78rem;
        min-height: 1.2rem;
    }

    [data-tool-card="chatgpt"] .company-logo {
        width: 5.0rem;
        height: 5.0rem;
    }

    [data-tool-card="claude"] .company-logo {
        width: 5.1rem;
        height: 5.1rem;
        padding: 0.3rem;
        box-sizing: border-box;
    }

    [data-tool-card="gemini"] .company-logo {
        width: 5.3rem;
        height: 5.3rem;
    }

    [data-tool-card="copilot"] .company-logo {
        width: 4.0rem;
        height: 4.0rem;
    }

    [data-tool-card="meta"] .company-logo {
        width: 3.9rem;
        height: 3.9rem;
    }

    [data-tool-card="grok"] .company-logo {
        width: 3.7rem;
        height: 3.7rem;
    }

    [data-tool-card="deepseek"] .company-logo {
        width: 4.2rem;
        height: 4.2rem;
    }

    [data-tool-card="perplexity"] .company-logo {
        width: 3.9rem;
        height: 3.9rem;
    }

    .selector-topics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .banner-inner {
        padding-top: 2rem;
    }

    .post-card {
        padding: 1.15rem;
    }

    .article-page {
        padding: 1.15rem;
    }

    .compass-panel {
        padding: 1rem;
    }

    .label-left,
    .label-right {
        display: none;
    }

    .compass-dot-label {
        font-size: 0.52rem;
    }

    .detail-rail {
        display: none;
        position: static;
    }

    /* Mobile overlay: side rail shown over the page when a tool
       card or use-case pill is tapped; dismissed via the × button
       or Escape. .is-open is toggled by kurliktai.js. */
    .detail-rail.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 100;
        background: #fffdf9;
        overflow-y: auto;
        padding: 3.2rem 1rem 1.5rem;
    }

    .detail-rail.is-open .detail-rail-close {
        display: flex;
    }

    body.rail-overlay-open {
        overflow: hidden;
    }
}

.detail-rail-close {
    display: none;
    position: fixed;
    top: 0.6rem;
    right: 0.6rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #fffdf9;
    border: 1px solid var(--line);
    border-radius: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink, #2a261f);
    cursor: pointer;
    z-index: 101;
}

.detail-rail-close:hover,
.detail-rail-close:focus-visible {
    border-color: #9f392e;
    color: #9f392e;
    outline: none;
}

/* ============================================================
   Card flip — front (overview + use-case pills) ↔
                back  (pricing tiers + tier review).
   Powered by kurliktai.js, which dynamically wraps each
   .tool-card's children in a .tool-card-flipper. CSS-only
   degradation: if the JS doesn't load, the original .tool-card
   markup renders flat and works as before (no flip, no corner
   button, no pricing data).
   ============================================================ */

.tool-card-flipper {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.tool-card.is-flipped .tool-card-flipper {
    transform: rotateY(180deg);
}

.tool-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.05rem 1rem;
    background: inherit;
    border-radius: inherit;
}

.tool-card-face.is-back {
    transform: rotateY(180deg);
}

/* Override .tool-selector to host the flipper (its existing flex/padding
   become unused once JS wraps the children; the faces re-apply them). */
.tool-selector {
    perspective: 1200px;
    position: relative;
    overflow: hidden;
}

/* Circular € / ↺ button in the top-right of each face */
.tool-card-corner {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(114, 104, 90, 0.3);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}

.tool-card-corner:hover,
.tool-card-corner:focus-visible {
    background: #fff3eb;
    border-color: #c77d60;
    transform: scale(1.08);
    outline: none;
}

/* Back face — title + pricing tier list + review */
.tool-card-face.is-back .back-title {
    margin: 0;
    padding-right: 2.5rem; /* keep clear of the corner button */
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.pricing-tiers {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pricing-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(114, 104, 90, 0.22);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pricing-tier:hover,
.pricing-tier:focus-visible {
    border-color: #d2b19c;
    background: #fff8f1;
    outline: none;
}

.pricing-tier.is-active {
    border-color: #c77d60;
    background: #fff3eb;
    box-shadow: inset 0 0 0 1px rgba(196, 74, 61, 0.06);
}

.pricing-tier-name {
    font-weight: 600;
}

.pricing-tier-price {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.pricing-review {
    margin-top: auto;
    padding-top: 0.45rem;
    border-top: 1px dashed rgba(114, 104, 90, 0.2);
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--muted);
}

.tier-price-inline {
    margin-left: 0.5rem;
    color: var(--muted);
    font-size: 0.85em;
    font-weight: 500;
}

/* ── Inline code (filename examples, paths) ───────────────────────── */

.chapter-block code,
.article-page code {
    padding: 0.08em 0.32em;
    background: rgba(159, 57, 46, 0.08);
    border: 1px solid rgba(159, 57, 46, 0.18);
    border-radius: 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
    color: #6a2519;
    white-space: nowrap;
}

/* ── Detail-rail embedded video ───────────────────────────────────── */

.detail-video-caption {
    margin: 0 0 0.7rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.detail-video-group .yt-lite,
.detail-video-group .yt-lite-iframe {
    margin-top: 0.2rem;
}

/* ── Click-to-load YouTube embed (kasirai.js) ─────────────────────── */

.video-block {
    margin-top: 2.5rem;
}

.video-block-heading {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.video-block-caption {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.yt-lite {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(114, 104, 90, 0.28);
    background: #1a1814;
    cursor: pointer;
    overflow: hidden;
    font: inherit;
    color: inherit;
    border-radius: 0;
    transition: border-color 160ms ease, transform 160ms ease;
}

.yt-lite:hover,
.yt-lite:focus-visible {
    border-color: #9f392e;
    outline: none;
}

.yt-lite:hover .yt-lite-play,
.yt-lite:focus-visible .yt-lite-play {
    background: #9f392e;
    transform: translate(-50%, -50%) scale(1.06);
}

.yt-lite-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.88);
}

.yt-lite-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 48px;
    background: rgba(20, 18, 16, 0.78);
    color: #f6efe1;
    font-size: 1.3rem;
    line-height: 1;
    padding-left: 4px;
    border-radius: 0;
    transition: background 160ms ease, transform 160ms ease;
    pointer-events: none;
}

.yt-lite-title {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 0.55rem 0.85rem;
    background: linear-gradient(to top, rgba(20, 18, 16, 0.88), rgba(20, 18, 16, 0));
    color: #f6efe1;
    font-size: 0.92rem;
    text-align: left;
    pointer-events: none;
}

.yt-lite-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(114, 104, 90, 0.28);
    border-radius: 0;
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .video-grid--two {
        grid-template-columns: 1fr 1fr;
    }
}
