/* DadMate v3 — Minimal Design */

:root {
    --cream: #FDFCFA;
    --bg: #F7F5F2;
    --surface: #FFFFFF;
    --card: #FFFFFF;

    --sage: #5B9A8B;
    --sage-light: #7BB8AA;
    --sage-bg: rgba(91, 154, 139, 0.08);
    --sage-border: rgba(91, 154, 139, 0.15);

    --coral: #E8846B;
    --coral-bg: rgba(232, 132, 107, 0.08);

    --amber: #D4956A;
    --amber-bg: rgba(212, 149, 106, 0.08);

    --purple: #8B5CF6;
    --purple-bg: rgba(139, 92, 246, 0.08);

    --text-1: #1A1A1A;
    --text-2: #666666;
    --text-3: #999999;
    --text-4: #CCCCCC;

    --border: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--cream);
    color: var(--text-1);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

#app {
    max-width: 420px;
    margin: 0 auto;
    min-height: 100dvh;
    background: var(--cream);
    padding-bottom: 90px;
}

.screen {
    display: none;
    animation: fadeUp 0.35s ease;
}
.screen.active { display: block; }

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

/* Header */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

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

.avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-sm);
}

.avatar-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--sage);
    opacity: 0.4;
}

.header-greeting {
    font-size: 13px;
    color: var(--text-3);
    font-weight: 400;
}

.header-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.4px;
}

.header-btn {
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    position: relative;
}

.header-btn:hover {
    transform: scale(1.05);
}

.ai-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: var(--sage);
    border-radius: 50%;
    border: 2px solid var(--cream);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

/* Week Hero */
.week-hero {
    background: var(--surface);
    border-radius: var(--radius-xl);
    margin: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: var(--shadow-sm);
}

.week-ring-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.week-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-week {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -2px;
}

.ring-label {
    font-size: 11px;
    color: var(--text-3);
}

.week-info { flex: 1; }

.week-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.fruit-emoji { font-size: 24px; }

.fruit-size {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
}

.days-count { margin-bottom: 8px; }

.days-num {
    font-family: var(--font-serif);
    font-size: 32px;
    color: var(--sage);
    line-height: 1;
}

.days-label {
    font-size: 12px;
    color: var(--text-3);
    margin-left: 4px;
}

.due-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
}

.week-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--sage-bg);
    color: var(--sage);
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    font-family: var(--font);
    transition: all 0.2s;
}

.week-detail-btn:hover {
    background: var(--sage);
    color: white;
}

/* To Do Section */
.todo-week {
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}

/* Week Tabs */
.week-tabs {
    display: flex;
    background: var(--surface);
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.week-tab {
    flex: 1;
    background: var(--bg);
    border: none;
    border-radius: var(--radius);
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.2s;
    font-family: var(--font);
}

.week-tab.active {
    background: var(--sage);
    color: white;
}

.week-tab-label {
    font-size: 13px;
    font-weight: 600;
}

.week-tab-sub {
    font-size: 10px;
    opacity: 0.7;
}

/* Week Contents */
.week-contents {
    position: relative;
    height: calc(100dvh - 180px);
    overflow: hidden;
}

/* Section Header Row */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-expand-btn {
    background: var(--sage-bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    color: var(--sage);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.cal-expand-btn.active {
    background: var(--sage);
    color: white;
}

.cal-expandable {
    margin-top: 16px;
}

.cal-date.has-appt {
    background: var(--coral-bg);
    color: var(--coral);
    font-weight: 600;
}

.cal-date.has-appt.selected {
    background: var(--coral);
    color: white;
}

.appt-card.highlighted {
    border: 2px solid var(--coral);
    background: rgba(232, 132, 107, 0.05);
}

.week-content {
    display: none;
    height: 100%;
    overflow-y: auto;
}

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

.todo-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
}

.todo-week-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.todo-arrow {
    transition: transform 0.3s;
    color: var(--text-3);
}

.todo-week.expanded .todo-arrow {
    transform: rotate(90deg);
}

.todo-week:not(.expanded) .todo-items {
    display: none;
}

.todo-count {
    font-size: 12px;
    color: var(--text-3);
}

.todo-count.done {
    color: var(--sage);
}

.todo-items {
    padding: 0 14px 12px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.todo-item:last-child {
    border-bottom: none;
}

.todo-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.todo-check:checked {
    background: var(--sage);
    border-color: var(--sage);
}

.todo-content {
    flex: 1;
}

.todo-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-1);
}

.todo-item.done .todo-name {
    text-decoration: line-through;
    color: var(--text-3);
}

.todo-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.todo-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text-3);
}

