/* 커스팅 프로그램 화면 소개 (intro.html) */

.intro-hero { padding: 76px 0 56px; }
.intro-hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -2.2px; line-height: 1.22; }
.intro-hero p { margin-top: 20px; max-width: 640px; font-size: 18.5px; color: var(--fog-2); line-height: 1.85; }

/* 장(챕터) 바로가기 */
.chapters {
    position: sticky; top: 68px; z-index: 50;
    background: rgba(15, 23, 42, .92); backdrop-filter: blur(10px);
    border-block: 1px solid rgba(255, 255, 255, .07);
}
.chapters ol { display: flex; gap: 4px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.chapters ol::-webkit-scrollbar { display: none; }
.chapters a {
    display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px;
    font-size: 14.5px; font-weight: 600; color: var(--fog); white-space: nowrap; border-bottom: 2px solid transparent;
}
.chapters a span { font-size: 12px; color: #5f6c84; font-variant-numeric: tabular-nums; }
.chapters a:hover { color: #fff; }
.chapters a[aria-current="true"] { color: #fff; border-bottom-color: var(--green); }

.chapter { padding: 96px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); scroll-margin-top: 120px; }
.chapter:nth-of-type(even) { background: var(--night-deep); }
.chapter-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 20px; max-width: 820px; margin-bottom: 44px; }
.chapter-no { grid-row: span 2; font-size: 15px; font-weight: 800; color: var(--green); padding-top: 12px; font-variant-numeric: tabular-nums; }
.chapter-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.3; }
.chapter-head p { margin-top: 12px; font-size: 17px; color: var(--fog); line-height: 1.8; }

/* 메인 화면 지도 */
.map { position: relative; }
.map img { width: 100%; height: auto; border-radius: 12px; border: 1px solid #33425e; }
.map .zone { position: absolute; border: 2px solid rgba(18, 200, 122, .85); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0); transition: background-color .2s; }
.map .zone.dim { border-color: rgba(18, 200, 122, .25); }
.map .pin {
    position: absolute; transform: translate(-50%, -50%);
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--green); color: var(--green-ink); font-weight: 800; font-size: 14px;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, .85);
}
.map-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 32px; list-style: none; }
.map-legend li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--rule); }
.map-legend b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); color: var(--green); font-size: 14px; border: 1px solid var(--rule); }
.map-legend h3 { font-size: 16.5px; font-weight: 800; }
.map-legend p { margin-top: 4px; font-size: 14.5px; color: var(--fog); line-height: 1.7; }
.map-legend li:hover b, .map-legend li:focus-within b { background: var(--green); color: var(--green-ink); }

