:root {
    --bg: #09070e;
    --bg-soft: #100d18;
    --panel: rgba(22, 17, 31, 0.82);
    --panel-strong: rgba(30, 23, 43, 0.94);
    --text: #f2edf7;
    --muted: #afa6bd;
    --muted-2: #7c728a;
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.18);
    --red: #ff3f61;
    --purple: #7c4dff;
    --purple-soft: rgba(124, 77, 255, 0.20);
    --red-soft: rgba(255, 63, 97, 0.18);
    --green: #7ef29a;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --max: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    color-scheme: dark;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    background:
        radial-gradient(circle at 8% 12%, rgba(255, 63, 97, 0.15), transparent 28rem),
        radial-gradient(circle at 86% 4%, rgba(124, 77, 255, 0.20), transparent 30rem),
        linear-gradient(135deg, #09070e 0%, #0c0912 48%, #100816 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.035), transparent);
    background-size: 100% 5px;
    opacity: 0.18;
    mix-blend-mode: overlay;
}

a {
    color: inherit;
}

.site-shell {
    position: relative;
    width: min(100% - 36px, var(--max));
    margin: 0 auto;
    padding: 26px 0 36px;
}

.ambient {
    position: fixed;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    filter: blur(48px);
    opacity: 0.24;
    pointer-events: none;
}

.ambient-one {
    left: -180px;
    top: 160px;
    background: var(--red);
}

.ambient-two {
    right: -200px;
    bottom: 120px;
    background: var(--purple);
}

.site-header {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(12, 9, 18, 0.74);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 52px rgba(0, 0, 0, 0.22);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--red), var(--purple));
    color: white;
    line-height: 1;
    box-shadow: 0 0 28px rgba(255, 63, 97, 0.26);
}

.brand-text {
    font-size: 1rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.93rem;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.site-nav a.active {
    box-shadow: inset 0 0 0 1px var(--line);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 17px;
    height: 2px;
    margin: 5px auto;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-open .nav-toggle span:first-child {
    transform: translateY(3.5px) rotate(45deg);
}

.nav-open .nav-toggle span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
}

main {
    padding: 72px 0 54px;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
    gap: 28px;
    align-items: stretch;
}

.hero-copy,
.page-hero,
.content-panel,
.status-card,
.card,
.split-panel,
.project-card,
.mini-cta,
.link-placeholder {
    position: relative;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(24, 18, 34, 0.88), rgba(12, 9, 18, 0.72));
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hero-copy,
.page-hero {
    padding: clamp(32px, 6vw, 64px);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.hero-copy::before,
.page-hero::before,
.content-panel::before,
.status-card::before,
.card::before,
.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 63, 97, 0.12), transparent 38%, rgba(124, 77, 255, 0.10));
    opacity: 0.72;
}

.hero-copy > *,
.page-hero > *,
.content-panel > *,
.status-card > *,
.card > *,
.project-card > * {
    position: relative;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--red);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.06;
    letter-spacing: -0.04em;
}

h1 {
    max-width: 860px;
    font-size: clamp(3.1rem, 10vw, 7.8rem);
}

.page-hero h1 {
    font-size: clamp(2.9rem, 8vw, 6.2rem);
}

h2 {
    font-size: clamp(1.55rem, 3.4vw, 2.55rem);
}

h3 {
    font-size: 1.28rem;
}

p {
    margin: 0;
    color: var(--muted);
}

p + p {
    margin-top: 16px;
}

.lead {
    max-width: 760px;
    margin-top: 16px;
    color: var(--text);
    font-size: clamp(1.18rem, 2vw, 1.55rem);
    line-height: 1.45;
}

.hero-copy > p:not(.eyebrow):not(.lead) {
    max-width: 780px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: linear-gradient(135deg, var(--red), var(--purple));
    color: white;
    box-shadow: 0 14px 34px rgba(255, 63, 97, 0.16);
}

.button-ghost {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.status-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.status-card-top {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--green);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.76rem;
}

.pulse {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 18px rgba(126, 242, 154, 0.75);
}

.console-lines {
    margin-top: 70px;
    padding: 18px;
    border: 1px solid rgba(126, 242, 154, 0.18);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.22);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
}