.todo-tag.urgent {
    background: var(--coral-bg);
    color: var(--coral);
}

/* Sections */
.page-body { padding: 0 16px 20px; }
.home-inner .section { padding: 16px; margin-bottom: 16px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

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

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: 0;
    text-transform: none;
    margin-top: 20px;
    margin-bottom: 12px;
}
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--sage-bg);
    color: var(--sage);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--sage);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Action Cards */
.action-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    padding: 12px;
    border-radius: var(--radius);
}

.action-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

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

.action-card.urgent {
    border-left: 3px solid var(--coral);
}

.action-icon { font-size: 20px; }

.action-content { flex: 1; }

.action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.action-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.action-priority {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-3);
    background: var(--bg);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.action-priority.urgent {
    color: var(--coral);
    background: var(--coral-bg);
}

.action-priority.normal {
    color: var(--sage);
    background: var(--sage-bg);
}

/* AI Banner */
.ai-banner {
    background: linear-gradient(135deg, var(--sage-bg) 0%, rgba(91, 154, 139, 0.05) 100%);
    border: 1px solid var(--sage-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.ai-banner:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.ai-avatar {
    width: 48px;
    height: 48px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sage);
}

.ai-text { flex: 1; }

.ai-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
}

.ai-desc {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}

.ai-arrow { color: var(--text-3); }

/* Quick Grid */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--surface);
    padding: 12px;
    border-radius: var(--radius);
}

.quick-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

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

.quick-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
}

.quick-badge {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-3);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.quick-badge.new {
    color: var(--coral);
    background: var(--coral-bg);
}

.quick-badge.urgent {
    color: var(--coral);
    background: var(--coral-bg);
}

/* Sync Preview */
.sync-preview {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.sync-pulse {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--sage);
    border-radius: 50%;
    animation: pingRing 2s ease infinite;
}

.pulse-dot {
    position: absolute;
    inset: 4px;
    background: var(--sage);
    border-radius: 50%;
}

@keyframes pingRing {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.8); opacity: 0; }
}

.sync-info { flex: 1; }

.sync-status {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.sync-time {
    font-size: 12px;
    color: var(--text-3);
}

.sync-moods {
    display: flex;
    gap: 6px;
}

.mood-chip {
    font-size: 11px;
    color: var(--text-2);
    background: var(--bg);
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

/* Page Nav */
.page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-back {
    background: none;
    border: none;
    color: var(--sage);
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
}

.nav-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-1);
}

.nav-more {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 8px;
}

.nav-new-post {
    background: var(--sage);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Week Overview */
.week-overview {
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 16px;
    color: white;
}

.week-overview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.week-emoji { font-size: 36px; }

.week-overview-text h2 {
    font-size: 20px;
    font-weight: 700;
}

.week-overview-text p {
    font-size: 13px;
    opacity: 0.9;
}

.week-stats {
    display: flex;
    gap: 16px;
}

.week-stat {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 20px;
    font-weight: 700;
}

.stat-key {
    font-size: 11px;
    opacity: 0.8;
}

/* Expect Card */
.expect-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.expect-card.collapsible {
    cursor: pointer;
}

.expect-card.collapsible .expect-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.expect-arrow {
    transition: transform 0.3s;
    color: var(--text-3);
}

.expect-card.collapsed .expect-arrow {
    transform: rotate(-90deg);
}

.expect-card .expect-list {
    display: block;
}

.expect-card.collapsed .expect-list {
    display: none !important;
}

.expect-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    margin-top: 16px;
    margin-bottom: 12px;
}

