:root {
    --bg: #f4f3ef;
    --surface: #ffffff;
    --ink: #1b2430;
    --muted: #4e5d6c;
    --line: #e4e1d8;
    --accent: #0f6e63;
    --accent-ink: #0c574e;
    --accent-soft: #e5f4f1;
    --project: #c2410c;
    --project-soft: #fff1e8;
    --faq: #1e3a8a;
    --faq-soft: #e8eefc;
    --warn-bg: #fff8ec;
    --warn-line: #f0d7a6;
    --warn-ink: #7a4b10;
    --shadow: 0 1px 2px rgba(22, 32, 42, 0.04), 0 14px 34px rgba(22, 32, 42, 0.06);
    --radius: 18px;
    --sidebar: 280px;
    --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--ink);
    overflow-wrap: break-word;
    background:
        radial-gradient(900px 420px at 100% -8%, rgba(15, 110, 99, 0.08), transparent 55%),
        radial-gradient(700px 360px at -8% 0%, rgba(30, 58, 138, 0.06), transparent 50%),
        var(--bg);
    min-height: 100vh;
}

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

.skip-link {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--ink);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    z-index: 2000;
}

.skip-link:focus {
    top: 12px;
}

.main-container {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar);
    background: var(--surface);
    border-right: 1px solid var(--line);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 20px;
    border-bottom: 1px solid var(--line);
    position: relative;
}

.sidebar-brand::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #7dbea8 0 25%, #e2c84b 25% 50%, #e25b5b 50% 75%, #5b6fd6 75% 100%);
}

.sidebar-brand img {
    width: 72px;
    height: auto;
    display: block;
    flex: none;
}

