@charset "UTF-8";

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: #f2f4f6;
    color: #191f28;
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; border: none; outline: none; }
img { display: block; max-width: 100%; }

/* ===== Layout ===== */
.page-wrap {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100dvh;
    background: #fff;
    position: relative;
}

.page-padding {
    padding: 0 20px;
}

/* ===== Typography ===== */
.t-hero    { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.35; }
.t-title   { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.4; }
.t-body    { font-size: 16px; font-weight: 400; line-height: 1.55; }
.t-caption { font-size: 13px; font-weight: 400; line-height: 1.5; }
.t-small   { font-size: 12px; font-weight: 400; }

.c-primary   { color: #191f28; }
.c-secondary { color: #4e5968; }
.c-tertiary  { color: #8b95a1; }
.c-accent    { color: #3182f6; }
.c-danger    { color: #f04452; }
.c-success   { color: #00c471; }

/* ===== Buttons ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: #191f28;
    color: #fff;
}
.btn-primary:hover { background: #333d4b; }

.btn-blue {
    background: #3182f6;
    color: #fff;
}
.btn-blue:hover { background: #1b64da; }

.btn-light {
    background: #f2f4f6;
    color: #4e5968;
}
.btn-light:hover { background: #e5e8eb; }

.btn-ghost {
    background: transparent;
    color: #4e5968;
}

.btn-sm {
    height: 40px;
    font-size: 14px;
    border-radius: 10px;
    width: auto;
    padding: 0 16px;
    display: inline-flex;
}

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f2f4f6;
}

.card-elevated {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
}

/* ===== Top Bar ===== */
.topbar {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
}
.topbar-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    margin-left: -8px;
}
.topbar-back:active { background: #f2f4f6; }
.topbar-back svg { width: 24px; height: 24px; }
.topbar-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    margin-right: 32px;
}

/* ===== Input ===== */
.input-field {
    width: 100%;
    height: 52px;
    background: #f2f4f6;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 16px;
    color: #191f28;
    transition: border-color 0.15s, background 0.15s;
}
.input-field:focus {
    background: #fff;
    border-color: #3182f6;
}
.input-field::placeholder { color: #adb5bd; }

/* ===== Badge / Chip ===== */
.chip {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}
.chip-blue  { background: #e8f3ff; color: #3182f6; }
.chip-green { background: #e8faf5; color: #00c471; }
.chip-red   { background: #fff0f0; color: #f04452; }
.chip-gray  { background: #f2f4f6; color: #6b7684; }
.chip-purple { background: #eef2ff; color: #6366f1; }

/* ===== Divider ===== */
.divider {
    height: 8px;
    background: #f2f4f6;
    margin: 0 -20px;
}
.divider-thin {
    height: 1px;
    background: #f2f4f6;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #333d4b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Bottom Fixed ===== */
.bottom-fixed {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.4s ease-out both;
}
.fade-up {
    animation: fadeUp 0.5s ease-out both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* stagger */
.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }
.delay-4 { animation-delay: 0.24s; }
.delay-5 { animation-delay: 0.3s; }

/* ===== Skeleton ===== */
.skeleton {
    background: linear-gradient(90deg, #f2f4f6 25%, #e5e8eb 50%, #f2f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* ===== Loading Dots ===== */
.loading-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.loading-dots span {
    width: 6px;
    height: 6px;
    background: #8b95a1;
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== Overlay ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Bottom Sheet ===== */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 300;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bottom-sheet.active {
    transform: translateX(-50%) translateY(0);
}
.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #d1d6db;
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* ===== Profile Circle ===== */
.profile-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f2f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
}
.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-circle-lg {
    width: 80px;
    height: 80px;
    font-size: 36px;
}

/* ===== Stat Row ===== */
.stat-row {
    display: flex;
    gap: 0;
}
.stat-item {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    position: relative;
}
.stat-item + .stat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    background: #e5e8eb;
}
.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #191f28;
    margin-bottom: 2px;
}
.stat-label {
    font-size: 12px;
    color: #8b95a1;
    font-weight: 500;
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
