:root {
    --notion-bg: #ffffff;
    --notion-page: #ffffff;
    --notion-text: #37352f;
    --notion-muted: #787774;
    --notion-border: rgba(55, 53, 47, 0.09);
    --notion-hover: rgba(55, 53, 47, 0.04);
    --notion-callout: #f1f1ef;
    --notion-callout-blue: #e7f3f8;
    --notion-callout-amber: #fbf3db;
    --notion-callout-green: #edf3ec;
    --notion-callout-pink: #f4e0e9;
    --notion-accent: #2383e2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f7f6f3;
    color: var(--notion-text);
    font-family: "DM Sans", ui-sans-serif, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.page-shell {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.25rem 1rem 4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    color: var(--notion-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.back-link:hover {
    background: var(--notion-hover);
    color: var(--notion-text);
}

.notion-page {
    background: var(--notion-page);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
    padding: 3rem 3.25rem 3.5rem;
}

.notion-cover {
    height: 8px;
    margin: -3rem -3.25rem 2.25rem;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, #d3e5ef 0%, #f5e0dc 45%, #e8deee 100%);
}

.notion-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--notion-text);
    margin: 0 0 1.25rem;
}

.notion-props {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--notion-border);
}

.prop-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.35rem 0.4rem;
    border-radius: 4px;
    font-size: 0.92rem;
}

.prop-row:hover { background: var(--notion-hover); }

.prop-label {
    color: var(--notion-muted);
    font-weight: 500;
}

.prop-value { color: var(--notion-text); }

.prop-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.prop-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
    background: #e8deee;
    color: #5a3e6b;
}

.prop-tag.blue { background: #d3e5ef; color: #1a5270; }
.prop-tag.green { background: #dbeddb; color: #2d5a2d; }
.prop-tag.amber { background: #fdecc8; color: #7a5c00; }

.notion-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--notion-muted);
    margin: 2rem 0 0.75rem;
}

.notion-h2 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 2.2rem 0 0.85rem;
    color: var(--notion-text);
    scroll-margin-top: 1.5rem;
}

.notion-h2:first-of-type { margin-top: 1.5rem; }

.notion-h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.55rem;
    color: var(--notion-text);
}

.notion-page p {
    margin: 0 0 0.9rem;
    color: var(--notion-text);
}

.notion-page ul,
.notion-page ol {
    margin: 0.25rem 0 1rem;
    padding-left: 0;
    list-style: none;
}

.notion-page li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.55rem;
}

.notion-page ul li::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.65rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--notion-text);
    opacity: 0.55;
}

.notion-page ol {
    counter-reset: notion-ol;
}

.notion-page ol li {
    counter-increment: notion-ol;
}

.notion-page ol li::before {
    content: counter(notion-ol) ".";
    position: absolute;
    left: 0;
    top: 0;
    width: 1.4rem;
    color: var(--notion-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.callout {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin: 1rem 0 1.25rem;
    padding: 0.95rem 1rem;
    border-radius: 6px;
    background: var(--notion-callout);
}

.callout.blue { background: var(--notion-callout-blue); }
.callout.amber { background: var(--notion-callout-amber); }
.callout.green { background: var(--notion-callout-green); }
.callout.pink { background: var(--notion-callout-pink); }

.callout-mark {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.1rem;
    border-radius: 4px;
    background: rgba(55, 53, 47, 0.08);
    color: var(--notion-muted);
    font-size: 0.7rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.callout-body { flex: 1; min-width: 0; }
.callout-body p { margin: 0; line-height: 1.6; }
.callout-body p + p { margin-top: 0.65rem; }

.callout-body a {
    color: var(--notion-accent);
    text-decoration: none;
    font-weight: 500;
}

.callout-body a:hover { text-decoration: underline; }

.decision {
    margin: 0.85rem 0;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    background: var(--notion-hover);
    border: 1px solid var(--notion-border);
}

.decision p { margin: 0; }

.story {
    margin: 1rem 0;
    padding: 1rem 1.05rem;
    border-radius: 6px;
    background: var(--notion-hover);
    border: 1px solid var(--notion-border);
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.45rem 0 0.75rem;
}

.story p { margin: 0 0 0.55rem; }
.story p:last-child { margin-bottom: 0; }

.ac {
    margin: 0.35rem 0 0;
    padding-left: 0;
    list-style: none;
}

.ac li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.94rem;
    color: var(--notion-muted);
}

.ac li::before {
    content: "→";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--notion-accent);
    font-weight: 600;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    background: none !important;
}

.divider {
    height: 1px;
    background: var(--notion-border);
    margin: 2.25rem 0;
    border: none;
}

.toc {
    margin: 0.5rem 0 1.5rem;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    background: var(--notion-hover);
}

.toc-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--notion-muted);
    margin-bottom: 0.45rem;
}

.toc a {
    display: block;
    color: var(--notion-accent);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 0.2rem 0;
}

.toc a:hover { text-decoration: underline; }

.doc-nav {
    display: grid;
    gap: 0.45rem;
    margin: 0.5rem 0 0;
}

.doc-nav a {
    display: block;
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    background: var(--notion-hover);
    color: var(--notion-text);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s;
}

.doc-nav a:hover { background: rgba(55, 53, 47, 0.08); }
.doc-nav a strong { font-weight: 600; }
.doc-nav a span {
    display: block;
    margin-top: 0.15rem;
    color: var(--notion-muted);
    font-size: 0.84rem;
}

.doc-nav a.current {
    border: 1px solid var(--notion-border);
    background: #fff;
    pointer-events: none;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1.25rem;
    font-size: 0.92rem;
}

.simple-table th,
.simple-table td {
    text-align: left;
    vertical-align: top;
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid var(--notion-border);
}

.simple-table th {
    color: var(--notion-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pre-block {
    margin: 0.75rem 0 1.25rem;
    padding: 0.95rem 1rem;
    border-radius: 6px;
    background: #f7f6f3;
    border: 1px solid var(--notion-border);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    overflow-x: auto;
    white-space: pre;
    color: var(--notion-text);
}

@media (max-width: 720px) {
    .notion-page {
        padding: 2rem 1.25rem 2.5rem;
    }

    .notion-cover {
        margin: -2rem -1.25rem 1.75rem;
    }

    .prop-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .simple-table {
        display: block;
        overflow-x: auto;
    }
}
