/* ========================================================
   MapleStory Character Selector - White & Orange Theme
   ======================================================== */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-card-selected: #fff7ed;
    --border-color: #e2e8f0;
    --border-highlight: rgba(249, 115, 22, 0.5);

    --primary: #f97316;       /* Maple Orange */
    --primary-hover: #ea580c;
    --primary-glow: rgba(249, 115, 22, 0.25);

    --gold: #d97706;          /* Accent Warm Amber */
    --gold-glow: rgba(217, 119, 6, 0.2);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --success: #10b981;
    --error: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 10px 25px -5px rgba(249, 115, 22, 0.2);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    zoom: 0.88;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(249, 115, 22, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #ffffff 0%, var(--bg-main) 100%);
    background-attachment: fixed;
    padding-bottom: 90px;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
}

/* ========================================================
   Header Section
   ======================================================== */
.main-header {
    margin-bottom: 28px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 10px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.16));
}

.logo-icon {
    font-size: 2.4rem;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--primary);
    text-transform: uppercase;
}

h1 {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0f172a 45%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 680px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
}
.status-idle {
    background: #f1f5f9;
    color: var(--text-secondary);
    border-color: #cbd5e1;
}
.status-success {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}
.status-error {
    background: #fef2f2;
    color: var(--error);
    border-color: #fecaca;
}

/* ========================================================
   Card & API Key Panel
   ======================================================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-text-action:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* Guide box */
