.handbook-main {
    /* 지진・해일 */
    --hb-red: #dc2626;
    --hb-red-dark: #991b1b;
    --hb-red-soft: #fef2f2;
    --hb-red-border: #fca5a5;

    /* 태풍・호우 */
    --hb-blue: #2563eb;
    --hb-blue-dark: #1d4ed8;
    --hb-blue-soft: #eff6ff;
    --hb-blue-border: #93c5fd;

    /* 그 외 재해 */
    --hb-slate: #59687a;
    --hb-slate-dark: #3c4857;
    --hb-slate-soft: #f0f3f6;
    --hb-slate-border: #b8c2ce;

    /* 행동을 시작하기 */
    --hb-green: #24866a;
    --hb-green-dark: #17664f;
    --hb-green-soft: #edf8f4;
    --hb-green-border: #86cbb6;

    /* 방재 TIPS */
    --hb-orange: #d66d27;
    --hb-orange-dark: #a94e17;
    --hb-orange-soft: #fff3e9;
    --hb-orange-border: #efb184;

    /* 공통 */
    --hb-text: #162033;
    --hb-body: #445065;
    --hb-muted: #758093;

    --hb-background: #f5f7fa;
    --hb-border: #dfe5ed;
    --hb-border-light: #ebeff4;

    --hb-white: #fff;

    color: var(--hb-text);
}

.handbook-container {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 0 120px;
}

.handbook-hero {
    position: relative;
    overflow: hidden;
    padding: 72px 24px 116px;
    color: #fff;
    background:
        radial-gradient(
            circle at 78% 20%,
            rgba(123, 188, 255, 0.24),
            transparent 24%
        ),
        linear-gradient(
            120deg,
            #073d80 0%,
            #0d5bbb 48%,
            #277fe1 100%
        );
}

.handbook-hero::before {
    content: "";
    position: absolute;
    inset: 0;

    opacity: 0.17;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.12) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.12) 1px,
            transparent 1px
        );

    background-size: 54px 54px;
    pointer-events: none;
}

.handbook-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    height: 46px;

    background: var(--background-color);

    clip-path: polygon(
        0 74%,
        17% 48%,
        34% 68%,
        51% 33%,
        70% 62%,
        85% 44%,
        100% 69%,
        100% 100%,
        0 100%
    );
}

.handbook-hero-inner {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 72px;
    align-items: center;

    width: min(1120px, 100%);
    margin: 0 auto;
}

.handbook-hero-content {
    max-width: 720px;
}


.handbook-hero h1 {
    margin: 0 0 24px;

    font-size: clamp(2.8rem, 7vw, 4.8rem);
    line-height: 1.08;
    letter-spacing: -0.06em;
}

.handbook-hero-lead {
    max-width: 650px;
    margin: 0;

    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.85;
    word-break: keep-all;

    color: rgba(255, 255, 255, 0.93);
}

.handbook-hero-notice {
    display: flex;
    align-items: center;
    gap: 10px;

    width: fit-content;
    margin: 28px 0 0;
    padding: 10px 15px;

    font-size: 0.78rem;
    line-height: 1.55;

    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 10px;
    backdrop-filter: blur(8px);
}

.handbook-hero-notice::before {
    content: "i";

    display: grid;
    place-items: center;

    flex: none;
    width: 20px;
    height: 20px;

    font-size: 0.7rem;
    font-weight: 800;

    color: #0d5bbb;
    background: #fff;
    border-radius: 50%;
}

/* ========================================
   빠른 목차
======================================== */

.handbook-quick-nav {
    position: relative;
    z-index: 2;

    margin: -45px 0 80px;

    background: #fff;
    border: 1px solid var(--hb-border);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(27, 55, 91, 0.1);
}

.handbook-quick-nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));

    padding: 0;
    margin: 0;

    list-style: none;
}

.handbook-quick-nav-list li {
    min-width: 0;
}

.handbook-quick-nav-list li + li {
    border-left: 1px solid var(--hb-border-light);
}

.handbook-quick-nav-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;

    min-height: 90px;
    padding: 18px;

    text-decoration: none;

    color: var(--hb-text);

    transition:
        color 0.2s,
        background-color 0.2s;
}

.handbook-quick-nav-list li:first-child
.handbook-quick-nav-link {
    border-radius: 21px 0 0 21px;
}

.handbook-quick-nav-list li:last-child
.handbook-quick-nav-link {
    border-radius: 0 21px 21px 0;
}

