:root {
    --primary: #527853; /* Warm leaf green (representing growth & help) */
    --primary-light: #EEF0E5;
    --primary-dark: #3D5A3F;
    --accent: #F9F07A; /* Gentle cream yellow (soft light) */
    --secondary: #3FA2F6; /* Assistive sky blue */
    --secondary-light: #E8F4FF;
    --bg-app: #F5F7F8;
    --bg-card: #FFFFFF;
    --text-main: #333333;
    --text-sub: #777777;
    --border-color: #EAEAEA;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 15px -3px rgba(82, 120, 83, 0.1), 0 4px 6px -2px rgba(82, 120, 83, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hidden {
    display: none !important;
}

/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Block global browser-level scrolling */
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: #E2E8F0; /* Soft desktop gray */
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    min-height: -webkit-fill-available;
}

/* App Wrapper - Simulating a premium smartphone/tablet mockup */
.app-container {
    width: 100%;
    max-width: 480px; /* Standard premium mobile view */
    height: 100%;
    height: 100dvh; /* Dynamic viewport height to prevent address bar overflow */
    max-height: 920px;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

@media (min-width: 480px) {
    .app-container {
        border-radius: 32px;
        border: 8px solid #1E293B; /* Frame border */
        height: 850px;
        max-height: 850px;
    }
}

/* Header Styles */
.app-header {
    background-color: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
    margin: -20px -20px 20px -20px; /* Offset parent .app-main padding to span edge-to-edge */
    border-radius: 0;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(82, 120, 83, 0.3);
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-dark);
    display: block;
    line-height: 1;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-sub);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-selector {
    background-color: var(--bg-app);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.lang-selector select {
    border: none;
    background: transparent;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

.notification-bell {
    font-size: 1.25rem;
    color: var(--text-sub);
    position: relative;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-bell:hover {
    background-color: var(--bg-app);
}

.notification-bell .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #EF4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--bg-card);
}

.badge.hidden {
    display: none;
}

/* Main Content Area */
.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 24px; /* Reduced space since bottom nav is now a flex item, not absolute overlay */
}

/* Hide webkit scrollbar */
.app-main::-webkit-scrollbar {
    width: 0px;
}

/* Card General Styling */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Dashboard Welcoming Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.welcome-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-text p {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.4;
}

.welcome-img {
    font-size: 3rem;
    opacity: 0.8;
}

/* Quick Status Grid */
.quick-status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.status-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.status-card:hover {
    background-color: #FAFAFA;
    transform: translateX(4px);
}

.status-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.status-icon.alert-style {
    background-color: var(--secondary-light);
    color: var(--secondary);
}

.status-icon.helper-style {
    background-color: #FFF5E4;
    color: #FF9F29;
}

.status-info {
    flex-grow: 1;
}

.status-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 2px;
}

.status-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.arrow-icon {
    color: #CCC;
    font-size: 0.85rem;
}

/* Tab Navigation */
.tab-content {
    display: none;
    animation: fadeIn 0.35s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* Section Title */
.section-title {
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title p {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.4;
}

/* Document Helper Inputs */
.helper-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.input-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-upload-btn input[type="file"] {
    display: none;
}

.upload-label {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.upload-label:hover {
    background-color: #E2E6D5;
}

.textarea-wrapper {
    position: relative;
    margin-bottom: 16px;
}

#doc-text-input {
    width: 100%;
    height: 140px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

#doc-text-input:focus {
    border-color: var(--primary);
}

.ocr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.9);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.ocr-loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 4px solid var(--primary-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* RAG Visualizer Panel */
.visualizer-card h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-sub);
    padding: 8px 0;
    border-left: 2px solid var(--primary-light);
    padding-left: 16px;
    position: relative;
}

.step-num {
    position: absolute;
    left: -9px;
    top: 6px;
    width: 16px;
    height: 16px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.step.active {
    color: var(--text-main);
    border-left-color: var(--primary);
}

.step.active .step-num {
    background-color: var(--primary);
    color: #ffffff;
}

.retrieved-data {
    margin-top: 6px;
    background-color: #F8F9FA;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.75rem;
    color: #555555;
    border-left: 3px solid var(--secondary);
    display: none;
}

.visualizer-card.hidden {
    display: none;
}

/* Result Card */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-dark);
}

.btn-copy {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.result-lang-indicator {
    margin-bottom: 12px;
}

.lang-tag {
    background-color: var(--secondary-light);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.result-body {
    line-height: 1.6;
    font-size: 0.9rem;
}

.result-body h4 {
    margin-top: 16px;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 0.95rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
}

.result-body p {
    color: #444444;
    margin-bottom: 8px;
}

.result-body ul {
    list-style-type: none;
    padding-left: 0;
}

.result-body li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    color: #444444;
}

.result-body li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--primary);
    font-weight: bold;
}

