/* ============================================================
   ?댄깭?먰쉶以?怨듯넻 ?ㅽ???(itw-common.css)
   ============================================================ */

:root {
    --bg: #f5f4f0;
    --surface: #ffffff;
    --surface-rgb: 255, 255, 255;
    --border: #dcdad2;
    /* Slightly darker for better visibility in light mode */
    --border-light: #eceae4;
    --text: #1a1916;
    --text-muted: #7a7872;
    --accent: #1a3a5c;
    --accent-rgb: 26, 58, 92;
    --accent-bg: #eef3f9;
    --green: #1e7e34;
    --green-bg: #eafaf1;
    --orange: #d35400;
    --orange-bg: #fef5ec;
    --red: #c0392b;
    --red-bg: #fdf0ef;
    --blue: #2471a3;
    --blue-bg: #eaf4fb;
    --purple-bg: #f5eef8;
    --yellow-bg: #fff3cd;
    --grey-bg: #f5f4f0;


    /* 吏??퀎 釉뚮옖??而щ윭 */
    --c-yongsan: #c0392b;
    --c-itw2: #d35400;
    --c-itw1: #7d6608;
    --c-bogwang: #27ae60;
    --c-dongbing: #2471a3;
    --c-hannam-s: #6c3483;
    --c-hannam-n: #9b59b6;
    --c-etc: #1a5276;
    --c-redev: #616a6b;
    --c-hold: #b2bec3;

    --font-main: 'Noto Sans KR', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --header-h: 52px;
    --tabbar-h: 64px;

    --bg-faint: #f8f7f2;
    --visited: var(--green);

    /* ?? [DESIGN SYSTEM] UI 媛꾧꺽 諛??쇱슫???쒖???(6px Grid) ?? */
    --space-xs: 6px;
    --space-sm: 12px;
    --space-md: 18px;
    --space-lg: 24px;
    --space-xl: 36px;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

/* ?? [DARK MODE CONFIG] ?쒖뒪??諛??섎룞 ?ㅽ겕 紐⑤뱶 ????? */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121212;
        --surface: #1e1e1e;
        --surface-rgb: 30, 30, 30;
        --border: #333333;
        --border-light: #2a2a2a;
        --text: #ffffff;
        --text-muted: #aaaaaa;
        --accent: #5482ab;
        --accent-bg: #1a2a3a;
        --bg-faint: #1a1a1a;
        --visited: #81c784;

        /* 다크모드 배경색 보정 */
        --accent-bg: #1a2a3a;
        --green-bg: #143a20;
        --red-bg: #3a1a1a;
        --orange-bg: #3a2a14;
        --blue-bg: #1a2f3a;
        --purple-bg: #2a1a3a;
        --yellow-bg: #2a2514;
        --grey-bg: #2a2a2a;
    }


    :root:not([data-theme="light"]) .itw-skeleton {
        background: linear-gradient(90deg,
                rgba(255, 255, 255, 0.03) 25%,
                rgba(255, 255, 255, 0.08) 50%,
                rgba(255, 255, 255, 0.03) 75%);
        background-size: 200% 100%;
    }
}

html[data-theme="dark"] {
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-rgb: 30, 30, 30;
    --border: #333333;
    --border-light: #2a2a2a;
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --accent: #5482ab;
    --accent-bg: #1a2a3a;
    --bg-faint: #1a1a1a;
    --visited: #81c784;

    /* 다크모드 배경색 보정 */
    --accent-bg: #1a2a3a;
    --green-bg: #143a20;
    --red-bg: #3a1a1a;
    --orange-bg: #3a2a14;
    --blue-bg: #1a2f3a;
    --purple-bg: #2a1a3a;
    --yellow-bg: #2a2514;
    --grey-bg: #2a2a2a;
}


html[data-theme="dark"] .itw-skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
}

/* ?ㅽ겕紐⑤뱶 ??묒? theme.js?먯꽌 data-theme="dark" ?띿꽦???듯빐 ?쒖뼱?섎ŉ, 
   ?쒖뒪???ㅼ젙(prefers-color-scheme)???④퍡 媛먯??섏뿬 怨좊?鍮꾨? ?좎??⑸땲?? */

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