.handbook-quick-nav-link:hover {
    color: var(--theme-color);
    background: var(--theme-soft);
}

.handbook-quick-nav-number {
    font-size: 0.68rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;

    color: var(--theme-color);
}

.handbook-quick-nav-text {
    overflow: hidden;

    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.45;
    text-overflow: ellipsis;
    word-break: keep-all;
}

.handbook-quick-nav-arrow {
    font-size: 0.82rem;

    color: #a0a9b6;

    transition: transform 0.2s;
}

.handbook-quick-nav-link:hover
.handbook-quick-nav-arrow {
    transform: translateY(3px);
    color: var(--theme-color);
}

/* ========================================
   섹션 공통
======================================== */

.handbook-contents {
    display: flex;
    flex-direction: column;
    gap: 104px;
}

.handbook-section {
    --theme-color: var(--hb-blue);
    --theme-dark: var(--hb-blue-dark);
    --theme-soft: var(--hb-blue-soft);

    scroll-margin-top: 86px;
}

.handbook-section-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;

    margin-bottom: 28px;
}
.handbook-section-number {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;

    color: var(--theme-color);
}

.handbook-section-symbol {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.05rem;
    font-weight: 800;
    padding: .5rem;
    background: var(--theme-soft);
    border-radius: 14px;
}

.handbook-section-heading h2 {
    margin: 0;

    font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1.3;
    letter-spacing: -0.045em;
}

.handbook-section-heading p {
    margin: 8px 0 0;

    font-size: 0.9rem;
    line-height: 1.7;

    color: var(--hb-muted);
}

.handbook-section-count {
    display: flex;
    align-items: baseline;
    gap: 7px;

    color: var(--theme-color);
}

.handbook-section-count strong {
    font-size: 1.55rem;
    font-variant-numeric: tabular-nums;
}