.console-lines p {
    color: #d9d2e6;
}

.console-lines p + p {
    margin-top: 8px;
}

.console-lines span {
    color: var(--green);
}

.cards-section,
.project-list,
.link-board {
    margin-top: 28px;
}

.compact-top {
    margin-top: 20px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.card-grid {
    display: grid;
    gap: 16px;
}

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

.card-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    min-height: 230px;
    padding: 26px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.link-card {
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.link-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 63, 97, 0.42);
    background: linear-gradient(145deg, rgba(34, 24, 47, 0.92), rgba(15, 10, 22, 0.82));
}

.card-kicker {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--muted-2);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.card p,
.project-card p {
    margin-top: 15px;
}

.split-panel {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 24px;
    margin-top: 28px;
    padding: 32px;
    border-radius: var(--radius-xl);
}

.quote-panel {
    border-color: rgba(255, 63, 97, 0.24);
}

.page-hero {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-hero.narrow {
    min-height: 280px;
}

.content-panel {
    margin-top: 20px;
    padding: clamp(28px, 5vw, 46px);
    border-radius: var(--radius-xl);
}

.prose {
    max-width: 900px;
}

.prose p {
    color: #d4ccde;
    font-size: 1.06rem;
}

.project-list {
    display: grid;
    gap: 16px;
}

.project-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.project-card h2 {
    font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.tag {
    position: relative;
    display: inline-flex;
    margin-top: 18px;
    margin-right: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.82rem;
}

.muted-card {
    opacity: 0.82;
}

.mini-cta {
    margin-top: 20px;
    padding: 26px;
    border-radius: var(--radius-lg);
}

.link-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.link-placeholder {
    display: flex;
    min-height: 116px;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    border-radius: var(--radius-lg);
}
.link-placeholder:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 63, 97, 0.42);
    background: linear-gradient(145deg, rgba(34, 24, 47, 0.92), rgba(15, 10, 22, 0.82));
}

.link-placeholder span {
    font-weight: 900;
    font-size: 1.08rem;
}

.link-placeholder small {
    color: var(--muted-2);
}

.quick-links {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: 20px;
    align-items: center;
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(24, 18, 34, 0.78), rgba(12, 9, 18, 0.62));
    box-shadow: var(--shadow);
}

.quick-link-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.035);
    transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mini-link:hover {
    transform: translateY(-2px);
    color: var(--text);
    border-color: rgba(255, 63, 97, 0.42);
    background: rgba(255, 255, 255, 0.07);
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.fact-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.035);
}

.fact-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted-2);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.fact-item strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
}

.cta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cta-row p {
    max-width: 780px;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 0 0;
    color: var(--muted-2);
    font-size: 0.9rem;
}

.footer-logo {
    display: block;
    color: var(--text);
    font-weight: 900;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.footer-meta span {
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.muted {
    color: var(--muted-2);
}

@media (max-width: 960px) {
    .section-grid,
    .split-panel,
    .card-grid.three,
    .card-grid.four,
    .card-grid.two,
    .link-board,
    .quick-links,
    .fact-grid {
        grid-template-columns: 1fr;
    }

    .quick-link-row {
        justify-content: flex-start;
    }

    .status-card {
        min-height: 320px;
    }

    .console-lines {
        margin-top: 44px;
    }
}

@media (max-width: 780px) {
    .site-shell {
        width: min(100% - 24px, var(--max));
        padding-top: 14px;
    }

    .site-header {
        align-items: center;
        border-radius: 24px;
    }

    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(12, 9, 18, 0.96);
        backdrop-filter: blur(18px);
        box-shadow: var(--shadow);
    }

    .nav-open .site-nav {
        display: flex;
    }

    .site-nav a {
        justify-content: flex-start;
        min-height: 44px;
        padding: 0 14px;
    }

    main {
        padding-top: 42px;
    }

    .hero-copy,
    .page-hero,
    .content-panel,
    .split-panel,
    .status-card,
    .card,
    .project-card {
        border-radius: 22px;
    }

    .site-footer,
    .cta-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    body {
        line-height: 1.58;
    }

    .hero-copy,
    .page-hero {
        padding: 26px;
    }

    h1 {
        font-size: clamp(2.6rem, 18vw, 4.8rem);
    }

    .page-hero h1 {
        font-size: clamp(2.3rem, 15vw, 4.1rem);
    }

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

    .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}


/* Base / Notes */
.base-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(24, 18, 34, 0.66), rgba(12, 9, 18, 0.54));
}

