:root {
    color-scheme: light;
    --bg: #edf2f6;
    --surface: #fbfcfe;
    --surface-2: #e3eaf1;
    --surface-3: #d7e1ea;
    --text: #1d2732;
    --muted: #5b6978;
    --faint: #5e6b78;
    --border: #c6d1dc;
    --border-soft: #dce4ec;
    --accent: #2b628f;
    --accent-hover: #214f73;
    --accent-soft: rgba(43, 98, 143, 0.1);
    --success: #276f52;
    --success-soft: rgba(39, 111, 82, 0.09);
    --warning: #75591f;
    --warning-soft: rgba(117, 89, 31, 0.1);
    --danger: #9a4457;
    --danger-soft: rgba(154, 68, 87, 0.09);
    --shadow: 0 1px 4px rgba(28, 55, 85, 0.08);
    --radius: 3px;
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
    --shell: 1180px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #151b22;
    --surface: #1c242d;
    --surface-2: #242e38;
    --surface-3: #2d3945;
    --text: #d3dbe4;
    --muted: #95a2b1;
    --faint: #8996a4;
    --border: #394654;
    --border-soft: #2b3540;
    --accent: #78b1d8;
    --accent-hover: #96c6e3;
    --accent-soft: rgba(120, 177, 216, 0.11);
    --success: #69ad8b;
    --success-soft: rgba(105, 173, 139, 0.1);
    --warning: #c3a15c;
    --warning-soft: rgba(195, 161, 92, 0.1);
    --danger: #d07b8b;
    --danger-soft: rgba(208, 123, 139, 0.1);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select,
summary {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent-hover);
}

button {
    color: inherit;
}

button:not(:disabled),
summary {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

::selection {
    background: var(--accent-soft);
}

[hidden] {
    display: none !important;
}

.shell {
    width: min(var(--shell), 100%);
    margin-inline: auto;
    padding-inline: 24px;
}

.shell-none {
    margin-top: 28px;
}

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

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--accent);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.icon {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: -0.15em;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    display: grid;
    width: 25px;
    height: 25px;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.brand-mark i {
    background: var(--accent);
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(4) {
    opacity: 0.55;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.primary-nav a {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
    color: var(--accent);
}

.theme-toggle {
    min-width: 52px;
    min-height: 30px;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero {
    border-bottom: 1px solid var(--border);
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center top;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
    gap: 64px;
    align-items: center;
    min-height: 490px;
    padding-block: 68px;
}

.hero-copy {
    padding: 26px;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(36px, 5.2vw, 62px);
    font-weight: 680;
    letter-spacing: -0.055em;
    line-height: 1.12;
    text-wrap: balance;
}

.hero-lede {
    max-width: 620px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition:
        background var(--ease) 140ms,
        border-color var(--ease) 140ms,
        color var(--ease) 140ms;
}

.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #f7fafc;
}

.button-primary:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
    color: #f7fafc;
}

.button-secondary {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.button-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.button-quiet {
    border-color: var(--border);
    background: transparent;
    color: var(--muted);
}

.button-quiet:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.button-block {
    width: 100%;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.atlas-panel {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.atlas-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}

.atlas-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.atlas-stats div {
    padding: 20px 14px;
    text-align: center;
}

.atlas-stats div + div {
    border-left: 1px solid var(--border-soft);
}

.atlas-stats strong {
    display: block;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 30px;
    line-height: 1;
}

.atlas-stats span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

.audit-summary {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 9px;
    align-items: center;
    padding: 13px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.audit-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.audit-summary strong {
    color: var(--text);
}

.audit-summary a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    text-decoration: none;
}

.audit-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning);
}

.audit-dot-pending {
    box-shadow: 0 0 0 3px var(--warning-soft);
}

.section-block {
    padding-block: 54px;
}

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

.section-heading h2,
.section-split h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 660;
    letter-spacing: -0.04em;
    line-height: 1.25;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.text-link:hover {
    text-decoration: underline;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.scenario-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    min-height: 142px;
    padding: 20px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: background var(--ease) 150ms;
}

.scenario-card:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.scenario-index {
    color: var(--faint);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.scenario-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.scenario-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.scenario-count {
    color: var(--faint);
    font-size: 11px;
    white-space: nowrap;
}

.section-split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 64px;
    border-top: 1px solid var(--border);
}

.section-lede {
    max-width: 520px;
    margin: 16px 0 22px;
    color: var(--muted);
    line-height: 1.85;
}

.compact-list {
    border-top: 1px solid var(--border);
}

.compact-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
}

.compact-item h3 {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
}

.compact-item h3 a {
    text-decoration: none;
}

.compact-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding-block: 46px 30px;
    border-bottom: 2px solid var(--accent);
}

