/* ==========================================================================
   SO貯金箱 - スタイルシート (marumie style)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+JP:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #238778;
    --primary-light: #64D8C6;
    --primary-dark: #1a6b5a;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --text: #1F2937;
    --text-muted: #6B7280;
    --border: #e5e7eb;
    --radius: 24px;
    --max-width: 1032px;
}

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

body {
    font-family: "Inter", "Noto Sans JP", sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========== Topbar (shared) =========== */
.topbar {
    background: transparent;
    color: var(--text);
    padding: 0.75rem 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
    border-bottom: none;
}
.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
    background: #eef9f6;
    border-radius: 16px;
}
.topbar-logo-img {
    height: 32px;
    width: auto;
    display: block;
}
.topbar-logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
}
.topbar-nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}
.topbar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.topbar-nav a:hover { background: rgba(255,255,255,0.6); color: var(--text); }
.topbar-nav a.active { background: rgba(255,255,255,0.7); color: var(--primary); }

.topbar-nav-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.topbar-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0.4rem;
    white-space: nowrap;
}
.topbar-nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.topbar-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

/* =========== Legacy sidebar → hidden (admin/super now use topbar) =========== */
.sidebar { display: none; }

/* =========== Content =========== */
.content {
    max-width: var(--max-width);
    margin: 0 auto;
    flex: 1;
    padding: 1.5rem 1.25rem;
    width: 100%;
}

.page-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }

/* =========== Cards =========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: none;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

/* =========== Stats =========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: none;
}
.stat-card.stat-primary {
    background: linear-gradient(135deg, #64D8C6, #BCECD3);
    color: var(--text);
    border: none;
}
.stat-card.stat-primary .stat-label { color: rgba(31,41,55,0.7); }
.stat-card.stat-success { border-left: 4px solid var(--success); }
.stat-card.stat-warning { border-left: 4px solid var(--warning); }

.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1.2; }
.stat-sub { font-size: 0.75rem; margin-top: 0.25rem; opacity: 0.8; }

/* =========== Company Level Bar =========== */
.level-card { margin-bottom: 1.5rem; }
.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.level-badge {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    background: #ecfdf5;
    padding: 0.3rem 1rem;
    border-radius: 999px;
}
.level-next { font-size: 0.8rem; color: var(--text-muted); }

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #64D8C6, #238778, #1a6b5a);
    border-radius: 12px;
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 2rem;
    position: relative;
    overflow: hidden;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: progressShine 2s ease-in-out infinite;
}
@keyframes progressShine {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}
.progress-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    position: relative;
    z-index: 1;
}

/* =========== Piggy Bank & Chest Stages =========== */
.piggy-bank { position: relative; overflow: hidden; }
.piggy-bank::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
    0%, 100% { transform: translateX(-30%) translateY(-30%); }
    50% { transform: translateX(30%) translateY(30%); }
}