.base-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.base-filter {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.base-filter:hover,
.base-filter.active {
    color: var(--text);
    border-color: rgba(255, 63, 97, 0.42);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.base-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.branch-card,
.note-card,
.loading-card,
.note-meta-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(24, 18, 34, 0.78), rgba(12, 9, 18, 0.64));
    box-shadow: var(--shadow);
}

.branch-card {
    padding: 24px;
}

.branch-card h3 {
    margin-bottom: 12px;
}

.branch-card-head p {
    margin-top: 12px;
}

.branch-meta,
.note-card-top,
.note-card-bottom,
.note-meta-list,
.note-tags,
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.branch-meta {
    margin-top: 18px;
}

.branch-meta span,
.category-pills span,
.note-card-top span,
.note-tags span,
.note-meta-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.78rem;
    font-weight: 800;
}

.category-pills {
    margin-top: 16px;
}

.note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.note-card {
    display: flex;
    min-height: 245px;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.note-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 63, 97, 0.42);
    background: linear-gradient(145deg, rgba(34, 24, 47, 0.92), rgba(15, 10, 22, 0.82));
}

.note-card h3 {
    margin-top: 18px;
}

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

.note-card-bottom {
    justify-content: space-between;
    align-items: end;
    margin-top: 22px;
}

.note-card-bottom small {
    color: var(--muted-2);
}

.loading-card {
    padding: 24px;
    color: var(--muted);
}

.loading-card.error {
    border-color: rgba(255, 63, 97, 0.42);
    color: var(--text);
}

.note-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.note-meta-panel {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 16px;
    padding: 20px;
}

.note-meta-list,
.note-tags-large {
    align-items: flex-start;
}

.note-content {
    margin-top: 0;
}

.note-content h2,
.note-content h3 {
    margin-top: 34px;
    margin-bottom: 12px;
}

.note-content h2:first-child,
.note-content h3:first-child {
    margin-top: 0;
}

.note-content ul {
    margin: 16px 0 0;
    padding-left: 22px;
    color: #d4ccde;
}

.note-content li + li {
    margin-top: 8px;
}

.note-content code {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 960px) {
    .base-map,
    .note-grid,
    .note-shell {
        grid-template-columns: 1fr;
    }

    .note-meta-panel {
        position: static;
    }
}

@media (max-width: 520px) {
    .base-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .base-filter,
    .base-filter-row {
        width: 100%;
    }

    .base-filter-row {
        flex-direction: column;
    }
}

/* Hierarchical Base v2 */
.hierarchy-panel {
    margin-top: 24px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 63, 97, 0.10), transparent 34%),
        linear-gradient(145deg, rgba(24, 18, 34, 0.78), rgba(12, 9, 18, 0.62));
    box-shadow: var(--shadow);
}

.hierarchy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.ghost-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
    transform: translateY(-1px);
    color: var(--text);
    border-color: rgba(255, 63, 97, 0.42);
    background: rgba(255, 255, 255, 0.07);
}

.active-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.16);
}

.path-root,
.path-chip,
.path-muted,
.path-separator {
    display: inline-flex;
    align-items: center;
}

.path-root {
    color: var(--text);
    font-weight: 900;
}

.path-chip {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 850;
    cursor: pointer;
}

.path-chip:hover {
    border-color: rgba(255, 63, 97, 0.42);
}

.tag-path {
    color: #e7d6ff;
}

.path-muted,
.path-separator {
    color: var(--muted-2);
    font-size: 0.88rem;
}

.selector-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.15fr 0.75fr;
    gap: 16px;
    align-items: start;
}

.selector-step {
    min-height: 260px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.025);
}

.selector-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.selector-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 63, 97, 0.28);
    border-radius: 999px;
    color: var(--accent-soft);
    background: rgba(255, 63, 97, 0.08);
    font-size: 0.8rem;
    font-weight: 950;
}

.selector-title h3 {
    margin: 0;
    font-size: 1.05rem;
}