.page-head-copy {
    max-width: 800px;
}

.page-head h1,
.detail-head h1,
.scenario-hero h1,
.reading-head h1,
.not-found h1 {
    margin: 0;
    font-size: clamp(30px, 4.4vw, 48px);
    font-weight: 670;
    letter-spacing: -0.05em;
    line-height: 1.18;
    text-wrap: balance;
}

.page-head-copy > p:last-child {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--muted);
}

.page-head-stat {
    flex: 0 0 auto;
    padding-left: 22px;
    border-left: 1px solid var(--border);
    text-align: right;
}

.page-head-stat strong {
    display: block;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 38px;
    line-height: 1;
}

.page-head-stat span {
    color: var(--muted);
    font-size: 11px;
}

.catalog-section {
    padding-block: 24px 60px;
}

.filter-panel {
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-field {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--input-border, var(--border));
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--muted);
}

.search-field:focus-within {
    border-color: var(--accent);
    outline: 2px solid var(--accent-soft);
}

.search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.search-field input::placeholder {
    color: var(--faint);
}

.search-field kbd {
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--faint);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.filter-grid label {
    min-width: 0;
}

.filter-grid label > span,
.tag-filter > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.filter-grid select {
    width: 100%;
    min-height: 34px;
    padding: 4px 28px 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}

.tag-filter > span {
    margin: 0 5px 0 0;
}

.tag-button {
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
}

.tag-button:hover,
.tag-button[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 2px 12px;
}

.results-bar p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.reset-button {
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.reset-button:disabled {
    color: var(--faint);
    cursor: default;
    text-decoration: none;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.skill-card {
    display: flex;
    min-width: 0;
    min-height: 270px;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--surface-3);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.skill-card:hover {
    border-top-color: var(--accent);
}

.skill-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.skill-card-domains,
.skill-card-tags,
.chip-row,
.detail-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.chip {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    background: transparent;
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
}

.chip-domain {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    color: var(--accent);
    background: var(--accent-soft);
}

.audit-badge,
.conclusion {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid currentColor;
    border-radius: var(--radius);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
}

.audit-current,
.conclusion-recommended {
    color: var(--success);
    background: var(--success-soft);
}

.audit-pending,
.audit-unknown,
.conclusion-not-assessed {
    color: var(--warning);
    background: var(--warning-soft);
}

.audit-stale,
.conclusion-conditional,
.conclusion-not-preferred {
    color: var(--accent);
    background: var(--accent-soft);
}

.skill-card h3 {
    margin: 18px 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.skill-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.skill-card h3 a:hover {
    color: var(--accent);
}

.skill-card-summary {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.skill-card-tags {
    margin-top: 14px;
}

.skill-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    color: var(--faint);
    font-size: 11px;
}

.skill-card-bottom a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    text-decoration: none;
}

.empty-state {
    padding: 64px 20px;
    border: 1px dashed var(--border);
    background: var(--surface);
    text-align: center;
}

.empty-state > .icon {
    color: var(--faint);
}

.empty-state h2 {
    margin: 12px 0 0;
    font-size: 20px;
}

.empty-state p {
    margin: 8px 0 18px;
    color: var(--muted);
}

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

.scenario-detail-card {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.scenario-detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.scenario-detail-card h2 {
    margin: 20px 0 0;
    font-size: 20px;
    line-height: 1.35;
}

.scenario-detail-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.scenario-detail-card h2 a:hover {
    color: var(--accent);
}

.scenario-detail-card > p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.scenario-fit-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 20px;
}

.scenario-fit-preview span {
    padding: 3px 7px;
    background: var(--surface-2);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
}

.scenario-detail-card .text-link {
    margin-top: auto;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    padding-top: 24px;
    color: var(--faint);
    font-size: 11px;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.detail-page {
    padding-bottom: 64px;
}

.detail-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    padding: 34px 0 26px;
    border-bottom: 2px solid var(--accent);
}

.detail-head > div:first-child {
    max-width: 820px;
}

.detail-head h1 {
    margin-top: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(30px, 4.3vw, 48px);
    overflow-wrap: anywhere;
}

.detail-head p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 34px;
    padding-top: 30px;
}

.detail-main {
    min-width: 0;
}

.detail-section {
    padding: 0 0 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
    margin-bottom: 0;
    border-bottom: 0;
}

.detail-section > h2,
.side-card > h2 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 660;
    letter-spacing: -0.025em;
}