.culture-note {
    background-color: #FFFDF0;
    border: 1px solid #FFE7A0;
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 16px;
    font-size: 0.85rem;
}

.culture-note h5 {
    color: #B2533E;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-card.hidden {
    display: none;
}

/* Button general */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #2b84cf;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.85rem;
}

.btn-outline:hover {
    background-color: var(--bg-app);
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 8px;
}

.btn-full {
    width: 100%;
}

/* Judge Panel */
.judge-panel {
    background-color: #ECEFF1;
    border: 1px solid #CFD8DC;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
}

.judge-panel h3 {
    font-size: 0.9rem;
    color: #455A64;
    margin-bottom: 8px;
}

.judge-panel p {
    font-size: 0.75rem;
    color: #607D8B;
    line-height: 1.4;
    margin-bottom: 12px;
}

.judge-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Profile Form styling */
.profile-card h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--primary-dark);
}

.profile-help {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    background-color: var(--bg-app);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--secondary);
}

/* Alert Lists and Trigger simulation */
.alerts-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simulation-trigger-card h4 {
    font-size: 0.9rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.simulation-trigger-card p {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.trigger-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.active-benefits-card h3 {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-data {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-sub);
}

.no-data i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.no-data p {
    font-size: 0.8rem;
}

/* Benefit Cards Generated in list */
.benefit-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background-color: #FAFAFA;
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.benefit-card.new::before {
    content: 'NEW';
    position: absolute;
    top: 0;
    right: 0;
    background-color: #EF4444;
    color: #FFFFFF;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-bottom-left-radius: 8px;
}

.benefit-card:hover {
    border-color: var(--secondary);
}

.benefit-cat-tag {
    font-size: 0.7rem;
    background-color: #E2E8F0;
    padding: 2px 8px;
    border-radius: 10px;
    color: #4A5568;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

.benefit-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.benefit-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    line-height: 1.4;
    margin-bottom: 12px;
}

.benefit-eligibility {
    background-color: var(--primary-light);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--primary-dark);
}

/* Toast/Push notification Toast simulation */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.push-toast {
    background-color: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 12px;
    pointer-events: auto;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.toast-icon {
    font-size: 1.4rem;
    color: var(--accent);
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.toast-time {
    font-size: 0.7rem;
    opacity: 0.6;
}

.toast-body {
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.9;
}

.toast-close {
    background: none;
    border: none;
    color: #ffffff;
    opacity: 0.5;
    cursor: pointer;
    align-self: flex-start;
}

.toast-close:hover {
    opacity: 1;
}

/* My Page styling */
.text-center {
    text-align: center;
}

.pad-lg {
    padding: 30px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.settings-list {
    text-align: left;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    cursor: pointer;
}

.setting-item:hover {
    background-color: #FAFADA;
}

.setting-item span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.setting-item span i {
    color: var(--text-sub);
}

/* Bottom Nav bar styling */
.app-nav {
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    flex-shrink: 0; /* Prevent shrinking when input keyboard pops up */
    box-sizing: border-box;
}

.nav-item {
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-sub);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    height: 100%;
    justify-content: center;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.15rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    color: var(--primary);
}

/* ==========================================
   TOSS-STYLE ONBOARDING OVERLAY
   ========================================== */
.onboarding-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-card);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.6s ease;
    border-radius: inherit;
}

.onboarding-overlay.fade-out {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.onboarding-container {
    width: 100%;
    height: 100%;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.onboarding-skip {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 0.88rem;
    color: var(--text-sub);
    font-weight: 500;
    cursor: pointer;
    z-index: 10;
    padding: 6px 12px;
    border-radius: 12px;
    transition: background-color 0.2s;
    pointer-events: auto;
}

.onboarding-skip:hover {
    background-color: var(--bg-app);
}

.onboarding-footer {
    position: relative;
    z-index: 10;
    width: 100%;
    margin-top: auto;
    pointer-events: auto;
}

/* Progress Bar */
.onboard-progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 24px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 20%;
    border-radius: 2px;
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Wizard step transitions (Toss-style slide in/out) */
.onboarding-wizard {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.wizard-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}

.wizard-step.active {
    opacity: 1;
    transform: translateX(0%);
    pointer-events: auto;
    z-index: 5;
}

.wizard-step.exit {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
    z-index: 1;
}

.wizard-step h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.wizard-step p {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.6;
}

.wizard-step .step-guide {
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.onboarding-graphic {
    width: 100%;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    background-color: var(--primary-light);
    border-radius: 28px;
    font-size: 5rem;
    color: var(--primary);
    box-shadow: inset 0 0 20px rgba(82, 120, 83, 0.05);
}

/* Form selections & buttons */
.language-grid-options, .children-count-options, .income-grid-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.lang-opt-btn, .child-count-btn, .income-opt-btn {
    text-align: left;
    justify-content: flex-start;
    padding: 16px 20px;
    font-size: 0.95rem;
    border-radius: 16px;
    background-color: var(--bg-app);
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.lang-opt-btn:hover, .child-count-btn:hover, .income-opt-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.lang-opt-btn.selected, .child-count-btn.selected, .income-opt-btn.selected {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Dynamic child inputs styling */
.dynamic-inputs-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
}

.child-input-row {
    background-color: var(--bg-app);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideUpIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.child-row-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.child-fields {
    display: flex;
    align-items: center;
    gap: 12px;
}

.child-age-field {
    flex: 1;
}

.child-age-field input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    outline: none;
}

.child-age-field input:focus {
    border-color: var(--primary);
}

/* Gender Selector (Toggle style with icons) */
.gender-toggle-group {
    display: flex;
    gap: 8px;
    height: 46px;
}

.gender-btn {
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.gender-btn.male {
    color: #4299E1;
}

.gender-btn.female {
    color: #ED64A6;
}

.gender-btn.male.selected {
    background-color: #EBF8FF;
    border-color: #4299E1;
    box-shadow: 0 0 0 1px #4299E1;
}

.gender-btn.female.selected {
    background-color: #FFF5F7;
    border-color: #ED64A6;
    box-shadow: 0 0 0 1px #ED64A6;
}

/* Micro-animations */
.anim-float {
    animation: tossFloat 3.5s ease-in-out infinite;
}

@keyframes tossFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(0.98); }
}

/* ==========================================
   TOSS COUNTER UI STYLES (STEP 2)
   ========================================== */
.onboard-counter-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    margin-top: 24px;
    background-color: var(--bg-app);
    padding: 24px 16px;
    border-radius: 24px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.btn-counter {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-size: 1.15rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-counter:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: scale(1.06);
}

.btn-counter:active {
    transform: scale(0.95);
}

.counter-value {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-dark);
    min-width: 44px;
    text-align: center;
    animation: popScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popScale {
    0% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

.counter-unit {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-left: -6px;
}

/* Welfare Feed Section (Home Tab) */
.welfare-feed-section {
    margin-bottom: 20px;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.welfare-feed-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-indicator {
    font-size: 0.72rem;
    font-weight: 700;
    color: #EF4444;
    background-color: #FEE2E2;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-indicator .dot {
    width: 6px;
    height: 6px;
    background-color: #EF4444;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.welfare-feed-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Horizontal Scroll Container */
.welfare-scroll-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for container */
.welfare-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.welfare-scroll-container::-webkit-scrollbar-track {
    background: #F1F1F1;
    border-radius: 10px;
}

.welfare-scroll-container::-webkit-scrollbar-thumb {
    background: #C1C1C1;
    border-radius: 10px;
}

.welfare-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #A8A8A8;
}

/* Scroll Card */
.welfare-scroll-card {
    flex: 0 0 280px; /* Fixed card width */
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    scroll-snap-align: start;
    transition: border-color 0.2s, transform 0.2s;
    cursor: pointer;
    position: relative;
    text-align: left;
}

.welfare-scroll-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.welfare-scroll-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.welfare-scroll-card .desc {
    font-size: 0.76rem;
    color: var(--text-sub);
    line-height: 1.4;
    height: 52px; /* Restrict lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.welfare-scroll-card .meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #718096;
}

.welfare-scroll-card .region-tag {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

/* Source link elements */
.scroll-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.scroll-card-header .benefit-cat-tag {
    margin-bottom: 0;
}

.feed-source-link {
    color: var(--text-sub);
    font-size: 0.8rem;
    transition: color 0.2s;
    padding: 2px 4px;
}

.feed-source-link:hover {
    color: var(--secondary);
}

.benefit-actions {
    margin-top: 14px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.btn-source-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.btn-source-go:hover {
    color: var(--primary-dark);
}

/* Toss/Premium Style Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Bottom sheet layout on mobile */
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-card);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

@media (min-width: 480px) {
    .modal-overlay {
        align-items: center; /* Centered modal on desktop view */
    }
    .modal-content {
        border-radius: 24px;
        width: 90%;
        max-height: 700px;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-sub);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 0.9rem;
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-info-box {
    background-color: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.info-label {
    color: var(--text-sub);
    font-weight: 500;
}

.info-value {
    color: var(--text-main);
    font-weight: 600;
}

.modal-eligibility-detail {
    font-size: 0.85rem;
    line-height: 1.5;
}

.modal-eligibility-detail h5 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.modal-eligibility-detail p {
    color: #4A5568;
}

/* slide-up animation */
.anim-slide-up {
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Explicit Source URL styling inside modal */
.modal-source-info {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 16px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    word-break: break-all;
}

.source-label {
    font-weight: 700;
    color: var(--text-main);
}

.source-url-text {
    color: var(--secondary);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.source-url-text:hover {
    color: var(--primary-dark);
}

/* Toss/Premium Style Income Direct Input */
.onboard-income-input-container {
    width: 100%;
    max-width: 320px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.income-input-row {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding: 8px 0;
    transition: border-color 0.2s;
}

.income-input-row:focus-within {
    border-color: var(--secondary);
}

.income-input-row input {
    border: none;
    background: none;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
    width: 100%;
    padding-right: 12px;
    outline: none;
    box-sizing: border-box;
}

/* remove spin buttons */
.income-input-row input::-webkit-outer-spin-button,
.income-input-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.income-unit {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-sub);
    white-space: nowrap;
}

.income-calc-guide {
    font-size: 0.85rem;
    color: var(--secondary);
    text-align: center;
    min-height: 20px;
    font-weight: 500;
}

/* Onboard Child Input Cards & Actions styling */
.btn-add-child {
    width: 100%;
    max-width: 320px;
    margin: 16px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1.5px dashed var(--secondary);
    background: none;
    color: var(--secondary);
    font-weight: 600;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-add-child:hover {
    background-color: rgba(67, 97, 238, 0.05);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

.onboard-child-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.onboard-child-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.btn-delete-child {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.btn-delete-child:hover {
    opacity: 0.7;
}

/* ==========================================
   ADMIN DASHBOARD CSS
   ========================================== */
.admin-table {
    border-collapse: collapse;
    width: 100%;
}

.admin-table th {
    font-weight: 600;
    color: var(--text-sub);
    background-color: var(--bg-app);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.admin-table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: rgba(49, 130, 246, 0.04) !important;
}

.admin-table td {
    color: var(--text-main);
    font-size: 14px;
}

/* Vertical Welfare List Container & Cards */
.welfare-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    padding-bottom: 20px;
}
.welfare-list-card {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.2s, transform 0.2s;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    position: relative;
}
.welfare-list-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.welfare-list-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.welfare-list-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    margin-top: 0;
}
.welfare-list-card .desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.welfare-list-card .meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #718096;
}
.welfare-list-card .region-tag {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

/* --- Coach Marks Walkthrough --- */
.coachmark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    pointer-events: auto;
    display: none;
    overflow: hidden;
}

.coachmark-spotlight {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10001;
}

.coachmark-tooltip {
    position: absolute;
    z-index: 10002;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 16px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg), 0 10px 30px rgba(0,0,0,0.15);
    width: 280px;
    max-width: 90vw;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.coachmark-tooltip::after {
    content: '';
    position: absolute;
    border: 8px solid transparent;
}

/* Arrow placements */
.coachmark-tooltip.arrow-top::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: var(--bg-card);
}
.coachmark-tooltip.arrow-bottom::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: var(--bg-card);
}
.coachmark-tooltip.arrow-left::after {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: var(--bg-card);
}
.coachmark-tooltip.arrow-right::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: var(--bg-card);
}

.coachmark-text {
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 12px;
}

.coachmark-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.coachmark-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.coachmark-btn-next {
    background-color: #0064FF;
    color: #ffffff;
    padding: 8px 18px;
}
.coachmark-btn-next:hover {
    background-color: #0052d6;
}

.coachmark-btn-skip {
    background-color: rgba(0, 0, 0, 0.08);
    color: #555;
    padding: 8px 14px;
}
.coachmark-btn-skip:hover {
    background-color: rgba(0, 0, 0, 0.14);
    color: #222;
}

/* Custom Toast Notification */
.daon-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(33, 37, 41, 0.9);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 11000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    text-align: center;
    max-width: 90%;
    width: max-content;
}
.daon-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
[data-theme="dark"] .daon-toast {
    background-color: rgba(248, 249, 250, 0.95);
    color: #212529;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}