.choice-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.choice-grid.compact {
    gap: 8px;
}

.choice-button {
    position: relative;
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 58px;
    padding: 13px 44px 13px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    text-align: left;
    background: rgba(255, 255, 255, 0.035);
    font: inherit;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice-button:hover,
.choice-button.active {
    transform: translateY(-1px);
    color: var(--text);
    border-color: rgba(255, 63, 97, 0.42);
    background: linear-gradient(145deg, rgba(34, 24, 47, 0.72), rgba(15, 10, 22, 0.58));
}

.choice-button.active::before {
    content: '';
    position: absolute;
    inset: 12px auto auto 10px;
    width: 4px;
    height: calc(100% - 24px);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--violet));
}

.choice-button span {
    color: inherit;
    font-size: 0.96rem;
    font-weight: 900;
}

.choice-button small {
    max-width: 94%;
    color: var(--muted-2);
    font-size: 0.8rem;
    line-height: 1.35;
}

.choice-button em {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    color: var(--muted-2);
    background: rgba(0, 0, 0, 0.18);
    font-style: normal;
    font-size: 0.74rem;
    font-weight: 850;
}

.empty-state {
    padding: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    color: var(--muted-2);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.92rem;
}

@media (max-width: 1060px) {
    .selector-grid {
        grid-template-columns: 1fr;
    }

    .selector-step {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .hierarchy-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .hierarchy-head {
        flex-direction: column;
    }

    .ghost-button {
        width: 100%;
    }
}

/* Hierarchical Base v3 — compact route, notes first */
.route-panel {
    margin-top: 18px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.022);
    box-shadow: none;
}

.route-head {
    align-items: center;
    margin-bottom: 12px;
}

.route-head .active-path {
    flex: 1;
    min-height: 38px;
    margin-bottom: 0;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.12);
}

.route-head .ghost-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.route-grid {
    grid-template-columns: 1.05fr 1.15fr 0.8fr;
    gap: 10px;
}

.route-step {
    min-height: unset;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.018);
}

.route-step h3 {
    margin: 0 0 9px;
    color: var(--muted-2);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.route-choices,
.route-choices.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 0;
}

.route-choices .choice-button {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 0 34px 0 12px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.028);
}

.route-choices .choice-button:hover,
.route-choices .choice-button.active {
    transform: translateY(-1px);
    color: var(--text);
    background: rgba(255, 255, 255, 0.065);
}

.route-choices .choice-button.active::before {
    inset: auto auto 6px 12px;
    width: calc(100% - 46px);
    height: 2px;
    border-radius: 999px;
}

.route-choices .choice-button span {
    font-size: 0.84rem;
    white-space: nowrap;
}

.route-choices .choice-button em {
    top: 5px;
    right: 6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.68rem;
}

.route-choices .empty-state,
.route-choices .loading-card {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
}

.notes-focus {
    margin-top: 30px;
}

.notes-focus .section-heading {
    align-items: end;
    margin-bottom: 16px;
}

.notes-focus .note-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.notes-focus .note-card {
    min-height: 270px;
    padding: 26px;
}

.notes-focus .note-card h3 {
    font-size: 1.24rem;
    line-height: 1.18;
}

@media (max-width: 1120px) {
    .notes-focus .note-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .route-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .route-panel {
        padding: 12px;
    }

    .route-head {
        align-items: stretch;
        flex-direction: column;
    }

    .route-head .ghost-button {
        width: 100%;
    }

    .route-choices .choice-button {
        width: 100%;
        justify-content: flex-start;
    }

    .notes-focus .note-grid {
        grid-template-columns: 1fr;
    }
}


/* Base v4 — compact above-the-fold layout */
.page-base main {
    padding-top: 26px;
    padding-bottom: 44px;
}

.page-base .base-compact-hero {
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    gap: 18px;
    align-items: end;
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(24, 18, 34, 0.70), rgba(12, 9, 18, 0.54));
    box-shadow: none;
}

.page-base .base-compact-hero::before {
    opacity: 0.34;
}

.page-base .base-compact-hero .eyebrow {
    margin-bottom: 5px;
    font-size: 0.66rem;
}

.page-base .base-compact-hero h1 {
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    letter-spacing: -0.035em;
}