.expect-icon { font-size: 16px; }

.expect-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expect-list li {
    font-size: 13px;
    color: var(--text-2);
    padding-left: 16px;
    position: relative;
}

.expect-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--sage);
}

/* Task Section */
.task-section {
    margin-bottom: 16px;
}

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

.task-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
}

.task-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--sage);
}

.task-list {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.task-item:last-child { border-bottom: none; }

.task-item.done { opacity: 0.6; }

.task-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.2s;
}

.task-check:hover { border-color: var(--sage); }

.task-check.checked {
    background: var(--sage);
    border-color: var(--sage);
    color: white;
}

.task-content { flex: 1; }

.task-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-1);
}

.task-item.done .task-name {
    text-decoration: line-through;
    color: var(--text-3);
}

.task-time {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

.task-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text-3);
}

.task-tag.urgent {
    background: var(--coral-bg);
    color: var(--coral);
}

.task-tag.done {
    background: var(--sage-bg);
    color: var(--sage);
}

/* Appointment Section */
.appt-section { margin-bottom: 16px; }

.appt-header { margin-bottom: 10px; }

.appt-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
}

.appt-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appt-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.appt-card.highlight {
    border: 1px solid var(--sage-border);
    background: var(--sage-bg);
}

.appt-date {
    background: var(--sage);
    color: white;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    text-align: center;
    min-width: 48px;
}

.appt-month {
    display: block;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.9;
}

.appt-day {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.appt-info { flex: 1; }

.appt-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.appt-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.appt-loc {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
}

.appt-add {
    background: none;
    border: 1.5px solid var(--sage);
    color: var(--sage);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font);
    align-self: center;
}

.appt-add.added {
    background: var(--sage);
    color: white;
}

/* Nutrition Section */
.nutrition-section { margin-bottom: 16px; }

.nutrition-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
    margin-bottom: 10px;
}

.nutrition-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nutrition-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.nutrition-icon { font-size: 24px; }

.nutrition-info { flex: 1; }

.nutrition-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.nutrition-desc {
    font-size: 12px;
    color: var(--text-3);
}

/* AI Doctor */
.ai-container {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 60px);
    overflow: hidden;
    padding-bottom: 70px;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%);
    color: white;
}

.ai-doc-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-doc-name {
    font-size: 16px;
    font-weight: 700;
}

.ai-doc-status {
    font-size: 12px;
    opacity: 0.9;
}

.quick-questions {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.quick-q-label {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 8px;
}

.q-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.q-chip {
    background: var(--sage-bg);
    border: none;
    border-radius: var(--radius-full);
    color: var(--sage);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.q-chip:hover {
    background: var(--sage);
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    display: flex;
    gap: 10px;
    animation: fadeUp 0.3s ease;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    background: var(--sage-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sage);
    flex-shrink: 0;
}

.msg.user .msg-avatar {
    background: var(--coral-bg);
    color: var(--coral);
}

.msg-bubble {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-1);
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    max-width: 280px;
}

.msg.user .msg-bubble {
    background: var(--sage-bg);
}

.msg.ai-msg {
    flex-direction: row;
}

.msg.ai-msg .msg-bubble {
    max-width: 85%;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--sage);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
    padding: 12px 16px 90px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 10px 16px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--sage);
}

.chat-send {
    width: 44px;
    height: 44px;
    background: var(--sage);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send:hover {
    transform: scale(1.05);
}

/* Learn Section */
.learn-progress {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.learn-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 4px;
}

.learn-progress-stats {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 10px;
}

.learn-progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.learn-progress-fill {
    height: 100%;
    background: var(--sage);
    border-radius: var(--radius-full);
}

.class-section { margin-bottom: 16px; }

.class-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
    margin-bottom: 10px;
}