html,
body {
    overflow-x: hidden;
    width: 100%;
}


body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    font-size: 14px;
    min-height: 100vh;
    min-height: 100svh;
    /* Fallback for iOS Safari */
    min-height: 100dvh;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    /* iOS Safari smooth scrolling */
    -webkit-overflow-scrolling: touch;
}

/* [iOS Optimization] Targeted fixes for WebKit engine */
@supports (-webkit-touch-callout: none) {

    /* Prevent address bar layout shifts */
    .itw-mobile {
        height: 100%;
        height: -webkit-fill-available;
    }

    input,
    textarea,
    select {
        /* Set minimum height for inputs to prevent default styling issues */
        min-height: 44px;
        /* Disable automatic zoom in on input focus if font-size < 16px */
        font-size: 16px !important;
    }

    /* Minimize heavy graphic overheads on iOS */
    .itw-hd,
    .itw-tabbar,
    .group-card,
    .modal {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    }

    /* Avoid nested fixed layouts rendering glitches */
    body.is-auth-view .login-wrap {
        position: absolute;
    }
}

/* ?? ?꾩뿭 ?명꽣?숈뀡 理쒖쟻???? */
button,
.itw-hd-btn,
.itw-hd-nav-btn,
.itw-tab,
.itw-action-btn,
.modal-save,
.modal-cancel,
.itw-hd-badge,
.qh-btn,
.rf-btn,
.sort-btn,
.place-chip,
.type-card,
label, 
button, 
a, 
.itw-hd-btn, 
.itw-hd-nav-btn, 
.itw-tab, 
.dist-nav-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* [Touch Optimization] Remove 300ms delay and prevent double-tap zoom on buttons */
    touch-action: manipulation;
}

/* [UX] Improved visual feedback for touch */
button:active,
.itw-hd-btn:active,
.itw-hd-nav-btn:active,
.itw-tab:active,
.itw-action-btn:active,
.qh-btn:active,
.rf-btn:active,
.dist-nav-btn:active {
    opacity: 0.7;
    transform: scale(0.95);
    transition: transform 0.05s; /* Speed up from 0.1s */
}

/* ?낅젰 ?꾨뱶留뚯? ?좏깮 媛?ν븯寃?蹂댁옣 */
input,
textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

/* ?? 源붾걫???ㅽ겕濡ㅻ컮 ?? */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 99px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* ?뱀뀡 ?쇰꺼 (怨듯넻) */
.section-label {
    padding: var(--space-sm) var(--space-xs) 0;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.admin-only {
    display: none !important;
}

/* 愿由ъ옄 沅뚰븳 ???쒖떆 濡쒖쭅 */
body.is-admin .admin-only {
    display: block !important;
}

/* 踰꾪듉, 留곹겕, ?띿뒪???쇰꺼 ?깆? ?몃씪???뚮젆?ㅻ줈 泥섎━?섏뿬 ?꾩씠肄섍낵 ?띿뒪???뺣젹 ?좎? */
body.is-admin button.admin-only,
body.is-admin a.admin-only,
body.is-admin span.admin-only,
body.is-admin label.admin-only,
body.is-admin i.admin-only {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

/* ?? ACTION BUTTONS ?? */
.itw-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs);
    border-radius: 8px;
    transition: background .2s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}

.itw-action-btn:active {
    background: var(--bg);
    transform: scale(0.95);
}

.itw-action-btn.edit svg {
    stroke: var(--blue);
}

.itw-action-btn.copy svg {
    stroke: var(--orange);
}

.itw-action-btn.del svg {
    stroke: var(--red);
}

/* ?? HEADER ?? */
.itw-hd {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1560;
    /* ??컮(1550), ?먮뵒??1540)蹂대떎 ?믨쾶 ?ㅼ젙 */
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-top: env(safe-area-inset-top, 0px);
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
}

.itw-hd-hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

.itw-hd-inner {
    height: var(--header-h);
    overflow: hidden;
}

.itw-hd-default {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 var(--space-xs);
    /* ?쒕ぉ 援ъ뿭 ?곗륫 ?щ갚??踰꾪듉?ㅼ씠 ?먯뿰?ㅻ읇寃?梨꾩슦?꾨줉 ?섏젙 */
    height: var(--header-h);
    gap: var(--space-xs);
}