.page-base .base-compact-hero .lead {
    justify-self: end;
    max-width: 540px;
    margin-top: 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.4;
    text-align: right;
}

.page-base .route-panel {
    margin-top: 12px;
    padding: 12px;
    border-radius: 18px;
}

.page-base .route-head {
    margin-bottom: 9px;
}

.page-base .route-head .active-path {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 12px;
}

.page-base .route-head .ghost-button {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.78rem;
}

.page-base .route-grid {
    gap: 8px;
}

.page-base .route-step {
    padding: 9px;
    border-radius: 14px;
}

.page-base .route-step h3 {
    margin-bottom: 7px;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

.page-base .route-choices,
.page-base .route-choices.compact {
    gap: 6px;
}

.page-base .route-choices .choice-button {
    min-height: 30px;
    padding: 0 30px 0 10px;
}

.page-base .route-choices .choice-button span {
    font-size: 0.78rem;
}

.page-base .route-choices .choice-button em {
    top: 4px;
    right: 5px;
    min-width: 20px;
    height: 20px;
    font-size: 0.64rem;
}

.page-base .route-choices .empty-state,
.page-base .route-choices .loading-card {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.78rem;
}

.page-base .notes-focus {
    margin-top: 18px;
}

.page-base .notes-focus .section-heading {
    align-items: center;
    margin-bottom: 10px;
}

.page-base .notes-focus .section-heading .eyebrow {
    margin-bottom: 4px;
}

.page-base .notes-focus .note-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.page-base .notes-focus .note-card {
    min-height: 0;
    padding: 18px 20px;
    border-radius: 18px;
}

.page-base .notes-focus .note-card h3 {
    margin-top: 12px;
    font-size: 1.08rem;
    line-height: 1.18;
}

.page-base .notes-focus .note-card p {
    margin-top: 8px;
    line-height: 1.45;
}

.page-base .notes-focus .note-card-bottom {
    align-items: center;
    margin-top: 14px;
}

.page-base .notes-focus .note-card-top span,
.page-base .notes-focus .note-tags span {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.72rem;
}

.page-base .notes-focus .loading-card {
    padding: 18px 20px;
}

@media (max-width: 720px) {
    .page-base main {
        padding-top: 18px;
    }

    .page-base .base-compact-hero {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 14px;
    }

    .page-base .base-compact-hero .lead {
        justify-self: start;
        text-align: left;
    }
}

/* Base v5 — single-path navigation + searchable tag select */
.page-base .route-grid {
    grid-template-columns: 1fr 1fr minmax(220px, 0.9fr);
}

.page-base .route-choices .choice-button {
    padding: 0 10px;
}

.page-base .route-choices .choice-button.active::before {
    width: calc(100% - 20px);
}

.page-base .tag-route-step {
    min-width: 0;
}

.tag-select-shell {
    display: grid;
    gap: 7px;
}

.tag-search-input,
.tag-select {
    width: 100%;
    min-height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 999px;
    outline: none;
    background: rgba(255, 255, 255, 0.028);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
}

.tag-search-input {
    padding: 0 10px;
}

.tag-select {
    padding: 0 10px;
    cursor: pointer;
}

.tag-select option {
    background: #120d1a;
    color: var(--text);
}

.tag-search-input::placeholder {
    color: var(--muted-2);
}

.tag-search-input:focus,
.tag-select:focus {
    border-color: rgba(255, 63, 97, 0.38);
    background: rgba(255, 255, 255, 0.055);
}

.page-base .notes-focus .loading-card {
    color: var(--muted);
}

@media (max-width: 900px) {
    .page-base .route-grid {
        grid-template-columns: 1fr;
    }
}

/* Base v6 — softer animated tag dropdown + route-aware tag counts */
.page-base .route-panel,
.page-base .route-grid,
.page-base .route-step,
.page-base .tag-route-step {
    overflow: visible;
}

.page-base .tag-select-shell {
    position: relative;
    display: block;
    z-index: 12;
}

.page-base .tag-dropdown {
    position: relative;
}

.page-base .tag-dropdown-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 32px;
    padding: 0 34px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
        rgba(10, 8, 15, 0.72);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.page-base .tag-dropdown-trigger::after {
    content: '';
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1px solid rgba(238, 231, 244, 0.72);
    border-bottom: 1px solid rgba(238, 231, 244, 0.72);
    transform: translateY(-62%) rotate(45deg);
    transition: transform 180ms ease, border-color 180ms ease;
}

.page-base .tag-dropdown-trigger:hover,
.page-base .tag-dropdown.open .tag-dropdown-trigger {
    border-color: rgba(255, 63, 97, 0.32);
    background:
        linear-gradient(145deg, rgba(255, 63, 97, 0.085), rgba(132, 63, 255, 0.052)),
        rgba(13, 10, 20, 0.86);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-base .tag-dropdown.open .tag-dropdown-trigger::after {
    transform: translateY(-38%) rotate(225deg);
    border-color: rgba(255, 63, 97, 0.82);
}

.page-base .tag-dropdown-trigger em,
.page-base .tag-option em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--muted);
    font-style: normal;
    font-size: 0.66rem;
    line-height: 1;
}