.guide-box {
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    animation: fadeIn 0.25s ease-out;
}
.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.step-num {
    background: var(--primary);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.guide-step a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.guide-step a:hover {
    text-decoration: underline;
}

/* Input group */
.input-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 1.2rem;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 46px 14px 44px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.btn-icon {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-icon:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ea580c 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: #fff7ed;
    border-color: rgba(249, 115, 22, 0.4);
    color: var(--primary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(249, 115, 22, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    font-size: 0.88rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-chip {
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-chip:hover {
    background: rgba(249, 115, 22, 0.18);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-chip-secondary {
    background: #f8fafc;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-chip-secondary:hover {
    color: var(--text-primary);
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ========================================================
   Filter & Search Bar
   ======================================================== */
.filter-section {
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-out;
}

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}
.search-box i.ph-magnifying-glass {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}
.search-box input {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 38px 12px 40px;
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: var(--transition);
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.btn-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}
.btn-clear:hover {
    color: var(--text-primary);
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.select-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}
.select-wrapper select {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 36px 12px 38px;
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}
.select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.8rem;
}

.list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 0 4px;
}
.count-text strong {
    color: var(--primary);
}

.badge-pill {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ========================================================
   Character Grid & Cards
   ======================================================== */
.character-container {
    min-height: 300px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    animation: fadeIn 0.3s ease-out;
}

/* Character Card */
.character-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.character-card:hover {
    background: var(--bg-card);
    border-color: rgba(249, 115, 22, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -6px rgba(249, 115, 22, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
}

.character-card.selected {
    background: #fffbf5;
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.22), 0 0 0 1px var(--primary);
}

.selected-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.6);
    opacity: 0;
    transform: scale(0.6);
    transition: var(--transition);
}
.character-card.selected .selected-indicator {
    opacity: 1;
    transform: scale(1);
}

.card-top-badges {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

/* World Filter Tabs (MapleStory World Icons) */
.world-filter-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.world-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 14px;
    background: #ebf2f8;
    border: 1px solid #dce6f0;
    border-radius: 6px;
    color: #475569;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.world-tab-btn:hover {
    background: #dfeaf4;
    border-color: #c5d6e8;
    color: #1e293b;
}

.world-tab-btn.active {
    background: #506fc3;
    border-color: #4562b2;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(80, 111, 195, 0.28);
}

.world-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    image-rendering: pixelated;
    flex-shrink: 0;
    vertical-align: middle;
}

/* World Badges */
.world-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    letter-spacing: -0.01em;
}
.world-scania    { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.world-luna      { background: #e0f2fe; color: #0284c7; border: 1px solid #7dd3fc; }
.world-elysium   { background: #fef3c7; color: #d97706; border: 1px solid #fcd34d; }
.world-croa      { background: #d1fae5; color: #059669; border: 1px solid #6ee7b7; }
.world-aurora    { background: #f3e8ff; color: #9333ea; border: 1px solid #d8b4fe; }
.world-bera      { background: #e0e7ff; color: #4f46e5; border: 1px solid #a5b4fc; }
.world-default   { background: #ebf2f8; color: #475569; border: 1px solid #cbd5e1; }

/* Level Badge */
.level-badge {
    font-size: 0.78rem;
    font-weight: 800;
    background: #fff7ed;
    color: #ea580c;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(249, 115, 22, 0.35);
}

/* Avatar Frame */
.avatar-frame {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, rgba(249, 115, 22, 0.14) 0%, #fff7ed 70%);
    border: 1.5px solid rgba(249, 115, 22, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.character-card:hover .avatar-frame {
    border-color: rgba(249, 115, 22, 0.45);
}

.character-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
    transition: transform 0.25s ease, opacity 0.25s ease;
    image-rendering: pixelated;
}

.character-avatar:not([src^="data:"]) {
    transform: scale(4.85);
    transform-origin: 47.5% 52.6%;
}

.character-avatar.avatar-loaded {
    animation: avatarFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes avatarFadeIn {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.character-card:hover .character-avatar:not([src^="data:"]) {
    transform: scale(5.05);
}

/* Card Info */
.card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-align: center;
}

.card-class {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.btn-card-select {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.character-card:hover .btn-card-select {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.character-card.selected .btn-card-select {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.card-combat-power-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid rgba(249, 115, 22, 0.28);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
    transition: var(--transition);
}

.card-combat-power-badge i {
    font-size: 0.95rem;
}

.character-card:hover .card-combat-power-badge {
    background: #ffedd5;
    border-color: rgba(249, 115, 22, 0.5);
}

.character-card.selected .card-combat-power-badge {
    background: #ffedd5;
    border-color: var(--primary);
    color: #c2410c;
}

/* ========================================================
   Empty & Loading States
   ======================================================== */
.empty-state, .loading-state {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon {
    font-size: 3.2rem;
    margin-bottom: 6px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
}
.empty-state p, .loading-state p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 440px;
    margin-bottom: 8px;
}

.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(249, 115, 22, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 8px;
}

/* ========================================================
   Global Blur Loading Overlay
   ======================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-overlay-card {
    background: #ffffff;
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(249, 115, 22, 0.15);
    padding: 36px 32px;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.loading-character-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding-top: 4px;
}

.loading-character-img {
    width: 92px;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    animation: mapleMonsterBounce 1.1s ease-in-out infinite;
    filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.16));
    user-select: none;
    -webkit-user-drag: none;
}

.loading-character-shadow {
    width: 56px;
    height: 8px;
    background: rgba(15, 23, 42, 0.14);
    border-radius: 50%;
    margin-top: 3px;
    animation: mapleShadowScale 1.1s ease-in-out infinite;
}

@keyframes mapleMonsterBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes mapleShadowScale {
    0%, 100% {
        transform: scale(1);
        opacity: 0.18;
    }
    50% {
        transform: scale(0.75);
        opacity: 0.07;
    }
}

.loading-spinner-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.loading-spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(249, 115, 22, 0.15);
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    animation: spin 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.loading-spinner-maple {
    font-size: 1.8rem;
    animation: maplePulse 1.8s ease-in-out infinite;
    user-select: none;
}

@keyframes maplePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.loading-overlay-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.loading-overlay-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.loading-progress-container {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loading-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    border-radius: var(--radius-full);
    transition: width 0.25s ease-out;
}

.loading-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.loading-progress-status {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.loading-progress-count {
    font-weight: 700;
    color: var(--primary);
}

/* ========================================================
   Selected Character Showcase Modal
   ======================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 12px;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background: #ffffff;
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2), 0 0 30px rgba(249, 115, 22, 0.15);
    position: relative;
    overflow: visible;
    animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f1f5f9;
    border: none;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    transition: var(--transition);
}
.modal-close-btn:hover {
    color: var(--error);
    background: #fee2e2;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-visual {
    background: radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.15) 0%, #fff7ed 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 185px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .modal-visual {
        border-bottom: none;
        border-right: 1px solid var(--border-color);
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }
}

.avatar-halo {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.3) 0%, transparent 70%);
    filter: blur(10px);
}

.detail-avatar {
    width: 112px;
    height: 112px;
    object-fit: cover;
    z-index: 2;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
    image-rendering: pixelated;
}

.detail-avatar:not([src^="data:"]) {
    transform: scale(3.5);
    transform-origin: 47.5% 52.6%;
}

.world-tag-large {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: #ffffff;
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.modal-info {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-level {
    font-size: 0.78rem;
    font-weight: 800;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.35);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.detail-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.badge-class {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Boss Scheduler Section (2열 리스트형 디자인) */
.boss-scheduler-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.boss-scheduler-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.boss-scheduler-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-primary);
}

.boss-scheduler-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.boss-scheduler-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 9px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.boss-sched-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.boss-sched-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 6px;
}

.boss-sched-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 8px 3px 5px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    min-height: 24px;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.boss-sched-item.cleared {
    background: #fdece6;
    border-color: #f9d5c7;
}

.boss-sched-item.warning {
    background: #ffffff;
    border: 1.5px solid #eab308;
}

.boss-sched-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.boss-sched-diff {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 17px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    line-height: 1;
}

.boss-sched-diff.diff-extreme {
    background: #1c1917;
    color: #f87171;
}

.boss-sched-diff.diff-chaos {
    background: #1c1917;
    color: #fde047;
}

.boss-sched-diff.diff-hard {
    background: #f43f5e;
    color: #ffffff;
}

.boss-sched-diff.diff-normal {
    background: #38bdf8;
    color: #ffffff;
}

.boss-sched-diff.diff-easy {
    background: #94a3b8;
    color: #ffffff;
}

.boss-sched-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boss-sched-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.boss-sched-icon.check {
    color: #16a34a;
}

.boss-sched-icon.warn {
    color: #eab308;
}

.boss-sched-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Stat section */
.stat-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stat-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.stat-spinner {
    color: var(--primary);
    font-size: 0.72rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.stat-box {
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
}
.stat-box.primary {
    border-color: rgba(249, 115, 22, 0.4);
    background: #fff7ed;
}
.stat-box .stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.stat-box .stat-value {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text-primary);
}
.stat-box.primary .stat-value {
    color: #ea580c;
}
#stat-sol-erda {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.union-champion-tier-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2.5px 8.5px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1.2;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
}
.union-champion-tier-pill.tier-master {
    background: #faf5ff;
    color: #9333ea;
    border-color: #d8b4fe;
}
.union-champion-tier-pill.tier-diamond {
    background: #f0f9ff;
    color: #0284c7;
    border-color: #bae6fd;
}
.union-champion-tier-pill.tier-platinum {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}
.union-champion-tier-pill.tier-gold {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}
.union-champion-tier-pill.tier-silver {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}
.union-champion-tier-pill.tier-bronze {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

/* Combat Power Preset Tooltip */
.stat-box.has-preset-tooltip {
    position: relative;
    cursor: help;
    transition: var(--transition);
}
.stat-box.has-preset-tooltip:hover {
    border-color: var(--primary);
    background: #ffedd5;
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.2);
}

.preset-hint-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.4);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 4px;
    vertical-align: middle;
}

.preset-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: #ffffff;
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(249, 115, 22, 0.4);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.15), 0 0 20px rgba(249, 115, 22, 0.15);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.stat-box.has-preset-tooltip:hover .preset-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.preset-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 28px;
    border-width: 7px;
    border-style: solid;
    border-color: rgba(249, 115, 22, 0.4) transparent transparent transparent;
}

.preset-tooltip-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 800;
    color: #ea580c;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.preset-tooltip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.76rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 8px;
}

.preset-cat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 74px;
}
.preset-cat i {
    color: var(--primary);
}

.preset-detail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    flex: 1;
}

.preset-num {
    font-weight: 800;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid rgba(249, 115, 22, 0.4);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
}

.preset-desc {
    color: var(--text-secondary);
    font-size: 0.71rem;
    line-height: 1.3;
    word-break: keep-all;
}

.preset-tooltip-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.preset-tooltip-footer strong {
    color: var(--success);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.modal-actions .btn-primary {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.action-sub-buttons {
    display: flex;
    gap: 6px;
}
.action-sub-buttons button {
    flex: 1;
    font-size: 0.78rem;
    padding: 7px 10px;
}

/* ========================================================
   Bottom Selection Bar
   ======================================================== */
.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1.5px solid rgba(249, 115, 22, 0.35);
    box-shadow: 0 -6px 25px rgba(15, 23, 42, 0.08);
    z-index: 900;
    padding: 12px 20px;
    animation: slideUp 0.25s ease-out;
}

.selection-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.selected-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: #fff7ed;
    border: 1.5px solid var(--primary);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.bar-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bar-avatar:not([src^="data:"]) {
    transform: scale(4.85);
    transform-origin: 47.5% 52.6%;
    image-rendering: pixelated;
}

.bar-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bar-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.bar-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.bar-class {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.bar-actions {
    display: flex;
    gap: 8px;
}

/* ========================================================
   Toast System
   ======================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}
.toast.success {
    border-color: #a7f3d0;
    background: #f0fdf4;
}
.toast.success i { color: var(--success); }
.toast.error {
    border-color: #fecaca;
    background: #fef2f2;
}
.toast.error i { color: var(--error); }
.toast.info {
    border-color: rgba(249, 115, 22, 0.3);
    background: #fff7ed;
}
.toast.info i { color: var(--primary); }

/* ========================================================
   Animations & Utilities
   ======================================================== */
.hidden {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .app-container {
        padding: 20px 14px;
    }
    h1 {
        font-size: 1.45rem;
    }
    .input-group {
        flex-direction: column;
    }
    .btn-primary {
        width: 100%;
    }
    .character-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================================
   파티 활동 기록 모달 & 버튼 스타일
   ======================================================== */
.btn-party-history {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    padding: 8px 14px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-party-history:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}
.history-badge {
    background: var(--primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.2;
}

.modal-card.party-history-modal-card {
    max-width: 960px;
    width: 95vw;
    height: 84vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: 20px;
}

.history-modal-header {
    padding: 18px 24px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-bottom: 1.5px solid rgba(249, 115, 22, 0.25);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.history-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-modal-title i {
    color: var(--primary);
    font-size: 20px;
}
.history-modal-sub {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
}

.history-modal-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #f8fafc;
}

.history-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1.5px solid #e2e8f0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
}

.history-card-item {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.history-card-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.history-card-item.active {
    background: #fff7ed;
    border-color: rgba(249, 115, 22, 0.5);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}
.history-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    gap: 6px;
}
.history-item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.history-item-btn,
.history-item-delete {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 13.5px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.history-item-btn.btn-delete:hover,
.history-item-delete:hover {
    color: #ef4444;
    background: #fee2e2;
}
.history-item-btn.btn-download:hover {
    color: #2563eb;
    background: #eff6ff;
}

.history-item-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 4px;
}
.history-item-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 11px;
}
.history-badge-tag {
    padding: 2px 7px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 600;
}
.history-badge-chat {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-pdf-download-detail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 8px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-pdf-download-detail:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.history-detail-panel {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-section-box {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.history-member-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.history-member-avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff7ed;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    border: 1px solid rgba(249, 115, 22, 0.25);
}
.history-member-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(4.85);
    transform-origin: 47.5% 52.6%;
    image-rendering: pixelated;
}
.history-member-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.history-member-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-member-sub {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.history-chat-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.history-chat-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.history-chat-avatar-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #fff7ed;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    border: 1px solid rgba(249, 115, 22, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-chat-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(4.85);
    transform-origin: 47.5% 52.6%;
    image-rendering: pixelated;
}
.history-chat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 80%;
}
.history-chat-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}
.history-chat-bubble {
    padding: 7px 11px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 12.5px;
    color: #1e293b;
    word-break: break-all;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .history-modal-layout {
        flex-direction: column;
    }
    .history-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1.5px solid #e2e8f0;
    }
}

/* ===== 사이트 하단 푸터 ===== */
.site-footer {
    margin-top: 48px;
    padding: 28px 4px 40px;
    background: transparent;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 13px;
    text-align: left;
}
.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.footer-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 4px;
}
.footer-brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.16));
}
.footer-info-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.65;
    color: #64748b;
    font-size: 13px;
}
.footer-links-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 13px;
    color: #94a3b8;
}
.footer-text-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    color: #475569;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s ease;
}
.footer-text-link.bold {
    font-weight: 700;
    color: #334155;
}
.footer-text-link:hover {
    color: #ea580c;
}
.footer-divider {
    color: #cbd5e1;
    user-select: none;
}
.footer-contact-row {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}
.footer-contact-row a {
    color: #475569;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
.footer-contact-row a:hover {
    color: #ea580c;
}

/* ===== 운영 정책 및 면책조항 모달 ===== */
.modal-card.policy-modal-card {
    max-width: 660px;
    width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(249, 115, 22, 0.35);
}
.policy-modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}
.policy-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16.5px;
    font-weight: 700;
    color: #0f172a;
}
.policy-modal-title i {
    color: #ea580c;
    font-size: 20px;
}
.policy-modal-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    display: block;
}
.policy-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
}
.policy-section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 4px solid #f97316;
}
.policy-section-card.security {
    border-left-color: #2563eb;
}
.policy-section-card.disclaimer {
    border-left-color: #64748b;
}
.policy-section-card.contact {
    border-left-color: #10b981;
}
.policy-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.policy-section-header i {
    font-size: 17px;
}
.policy-section-card ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.policy-section-card li {
    font-size: 12.5px;
    color: #475569;
}
.policy-section-card li strong {
    color: #0f172a;
}
.policy-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
}
.policy-confirm-btn {
    padding: 8px 22px;
    background: #ea580c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.policy-confirm-btn:hover {
    background: #c2410c;
}