.itw-hd-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.itw-hd-title {
    flex: 1;
    min-width: 0;
    max-width: 85%;
    /* ?쒕ぉ??吏?섏튂寃?湲몄뼱 ?곗륫 踰꾪듉???붾㈃ 諛뽰쑝濡?諛?대궡???꾩긽 諛⑹?. 援ъ뿭 ?곸꽭??寃쎌슦 醫뚯슦 踰꾪듉???덉쑝誘濡??щ갚?????섎┝ */
    text-align: left;
    font-size: clamp(16px, 4.6vmin, 18px);
    /* ?고듃 ?ъ씠利?誘몄꽭 議곗젙 */
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.itw-hd-title a {
    color: var(--text);
    text-decoration: none;
}

.itw-hd-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
    flex: none;
    flex-shrink: 0;
    min-width: 0;
    height: 100%;
}



.itw-hd-btn {
    font-size: clamp(11.5px, 3.4vmin, 13px);
    color: var(--accent);
    padding: 0 14px;
    border-radius: 99px;
    background: var(--accent-bg);
    border: 1.5px solid var(--accent);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    height: 34px;
    min-width: 34px;
    box-sizing: border-box;
}

.itw-hd-btn.icon-only {
    padding: 0;
    width: 34px;
}

.itw-hd-btn:active {
    opacity: 0.7;
    transform: scale(0.96);
}

/* ?ㅻ퉬寃뚯씠?섏슜 ?꾩씠肄?踰꾪듉 (?ㅻ줈媛€湲? ?ㅼ젙 ?? */
.itw-hd-nav-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.itw-hd-nav-btn:active {
    background: var(--bg);
}

.itw-hd-nav-btn svg {
    width: 22px;
    height: 22px;
}

/* ── District Navigation Buttons (Header) ── */
.itw-hd-dist-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.dist-nav-btn {
    background: none;
    border: none;
    color: var(--text);
    /* Increase touch hit area to 44x44px minimum */
    padding: 10px 18px; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.dist-nav-btn:active {
    background: var(--bg-faint);
    transform: scale(0.92);
}

.dist-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 3;
}

.dist-nav-btn:disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* ?? TABBAR ?? */
.itw-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tabbar-h);
    background: var(--surface);
    z-index: 1550;
    /* ?먮뵒??1540)蹂대떎 ?믨퀬 ?ㅻ뜑(1560)蹂대떎 ??쓬 */
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.itw-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 500;
    padding-top: 8px;
    position: relative;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    -webkit-user-select: none;
    user-select: none;
    /* [Touch Optimization] Instant feedback */
    touch-action: manipulation;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease, opacity 0.1s ease;
}

.itw-tab:active {
    transform: scale(0.9);
    opacity: 0.7;
}

.itw-tab.active {
    color: var(--accent);
}

.itw-tab svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

/* ?? TABBAR BADGE ?? */
/* ✨ [DESIGN] Tabbar Icon Wrapper for Badge Positioning */
.tab-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ✅ [UX] Tabbar Badge - Optimized for Visual Balance (Matched to Capture) */
.itw-tab-badge,
.tab-badge {
    position: absolute;
    top: -5px;
    /* 아이콘을 살짝 가리도록 위로 밀착 */
    right: -7px;
    /* 아이콘을 살짝 가리도록 안쪽으로 조절 */
    min-width: 17px;
    height: 17px;
    background: #ff3b30;
    /* 캡처와 유사한 선명한 Red-Orange */
    color: #ffffff;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 1.5px solid var(--surface);
    /* 흰색 보더로 아이콘과 분리 (캡처 느낌) */
    z-index: 10;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}