.chest-wooden { background: linear-gradient(135deg, #92400e, #78350f) !important; }
.chest-iron { background: linear-gradient(135deg, #475569, #334155) !important; }
.chest-silver { background: linear-gradient(135deg, #94a3b8, #64748b) !important; }
.chest-gold { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.chest-diamond { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; }
.chest-legendary {
    background: linear-gradient(135deg, #7c3aed, #6d28d9, #a78bfa) !important;
    animation: legendaryPulse 2s ease-in-out infinite;
}
@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(124,58,237,0.3); }
    50% { box-shadow: 0 0 25px rgba(124,58,237,0.6); }
}

/* =========== Member Header =========== */
.member-header { margin-bottom: 1.5rem; }
.member-level {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.member-icon-large { font-size: 2.5rem; }
.member-level-badge {
    display: inline-block;
    background: #ecfdf5;
    color: var(--primary);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}
.chest-label {
    display: inline-block;
    background: #fefce8;
    color: #92400e;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* =========== Dashboard Grid =========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.chart-container { position: relative; max-width: 350px; margin: 0 auto; }
.chart-note { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* =========== Timeline =========== */
.timeline { max-height: 400px; overflow-y: auto; }
.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    animation: fadeSlideIn 0.3s ease-out;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon { font-size: 1.3rem; flex-shrink: 0; }
.timeline-content { flex: 1; }
.timeline-message { font-size: 0.9rem; line-height: 1.4; }
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.timeline-hidden { display: none; }
.timeline-expanded .timeline-hidden { display: flex; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: none; }
}

/* =========== Dream Board =========== */
.dream-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.dream-card-mini {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    padding: 1rem;
    position: relative;
    transition: transform 0.2s;
}
.dream-card-mini:hover { transform: translateY(-2px); }
.dream-card-icon { font-size: 1.2rem; position: absolute; top: 0.5rem; right: 0.5rem; }
.dream-card-mini p { font-size: 0.9rem; font-weight: 600; color: #92400e; margin-bottom: 0.3rem; }
.dream-amount { font-size: 0.8rem; color: #78350f; }

/* =========== Memo List =========== */
.memo-list { max-height: 300px; overflow-y: auto; }
.memo-item {
    padding: 0.75rem;
    border-left: 3px solid var(--primary-light);
    margin-bottom: 0.5rem;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
}
.memo-item p { font-size: 0.9rem; }
.memo-date { font-size: 0.75rem; color: var(--text-muted); }

/* =========== Hint icon & stat hint =========== */
.hint-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 0.7rem;
    cursor: pointer;
    vertical-align: middle;
    opacity: 0.6;
}
.hint-icon:hover { opacity: 1; }
.stat-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: 6px;
    line-height: 1.5;
}

/* =========== Health Score =========== */
.score-bar {
    width: 100px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.score-fill {
    height: 100%;
    border-radius: 9px;
    transition: width 0.5s;
}
.score-high { background: var(--success); }
.score-mid { background: var(--warning); }
.score-low { background: var(--danger); }
.score-num {
    position: absolute;
    right: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text);
}

/* =========== Calendar =========== */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.calendar-title { font-size: 1.2rem; min-width: 140px; text-align: center; }

.calendar-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.legend-grant { background: #238778; }
.legend-exercise { background: #22c55e; }
.legend-expiry { background: #ef4444; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cal-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem;
}
.cal-cell {
    min-height: 80px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem;
    font-size: 0.75rem;
    overflow: hidden;
}
.cal-empty { border: none; }
.cal-today { background: #ecfdf5; border-color: var(--primary); }
.cal-day { font-weight: 700; font-size: 0.8rem; display: block; margin-bottom: 0.2rem; }

.cal-event {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-event-grant { background: #d1fae5; color: #065f46; }
.cal-event-exercise { background: #dcfce7; color: #166534; }
.cal-event-expiry { background: #fee2e2; color: #991b1b; }

/* =========== Tables =========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th, .data-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.data-table tbody tr:hover { background: #f1f5f9; }

.alert-row { background: #fef3c7 !important; }
.alert-row:hover { background: #fde68a !important; }

.row-resigned { opacity: 0.5; }
.row-resigned:hover { opacity: 0.7; }

/* Passbook */
.passbook .text-positive { color: var(--success); font-weight: 600; }
.passbook .text-negative { color: var(--danger); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-grant { background: #d1fae5; color: #065f46; }
.badge-exercise { background: #fce7f3; color: #be185d; }
.badge-expiry { background: #fee2e2; color: #991b1b; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-resigned { background: #fee2e2; color: #991b1b; }

/* =========== Forms =========== */
.form-inline { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; min-width: 150px; }
.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.form-group input, .form-group select, .form-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(35,135,120,0.15);
}
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.3rem;
}
.form-actions { justify-content: flex-end; }
.required { color: var(--danger); }
.hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.filter-bar { margin-bottom: 1rem; }

/* =========== Buttons =========== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #111827; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--text); }
.btn-secondary:hover { background: #f3f4f6; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.1rem; }

/* =========== Flash =========== */
.notification-banner {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.notification-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.notification-item {
    font-size: 0.9rem;
    padding: 0.3rem 0;
}

.flash-messages { margin-bottom: 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    animation: fadeSlideIn 0.3s;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

.empty-message { color: var(--text-muted); font-style: italic; padding: 1rem 0; }

/* =========== Simulator =========== */
.simulator-slider-section { margin: 1.5rem 0; }
.simulator-slider-section h3 { margin-bottom: 0.75rem; }
.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.sim-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #BCECD3, #64D8C6, #238778);
    outline: none;
}
.sim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.sim-presets { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.sim-price-input { max-width: 200px; font-size: 1.2rem !important; font-weight: 700; }

.sim-result { animation: fadeIn 0.4s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.dream-label {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 1rem;
    padding: 1rem;
    background: #ecfdf5;
    border-radius: var(--radius);
}
.dream-icon { font-size: 1.5rem; }

/* =========== Edit Row =========== */
.edit-row td { background: #f8fafc; padding: 1rem !important; }

/* =========== Confetti =========== */
.confetti-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-in forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* =========== Onboarding Wizard =========== */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.4;
    transition: all 0.3s;
}
.wizard-step.active, .wizard-step.done { opacity: 1; }
.wz-num {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.9rem;
    transition: all 0.3s;
}
.wizard-step.active .wz-num { background: var(--primary); color: #fff; }
.wizard-step.done .wz-num { background: var(--success); color: #fff; }
.wz-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.wizard-step.active .wz-label { color: var(--primary); }
.wizard-connector {
    width: 40px; height: 2px;
    background: var(--border);
    margin: 0 0.25rem;
    margin-bottom: 1.2rem;
}

.wizard-panel { display: none; animation: fadeIn 0.4s; }
.wizard-panel.active { display: block; }

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Hero */
.onb-hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: var(--radius);
    margin-bottom: 2rem;
}
.onb-hero-icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.onb-hero h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.onb-hero-sub { color: var(--text-muted); font-size: 1.1rem; }

/* Explain Cards */
.onb-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.onb-explain-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
}
.onb-card-num {
    position: absolute; top: -10px; left: -10px;
    width: 28px; height: 28px;
    background: var(--primary); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem;
}
.onb-explain-card h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.onb-explain-card p { font-size: 0.9rem; line-height: 1.6; color: var(--text-muted); }

.onb-list { list-style: none; padding: 0; margin-top: 0.75rem; }
.onb-list li { padding: 0.3rem 0; font-size: 0.9rem; line-height: 1.5; }

/* Example box */
.onb-example {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
}
.onb-example-row {
    display: flex; justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.onb-example-row:last-child { border-bottom: none; }
.onb-example-row.onb-highlight { font-weight: 700; color: var(--primary); background: #ecfdf5; padding: 0.4rem; border-radius: 4px; margin-top: 0.3rem; }
.onb-val { font-weight: 700; }

/* Flow diagram */
.onb-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}
.onb-flow-step {
    display: flex; flex-direction: column; align-items: center;
    background: #ecfdf5;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    min-width: 80px;
}
.onb-flow-icon { font-size: 1.5rem; }
.onb-flow-step span:last-child { font-size: 0.75rem; font-weight: 600; }
.onb-flow-arrow { font-size: 1.5rem; color: var(--primary); }
.onb-flow-note { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* FAQ */
.onb-faq { margin-top: 2rem; }
.onb-faq h3 { margin-bottom: 1rem; }
.onb-faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.onb-faq-item summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background: #f8fafc;
    transition: background 0.2s;
}
.onb-faq-item summary:hover { background: #ecfdf5; }
.onb-faq-item p { padding: 0 1rem 1rem; font-size: 0.85rem; line-height: 1.6; color: var(--text-muted); }

/* Form cards (Step 1) */
.onb-form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.onb-form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.onb-form-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.onb-help { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.5; }

.onb-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.onb-big-input {
    font-size: 1.3rem !important;
    font-weight: 700;
    max-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
}
.onb-big-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(35,135,120,0.15); }
.onb-unit { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.onb-prefix { font-size: 1.3rem; font-weight: 700; color: var(--text-muted); }

.onb-presets { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }

.onb-tip {
    background: #fffbeb;
    border-left: 3px solid var(--warning);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #92400e;
}

.onb-section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }

/* Allocation (Step 2) */
.onb-alloc-info {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.onb-alloc-remain strong { font-size: 1.1rem; }

.onb-role-row {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border-left: 4px solid var(--primary-light);
}
.onb-role-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.role-name-input {
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    width: 160px;
}
.onb-role-pct-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.role-pct-input {
    width: 60px;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem;
}
.role-pts-display { font-size: 0.85rem; color: var(--text-muted); min-width: 100px; }
.role-desc-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.onb-role-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }

.onb-alloc-chart-area {
    max-width: 350px;
    margin: 1.5rem auto 0;
}

/* Member Registration (Step 3) */
.onb-member-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.onb-member-section h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.onb-member-pts {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    background: #ecfdf5;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.onb-member-textarea {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    margin-top: 0.5rem;
}
.onb-member-textarea:focus { border-color: var(--primary); outline: none; }
.onb-member-calc {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.onb-member-calc span { font-weight: 700; color: var(--primary); }

/* Completion */
.onb-complete {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-radius: var(--radius);
    margin-top: 2rem;
}
.onb-complete-icon { font-size: 4rem; display: block; margin-bottom: 0.5rem; }
.onb-complete h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.onb-complete p { color: var(--text-muted); font-size: 1rem; }

/* =========== Document Upload Tabs =========== */
.doc-upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.doc-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.doc-tab:hover { color: var(--text); }
.doc-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.doc-tab-panel { margin-bottom: 0.5rem; }

.doc-icon { margin-right: 0.25rem; }

.btn-link-open {
    background: linear-gradient(135deg, #238778, #64D8C6);
    color: #fff;
    font-size: 0.8rem;
}
.btn-link-open:hover { background: linear-gradient(135deg, #1a6b5a, #238778); }

.badge-doc-link { background: #d1fae5; color: #065f46; }
.badge-doc-contract { background: #dcfce7; color: #166534; }
.badge-doc-notice { background: #fef3c7; color: #92400e; }
.badge-doc-reference { background: #f0f9ff; color: #075985; }
.badge-doc-other { background: #f1f5f9; color: #475569; }

/* =========== Portal =========== */
.portal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #64D8C6 0%, #BCECD3 100%);
}
.portal {
    max-width: 700px;
    width: 100%;
    padding: 2rem;
}
.portal-header {
    text-align: center;
    color: var(--text);
    margin-bottom: 2rem;
}
.portal-icon { font-size: 3.5rem; display: block; margin-bottom: 0.5rem; }
.portal-logo-img { height: 48px; width: auto; margin-bottom: 0.5rem; }
.portal-header h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.portal-header p { color: #374151; font-size: 1rem; }

.portal-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.portal-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.portal-card:hover { transform: translateY(-4px); }
.portal-card-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.portal-card h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.portal-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }

.portal-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    background: #fff;
}
.portal-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(35,135,120,0.15);
}

.btn-member {
    background: var(--text);
    color: #fff;
    width: 100%;
}
.btn-member:hover { background: #111827; }
.btn-member:disabled { background: #94a3b8; cursor: not-allowed; }

.btn-admin {
    background: var(--text);
    color: #fff;
    width: 100%;
    display: block;
}

/* =========== Login Page =========== */
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.login-card h2 {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}
.login-card .form-group {
    margin-bottom: 1rem;
}
.login-card .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
}
.login-card .form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}
.login-card .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(35,135,120,0.15);
}
.login-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}
.login-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
}
.btn-admin:hover { background: #111827; }

.portal-empty {
    text-align: center;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: var(--text);
}
.portal-empty p { margin-bottom: 1rem; font-size: 1rem; }

/* =========== Member Layout (Top Bar) =========== */
.layout-member {
    flex-direction: column;
}

.content-member {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    flex: 1;
    width: 100%;
}

/* =========== Admin Layout =========== */
.layout-admin { display: flex; flex-direction: column; }
.sidebar-admin .logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* =========== Milestone Timeline (Onboarding) =========== */
.ms-timeline-track {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1.5rem 0.5rem;
    overflow-x: auto;
}
.ms-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    text-align: center;
    flex-shrink: 0;
}
.ms-node-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    box-shadow: 0 0 0 3px rgba(35,135,120,0.2);
}
.ms-node-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.ms-node-price {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}
.ms-node-days {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.ms-node-past { opacity: 0.4; }
.ms-node-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--success));
    flex-shrink: 0;
    margin-bottom: 2.5rem;
}

/* =========== Milestone Roadmap (Admin) =========== */
.ms-roadmap-track {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ms-roadmap-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
}
.ms-roadmap-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    background: #d1d5db;
    box-shadow: 0 0 0 4px rgba(209,213,219,0.3);
    transition: all 0.3s;
}
.ms-roadmap-past .ms-roadmap-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34,197,94,0.2);
}
.ms-roadmap-now .ms-roadmap-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(35,135,120,0.3);
    animation: ms-roadmap-pulse 2s ease-in-out infinite;
}
.ms-roadmap-future .ms-roadmap-dot {
    background: #d1d5db;
    color: #9ca3af;
}
@keyframes ms-roadmap-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(35,135,120,0.3); }
    50% { box-shadow: 0 0 0 8px rgba(35,135,120,0.15); }
}
.ms-roadmap-now-marker {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em;
}
.ms-roadmap-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
    max-width: 130px;
    word-break: break-word;
}
.ms-roadmap-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.1rem;
}
.ms-roadmap-budget {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}
.ms-roadmap-connector {
    width: 40px;
    height: 2px;
    flex-shrink: 0;
    margin-top: 17px;
    background: #d1d5db;
    border: none;
}
.ms-roadmap-connector-past {
    background: var(--success);
}
.ms-roadmap-connector-future {
    background: none;
    border-top: 2px dashed #d1d5db;
    height: 0;
}
.ms-roadmap-past .ms-roadmap-label { color: var(--text-muted); }
.ms-roadmap-future .ms-roadmap-label { color: var(--text); }

/* =========== Milestone Edit Row (Onboarding) =========== */
.ms-row {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

/* =========== Milestone Cards (Member Simulator) =========== */
.ms-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.ms-sim-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ms-sim-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35,135,120,0.15);
}
.ms-sim-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.ms-sim-card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.3rem;
}
.ms-sim-card-days {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Past milestone card */
.ms-card-past {
    opacity: 0.45;
    border-style: dashed;
}
.ms-card-past:hover {
    opacity: 0.7;
}

/* =========== Countdown Banner =========== */
.ms-countdown-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid #a7f3d0;
}
.ms-countdown-days {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    min-width: 80px;
    text-align: center;
}
.ms-countdown-days::after {
    content: '日';
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}
.ms-countdown-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ms-countdown-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}
.ms-countdown-target {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* =========== Onboarding: Education Layout =========== */
.onb-layout-with-edu {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}
.onb-main-col { min-width: 0; }

.onb-edu-sidebar {
    position: sticky;
    top: 2rem;
}
.onb-edu-text {
    background: #ecfdf5;
    border-left: 3px solid var(--primary);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #065f46;
}
.onb-edu-text strong { color: #047857; }
.onb-edu-text code {
    background: #d1fae5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    word-break: break-all;
}

/* Onboarding: Tab Group */
.onb-tab-group {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}
.onb-tab {
    padding: 0.6rem 1.25rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.onb-tab:hover { color: var(--text); }
.onb-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.onb-tab-content { display: none; }
.onb-tab-content.active { display: block; }

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.admin-tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* Onboarding: Range Slider */
.onb-range-slider-container { margin: 1rem 0; }
.onb-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.onb-range-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #238778, #e5e7eb);
    outline: none;
    margin-bottom: 0.5rem;
}
.onb-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.onb-range-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.onb-range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Onboarding: Simulation Result */
.onb-sim-result { animation: fadeIn 0.4s; }
.onb-sim-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.onb-sim-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.onb-sim-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.onb-sim-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
}
.onb-sim-highlight {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid var(--primary-light);
}
.onb-sim-highlight .onb-sim-value { color: var(--primary); font-size: 1.5rem; }

/* Onboarding: Warning */
.onb-warning {
    background: #fff7ed;
    border-left: 3px solid #f97316;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #9a3412;
    margin-top: 1rem;
}

/* Onboarding: Member Sub-section within role row */
.onb-member-sub { margin-top: 0.5rem; }

@media (max-width: 900px) {
    .onb-layout-with-edu {
        grid-template-columns: 1fr;
    }
    .onb-edu-sidebar {
        position: static;
    }
}

/* =========== Review Section =========== */
.review-section { border-left: 4px solid var(--primary); }

/* =========== Status Badges =========== */
.status-badge-granted {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
    letter-spacing: 0.03em;
}
.status-badge-reserved {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    letter-spacing: 0.03em;
}

/* =========== Potential Card =========== */
.potential-card {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #a7f3d0;
}
.potential-card .card-title {
    border-bottom-color: #a7f3d0;
    color: #065f46;
}

/* =========== Approve Button =========== */
.approve-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.approve-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

/* =========== Mode Selector (Onboarding) =========== */
.onb-mode-selector {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.onb-mode-card {
    flex: 1;
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.onb-mode-card:hover {
    border-color: var(--primary-light);
}
.onb-mode-card.active {
    border-color: var(--primary);
    background: #ecfdf5;
}
.onb-mode-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* =========== Validation Milestone Row =========== */
.vms-row {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

/* =========== Welcome Wizard (Member Onboarding) =========== */
.welcome-hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.welcome-step-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.welcome-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s;
}
.welcome-step-dot.active {
    background: var(--primary);
}

.welcome-points-summary {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}
.welcome-point-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 200px;
    flex: 1;
    max-width: 280px;
}
.welcome-point-granted {
    border-top: 4px solid var(--success);
}
.welcome-point-reserved {
    border-top: 4px solid var(--warning);
}
.welcome-point-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.welcome-point-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.welcome-point-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.welcome-flow-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.welcome-flow-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}
.welcome-flow-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.welcome-goal-link-item {
    padding: 0.5rem 0.75rem;
    background: #f0fdf4;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.welcome-goal-link-item a {
    color: var(--primary);
    text-decoration: none;
}
.welcome-goal-link-item a:hover {
    text-decoration: underline;
}

/* =========== Unlock Plan & Goals (Quest) =========== */
.unlock-plan-card {
    border-top: 4px solid var(--primary);
}

/* Summary flow */
.unlock-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc, #ecfdf5);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.unlock-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}
.unlock-summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.unlock-summary-value {
    font-size: 1.3rem;
    font-weight: 800;
}
.unlock-summary-granted { color: var(--primary); }
.unlock-summary-potential { color: var(--warning); }
.unlock-summary-total { color: var(--success); }
.unlock-summary-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Progress section */
.unlock-progress-section {
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

/* Section headings */
.unlock-section-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

/* Quest list */
.unlock-quest-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.unlock-goal-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.unlock-goal-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.unlock-goal-done {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}
.unlock-goal-pending {
    border-left: 4px solid var(--primary-light);
    background: #fafffe;
}

/* Step number circle for pending goals */
.unlock-goal-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.unlock-goal-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}
.unlock-goal-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
}
.unlock-goal-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.5;
}
.unlock-goal-points {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), #64D8C6);
    color: #fff;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.4rem;
    vertical-align: middle;
}
.unlock-goal-points-done {
    background: linear-gradient(135deg, var(--success), #16a34a);
}
.unlock-goal-date {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 0.3rem;
}
.unlock-goal-tag-member {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.unlock-goal-tag-ms {
    font-size: 0.7rem;
    color: var(--primary);
    background: #ecfdf5;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.3rem;
}

/* Empty guide */
.unlock-empty-guide {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.unlock-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}
.unlock-empty-guide h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.unlock-empty-guide p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Add form */
.unlock-add-form {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
    .unlock-summary { flex-direction: column; gap: 0.5rem; }
    .unlock-summary-arrow { transform: rotate(90deg); }
}

/* =========== Onboarding Intro Modal =========== */
.intro-modal {
    max-width: 520px;
    text-align: center;
    padding: 2rem;
}
.intro-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.intro-modal h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}
.intro-modal p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.intro-step {
    animation: introFadeIn 0.3s ease;
}
@keyframes introFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.intro-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}
.intro-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s, transform 0.3s;
}
.intro-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}
.intro-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

/* =========== Enhanced Step Indicator =========== */
.welcome-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.welcome-step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: all 0.3s;
}
.welcome-step-item.active { opacity: 1; }
.welcome-step-item.done { opacity: 1; }
.welcome-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex-shrink: 0;
}
.welcome-step-item.active .welcome-step-num {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(35,135,120,0.2);
}
.welcome-step-item.done .welcome-step-num {
    background: var(--success);
    color: #fff;
}
.welcome-step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.welcome-step-item.active .welcome-step-label { color: var(--primary); font-weight: 700; }
.welcome-step-item.done .welcome-step-label { color: var(--success); }
.welcome-step-connector {
    width: 50px;
    height: 2px;
    background: var(--border);
    margin: 0 0.75rem;
    flex-shrink: 0;
    transition: background 0.3s;
}
.welcome-step-connector.done { background: var(--success); }

/* =========== Milestone Goal Card =========== */
.ms-goal-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.2s;
    background: var(--card-bg);
}
.ms-goal-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(35,135,120,0.08);
}
.ms-goal-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc, #ecfdf5);
    border-bottom: 1px solid var(--border);
}
.ms-goal-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #64D8C6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.ms-goal-card-info { flex: 1; min-width: 0; }
.ms-goal-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.ms-goal-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ms-goal-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ms-goal-card-body {
    padding: 1rem 1.25rem;
}
.ms-goal-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.ms-goal-card-goals {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.ms-goal-created-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #166534;
    animation: goalSlideIn 0.3s ease-out;
}
@keyframes goalSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}
.ms-goal-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 2px dashed var(--primary-light);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ms-goal-add-btn:hover {
    background: #ecfdf5;
    border-color: var(--primary);
}
.ms-goal-form {
    display: none;
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border);
    animation: fadeIn 0.3s;
}
.ms-goal-form.active { display: block; }