.detail-lede {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.two-column-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin-top: 22px;
}

.two-column-list h3,
.two-column-list h4 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 13px;
}

.check-list,
.plain-list,
.reading-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: var(--muted);
    font-size: 13px;
}

.check-list .icon {
    margin-top: 4px;
    color: var(--success);
}

.plain-list li {
    position: relative;
    padding-left: 14px;
    color: var(--muted);
    font-size: 13px;
}

.plain-list li + li {
    margin-top: 7px;
}

.plain-list li::before {
    position: absolute;
    top: 0.72em;
    left: 0;
    width: 4px;
    height: 4px;
    background: var(--faint);
    content: "";
}

.section-note {
    margin: -7px 0 18px;
    color: var(--muted);
    font-size: 12px;
}

.fit-list {
    border-top: 1px solid var(--border);
}

.fit-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.fit-item:last-child {
    border-bottom: 0;
}

.fit-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fit-item h3 {
    margin: 0;
    font-size: 16px;
}

.fit-item h3 a {
    color: var(--text);
    text-decoration: none;
}

.fit-item > p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.fit-meta {
    padding: 8px 10px;
    border-left: 2px solid var(--border);
    background: var(--surface-2);
    font-size: 12px !important;
}

.fit-meta strong {
    margin-right: 8px;
    color: var(--text);
}

.audit-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.audit-current h3 {
    margin: 0;
    font-size: 15px;
}

