﻿/* ?? ?섏쓽 遊됱궗 ?섏씠吏 ?ㅽ????? */
:root {
    --bg: #f5f4f0;
    --surface: #ffffff;
    --border: #e8e6e0;
    --text: #1a1916;
    --text-muted: #7a7872;
    /* itw-common?먯꽌 accent???뺤쓽?섏뼱 ?덉쓣 寃껋씠吏留?myservice???먯껜?곸쑝濡쒕룄 ?뺤쓽 ??*/
    --accent: #1a3a5c;
    --green: #1e7e34;
    --green-bg: #eafaf1;
    --orange: #d35400;
    --orange-bg: #fef5ec;
    --purple: #8e44ad;
    --purple-bg: #f5eef8;
    --red: #c0392b;
    --red-bg: #fdf0ef;
    --blue: #2471a3;
}

/* ?? ?쒕툕 ???? */
.sub-tabs {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    padding: 0 12px;
}

.sub-tab {
    flex: 1;
    padding: 12px 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-align: center;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}

.sub-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

/* ?? ?뱀뀡 怨듯넻 ?? */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* ?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧
 1. 遊됱궗 ?쒓컙 ?뱀뀡
?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧 */
.hours-hero {
    margin: 12px 14px 12px;
    background: var(--accent);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hours-hero::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.hours-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hours-month {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 6px;
}

.hours-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(36px, 12vmin, 52px);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 4px;
}

.hours-unit {
    font-size: 16px;
    opacity: 0.7;
}

.hours-goal {
    font-size: 12px;
    opacity: 0.65;
    margin-top: 8px;
}

.hours-goal-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.hours-goal-fill {
    height: 100%;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.8);
}

.month-summary-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ms-stat {
    text-align: center;
    flex: 1;
}

.ms-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(17px, 5.5vmin, 22px);
    font-weight: 700;
    line-height: 1;
}

.ms-label {
    font-size: 10.5px;
    opacity: 0.75;
    margin-top: 4px;
}

.hours-log-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 14px 8px;
    letter-spacing: 0.3px;
}