.class-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.class-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.class-card:hover {
    box-shadow: var(--shadow);
}

.class-card.completed {
    opacity: 0.7;
}

.class-card.in-progress {
    border: 1px solid var(--sage-border);
}

.class-icon { font-size: 24px; }

.class-content { flex: 1; }

.class-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.class-card.completed .class-name {
    text-decoration: line-through;
    color: var(--text-3);
}

.class-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.class-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.class-duration {
    font-size: 11px;
    color: var(--text-3);
}

.class-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text-3);
}

.class-status.completed {
    background: var(--sage-bg);
    color: var(--sage);
}

.class-status.in-progress {
    background: var(--amber-bg);
    color: var(--amber);
}

.class-check {
    color: var(--sage);
    font-size: 18px;
}

.class-progress-dot {
    width: 10px;
    height: 10px;
    background: var(--amber);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Tips Section */
.tips-section { margin-bottom: 16px; }

.tips-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
    margin-bottom: 10px;
}

.tip-card {
    background: var(--amber-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.tip-card p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}

/* Health Grid */
.health-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.health-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.health-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.health-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
}

.trend {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.trend.up { background: var(--coral-bg); color: var(--coral); }
.trend.down { background: var(--coral-bg); color: var(--coral); }
.trend.normal { background: var(--bg); color: var(--text-2); }
.trend.good { background: var(--sage-bg); color: var(--sage); }

.health-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
}

.health-unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-3);
}

.health-note {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
}

/* Report Card */
.report-card {
    background: linear-gradient(135deg, var(--purple-bg) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.report-icon {
    width: 44px;
    height: 44px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple);
}

.report-text { flex: 1; }

.report-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.report-desc {
    font-size: 12px;
    color: var(--text-2);
}

.report-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    background: var(--purple);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

/* Topic Chips */
.topic-scroll {
    display: flex;
    gap: 8px;
    padding: 4px 0 12px;
    flex-wrap: wrap;
}

.topic-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font);
    transition: all 0.2s;
}

.topic-chip:hover {
    border-color: var(--sage-border);
}

.topic-chip.active {
    background: var(--sage);
    border-color: var(--sage);
    color: white;
}

/* Posts */
.post-featured {
    background: linear-gradient(135deg, #FDF8F5 0%, #FFF5EE 100%);
    border: 1px solid rgba(232, 132, 107, 0.2);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

.post-badge {
    display: inline-block;
    background: var(--coral);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
}

.post-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text-3);
    margin-left: 4px;
}

.badge.expert {
    background: var(--sage-bg);
    color: var(--sage);
}

.badge.new {
    background: var(--coral-bg);
    color: var(--coral);
}

.author-time {
    font-size: 11px;
    color: var(--text-3);
}

.post-headline {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.4;
    margin-bottom: 6px;
}