.audit-current p {
    max-width: 650px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.legacy-audits {
    margin-top: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.legacy-audits summary {
    padding: 12px 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.legacy-list {
    border-top: 1px solid var(--border);
}

.legacy-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
}

.legacy-item:last-child {
    border-bottom: 0;
}

.legacy-item > div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.legacy-item > div span {
    color: var(--warning);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
}

.legacy-item p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.legacy-item a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}

.detail-sidebar {
    display: grid;
    align-content: start;
    gap: 14px;
}

.side-card {
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.side-card > h2 {
    font-size: 15px;
}

.meta-list {
    margin: 0;
}

.meta-list div {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}

.meta-list div:last-child {
    border-bottom: 0;
}

.meta-list dt {
    color: var(--faint);
    font-size: 11px;
}

.meta-list dd {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.meta-list a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.side-note {
    margin: -4px 0 10px;
    color: var(--muted);
    font-size: 11px;
}

.command-block {
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    background: var(--bg);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.plain-list.compact {
    margin-top: 12px;
}

.scenario-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 40px;
    align-items: end;
    padding: 42px 0 30px;
    border-bottom: 2px solid var(--accent);
}

.scenario-hero h1 {
    margin-top: 16px;
}

.scenario-hero > div:first-child > p {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--muted);
}

.task-card {
    padding: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.task-card span {
    color: var(--accent);
    font-size: 11px;
    font-weight: 650;
}

.task-card p {
    margin: 8px 0 0;
    font-size: 14px;
}

.fit-item-large {
    padding: 24px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--surface);
}

.fit-item-large + .fit-item-large {
    margin-top: 12px;
}

.fit-item-large .text-link {
    margin-top: 18px;
}

.reading-page {
    max-width: 920px;
    padding-block: 50px 72px;
}

.reading-head {
    padding-bottom: 30px;
    border-bottom: 2px solid var(--accent);
}

.reading-head > p:last-child {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 16px;
}

.reading-section {
    padding-block: 34px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 90px;
}

.reading-section:last-child {
    border-bottom: 0;
}

.reading-section h2 {
    margin: 0 0 14px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.reading-section > p {
    color: var(--muted);
    line-height: 1.9;
}

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

.definition-grid > div {
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.definition-grid p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.reading-list {
    display: grid;
    gap: 12px;
}

.reading-list li {
    padding-left: 18px;
    border-left: 2px solid var(--accent);
    color: var(--muted);
}

.reading-list strong {
    color: var(--text);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.checklist-grid div {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.checklist-grid span {
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.checklist-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.callout {
    padding: 20px;
    border: 1px solid var(--border) !important;
    border-left: 3px solid var(--accent) !important;
    background: var(--surface);
}

.callout h2 {
    font-size: 18px;
}

.timeline article {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 22px;
}

.timeline time {
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.timeline h2 {
    margin: 0;
    font-size: 18px;
}

.timeline p {
    margin: 8px 0 0;
    color: var(--muted);
}

.not-found {
    padding-block: 100px;
    text-align: center;
}

.not-found p:not(.eyebrow) {
    margin: 16px 0 24px;
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px 40px;
    align-items: start;
    padding-block: 28px;
}

.footer-inner strong {
    font-size: 15px;
}

.footer-inner p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.footer-inner nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-inner nav a {
    font-size: 12px;
    text-decoration: none;
}

.footer-note {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    max-width: min(360px, calc(100vw - 40px));
    padding: 10px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition:
        opacity 160ms var(--ease),
        transform 160ms var(--ease);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

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

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

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

    .detail-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 24px;
    }

    .legacy-item {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .legacy-item a {
        grid-column: 2;
    }
}

@media (max-width: 760px) {
    .shell {
        padding-inline: 16px;
    }

    .header-inner {
        min-height: 56px;
        gap: 14px;
    }

    .brand {
        font-size: 16px;
    }

    .primary-nav {
        gap: 13px;
    }

    .primary-nav a {
        font-size: 12px;
    }

    .primary-nav a:nth-child(3),
    .primary-nav a:nth-child(4) {
        display: none;
    }

    .theme-toggle {
        min-width: 46px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        min-height: auto;
        padding-block: 34px;
    }

    .hero-copy {
        padding: 18px;
    }

    .hero h1 {
        font-size: clamp(34px, 10vw, 48px);
    }

    .hero-lede {
        font-size: 14px;
    }

    .atlas-panel {
        max-width: none;
    }

    .section-block {
        padding-block: 38px;
    }

    .section-heading {
        display: block;
    }

    .section-heading .text-link {
        margin-top: 12px;
    }

    .scenario-grid,
    .scenario-directory,
    .section-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .scenario-card {
        grid-template-columns: 32px minmax(0, 1fr);
        min-height: auto;
    }

    .scenario-count {
        grid-column: 2;
    }

    .section-split {
        gap: 30px;
    }

    .page-head,
    .detail-head,
    .scenario-hero {
        display: block;
        padding-block: 32px 24px;
    }

    .page-head-stat {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-top: 18px;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .page-head-stat strong {
        font-size: 26px;
    }

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

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

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

    .skill-card {
        min-height: auto;
    }

    .detail-head > .audit-badge {
        margin-top: 18px;
    }

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

    .detail-sidebar {
        grid-row: auto;
    }

    .two-column-list,
    .definition-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .fit-item-head,
    .audit-current {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .legacy-item a {
        grid-column: auto;
    }

    .task-card {
        margin-top: 22px;
    }

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

    .timeline article {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

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

    .footer-note {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .primary-nav {
        gap: 10px;
    }

    .primary-nav a:nth-child(2) {
        display: none;
    }

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

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .atlas-stats div {
        padding-inline: 8px;
    }

    .audit-summary {
        grid-template-columns: 10px 1fr;
    }

    .audit-summary a {
        grid-column: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