.hours-log {
    margin: 12px 14px 0;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.hours-log-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.hours-log-item:last-child {
    border-bottom: none;
}

.log-date-badge {
    background: var(--bg);
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    min-width: 44px;
    flex-shrink: 0;
}

.log-date-d {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(15px, 4.8vmin, 20px);
    font-weight: 600;
    line-height: 1.1;
}

.log-date-m {
    font-size: 10px;
    color: var(--text-muted);
}

.log-info {
    flex: 1;
}

.log-type {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.log-place {
    font-size: 12px;
    color: var(--text-muted);
}

.log-hours {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
}

.hours-add {
    margin: 12px 14px 0;
    width: calc(100% - 28px);
    padding: 13px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* 遊됱궗 ?좏삎蹂??붿빟 */
.hours-type-summary {
    margin: 12px 14px 0;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.hts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
}

.hts-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.hts-total {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.hts-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
}

.hts-icon {
    font-size: 17px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.hts-label {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
}

.hts-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.hts-hours {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
}

/* ?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧
 2. ?щ갑 ?뱀뀡
?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧 */
.revisit-add {
    margin: 12px 14px 0;
    width: calc(100% - 28px);
    padding: 13px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ?뺣젹 諛?*/
.sort-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-bar-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.sort-btns {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sort-btns::-webkit-scrollbar {
    display: none;
}

.sort-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.sort-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ?꾪꽣 諛?*/
.revisit-filter {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.revisit-filter::-webkit-scrollbar {
    display: none;
}

.rf-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
    white-space: nowrap;
}

.rf-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ?щ갑 紐⑸줉 */
.revisit-list {
    margin: 12px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.revisit-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .15s;
}

.revisit-card:active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.revisit-card-top {
    display: flex;
    align-items: flex-start;
}

.revisit-color-bar {
    width: 4px;
    align-self: stretch;
    flex-shrink: 0;
}

.revisit-body {
    flex: 1;
    padding: 12px 14px;
}

.revisit-name {
    font-size: clamp(14px, 4vmin, 16px);
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 4px;
}

.revisit-addr {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.revisit-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.revisit-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.revisit-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.revisit-meta {
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
}

.revisit-next {
    font-size: 12px;
    font-weight: 600;
}

.revisit-next.soon {
    color: var(--red);
}

.revisit-next.upcoming {
    color: var(--orange);
}

.revisit-next.ok {
    color: var(--green);
}

.revisit-last {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.revisit-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.revisit-empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

/* ?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧
 3. ?깃꼍怨듬? ?뱀뀡
?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧?먥븧 */
.study-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 14px 0;
}

.study-sum-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px;
}

.study-sum-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(24px, 7.5vmin, 32px);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 4px;
}

.study-sum-label {
    font-size: 11px;
    color: var(--text-muted);
}

.study-add-btn {
    margin: 12px 14px 0;
    width: calc(100% - 28px);
    padding: 13px;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.study-list {
    margin: 12px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.study-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
}

.study-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.study-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.study-info {
    flex: 1;
}

.study-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.study-book {
    font-size: 12px;
    color: var(--text-muted);
}

.study-progress-wrap {
    padding: 0 14px 14px;
}

.study-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.study-progress-bar-bg {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.study-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--purple);
}

.study-meta {
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
}

.study-next-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.study-lesson {
    font-size: 11px;
    color: var(--text-muted);
}

.study-status-badge {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
}

/* ?€?€ 紐⑤떖 ?€?€ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: 24px;
    padding: 28px 24px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

@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: 17px;
    font-weight: 700;
    margin-bottom: 14px;
}

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

.form-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
}

.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;
}

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

.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: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
    transition: background .15s, transform .1s;
}

.modal-save:active {
    transform: scale(0.98);
}

.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;
}

/* 빠른 시간 선택 */
.quick-hours {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.qh-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
}

.qh-btn.sel {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* 장소 추천 칩 */
.place-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.place-chip {
    padding: 5px 11px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
    white-space: nowrap;
}

.place-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 봉사 유형 선택 카드 */
.type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 2px;
}

.type-card {
    padding: 10px 10px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.type-card.sel {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
}

.type-card-icon {
    font-size: 18px;
}

/* 수정/삭제 액션 스타일 */
.revisit-meta-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.revisit-actions {
    display: flex;
    gap: 4px;
}

.itw-action-btn:hover {
    background: var(--bg);
}

.log-hours-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* ── [SECURITY] 시스템 다크 모드 강제 고대비 스타일 ── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #121212 !important;
        --surface: #1e1e1e !important;
        --bg-faint: #252525 !important;
        --border: #333333 !important;
        --text: #ffffff !important;
        --text-muted: #aaaaaa !important;
    }

    :root:not([data-theme="light"]) body.itw-mobile {
        background-color: #121212 !important;
        color: #ffffff !important;
    }

    :root:not([data-theme="light"]) .stat-card,
    :root:not([data-theme="light"]) .log-item,
    :root:not([data-theme="light"]) .revisit-item,
    :root:not([data-theme="light"]) .modal,
    :root:not([data-theme="light"]) .type-card,
    :root:not([data-theme="light"]) .qh-btn,
    :root:not([data-theme="light"]) .place-chip {
        background-color: #1e1e1e !important;
        border-color: #333333 !important;
    }

    :root:not([data-theme="light"]) .stat-label,
    :root:not([data-theme="light"]) .log-title,
    :root:not([data-theme="light"]) .revisit-address,
    :root:not([data-theme="light"]) .modal-title,
    :root:not([data-theme="light"]) .form-label,
    :root:not([data-theme="light"]) .type-card:not(.sel),
    :root:not([data-theme="light"]) .qh-btn:not(.sel) {
        color: #ffffff !important;
    }

    :root:not([data-theme="light"]) .stat-value,
    :root:not([data-theme="light"]) .stat-unit {
        color: var(--accent) !important;
    }

    :root:not([data-theme="light"]) .log-meta,
    :root:not([data-theme="light"]) .revisit-meta,
    :root:not([data-theme="light"]) .log-memo,
    :root:not([data-theme="light"]) .qh-btn:not(.sel),
    :root:not([data-theme="light"]) .place-chip {
        color: #aaaaaa !important;
    }

    :root:not([data-theme="light"]) .log-item:active,
    :root:not([data-theme="light"]) .revisit-item:active,
    :root:not([data-theme="light"]) .type-card:active {
        background-color: #252525 !important;
    }

    :root:not([data-theme="light"]) .form-input,
    :root:not([data-theme="light"]) .modal-textarea {
        background-color: #252525 !important;
        border-color: #444 !important;
        color: #ffffff !important;
    }

    :root:not([data-theme="light"]) .itw-skeleton {
        background: linear-gradient(90deg, #252525 25%, #333 50%, #252525 75%) !important;
        background-size: 200% 100% !important;
    }
}