.brand-school {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.sidebar-brand h1 {
    font-size: 18px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 2px;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
}

.sidebar-nav {
    padding: 16px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: #f6f5f1;
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    flex: none;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.sidebar-foot {
    margin-top: 8px;
    padding: 16px 18px 24px;
    border-top: 1px solid var(--line);
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.sidebar-foot h2 {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 16px 0 8px;
}

.sidebar-foot h2:first-child {
    margin-top: 0;
}

.sidebar-foot .foot-label {
    font-size: 13px;
    font-weight: 700;
    margin: 12px 0 4px;
}

.sidebar-foot a {
    display: block;
    color: var(--accent-ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 0;
}

.sidebar-foot a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sidebar-foot .side-notes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-foot .side-notes li {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.45;
}

.mail-link {
    word-break: break-all;
}

.main-content {
    margin-left: var(--sidebar);
    padding: 42px max(28px, calc((100vw - var(--sidebar) - 1040px) / 2)) 72px;
}

.content-header {
    margin-bottom: 28px;
}

.eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 8px;
}

.content-header h1 {
    font-size: clamp(1.8rem, 2.4vw, 2.45rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-weight: 800;
}

.nobreak {
    white-space: nowrap;
}

.content-header .subtitle,
.lede {
    margin-top: 12px;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 62ch;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 22px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    font-size: 14.5px;
}

.back-link:hover {
    color: var(--ink);
}

.guide-search {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 14px;
    margin: 0 0 22px;
    box-shadow: var(--shadow);
}

.guide-search label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 8px;
}

.guide-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    color: var(--ink);
    background: #fafaf7;
}

.guide-search input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    background: white;
}

.guide-results {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-results a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    background: var(--accent-soft);
    color: var(--ink);
}

.guide-results a:hover {
    background: #d7efe9;
}

.guide-results strong {
    font-size: 15px;
}

.guide-results span,
.guide-empty {
    color: var(--muted);
    font-size: 14px;
}

.guide-empty {
    padding: 4px 2px 2px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.guide-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 230px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(22, 32, 42, 0.1);
}

.guide-mark {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
}

.mark-stage { background: var(--accent-soft); color: var(--accent-ink); }
.mark-project { background: var(--project-soft); color: #9a3412; }
.mark-faq { background: var(--faq-soft); color: var(--faq); }

.guide-card h2 {
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.guide-card p {
    color: var(--muted);
    flex: 1;
}

.guide-action {
    font-weight: 700;
    color: var(--ink);
}

.guide-card:hover .guide-action {
    color: var(--accent-ink);
}

.content-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 26px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    scroll-margin-top: 20px;
}

.content-section h2 {
    font-size: 1.45rem;
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin-bottom: 12px;
}

.content-section h3 {
    font-size: 1.08rem;
    margin: 22px 0 8px;
    letter-spacing: -0.02em;
}

.content-section p,
.content-section li {
    color: #2a3542;
}

.content-section p {
    margin-bottom: 12px;
}

.content-section ul,
.content-section ol {
    margin: 12px 0 16px;
    padding-left: 1.15rem;
}

.content-section li {
    margin: 6px 0;
}

.content-section li::marker {
    color: var(--accent);
}

.content-section a {
    color: var(--accent-ink);
    font-weight: 600;
    text-underline-offset: 3px;
}

.content-section.is-highlight {
    box-shadow: 0 0 0 3px rgba(15, 110, 99, 0.28), var(--shadow);
}

.phase-initial { box-shadow: inset 3px 0 0 #c2410c, var(--shadow); }
.phase-1 { box-shadow: inset 3px 0 0 #6d28d9, var(--shadow); }
.phase-2 { box-shadow: inset 3px 0 0 #0f6e63, var(--shadow); }
.phase-3 { box-shadow: inset 3px 0 0 #1e3a8a, var(--shadow); }

.callout {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--accent-soft);
    border-radius: 12px;
    color: var(--accent-ink);
    font-size: 0.95rem;
}

.important-note {
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 16px 0;
}

.important-note p,
.important-note li {
    color: var(--warn-ink);
}

.pending-note {
    background: #fdecec;
    border: 1px solid #e7b4b4;
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 16px;
}

.pending-note p {
    color: #9b1c1c;
    margin-bottom: 0;
}

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

.phase-card {
    display: flex;
    gap: 14px;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    background: #fafaf7;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.phase-card:hover {
    border-color: #c9c5b8;
    transform: translateY(-2px);
}

.phase-index {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex: none;
}

.tone-initial { background: #fff1e8; color: #9a3412; }
.tone-1 { background: #f3e8ff; color: #6d28d9; }
.tone-2 { background: var(--accent-soft); color: var(--accent-ink); }
.tone-3 { background: var(--faq-soft); color: var(--faq); }

.phase-kicker {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.phase-title {
    display: block;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2px 0 6px;
}

.phase-description {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.schedule-block {
    margin: 8px 0 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fafaf7;
}

.schedule-head h3 {
    margin-top: 0;
}

.schedule-head p {
    color: var(--muted);
    margin-bottom: 12px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 99px;
}

.dot-afm { background: #0f6e63; }
.dot-rim { background: #1e3a8a; }
.dot-sia { background: #c8960a; }
.dot-tur { background: #c2410c; }

.period-list,
.year-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.period-row,
.year-row {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 12px;
    align-items: center;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}

.period-dates,
.year-label {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.02rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.class-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink);
}

a.class-chip.chip-afm,
span.class-chip.chip-afm { background: #e5f4f1; color: #0c574e; }
a.class-chip.chip-rim,
span.class-chip.chip-rim { background: #e7eefc; color: #1e3a8a; }
a.class-chip.chip-sia,
span.class-chip.chip-sia { background: #fff4d4; color: #7a5a00; }
a.class-chip.chip-tur,
span.class-chip.chip-tur { background: #fde8e3; color: #9a3412; }

a.class-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 32, 42, 0.08);
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fafaf7;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    color: var(--ink);
}

.faq-question:hover { background: #f3f1ea; }

.faq-item.active .faq-question { background: white; }

.faq-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    flex: none;
    font-weight: 700;
    color: var(--muted);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
    background: white;
}

.faq-item.active .faq-answer {
    max-height: 2000px;
}

.faq-answer p,
.faq-answer li {
    color: #2a3542;
}

.faq-answer p { padding: 4px 18px 16px; }

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1100;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.mobile-menu-toggle svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 980px) {
    .guide-grid,
    .phases-navigation {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .mobile-menu-toggle { display: grid; place-items: center; }

    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: none;
        box-shadow: 12px 0 40px rgba(22, 32, 42, 0.16);
    }

    body.nav-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(20, 28, 38, 0.45);
        z-index: 900;
    }

    .main-content {
        margin-left: 0;
        padding: 84px 16px 48px;
    }

    .content-header h1 {
        max-width: none;
    }

    .nobreak {
        white-space: normal;
    }

    .period-row,
    .year-row {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .content-section { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition: none !important;
    }
}

@media print {
    .sidebar,
    .mobile-menu-toggle,
    .back-link,
    .guide-search { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    body { background: white; }
}