/* ?? RESPONSIVE: TABLET & DESKTOP (600px+) ?? */
@media (min-width: 600px) {
    body {
        padding-bottom: 0 !important;
        padding-left: 80px !important;
        background-color: var(--bg-faint);
    }

    .itw-hd {
        padding-top: 0;
        left: 80px !important;
        width: calc(100% - 80px) !important;
    }

    .itw-hd-inner {
        max-width: 100%;
        margin: 0;
    }

    .itw-tabbar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 80px;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
        border-top: none;
        border-right: 1px solid var(--border);
        z-index: 1570;
    }

    .itw-tab {
        flex: none;
        height: 72px;
        padding-top: 0;
    }

    .itw-tab.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 15%;
        bottom: 15%;
        width: 4px;
        background: var(--accent);
        border-radius: 0 4px 4px 0;
    }

    .itw-tab-badge,
    .tab-badge {
        right: -6px;
        /* Desktop side-nav tucked in position */
        top: -4px;
    }

    /* ?깆썝/沅뚰븳 愿由?紐⑤떖 ??紐⑤떖 ?쒖뒪???곗뒪?ы넲 ???*/
    .modal-overlay {
        align-items: center;
        padding: 40px 20px;
    }

    .modal {
        max-width: 500px;
        border-radius: 28px;
        max-height: 85vh;
        /* ?곗뒪?ы넲? vh濡?異⑸텇 */
        animation: modalFadeIn .3s ease;
        padding-bottom: 24px;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ???뱀뀡 湲곕낯 ?ㅽ???*/
.tab-section {
    display: none;
}

/* ?? 怨듯넻 ?ㅻ쾭?덉씠 ?? */
.itw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
}

.itw-overlay.open {
    display: flex;
}

.itw-sheet {
    background: var(--surface);
    border-radius: 24px;
    padding: 24px;
    width: calc(100% - 32px);
    max-width: 480px;
    animation: modalPop .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.itw-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

/* ?? 怨듯넻 紐⑤떖 (Modal System) ?? */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal-overlay.open {
    display: flex;
}

/* [UX Fix] Mobile Keyboard Covering Issue:
   Move modal to top when an input is focused to keep it visible above the keyboard. */
.modal-overlay.keyboard-open {
    align-items: flex-start !important;
    padding-top: 20px;
    padding-top: env(safe-area-inset-top, 20px);
}

.itw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.itw-modal-overlay.open {
    display: flex;
}

/* 紐⑤떖 ?ㅽ뵂 ???덉씠???곗꽑?쒖쐞 媛뺤젣 議곗젙 (?대퉬寃뚯씠??媛由?諛⑹?) */
.modal-overlay.open {
    z-index: 10000 !important;
}

.itw-modal-overlay.open {
    z-index: 11000 !important;
}

/* 紐⑤떖???쒖꽦?붾맂 寃쎌슦 ?ㅻⅨ 怨좎젙 ?섎━癒쇳듃?ㅼ쓽 ?곗꽑?쒖쐞瑜???땄 */
body.itw-modal-open .itw-hd {
    z-index: 1000 !important;
}

/* 紐⑤떖 ?ㅽ뵂 ??蹂몃Ц ?ㅽ겕濡?諛⑹? */
body.itw-modal-open {
    overflow: hidden !important;
    /* position: fixed; 제거: 화면 튐 방지 */
}

.modal {
    background: var(--surface);
    border-radius: 24px;
    padding: 24px;
    width: calc(100% - 32px);
    max-width: 480px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    animation: modalPop .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -ms-overflow-style: auto;
}

/* Chrome, Safari, Opera 留욎땄???ㅽ겕濡ㅻ컮 */
.modal::-webkit-scrollbar {
    display: block;
    width: 4px;
    /* 留ㅼ슦 ?뉗? ?먭퍡 */
}

.modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
    opacity: 0.5;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ?? Centered Popups (Alert/Confirm) ?? */
.alert-modal,
.confirm-modal {
    margin: 0 !important;
    padding-bottom: 24px !important;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.modal-title {
    font-size: clamp(16px, 4.8vmin, 20px);
    font-weight: 700;
    margin-bottom: 16px;
}

.form-field {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ?? 紐⑤떖 蹂댁“ ?ㅽ???(?듯빀 援ъ뿭 愿由ъ슜) ?? */
.modal-note-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 24px 0 12px;
    padding-left: 4px;
    border-left: 3px solid var(--accent);
}

.op-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: center;
}

.op-history-table thead {
    background: var(--bg);
    color: var(--text-muted);
}

.op-history-table th,
.op-history-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-light);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.progress-pct {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent);
}

.progress-bar-bg {
    background: var(--bg-faint);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width .3s;
}

.progress-legend {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.prog-leg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.prog-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}