.page-base .tag-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 40;
    display: grid;
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 63, 97, 0.12), transparent 36%),
        linear-gradient(145deg, rgba(18, 13, 26, 0.98), rgba(10, 8, 15, 0.98));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transform: translateY(-6px) scale(0.985);
    transform-origin: top center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 170ms ease, transform 170ms ease, visibility 170ms ease;
}

.page-base .tag-dropdown.open .tag-dropdown-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.page-base .tag-search-input {
    width: 100%;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 999px;
    outline: none;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    transition: border-color 150ms ease, background 150ms ease;
}

.page-base .tag-search-input::placeholder {
    color: var(--muted-2);
}

.page-base .tag-search-input:focus {
    border-color: rgba(255, 63, 97, 0.38);
    background: rgba(255, 255, 255, 0.055);
}

.page-base .tag-options {
    display: grid;
    gap: 5px;
    max-height: 212px;
    overflow: auto;
    padding-right: 2px;
}

.page-base .tag-options::-webkit-scrollbar {
    width: 6px;
}

.page-base .tag-options::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.page-base .tag-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 30px;
    padding: 0 9px 0 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.77rem;
    text-align: left;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.page-base .tag-option:hover,
.page-base .tag-option.active {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.075);
    background: linear-gradient(145deg, rgba(255, 63, 97, 0.09), rgba(132, 63, 255, 0.055));
}

.page-base .tag-option:hover {
    transform: translateX(2px);
}

.page-base .tag-option.active em {
    color: var(--text);
    background: rgba(255, 63, 97, 0.18);
}

.page-base .tag-empty {
    padding: 8px 10px;
    color: var(--muted-2);
    font-size: 0.76rem;
}

@media (max-width: 900px) {
    .page-base .tag-dropdown-panel {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        margin-top: 8px;
    }
}

/* Base v7 — multiple tag combinations + removable selected chips */
.page-base .tag-dropdown {
    display: grid;
    gap: 7px;
}

.page-base .selected-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.page-base .selected-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 0 7px 0 10px;
    border: 1px solid rgba(255, 63, 97, 0.22);
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(255, 63, 97, 0.12), rgba(132, 63, 255, 0.075)),
        rgba(255, 255, 255, 0.035);
    color: var(--text);
    font: inherit;
    font-size: 0.74rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.page-base .selected-tag-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 63, 97, 0.42);
    background:
        linear-gradient(145deg, rgba(255, 63, 97, 0.18), rgba(132, 63, 255, 0.095)),
        rgba(255, 255, 255, 0.052);
}

.page-base .selected-tag-chip b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(238, 231, 244, 0.82);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
}

.page-base .selected-tag-chip:hover b {
    color: var(--text);
    background: rgba(255, 63, 97, 0.22);
}

.page-base .tag-option.active {
    border-color: rgba(255, 63, 97, 0.25);
}

.page-base .tag-clear-option {
    margin-bottom: 3px;
    color: var(--muted-2);
}

.page-base .tag-clear-option:hover {
    color: var(--text);
}

@media (max-width: 720px) {
    .page-base .selected-tags-row {
        gap: 5px;
    }

    .page-base .selected-tag-chip {
        min-height: 26px;
        font-size: 0.7rem;
    }
}