/* 영역 확대 + 버튼 설명 */
.zoom { margin-top: 72px; }
.zoom + .zoom { margin-top: 64px; }
.zoom h3 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 12px; }
.zoom h3 b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: var(--green-ink); font-size: 13px; }
.zoom > p { margin-top: 8px; font-size: 16px; color: var(--fog); max-width: 760px; }
.zoom figure { margin-top: 20px; }
.zoom figure img { height: auto; border-radius: 10px; border: 1px solid #33425e; }

.btn-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 15px; }
.btn-table th { text-align: left; font-size: 13px; color: var(--fog); font-weight: 700; padding: 0 14px 10px 0; border-bottom: 1px solid var(--rule); }
.btn-table td { padding: 14px 14px 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: top; color: var(--fog-2); line-height: 1.7; }
.btn-table td:first-child { width: 190px; }
.btn-table td:last-child { color: var(--fog); width: 32%; }
.ui {
    display: inline-block; padding: 2px 9px; border-radius: 6px; border: 1px solid #4a5a78;
    background: #1e293b; color: #e2e8f0; font-size: 13.5px; font-weight: 600; white-space: nowrap; line-height: 1.6;
}
.ui.g { border-color: #10b981; color: #6ee7b7; }
.ui.y { border-color: #fbbf24; color: #fcd34d; }
.ui.p { border-color: #8b5cf6; color: #c4b5fd; }
.ui.o { border-color: #f97316; background: #c2410c; color: #fff; }
.ui.b { border-color: #3b82f6; color: #93c5fd; }
.ui.r { border-color: #ef4444; color: #fca5a5; }

/* 두 단 (설명 + 화면) */
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.split.flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.split.wide { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: center; }
.split.wide.flip { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.split.flip > :first-child { order: 2; }
.split + .split { margin-top: 88px; }
.split h3 { font-size: 24px; font-weight: 800; letter-spacing: -.6px; line-height: 1.4; }
.split h3 + p { margin-top: 10px; font-size: 16px; color: var(--fog); line-height: 1.8; }
.split figure img { height: auto; border-radius: 12px; border: 1px solid #33425e; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.steps-list { list-style: none; counter-reset: s; margin-top: 22px; }
.steps-list li { counter-increment: s; position: relative; padding: 0 0 18px 40px; font-size: 15.5px; color: var(--fog-2); line-height: 1.75; }
.steps-list li::before {
    content: counter(s); position: absolute; left: 0; top: 1px;
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: var(--panel-2); border: 1px solid var(--rule); font-size: 13px; font-weight: 800; color: var(--green);
}
.note { margin-top: 18px; padding: 14px 18px; border-radius: 10px; background: rgba(245, 179, 1, .07); border: 1px solid rgba(245, 179, 1, .25); font-size: 14.5px; color: #f5deb0; line-height: 1.75; }
.plain-list { list-style: none; margin-top: 18px; }
.plain-list li { padding: 12px 0; border-top: 1px solid var(--rule); font-size: 15px; color: var(--fog-2); line-height: 1.7; }
.plain-list li b { color: #fff; margin-right: 6px; }

/* 설정 탭 뷰어 */
.tabs { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
.tab-list { display: flex; flex-direction: column; gap: 2px; }
.tab-list button {
    text-align: left; padding: 16px 18px; border-radius: 10px; border: 1px solid transparent;
    display: grid; gap: 2px;
}
.tab-list button b { font-size: 16px; font-weight: 800; color: var(--fog-2); }
.tab-list button span { font-size: 13.5px; color: var(--fog); line-height: 1.6; }
.tab-list button:hover b { color: #fff; }
.tab-list button[aria-selected="true"] { background: var(--panel); border-color: var(--rule); }
.tab-list button[aria-selected="true"] b { color: #fff; }
.tab-list button[aria-selected="true"] b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: 8px; vertical-align: middle; }
.tab-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 32px; align-items: start; }
.tab-panel[hidden] { display: none; }
.tab-panel img { height: auto; border-radius: 12px; border: 1px solid #33425e; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.tab-panel .when { font-size: 13px; font-weight: 700; color: var(--green); }
.tab-panel h3 { margin-top: 6px; font-size: 21px; font-weight: 800; }
.tab-panel p { margin-top: 10px; font-size: 15px; color: var(--fog); line-height: 1.8; }

/* 그림 묶음 */
.gallery { display: grid; gap: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; margin-top: 36px; }
.gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery figure img { height: auto; border-radius: 10px; border: 1px solid #33425e; }
.gallery figcaption b { color: #fff; display: block; font-size: 15px; margin-bottom: 2px; }

.legend-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14.5px; }
.legend-table td { padding: 11px 12px 11px 0; border-top: 1px solid var(--rule); color: var(--fog-2); vertical-align: top; }
.legend-table td:first-child { width: 120px; }
.chip { display: inline-flex; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.chip b { font-weight: 800; opacity: .75; }
.chip.preset { background: rgba(99, 102, 241, .15); border-color: #6366f1; color: #c7d2fe; }
.chip.mine { background: rgba(16, 185, 129, .15); border-color: #10b981; color: #a7f3d0; }
.chip.custom { background: rgba(245, 158, 11, .15); border-color: #f59e0b; color: #fde68a; }
.chip.pending { background: rgba(100, 116, 139, .15); border-color: #64748b; color: #cbd5e1; }

/* 문제 해결 */
.trouble { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.trouble div { padding: 22px 0; border-top: 1px solid var(--rule); }
.trouble h3 { font-size: 17px; font-weight: 800; }
.trouble p { margin-top: 8px; font-size: 15px; color: var(--fog); line-height: 1.8; }

.intro-cta { padding: 96px 0; text-align: center; }
.intro-cta h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -1.2px; }
.intro-cta p { margin-top: 14px; font-size: 17px; color: var(--fog-2); }
.intro-cta .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }

@media (max-width: 1080px) {
    .split, .split.flip { grid-template-columns: 1fr; gap: 32px; }
    .split.flip > :first-child { order: 0; }
    .split.wide, .split.wide.flip { grid-template-columns: 1fr; }
    .tabs { grid-template-columns: 1fr; gap: 24px; }
    .tab-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .tab-list button { flex: 0 0 auto; padding: 10px 14px; }
    .tab-list button span { display: none; }
    .tab-panel { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .chapter { padding: 72px 0; }
    .chapter-head { grid-template-columns: 1fr; }
    .chapter-no { padding-top: 0; }
    .map-legend { grid-template-columns: 1fr; }
    .map .pin { width: 22px; height: 22px; font-size: 11px; box-shadow: 0 0 0 3px rgba(15, 23, 42, .85); }
    .map .zone { border-width: 1px; border-radius: 4px; }
    .btn-table thead { display: none; }
    .btn-table, .btn-table tbody, .btn-table tr, .btn-table td { display: block; width: 100% !important; }
    .btn-table tr { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
    .btn-table td { border: 0; padding: 3px 0; }
    .gallery, .gallery.two, .trouble { grid-template-columns: 1fr; }
    .zoom figure { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
    .zoom figure img { width: 920px; max-width: none; }
    .zoom figure::after { content: '좌우로 밀어서 보기'; display: block; margin-top: 6px; font-size: 12px; color: var(--fog); }
}
@media (max-width: 560px) {
    .chapters { top: 60px; }
    .intro-hero { padding: 52px 0 40px; }
    .intro-hero p { font-size: 16.5px; }
}