.form-input {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    -webkit-user-select: auto;
    user-select: auto;
    transition: border-color .15s;
    background: var(--surface);
    color: var(--text);
}

.form-input:focus {
    border-color: var(--accent);
}

.form-input:disabled {
    background: var(--bg);
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-save {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
    min-height: 50px;
    /* 紐⑤컮???곗튂 ?寃?理쒖냼 ?믪씠 蹂댁옣 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.1s, opacity 0.1s;
}

.modal-save:active {
    transform: scale(0.97);
    opacity: 0.85;
    background: var(--accent);
    /* ?쒖꽦 ?곹깭 ?됱긽 ?좎? ?뱀? 誘몄꽭 議곗젙 */
}

.modal-cancel {
    width: 100%;
    padding: 12px;
    background: none;
    color: var(--text-muted);
    border: none;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    margin-top: 6px;
}

/* Modal Enhancements */
.modal-footer-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-bottom: 12px;
    /* ?щ갚 ?뺣? */
}

.modal-footer-row .modal-save {
    flex: 2;
    margin-top: 0;
}

.modal-footer-row .modal-cancel {
    flex: 1;
    margin-top: 0;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-weight: 600;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

/* ?? Skeleton Loading (CLS Optimization) ?? */
.itw-skeleton {
    background: linear-gradient(90deg,
            rgba(26, 58, 92, 0.05) 25%,
            rgba(26, 58, 92, 0.12) 50%,
            rgba(26, 58, 92, 0.05) 75%);
    background-size: 200% 100%;
    animation: itwSkeleton 1.5s infinite linear;
    border-radius: 12px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
    min-height: 20px;
}

@keyframes itwSkeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ?? 鍮꾨?踰덊샇 ?낅젰 ?꾨뱶 蹂댁엫/?④? ?좉? (怨듯넻) ?? */
.pw-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.pw-input-wrapper .form-input {
    padding-right: 44px;
    /* ?좉? 踰꾪듉 怨듦컙 ?뺣낫 */
}

.pw-toggle {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.pw-toggle:active {
    background: var(--accent-bg);
    color: var(--accent);
}

.pw-rule-notice {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--accent-bg);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

html[data-theme="dark"] .pw-rule-notice {
    background: rgba(255, 255, 255, 0.05);
}

/* ?? [COMMON UI] Toast Notification ?? */
.itw-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(33, 33, 33, 0.95);
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    z-index: 12000 !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.itw-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.itw-toast-icon {
    font-size: 18px;
}

/* ── 동기화 상태 도트 (Header) ── */
.sync-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    background: #bbb;
    transition: all 0.3s;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.sync-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.6);
}

.sync-dot.cache {
    background: #f39c12;
}

.sync-dot.offline {
    background: #e74c3c;
}

.sync-dot.syncing {
    animation: itwSyncPulse 1s infinite alternate;
}

@keyframes itwSyncPulse {
    from {
        opacity: 0.4;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ── [DESIGN] Premium Cookie Consent Banner ── */
.itw-cookie-banner {
    position: fixed;
    bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    width: calc(100% - 32px);
    max-width: 460px;
    z-index: 10000;
    background: rgba(var(--surface-rgb), 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%) translateY(150%);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.itw-cookie-banner.show {
    transform: translateX(-50%) translateY(0);
}

.itw-cookie-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.itw-cookie-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.itw-cookie-text {
    flex: 1;
    min-width: 0;
}

.itw-cookie-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.itw-cookie-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: keep-all;
}

.itw-cookie-actions {
    display: flex;
    flex-shrink: 0;
}

.itw-cookie-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.itw-cookie-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* 태블릿/데스크탑 대응: 중앙 정렬 유지 */
@media (min-width: 600px) {
    .itw-cookie-banner {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(150%);
        bottom: 24px;
    }
    .itw-cookie-banner.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* Pill-shaped buttons */
button, .qa-btn, .map-btn, .action-btn, .submit-btn, .cancel-btn, .primary-btn {
    border-radius: 99px !important;
}
/* Map button active state */
.map-btn.active {
    background: var(--primary, #000) !important;
    color: #fff !important;
}
.map-btn.active svg {
    stroke: #fff !important;
}