/* =========== Created Goals Summary (Welcome) =========== */
.goals-summary-card {
    border: 2px solid var(--success);
    border-radius: 12px;
    overflow: hidden;
}
.goals-summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}
.goals-summary-count {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}
.goals-summary-body {
    padding: 0.75rem 1.25rem;
}
.goals-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}
.goals-summary-item:last-child { border-bottom: none; }

/* =========== Collapsible Section =========== */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    user-select: none;
}
.collapsible-header:hover { border-color: var(--primary-light); background: #fafffe; }
.collapsible-header-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.collapsible-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}
.collapsible-header.open .collapsible-arrow { transform: rotate(180deg); }
.collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}
.collapsible-body.open { max-height: 800px; }

/* =========== Guide Tip Box =========== */
.guide-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.guide-tip-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
}
.guide-tip-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #92400e;
}
.guide-tip-text strong { color: #78350f; }

/* =========== Member Home: Enhanced Milestone Selector =========== */
.ms-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.ms-select-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
    font-size: 0.85rem;
}
.ms-select-chip:hover {
    border-color: var(--primary-light);
    background: #fafffe;
}
.ms-select-chip.active {
    border-color: var(--primary);
    background: #ecfdf5;
}
.ms-select-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #64D8C6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.ms-select-chip-text {
    flex: 1;
    min-width: 0;
}
.ms-select-chip-label {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ms-select-chip-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========== Welcome Step 2 Intro Banner =========== */
.step2-intro {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.step2-intro h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}
.step2-intro p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========== Success Toast =========== */
.goal-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(34,197,94,0.3);
    z-index: 9999;
    animation: toastIn 0.3s ease-out, toastOut 0.3s 2.5s ease-in forwards;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
}
@keyframes toastOut {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: translateY(20px); }
}

