:root {
    /* Colors */
    --primary: #3b82f6; /* Trust Blue */
    --primary-hover: #2563eb;
    --secondary: #10b981; /* Emerald Green */
    --accent: #6366f1; /* Indigo */

    --bg-dark: #0f172a; /* Deep Slate Navy background */
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-glass: rgba(30, 41, 59, 0.4);

    --text-main: #f8fafc; /* Off-White for eye comfort */
    --text-muted: #94a3b8; /* Cool Gray */

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), #2dd4bf);
    --gradient-logo: linear-gradient(135deg, #10b981, #3b82f6); /* HappE */
    --gradient-logo-left: linear-gradient(135deg, #FFE81A 30%, #FFA000 100%); /* Happy (밝은 옐로우 오렌지) */
    --gradient-glow: radial-gradient(circle at center, var(--primary), transparent 70%);

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    /* Borders & Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --border-glass: 1px solid hsla(0, 0%, 100%, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px hsla(230, 85%, 60%, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(230, 85%, 60%, 0.6);
}

.btn-glass {
    background: var(--bg-glass);
    border: var(--border-glass);
    backdrop-filter: blur(10px);
    color: var(--text-main);
}

.btn-glass:hover {
    background: hsla(220, 30%, 20%, 0.6);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: hsla(0, 0%, 100%, 0.2);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-md) 0;
    background: hsla(220, 30%, 8%, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo - Strict Alignment System */
.logo {
    display: inline-flex;
    flex-direction: column;
    /* Fallback */
    text-decoration: none;
    cursor: pointer;
}

.logo-grid {
    display: grid;
    grid-template-columns: auto auto;
    /* Allow natural width, but maybe align via justify? */
    /* To align H and 합 strictly, we need the split point to be the anchor. 
       Best way: Two equal width columns meeting in center? No 'Safe' != 'HappE'.
       Text-align approach:
    */
    grid-template-columns: 1fr 1fr;
    /* Equal width halves if wrapper is centered? */
    /* Let's try flexible columns but aligned to center seam. */
    align-items: baseline;
    column-gap: 0;
}

.logo-row-en {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    /* Removed display: contents */
}

/* Row 1 Cells */
.logo-en-left {
    background: var(--gradient-logo-left);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: right;
    grid-column: 1;
    grid-row: 1;
    display: block;
}

.logo-en-right {
    background: var(--gradient-logo);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: left;
    grid-column: 2;
    grid-row: 1;
    display: block;
}

.logo-row-kr {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Row 2 Cells */
.logo-kr-left {
    background: var(--gradient-logo-left);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: right;
    grid-column: 1;
    grid-row: 2;
    padding-right: 0px;
    display: block;
    /* Adjust proximity to seam */
    /* To visually pull '해피' bit left if needed? No, right align pulls it to seam. */
}

.logo-kr-right {
    color: var(--secondary);
    text-align: left;
    grid-column: 2;
    grid-row: 2;
    padding-left: 0px;
    display: block;
}

nav ul {
    display: flex;
    gap: var(--space-lg);
}

nav a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 180px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Background Glow Effects */
.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 60%);
    opacity: 0.15;
    filter: blur(80px);
    top: -100px;
    left: -100px;
    z-index: -1;
    animation: float 10s infinite ease-in-out;
}

.glow-bg-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 60%);
    opacity: 0.1;
    filter: blur(80px);
    bottom: 0;
    right: -100px;
    z-index: -1;
    animation: float 12s infinite ease-in-out reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.hero-text h1 {
    font-size: 4rem;
    line-height: 1.4;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-text .highlight {
    color: var(--secondary);
    position: relative;
    display: inline-block;
    /* Removed gradient and drop-shadow as per request to revert color style */
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
}

.hero-visual {
    position: relative;
}

.hero-card-mockup {
    background: linear-gradient(160deg, hsla(0, 0%, 100%, 0.1), hsla(0, 0%, 100%, 0.05));
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(20px);
    transform: rotateY(-10deg) rotateX(5deg);
    perspective: 1000px;
    box-shadow: 20px 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.mockup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
}

.status-badge {
    padding: 0.3rem 0.8rem;
    background: hsla(170, 80%, 50%, 0.2);
    color: var(--secondary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Features Section */
.features {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.section-header p {
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
    background: var(--bg-glass);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary);
}

/* Footer */
footer {
    padding: var(--space-xl) 0;
    background: hsla(220, 30%, 6%, 0.95);
    border-top: 1px solid hsla(0, 0%, 100%, 0.05);
    margin-top: 100px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.footer-brand h3 {
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links h4 {
    margin-bottom: var(--space-md);
    color: var(--text-main);
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--secondary);
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-card-mockup {
        margin-top: var(--space-lg);
        transform: none;
    }

    .hero-text p {
        margin: 0 auto var(--space-lg);
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: hsla(220, 30%, 14%, 0.4);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: hsla(220, 30%, 14%, 0.8);
    box-shadow: 0 0 0 3px hsla(230, 85%, 60%, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: radial-gradient(circle at top right, hsla(230, 85%, 60%, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, hsla(170, 80%, 50%, 0.05), transparent 40%);
}

.auth-box {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: hsla(220, 30%, 8%, 0.95);
    border-right: 1px solid hsla(0, 0%, 100%, 0.05);
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow: hidden; /* 사이드바 자체는 넘침 숨김 */
}

.sidebar .logo {
    margin-bottom: 40px;
    padding-left: 10px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;              /* 남은 공간을 모두 차지 */
    min-height: 0;        /* Flexbox 내에서 스크롤이 작동하기 위해 필수 */
    overflow-y: auto;     /* 메뉴가 넘칠 때 세로 스크롤 */
    overflow-x: hidden;
    padding-right: 4px;   /* 스크롤바 공간 확보 */
    /* 스크롤바 스타일 (Webkit 계열) */
    scrollbar-width: thin;
    scrollbar-color: hsla(0, 0%, 100%, 0.15) transparent;
}

.nav-links::-webkit-scrollbar {
    width: 4px;
}

.nav-links::-webkit-scrollbar-track {
    background: transparent;
}

.nav-links::-webkit-scrollbar-thumb {
    background: hsla(0, 0%, 100%, 0.15);
    border-radius: 4px;
}

.nav-links::-webkit-scrollbar-thumb:hover {
    background: hsla(0, 0%, 100%, 0.3);
}

/* 로그아웃 버튼 - 사이드바 최하단 고정 */
.sidebar-logout {
    flex-shrink: 0;       /* 줄어들지 않도록 고정 */
    padding-top: 10px;
    border-top: 1px solid hsla(0, 0%, 100%, 0.06);
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: 0.3s;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    background: hsla(220, 30%, 14%, 0.6);
    color: var(--text-main);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    padding: var(--space-lg);
    background: var(--bg-dark);
    /* Fallback */
    background: radial-gradient(circle at top right, hsla(220, 30%, 15%, 0.3), transparent 50%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Info Row for Case Overview */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.info-row .info-val {
    font-weight: 600;
}

@media (min-width: 769px) {
    .mobile-bottom-nav, .mobile-drawer-header, .mobile-drawer-overlay {
        display: none !important;
    }
}

/* --- Mobile Responsive Updates --- */
@media (max-width: 768px) {

    /* Layout Reset */
    .dashboard-layout {
        flex-direction: column;
        padding-bottom: 70px;
        /* Space for bottom nav */
    }

    /* Hide debug panel on mobile */
    #proposal-debug-panel {
        display: none !important;
    }

    /* Info Row Vertical Stacking */
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .info-row .info-val {
        width: 100%;
        line-height: 1.4;
        word-break: keep-all;
    }

    /* Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        width: 100%;
        height: 70px;
        position: fixed;
        bottom: 0;
        left: 0;
        background: hsla(220, 30%, 8%, 0.98);
        border-top: 1px solid hsla(0, 0%, 100%, 0.1);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-bottom-nav .nav-item {
        flex-direction: column;
        gap: 5px;
        font-size: 0.7rem;
        padding: 5px 10px;
        text-align: center;
        border-radius: 0;
        color: var(--text-muted);
        background: transparent !important;
    }

    .mobile-bottom-nav .nav-item.active {
        color: var(--text-main);
        font-weight: 700;
    }

    .mobile-bottom-nav .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    /* Sidebar -> Full Screen Drawer on Mobile */
    .sidebar {
        width: 80%;
        max-width: 320px;
        height: 100vh;
        position: fixed;
        top: 0;
        right: -100%; /* Hidden off-screen to the right by default */
        left: auto;
        bottom: auto;
        border-left: 1px solid hsla(0, 0%, 100%, 0.1);
        border-right: none;
        padding: 20px;
        background: hsla(220, 30%, 8%, 0.98);
        z-index: 2000;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .sidebar.drawer-open {
        right: 0;
    }

    .mobile-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid hsla(0, 0%, 100%, 0.1);
    }

    /* Overlay for drawer */
    .mobile-drawer-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1500;
        backdrop-filter: blur(2px);
    }
    .mobile-drawer-overlay.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-item {
        flex-direction: row;
        font-size: 0.95rem;
        padding: 12px 16px;
        text-align: left;
    }

    .nav-item i {
        font-size: 1rem;
        margin-bottom: 0;
    }

    /* Main Content Adjustments */
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-bottom: 90px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .top-bar>div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    /* Stack Grids */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Agreements Page Mobile */
    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .document-viewer {
        height: 500px;
        padding: 10px;
    }

    .paper-doc {
        padding: 20px;
        font-size: 0.9rem;
    }
}

.stat-card {
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Chat UI */
.chat-container {
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
    background: hsla(220, 30%, 12%, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.received {
    align-self: flex-start;
    background: hsla(220, 30%, 20%, 0.8);
    color: var(--text-muted);
    border-bottom-left-radius: 2px;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.message-input-area {
    padding: 16px;
    background: hsla(220, 30%, 10%, 0.8);
    border-top: 1px solid hsla(0, 0%, 100%, 0.05);
    display: flex;
    gap: 10px;
}

.system-msg {
    align-self: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: hsla(0, 0%, 100%, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    margin: 10px 0;
}

/* --- Apology Letter Styling --- */

/* Stationery Styles */
.stationery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.style-option-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.style-option-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.style-option-card.selected {
    border-color: var(--secondary);
    background: rgba(74, 222, 128, 0.1);
}

.style-preview-box {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Background Variants */
.bg-basic {
    background-color: #ffffff;
}

.bg-sincere {
    background-color: #fcf8f2;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
}

.bg-formal {
    background-color: #ffffff;
    background-image: linear-gradient(#e5e5e5 1px, transparent 1px);
    background-size: 100% 2em;
}

.bg-emotional {
    background: linear-gradient(to bottom right, #e0eafc, #a8edea);
}


/* Font Variants */
.font-basic {
    font-family: 'Inter', sans-serif;
    /* Default */
}

.font-serif {
    font-family: 'Noto Serif KR', serif;
}

.font-hand {
    font-family: 'Nanum Pen Script', cursive;
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.preview-content {
    background: #fff;
    color: #333;
    width: 90%;
    max-width: 600px;
    height: 80vh;
    padding: 40px;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.modal-close:hover {
    color: #333;
}

@keyframes swing {
    20% {
        transform: rotate(15deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(5deg);
    }

    80% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Process Section */
.process-section {
    padding: 100px 0;
    background: radial-gradient(circle at center, hsla(230, 85%, 60%, 0.05), transparent 70%);
}

.process-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 50px;
}

.process-card {
    flex: 1;
    min-width: 220px;
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    position: relative;
    transition: transform 0.3s;
}

.process-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
}

.process-card.highlight-step {
    border: 1px solid var(--secondary);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
}

.step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 5px 15px;
    border-radius: 20px;
}

.process-card.highlight-step .step-number {
    color: var(--secondary);
    border-color: var(--secondary);
}

.process-card .icon-box {
    margin-bottom: 20px;
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.process-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.process-card:hover .process-icon {
    transform: scale(1.05);
}

.process-card.highlight-step .process-icon {
    border-color: var(--secondary);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

.process-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.process-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.process-arrow {
    color: rgba(255, 255, 255, 0.1);
    font-size: 1.5rem;
}

/* Tooltip & Hint Text Styles */
.process-card.has-tooltip {
    cursor: pointer;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--secondary);
    margin-top: 5px;
    opacity: 0.8;
}

.process-tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 280px;
    background: hsla(220, 30%, 15%, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid hsla(0, 0%, 100%, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
    pointer-events: none;
}

.process-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: hsla(220, 30%, 15%, 0.95) transparent transparent transparent;
}

.process-card.has-tooltip:hover .process-tooltip,
.process-card.has-tooltip.active .process-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
    .process-steps {
        flex-direction: column;
        gap: 40px;
    }

    .process-arrow {
        transform: rotate(90deg);
    }
    
    .process-tooltip {
        bottom: auto;
        top: 100%;
        margin-top: 15px;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .process-tooltip::after {
        top: auto;
        bottom: 100%;
        border-color: transparent transparent hsla(220, 30%, 15%, 0.95) transparent;
    }
    
    .process-card.has-tooltip:hover .process-tooltip,
    .process-card.has-tooltip.active .process-tooltip {
        transform: translateX(-50%) translateY(0);
    }
}

/* Welcome Modal / Founder Letter */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.welcome-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.welcome-modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 35px 30px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh; /* Fallback for older browsers */
    max-height: 85dvh;          /* 화면 높이의 85% 초과 금지 */
    display: flex;
    flex-direction: column;     /* header / body / footer 세로 분리 */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.welcome-modal-overlay.show .welcome-modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.35rem;
    color: var(--text-main);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-modal-btn:hover {
    color: var(--accent);
}

.modal-body {
    overflow-y: auto;           /* 내용이 넘치면 내부 스크롤 */
    flex: 1 1 auto;             /* 남은 공간 모두 사용, 축소 가능 */
    min-height: 0;              /* 플렉스 자식이 컨텐츠 크기 이하로 축소되도록 강제 (중요) */
    -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    padding-right: 5px;         /* 스크롤바 영역 확보 */
}

.modal-body p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1rem;
}

.modal-body p strong {
    color: var(--text-main);
}

.beta-notice {
    background: hsla(230, 85%, 60%, 0.1);
    border-left: 3px solid var(--primary);
    padding: 15px 20px;
    border-radius: 4px;
    margin-top: 25px;
}

.beta-notice .notice-title {
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.beta-notice p {
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.beta-notice .contact-email {
    margin-top: 10px;
    margin-bottom: 0;
    color: var(--primary);
    font-size: 0.95rem;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.dont-show-again {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dont-show-again input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── 모바일 팝업 대응 (Option A) ── */
@media (max-width: 768px) {
    .welcome-modal-overlay {
        align-items: flex-start;    /* 팝업을 화면 상단부터 배치 → 닫기 버튼 항상 보임 */
        padding: 16px 12px;         /* 좌우 여백 축소 */
        padding-top: max(16px, env(safe-area-inset-top)); /* 노치 대응 */
    }

    .welcome-modal-content {
        padding: 20px 16px;         /* 모바일 패딩 축소 */
        max-height: 90vh;           /* Fallback */
        max-height: 90dvh;          /* 모바일에서 조금 더 여유 확보 */
        border-radius: var(--radius-sm);
    }

    .modal-header h3 {
        font-size: 1.1rem;          /* 제목 폰트 축소 */
    }

    .close-modal-btn {
        font-size: 2rem;            /* 터치 대상 크기 확대 */
        min-width: 44px;            /* 최소 터치 영역 44px (iOS 권장) */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .modal-footer {
        flex-direction: column;     /* 체크박스 + 닫기버튼 세로 배치 */
        gap: 12px;
        align-items: stretch;
    }

    .modal-footer .btn {
        width: 100%;                /* 닫기 버튼 풀 너비 */
        padding: 14px;
    }
}