.post-preview {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-actions {
    display: flex;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.action-like, .action-comment {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.action-like:hover {
    background: var(--coral-bg);
    color: var(--coral);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 28px;
    z-index: 100;
}

.tab {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--text-4);
    transition: all 0.2s;
    border-radius: 10px;
}

.tab span {
    font-size: 10px;
    font-weight: 600;
}

.tab.active {
    color: var(--sage);
}

.ai-tab .ai-tab-icon {
    width: 40px;
    height: 40px;
    background: var(--sage);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(91, 154, 139, 0.3);
}

.ai-tab.active .ai-tab-icon {
    transform: scale(1.1);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text-1);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Additional Styles for Complete Content ── */

/* Status Chips Row */
.status-chips-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 12px;
    border-radius: var(--radius);
}

.status-chip-mini {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.chip-emoji { font-size: 16px; }

.chip-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

/* Next Appointment Banner */
.next-appt-banner {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    margin-bottom: 16px;
}

.next-appt-banner:hover {
    box-shadow: var(--shadow);
}

.next-appt-icon { font-size: 28px; }

.next-appt-info { flex: 1; }

.next-appt-label {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 2px;
}

.next-appt-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.next-appt-time {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.next-appt-days {
    font-size: 12px;
    font-weight: 600;
    color: var(--sage);
    background: var(--sage-bg);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* Daily Tip Card */
.daily-tip-card {
    background: linear-gradient(135deg, var(--sage-bg) 0%, rgba(91, 154, 139, 0.05) 100%);
    border: 1px solid var(--sage-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.tip-icon { font-size: 24px; }

.tip-content { flex: 1; }

.tip-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--sage);
    margin-bottom: 4px;
}

.tip-text {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}

/* Development Card */
.development-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.development-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    margin-top: 16px;
    margin-bottom: 12px;
}

.development-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.development-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dev-icon { font-size: 20px; }

.dev-info { }

.dev-label {
    font-size: 11px;
    color: var(--text-3);
}

.dev-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

/* Nutrition Card Warning */
.nutrition-card.warning {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.nutrition-card.warning .nutrition-icon {
    filter: grayscale(0.5);
}

/* Symptoms Section */
.symptoms-section { margin-bottom: 16px; }

.symptoms-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
    margin-bottom: 10px;
}

.symptoms-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.symptom-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.symptom-card.warning {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.symptom-header {
    margin-bottom: 8px;
}

.symptom-emoji {
    font-size: 12px;
    font-weight: 600;
}

.symptom-card.warning .symptom-emoji {
    color: #E8846B;
}

.symptom-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.symptom-list li {
    font-size: 13px;
    color: var(--text-2);
    padding-left: 14px;
    position: relative;
}

.symptom-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--sage);
}

.symptom-card.warning .symptom-list li::before {
    color: #E8846B;
}

/* Section Description */
.section-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 12px;
}

/* Bonding Section */
.bonding-section { margin-bottom: 16px; }

.bonding-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 16px;
    margin-bottom: 10px;
}

.bonding-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bonding-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.bonding-emoji { font-size: 24px; }

.bonding-content { flex: 1; }

.bonding-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.bonding-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

/* Partner Card */
.partner-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.partner-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffd5dc;
}

.partner-info { flex: 1; }

.partner-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
}

.partner-status {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.partner-message-btn {
    width: 40px;
    height: 40px;
    background: var(--sage-bg);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sage);
    cursor: pointer;
}

/* Activity Grid */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.activity-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}

.activity-icon { font-size: 20px; margin-bottom: 8px; }

.activity-info { margin-bottom: 8px; }

.activity-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-1);
}

.activity-label {
    font-size: 11px;
    color: var(--text-3);
}

.activity-progress {
    height: 4px;
    background: var(--bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--sage);
    border-radius: var(--radius-full);
}

.activity-goal {
    font-size: 10px;
    color: var(--text-3);
}

/* Recent Reports */
.recent-reports {
    margin-top: 10px;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.report-item:last-child { border-bottom: none; }

.report-date {
    font-size: 12px;
    color: var(--text-3);
    min-width: 50px;
}

.report-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-1);
}

.report-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.report-status.normal {
    background: var(--sage-bg);
    color: var(--sage);
}