/* =========== Greeting Banner =========== */
.greeting-banner {
    margin-bottom: 1.5rem;
}
.greeting-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.greeting-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========== Table Scroll Wrapper =========== */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

/* =========== Collapsible Card (details/summary) =========== */
.collapsible-details {
    border: none;
}
.collapsible-summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    list-style: none;
    margin-bottom: 0;
    border-bottom: none;
}
.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary::marker { display: none; content: ''; }
.collapsible-summary::after {
    content: '\25BE';
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.25s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.collapsible-details[open] > .collapsible-summary {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}
.collapsible-details[open] > .collapsible-summary::after {
    transform: rotate(180deg);
}
.collapsible-details .collapsible-body {
    max-height: none;
    overflow: visible;
}

/* =========== Bottom Tab Bar (Mobile) =========== */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0 0.6rem 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    background: transparent;
}
.bottom-tab-bar-inner {
    display: flex;
    width: 100%;
    background: #eef9f6;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 0 0 1px rgba(35,135,120,0.08);
}
.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0;
    text-decoration: none;
    color: var(--text-muted);
    gap: 0.2rem;
    transition: color 0.2s;
    font-weight: 600;
    position: relative;
}
.bottom-tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bottom-tab-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.bottom-tab-label {
    font-size: 0.6rem;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.bottom-tab.active {
    color: var(--primary);
}
.bottom-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2.5px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* =========== Responsive: Tablet (max-width: 768px) =========== */
@media (max-width: 768px) {
    /* --- Bottom Tab Bar --- */
    .bottom-tab-bar { display: flex; }
    .layout-member .topbar-nav { display: none; }
    .layout-admin .topbar-nav { display: none; }
    .content-member { padding-bottom: 4.5rem; }
    .layout-admin .content { padding-bottom: 4.5rem; }

    /* --- Content --- */
    .content { padding: 1rem; max-width: 100%; }

    /* --- Dashboard & Stats --- */
    .stats-row { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }

    /* --- Topbar (admin/member) --- */
    .topbar-inner { gap: 0.5rem; padding: 0 0.75rem; }
    .topbar-nav { gap: 0.15rem; overflow-x: auto; }
    .topbar-nav a { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
    .topbar-nav-label { display: none; }
    .topbar-nav-divider { margin: 0 0.25rem; }
    .content-member { padding: 1rem; }

    /* --- Forms --- */
    .form-inline { flex-direction: column; align-items: stretch; }
    .form-row { flex-direction: column; }
    .form-group { min-width: 0; width: 100%; }

    /* --- Tables --- */
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 0.5rem; white-space: nowrap; }
    .hide-mobile { display: none !important; }
    .edit-row td { white-space: normal !important; }
    .edit-row .form-inline { gap: 0.75rem; }
    .edit-row .form-inline .btn { width: 100%; }

    /* --- Onboarding --- */
    .onb-layout-with-edu { grid-template-columns: 1fr; }
    .onb-edu-sidebar { position: static; }
    .onb-form-section { grid-template-columns: 1fr; }
    .onb-cards-row { grid-template-columns: 1fr; }
    .wizard-progress { flex-wrap: wrap; padding: 1rem; }
    .wizard-connector { width: 20px; }
    .wz-label { font-size: 0.6rem; }

    /* --- Welcome Steps --- */
    .welcome-steps-bar { padding: 1rem; gap: 0; flex-wrap: wrap; }
    .welcome-step-label { display: none; }
    .welcome-step-connector { width: 20px; margin: 0 0.2rem; }

    /* --- Calendar --- */
    .cal-cell { min-height: 50px; }
    .calendar-grid { font-size: 0.7rem; }

    /* --- Portal --- */
    .portal-cards { grid-template-columns: 1fr; }
    .portal { padding: 1.5rem 1rem; }

    /* --- Milestone & Goal Cards --- */
    .ms-select-grid { grid-template-columns: 1fr; }
    .ms-goal-card-header { flex-wrap: wrap; }
    .ms-cards-row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .ms-timeline-track { padding: 1rem 0; }
    .ms-roadmap-track { padding: 1rem 0.5rem; }
    .ms-roadmap-node { min-width: 90px; }
    .ms-roadmap-dot { width: 30px; height: 30px; font-size: 0.75rem; }
    .ms-roadmap-connector { width: 28px; margin-top: 14px; }
    .ms-roadmap-label { font-size: 0.72rem; max-width: 90px; }
    .ms-roadmap-date { font-size: 0.65rem; }
    .ms-roadmap-budget { font-size: 0.63rem; }
    .ms-roadmap-now-marker { font-size: 0.6rem; padding: 0.05rem 0.4rem; }

    /* --- Member Layout Cards --- */
    .unlock-summary { flex-direction: column; gap: 0.5rem; }
    .unlock-summary-arrow { transform: rotate(90deg); }

    /* --- Greeting --- */
    .greeting-text { font-size: 1.2rem; }

    /* --- Dream Board --- */
    .dream-board { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

    /* --- Milestone Rows --- */
    .ms-row { flex-direction: column !important; }
    .ms-row .form-group { min-width: 0 !important; flex: 1 1 100% !important; }

    /* --- Wizard Nav --- */
    .wizard-nav { gap: 0.5rem; align-items: stretch; }
    .wizard-nav .btn { white-space: normal; line-height: 1.3; }

    /* --- Cards --- */
    .card { padding: 1.5rem; }
}

/* =========== Responsive: SP (max-width: 480px) =========== */
@media (max-width: 480px) {
    /* --- Content padding --- */
    .content { padding: 0.75rem; }
    .layout-admin .content { padding-bottom: 4.5rem; }
    .content-member { padding: 0.75rem; }
    .card { padding: 1rem; margin-bottom: 1rem; }

    /* --- Stats: 1 column --- */
    .stats-row { grid-template-columns: 1fr; gap: 0.75rem; }
    .stat-value { font-size: 1.5rem; }

    /* --- Page title & greeting --- */
    .page-title { font-size: 1.2rem; }
    .greeting-text { font-size: 1.1rem; }
    .greeting-date { font-size: 0.8rem; }

    /* --- Bottom Tab Bar SP --- */
    .bottom-tab-bar { padding: 0 0.4rem 0.35rem; padding-bottom: calc(0.35rem + env(safe-area-inset-bottom)); }
    .bottom-tab-bar-inner { border-radius: 14px; }
    .bottom-tab { padding: 0.35rem 0; }
    .bottom-tab-icon svg { width: 20px; height: 20px; }
    .bottom-tab-label { font-size: 0.55rem; }
    .content-member { padding-bottom: 4.5rem; }

    /* --- Topbar SP --- */
    .topbar { padding: 0.4rem 0.4rem 0; }
    .layout-member .topbar-inner { flex-wrap: nowrap; height: 48px; }
    .topbar-inner { height: auto; flex-wrap: wrap; padding: 0.5rem 0.75rem; gap: 0.25rem; border-radius: 12px; }
    .topbar-logo { font-size: 0.95rem; }
    .topbar-logo-img { height: 26px; }
    .topbar-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid var(--border);
        padding-top: 0.4rem;
    }
    .topbar-nav-group { gap: 0.15rem; }
    .topbar-nav a { font-size: 0.7rem; padding: 0.35rem 0.4rem; }
    .topbar-nav-divider { height: 18px; margin: 0 0.15rem; }
    .topbar-user { margin-left: auto; }
    .topbar-username { font-size: 0.8rem; }

    /* --- Tables: Scrollable --- */
    .data-table th, .data-table td { padding: 0.4rem; font-size: 0.75rem; }

    /* --- Forms: Full width --- */
    .form-inline { gap: 0.75rem; }
    .form-group {
        min-width: 0 !important;
        width: 100% !important;
    }
    .form-group input, .form-group select, .form-group textarea {
        font-size: 0.85rem;
        padding: 0.5rem;
        max-width: 100%;
    }
    .btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
    .btn-lg { padding: 0.6rem 1.5rem; font-size: 1rem; }

    /* --- Level Card --- */
    .level-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .level-badge { font-size: 1rem; }
    .progress-bar { height: 20px; }
    .progress-text { font-size: 0.6rem; }

    /* --- Onboarding Wizard --- */
    .wizard-progress { padding: 0.75rem; gap: 0; }
    .wizard-step { min-width: auto; }
    .wz-num { width: 28px; height: 28px; font-size: 0.75rem; }
    .wz-label { display: none; }
    .wizard-connector { width: 16px; margin-bottom: 0; }
    .onb-hero h1 { font-size: 1.3rem; }
    .onb-hero-sub { font-size: 0.9rem; }
    .onb-section-title { font-size: 1.1rem; }
    .onb-big-input { font-size: 1.1rem !important; max-width: 100%; }
    .onb-mode-selector { flex-direction: column; }
    .onb-flow { flex-direction: column; gap: 0.5rem; }
    .onb-flow-arrow { transform: rotate(90deg); }

    /* --- Welcome Steps --- */
    .welcome-steps-bar { padding: 0.75rem; }
    .welcome-step-num { width: 28px; height: 28px; font-size: 0.75rem; }
    .welcome-step-connector { width: 16px; }
    .welcome-hero { padding: 1.25rem 0.75rem; }
    .welcome-points-summary { flex-direction: column; align-items: stretch; }
    .welcome-point-card { max-width: 100%; min-width: 0; }
    .welcome-point-value { font-size: 1.6rem; }

    /* --- SP Grid override --- */
    .sp-grid-1col { grid-template-columns: 1fr !important; }

    /* --- Milestone cards --- */
    .ms-sim-card { padding: 0.75rem; }
    .ms-sim-card-price { font-size: 1.1rem; }
    .ms-roadmap-track { padding: 0.75rem 0.25rem; }
    .ms-roadmap-node { min-width: 80px; }
    .ms-roadmap-dot { width: 28px; height: 28px; font-size: 0.7rem; }
    .ms-roadmap-connector { width: 20px; margin-top: 13px; }
    .ms-roadmap-label { font-size: 0.68rem; max-width: 80px; }
    .ms-roadmap-date { font-size: 0.6rem; }
    .ms-roadmap-budget { font-size: 0.58rem; }
    .ms-countdown-banner { flex-direction: column; text-align: center; padding: 1rem; }
    .ms-countdown-days { font-size: 2rem; }

    /* --- Goal / Unlock Cards --- */
    .unlock-goal-item { padding: 0.65rem 0.75rem; }
    .ms-goal-card-icon { width: 36px; height: 36px; font-size: 1.1rem; }
    .ms-goal-card-header { padding: 0.75rem; }
    .ms-goal-card-body { padding: 0.75rem; }

    /* --- Calendar: hide on SP or minimal --- */
    .cal-event { font-size: 0.55rem; padding: 0.05rem 0.2rem; }
    .cal-cell { min-height: 40px; padding: 0.2rem; }
    .cal-day { font-size: 0.7rem; }
    .calendar-nav { gap: 0.75rem; }
    .calendar-title { font-size: 1rem; min-width: 100px; }

    /* --- Dream Board --- */
    .dream-board { grid-template-columns: 1fr; }

    /* --- Chart container --- */
    .chart-container { max-width: 280px; }

    /* --- Simulator --- */
    .sim-presets { flex-wrap: wrap; }
    .sim-price-input { max-width: 100%; }

    /* --- Portal / Login --- */
    .portal-body { padding: 0.75rem; }
    .portal { padding: 1rem 0.75rem; }
    .portal-header h1 { font-size: 1.5rem; }
    .portal-logo-img { height: 40px; }
    .portal-card { padding: 1.25rem 1rem; }
    .login-card { padding: 1.25rem 1rem; }

    /* --- Collapsible --- */
    .collapsible-header { padding: 0.75rem; }
    .collapsible-header-text { font-size: 0.85rem; }

    /* --- Guide Tip --- */
    .guide-tip { padding: 0.75rem; }
    .guide-tip-text { font-size: 0.82rem; }

    /* --- Modal --- */
    .modal-content { padding: 1rem; width: 95%; }

    /* --- Admin Tabs --- */
    .admin-tabs { gap: 0; }
    .admin-tab { padding: 0.6rem 0.75rem; font-size: 0.8rem; }

    /* --- Hero Card Mobile --- */
    .hero-stats { gap: 1rem; }
    .hero-stat-main .hero-stat-value { font-size: 1.75rem; }
    .hero-links { flex-wrap: wrap; }
}

/* ==========================================================================
   Section Divider — zone labels
   ========================================================================== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2.5rem 0 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ==========================================================================
   Hero Card
   ========================================================================== */
.hero-card {
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.hero-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.hero-icon {
    font-size: 2.5rem;
}
.hero-stats {
    display: flex;
    text-align: left;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.hero-stat {
    text-align: left;
    flex: none;
    min-width: 80px;
}
.hero-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}
.hero-stat-main .hero-stat-value {
    font-size: 2rem;
    color: var(--primary);
}
.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.hero-links {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Details / Collapsible for goals
   ========================================================================== */
.unlock-details summary {
    cursor: pointer;
    list-style: none;
}
.unlock-details summary::-webkit-details-marker {
    display: none;
}
.unlock-details-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    transition: background 0.15s;
}
.unlock-details-summary:hover {
    background: var(--bg);
}
.unlock-details-summary::after {
    content: '\25B8';
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.unlock-details[open] > .unlock-details-summary::after {
    transform: rotate(90deg);
}
.unlock-goal-item .btn-sm {
    padding: 0.375rem 0.75rem;
    min-height: 32px;
}

/* =========== Topbar User Links =========== */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    background: #fff;
    border: 1px solid #d1e7e0;
    border-radius: 10px;
    padding: 0.35rem 0.75rem;
}
.topbar-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.topbar-link:hover { opacity: 1; }

/* =========== User Dropdown =========== */
.user-dropdown { position: relative; }
.user-dropdown-toggle {
    background: none; border: none; cursor: pointer;
    color: var(--text); font-size: 0.9rem; font-weight: 600;
    padding: 0.4rem 0.75rem; border-radius: 8px;
}
.user-dropdown-toggle:hover { background: rgba(0,0,0,0.05); }
.user-dropdown-menu {
    display: none; position: absolute; right: 0; top: 100%;
    background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px; padding: 0.5rem 0; z-index: 100; margin-top: 0.25rem;
}
.user-dropdown.open .user-dropdown-menu { display: block; }
.user-dropdown-menu a {
    display: block; padding: 0.5rem 1rem; color: var(--text);
    text-decoration: none; font-size: 0.875rem;
}
.user-dropdown-menu a:hover { background: var(--bg-light, #f3f4f6); }
.user-dropdown-menu a.user-dropdown-highlight {
    font-weight: 700; font-size: 0.95rem;
}

/* =========== XP Bar Row (below topbar) =========== */
.topbar-xp-row {
    background: #e4f5f0;
    border-top: none;
    padding: 0.35rem 0;
}
.topbar-xp-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.xp-bar-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.xp-bar-level {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
.xp-bar-track {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #64D8C6, #238778);
    border-radius: 4px;
    transition: width 1s ease-out;
}
.xp-bar-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* =========== Level-Up Overlay =========== */
.levelup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    transition: opacity 0.3s;
}
.levelup-modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: levelupBounce 0.5s ease-out;
}
.levelup-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.levelup-title {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.levelup-level {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
@keyframes levelupBounce {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); }
}

/* =========== Achievement Badges =========== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.achievement-item {
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}
.achievement-item:hover {
    transform: translateY(-2px);
}
.achievement-item.unlocked {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}
.achievement-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}
.achievement-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.4rem;
}
.achievement-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.achievement-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* =========== XP Bar Mobile =========== */
@media (max-width: 768px) {
    .topbar-xp-inner { padding: 0 0.75rem; gap: 0.4rem; }
    .xp-bar-track { max-width: 120px; }
    .xp-bar-level { font-size: 0.7rem; }
}
@media (max-width: 480px) {
    .topbar-xp-inner { padding: 0 0.75rem; }
    .xp-bar-text { display: none; }
    .xp-bar-track { max-width: 100px; }
    .xp-bar-level { font-size: 0.65rem; }
}

/* =========== Notifications =========== */
.notification-bell-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}
.notification-bell-link:hover {
    background: rgba(255,255,255,0.6);
    color: var(--text);
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s;
}
.notification-item.unread {
    background: #f0fdf4;
    border-left: 3px solid var(--primary);
}
.notification-item-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.notification-item-content {
    flex: 1;
    min-width: 0;
}
.notification-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.notification-item-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.2rem;
}
.notification-item-time {
    font-size: 0.7rem;
    color: #9ca3af;
}
.notification-item-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    flex-shrink: 0;
    align-self: center;
    transition: all 0.2s;
}
.notification-item-link:hover {
    background: var(--primary);
    color: #fff;
}