.handbook-section-count span {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

/* 테마 */
.theme-red {
    --theme-color: var(--hb-red);
    --theme-dark: var(--hb-red-dark);
    --theme-soft: var(--hb-red-soft);
    --theme-border: var(--hb-red-border);
}

.theme-blue {
    --theme-color: var(--hb-blue);
    --theme-dark: var(--hb-blue-dark);
    --theme-soft: var(--hb-blue-soft);
    --theme-border: var(--hb-blue-border);
}

.theme-slate {
    --theme-color: var(--hb-slate);
    --theme-dark: var(--hb-slate-dark);
    --theme-soft: var(--hb-slate-soft);
    --theme-border: var(--hb-slate-border);
}

.theme-green {
    --theme-color: var(--hb-green);
    --theme-dark: var(--hb-green-dark);
    --theme-soft: var(--hb-green-soft);
    --theme-border: var(--hb-green-border);
}

.theme-orange {
    --theme-color: var(--hb-orange);
    --theme-dark: var(--hb-orange-dark);
    --theme-soft: var(--hb-orange-soft);
    --theme-border: var(--hb-orange-border);
}
/* ========================================
   카드 그리드
======================================== */

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

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

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

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

/* ========================================
   카드 공통
======================================== */

.handbook-card {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    min-height: 245px;
    padding: 24px;

    color: var(--hb-text);
    text-decoration: none;

    background: #fff;
    border: 1px solid var(--hb-border);
    border-radius: 19px;

    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.handbook-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;

    height: 3px;

    background: var(--theme-color);
    border-radius: 0 0 5px 5px;

    transform: scaleX(0);
    transform-origin: left;

    transition: transform 0.22s ease;
}

.handbook-card::after {
    content: "";
    position: absolute;
    right: -52px;
    bottom: -52px;

    width: 116px;
    height: 116px;

    background: var(--theme-soft);
    border-radius: 50%;

    opacity: 0.7;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.handbook-card:hover {
    transform: translateY(-5px);

    border-color: color-mix(
        in srgb,
        var(--theme-color) 45%,
        var(--hb-border)
    );

    box-shadow: 0 16px 36px rgba(30, 55, 88, 0.09);
}

.handbook-card:hover::before {
    transform: scaleX(1);
}

.handbook-card:hover::after {
    transform: scale(1.18);
    opacity: 1;
}

.handbook-card:focus-visible {
    outline: 3px solid color-mix(
        in srgb,
        var(--theme-color) 26%,
        transparent
    );

    outline-offset: 4px;
}

.handbook-card-top {
    position: relative;
    z-index: 1;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 28px;
}

.handbook-card-symbol {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    color: var(--theme-dark);
    background: var(--theme-soft);
    border-radius: 12px;
}
.handbook-card-icon {
    display: block;

    width: 24px;
    height: 24px;

    object-fit: contain;
}
.handbook-card-icon-fallback {
    font-size: 0.76rem;
    font-weight: 800;

    color: var(--theme-dark);
}

.handbook-card-index {
    font-size: 0.68rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;

    color: #a0a9b6;
}

.handbook-card-body {
    position: relative;
    z-index: 1;
}

.handbook-card-body h3 {
    margin: 0 0 11px;

    font-size: 1.16rem;
    line-height: 1.45;
    letter-spacing: -0.03em;
    word-break: keep-all;
}

.handbook-card-body p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    line-clamp:3;
    -webkit-line-clamp: 3;
    margin: 0;

    font-size: 0.84rem;
    line-height: 1.7;
    word-break: keep-all;

    color: var(--hb-muted);
}

.handbook-card-footer {
    position: relative;
    z-index: 1;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding-top: 18px;
    margin-top: auto;

    font-size: 0.75rem;
    font-weight: 700;

    color: var(--theme-color);
    border-top: 1px solid var(--hb-border-light);
}

.handbook-card-arrow {
    display: grid;
    place-items: center;

    width: 29px;
    height: 29px;

    font-size: 0.9rem;

    background: var(--theme-soft);
    border-radius: 50%;

    transition: transform 0.2s ease;
}

.handbook-card:hover .handbook-card-arrow {
    transform: translateX(4px);
}

.handbook-card.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

/* ========================================
   그 외 재해 작은 카드
======================================== */

.handbook-section--divall .handbook-card {
    min-height: 180px;
    padding: 20px;
}

.handbook-section--divall .handbook-card-top {
    margin-bottom: 18px;
}

.handbook-section--divall .handbook-card-symbol {
    width: 38px;
    height: 38px;
}

.handbook-section--divall .handbook-card-body h3 {
    margin-bottom: 6px;
    font-size: 1rem;
}

.handbook-section--divall .handbook-card-body p {
    font-size: 0.76rem;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.handbook-section--divall .handbook-card-footer {
    padding-top: 14px;
}

.handbook-section--divall
.handbook-card-footer > span:first-child {
    display: none;
}
.handbook-section--divall .handbook-card-icon {
    width: 22px;
    height: 22px;
}

/* ========================================
   로딩 / 오류
======================================== */

.handbook-loading,
.handbook-error {
    padding: 60px 24px;

    text-align: center;

    color: var(--hb-muted);
    background: #fff;
    border: 1px solid var(--hb-border);
    border-radius: 18px;
}

.handbook-error strong {
    display: block;
    margin-bottom: 8px;

    color: var(--hb-text);
}

.handbook-error p {
    margin: 0;
}

/* ========================================
   이용 시 주의사항
======================================== */

.handbook-disclaimer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 24px 26px;

    color: #4b5563;
    background: #f8fafc;
    border: 1px solid #dce3ea;
    border-left: 4px solid #7c8a9a;
    border-radius: 16px;
}

.handbook-disclaimer-icon {
    width: 24px;
    height: 24px;
    margin-top: 1px;
    opacity: 0.76;
}

.handbook-disclaimer-content {
    min-width: 0;
}

.handbook-disclaimer-title {
    margin: 0 0 10px;
    color: #263241;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.handbook-disclaimer-content p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.75;
}

.handbook-disclaimer-content p + p {
    margin-top: 7px;
}

/* ========================================
   반응형
======================================== */

@media (max-width: 1000px) {
    .handbook-hero-inner {
        grid-template-columns: minmax(0, 1fr) 260px;
        gap: 40px;
    }

    .handbook-quick-nav-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .handbook-quick-nav-list li {
        border-bottom: 1px solid var(--hb-border-light);
    }

    .handbook-quick-nav-list li + li {
        border-left: 1px solid var(--hb-border-light);
    }

    .handbook-quick-nav-list li:nth-child(4) {
        border-left: 0;
    }

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

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

@media (max-width: 760px) {
    .handbook-container {
        width: min(100% - 32px, 620px);
        padding-bottom: 88px;
    }

    .handbook-hero {
        padding: 54px 20px 100px;
    }

    .handbook-hero-inner {
        display: block;
    }

    .handbook-hero-visual {
        display: none;
    }

    .handbook-quick-nav {
        margin-bottom: 64px;
    }

    .handbook-quick-nav-list {
        grid-template-columns: 1fr;
    }

    .handbook-quick-nav-list li,
    .handbook-quick-nav-list li + li {
        border-left: 0;
        border-bottom: 1px solid var(--hb-border-light);
    }

    .handbook-quick-nav-list li:last-child {
        border-bottom: 0;
    }

    .handbook-quick-nav-link {
        min-height: 62px;
    }

    .handbook-quick-nav-list li:first-child
    .handbook-quick-nav-link {
        border-radius: 21px 21px 0 0;
    }

    .handbook-quick-nav-list li:last-child
    .handbook-quick-nav-link {
        border-radius: 0 0 21px 21px;
    }

    .handbook-contents {
        gap: 80px;
    }

    .handbook-section-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .handbook-section-count {
        display: none;
    }

    .handbook-section--div3 .handbook-card-grid,
    .handbook-section--div2 .handbook-card-grid,
    .handbook-section--divall .handbook-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .handbook-container {
        width: calc(100% - 24px);
    }

    .handbook-hero {
        padding: 42px 16px 88px;
    }

    .handbook-hero h1 {
        font-size: 2.65rem;
    }

    .handbook-hero-lead {
        font-size: 0.96rem;
        line-height: 1.75;
    }

    .handbook-hero-notice {
        align-items: flex-start;
        font-size: 0.72rem;
    }

    .handbook-disclaimer {
        gap: 12px;
        padding: 19px 17px;
        border-radius: 13px;
    }

    .handbook-disclaimer-icon {
        width: 21px;
        height: 21px;
    }

    .handbook-disclaimer-title {
        margin-bottom: 8px;
        font-size: 0.92rem;
    }

    .handbook-disclaimer-content p {
        font-size: 0.78rem;
        line-height: 1.7;
    }

    .handbook-section-header {
        gap: 14px;
    }

    .handbook-section-identity {
        display: block;
    }

    .handbook-section-number {
        display: block;
        margin-bottom: 8px;
    }

    .handbook-section-symbol {
        width: 40px;
        height: 40px;
    }

    .handbook-section-heading h2 {
        font-size: 1.5rem;
    }

    .handbook-section--div3 .handbook-card-grid,
    .handbook-section--div2 .handbook-card-grid {
        grid-template-columns: 1fr;
    }

    .handbook-section--divall .handbook-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .handbook-card {
        min-height: 218px;
        padding: 21px;
    }

    .handbook-section--divall .handbook-card {
        min-height: 160px;
        padding: 16px;
    }

    .handbook-section--divall .handbook-card-top {
        margin-bottom: 14px;
    }

    .handbook-section--divall .handbook-card-body h3 {
        font-size: 0.92rem;
    }

    .handbook-section--divall .handbook-card-body p {
        display: none;
    }
}

.handbook-checklist:empty {
    display: none;
}

.handbook-checklist {
    margin-bottom: 28px;
}

.handbook-checklist-heading {
    margin-bottom: 12px;
}

.handbook-checklist-heading h2 {
    margin: 0 0 5px;
    color: #303b43;
    font-size: 1.05rem;
}

.handbook-checklist-heading p {
    margin: 0;
    color: #757f86;
    font-size: 0.82rem;
    line-height: 1.6;
}

.handbook-checklist-list {
    overflow: hidden;
    border: 1px solid #e0e5e8;
    border-radius: 9px;
    background: #fff;
}

.handbook-checklist-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 14px;
    align-items: center;
    padding: 13px 15px;
    border-bottom: 1px solid #edf0f2;
    color: inherit;
    text-decoration: none;
}

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

.handbook-checklist-item:hover {
    background: #f7f9fa;
}

.handbook-checklist-item-content {
    min-width: 0;
}

.handbook-checklist-item-name {
    display: block;
    color: #354049;
    font-size: 0.88rem;
}

.handbook-checklist-item-detail {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: #7a8389;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.handbook-checklist-item-status {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.handbook-checklist-item.is-expired .handbook-checklist-item-status {
    background: #fff0f0;
    color: #c33f3f;
}

.handbook-checklist-item.is-soon .handbook-checklist-item-status {
    background: #fff6e7;
    color: #b66c00;
}

.handbook-checklist-item-arrow {
    position: relative;
    width: 18px;
    height: 18px;
}

.handbook-checklist-item-arrow::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-top: 2px solid #879097;
    border-right: 2px solid #879097;
    content: '';
    transform: translate(-65%, -50%) rotate(45deg);
}

@media (max-width: 600px) {
    .handbook-checklist-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .handbook-checklist-item-arrow {
        display: none;
    }
}