/* Calendar Preview */
.calendar-preview {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

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

.cal-month {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
}

.cal-nav {
    font-size: 14px;
    color: var(--sage);
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.cal-day {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-3);
    padding: 4px;
}

.cal-date {
    font-size: 12px;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.cal-date.empty { background: transparent; }

.cal-date.today {
    background: var(--sage);
    color: white;
    font-weight: 600;
}

.cal-date.event {
    background: var(--coral-bg);
    color: var(--coral);
    font-weight: 600;
}

.calendar-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-3);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.highlight { background: var(--coral); }
.legend-dot.today { background: var(--sage); }

/* Thinking toggle styles */
.thinking-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.thinking-toggle {
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.thinking-toggle:hover {
    background: #efefef;
}

.thinking-toggle.collapsed .thinking-indicator::after {
    content: ' (click to show)';
}

.thinking-content {
    margin-top: 6px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
    max-height: 150px;
    overflow-y: auto;
}

/* Floating AI Doctor Button */
.floating-ai-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(232, 132, 107, 0.4);
    cursor: pointer;
    z-index: 1000;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-ai-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(232, 132, 107, 0.5);
}

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

/* ── Modal System ─────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.modal-back {
    background: none;
    border: none;
    color: var(--sage);
    cursor: pointer;
    padding: 4px;
    margin-left: -4px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-icon {
    font-size: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
}

.modal-duration {
    font-size: 12px;
    color: var(--text-3);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.modal-post-btn {
    background: var(--sage);
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font);
}

/* Lesson Modal */
.lesson-modal-content {
    max-height: 85vh;
}

.lesson-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    line-height: 1.6;
}

.lesson-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1);
    margin: 16px 0 8px;
}

.lesson-body h3:first-child {
    margin-top: 0;
}

.lesson-body p {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 12px;
}

.lesson-body ul {
    list-style: none;
    margin-bottom: 12px;
}

.lesson-body li {
    font-size: 14px;
    color: var(--text-2);
    padding: 4px 0 4px 16px;
    position: relative;
}

.lesson-body li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--sage);
}

/* Post Modal */
.post-modal-content {
    max-height: 90vh;
}

.post-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.pm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pm-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
}

.pm-author {
    flex: 1;
}

.pm-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
}

.pm-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--sage-bg);
    color: var(--sage);
    margin-left: 6px;
}

.pm-time {
    font-size: 12px;
    color: var(--text-3);
}

.pm-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.4;
    margin-bottom: 16px;
}

.pm-body {
    margin-bottom: 20px;
}

.pm-body p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 10px;
}

.pm-body b {
    color: var(--text-1);
    font-weight: 600;
}

.pm-actions {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pm-like, .pm-comment {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font);
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.pm-like:hover, .pm-comment:hover {
    background: var(--sage-bg);
    color: var(--sage);
}

/* New Post Modal */
.newpost-modal-content {
    max-height: 70vh;
}

.newpost-body {
    padding: 16px;
}

.newpost-title {
    width: 100%;
    border: none;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 0;
    outline: none;
    font-family: var(--font);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.newpost-title::placeholder {
    color: var(--text-4);
}

.newpost-text {
    width: 100%;
    border: none;
    font-size: 14px;
    padding: 12px 0;
    outline: none;
    font-family: var(--font);
    resize: none;
    min-height: 150px;
    line-height: 1.5;
}

.newpost-text::placeholder {
    color: var(--text-4);
}

/* Clickable cards cursor */
.post-featured, .post-card {
    cursor: pointer;
}

/* Class card cursor */
.class-card {
    cursor: pointer;
}

/* Conversations Modal */
.conv-modal-content {
    max-height: 75vh;
}

.conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.conv-item:hover {
    background: var(--bg);
}

.conv-item.active {
    background: var(--sage-bg);
    border-left: 3px solid var(--sage);
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.conv-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--text-3);
}

.conv-badge.new {
    background: var(--coral-bg);
    color: var(--coral);
}

.conv-preview {
    font-size: 13px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 11px;
    color: var(--text-4);
    flex-shrink: 0;
}

.modal-icon-btn {
    background: none;
    border: none;
    color: var(--sage);
    cursor: pointer;
    padding: 4px;
}

/* Comments Modal */
.comments-modal-content {
    max-height: 80vh;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-time {
    font-size: 11px;
    color: var(--text-4);
    font-weight: 400;
}

.comment-text {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    margin-top: 4px;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.comment-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
}

.comment-input:focus {
    border-color: var(--sage);
}

.comment-send {
    width: 40px;
    height: 40px;
    background: var(--sage);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 420px) {
    #app { max-width: 100%; }
    .tab-bar { max-width: 100%; }
}