.notification-prefs-table {
    width: 100%;
    border-collapse: collapse;
}
.notification-prefs-table th,
.notification-prefs-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.notification-prefs-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.notification-prefs-table tbody tr:hover {
    background: var(--bg);
}

/* ==========================================================================
   AI Chat Panel
   ========================================================================== */

.ai-chat-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 400px;
    max-height: 70vh;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border);
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    flex-shrink: 0;
}

.ai-chat-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.ai-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0.8;
}
.ai-chat-close:hover { opacity: 1; }

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
    max-height: calc(70vh - 140px);
}

.ai-msg {
    display: flex;
}
.ai-msg-user {
    justify-content: flex-end;
}
.ai-msg-assistant {
    justify-content: flex-start;
}

.ai-msg-bubble {
    max-width: 85%;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.ai-msg-user .ai-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg-assistant .ai-msg-bubble {
    background: #f3f4f6;
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.ai-typing {
    display: inline-block;
    animation: aiTypingPulse 1s ease-in-out infinite;
    color: var(--text-muted);
}

@keyframes aiTypingPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.ai-code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.ai-proposal-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    background: #faf5ff;
    flex-shrink: 0;
}

.ai-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    flex-shrink: 0;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
}
.ai-chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(35,135,120,0.15);
}

.ai-chat-send {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ai-chat-send:hover { background: var(--primary-dark); }
.ai-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Choice buttons */
.ai-choices-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0 0.25rem;
}

.ai-choice-btn {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 0.45rem 0.9rem;
    font-size: 0.84rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
}
.ai-choice-btn:hover {
    border-color: var(--primary);
    background: #f0fdf4;
    color: var(--primary);
}
.ai-choice-btn-selected {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
.ai-choice-btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.ai-choice-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.ai-choice-btn-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .ai-chat-panel {
        width: calc(100% - 16px);
        right: 8px;
        bottom: 70px;
        max-height: 75vh;
        border-radius: 12px;
    }
    .ai-chat-messages {
        max-height: calc(75vh - 140px);
    }
}
