/* =============================================
   WithCare Curator – Styles
   ============================================= */

:root {
    --bg: #F1F4F8;
    --bg-warm: #E7ECFF;
    --card: #FFFFFF;
    --dark: #384E58;
    --dark-soft: #4f5d66;
    --sage: #8987DA;
    --sage-light: #a3a1e6;
    --sage-bg: #EFEFFB;
    --terracotta: #EE8B60;
    --terracotta-light: #f4a882;
    --terracotta-bg: #fef0e9;
    --text: #384E58;
    --text-muted: #57636C;
    --border: #dde2e8;
    --success: #4BBA76;
    --warning: #F9CF58;
    --error: #FF5963;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.18);
    --radius: 16px;
    --radius-sm: 12px;
    --transition: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    min-height: 100dvh;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.25px;
}

/* =============================================
   App Shell
   ============================================= */

.app-frame {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    position: relative;
    background: transparent;
    overflow: hidden;
}

/* Blurred decorative circles (как в care_pro) */
.app-frame::before,
.app-frame::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    filter: blur(80px);
}

.app-frame::before {
    top: 100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(0, 150, 136, 0.12);
}

.app-frame::after {
    bottom: 80px;
    left: -120px;
    width: 340px;
    height: 340px;
    background: rgba(233, 30, 99, 0.10);
}

@media (min-width: 768px) {
    body { background: linear-gradient(180deg, #F6F3FB 0%, #EDE9F7 100%); background-attachment: fixed; }
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(246, 243, 251, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(221, 216, 235, 0.4);
    padding: 0 1.25rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header-title {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
}

.app-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Bottom Nav (matching WithCare client app) */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 56px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: none;
    background: none;
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: color var(--transition);
}

.nav-tab.active {
    color: var(--sage);
    font-weight: 600;
}

.nav-tab svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Content */
.app-content {
    position: relative;
    z-index: 1;
    padding: 1rem 1rem 4.5rem;
    min-height: calc(100dvh - 56px);
}

/* =============================================
   Icon Button
   ============================================= */

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

.icon-btn:hover { background: var(--sage); color: #fff; }

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =============================================
   Tabs (pill style)
   ============================================= */

.tabs {
    display: none;
}

/* =============================================
   Client Card
   ============================================= */

.client-card {
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.client-card-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

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

.client-card:active {
    transform: translateY(0);
}

/* Avatar */
.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sage-bg);
    color: var(--sage);
    font-weight: 600;
    font-size: 1rem;
    position: relative;
}

.avatar-sm { width: 36px; height: 36px; font-size: 0.8rem; }

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

.client-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.35rem;
}

.client-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.goal-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--sage-bg);
    color: var(--sage);
}

.schedule-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--sage-bg);
    color: var(--sage);
}

.new-diary-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--terracotta);
    border: 2px solid #fff;
    flex-shrink: 0;
    position: absolute;
    top: -2px;
    right: -2px;
}

.client-activity {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.client-activity svg {
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.card-chevron {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Meal Preview on Client Card */
.meal-preview {
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

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

.meal-preview-header {
    margin-bottom: 0.35rem;
}

.meal-preview-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.new-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.55rem;
    border-radius: 8px;
    background: var(--terracotta-bg);
    color: var(--terracotta);
}

.meal-preview-photo {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.meal-preview-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.meal-preview-foods {
    font-size: 0.82rem;
    color: var(--dark);
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.meal-preview-scales {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mini-scale {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mini-scale-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    width: 44px;
    flex-shrink: 0;
}

.mini-scale-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--sage-bg);
    overflow: hidden;
}

.mini-scale-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition);
}

.mini-scale-fill.hunger {
    background: linear-gradient(90deg, #7d7bd6, #9997e0);
}

.mini-scale-fill.satiety {
    background: linear-gradient(90deg, #b07cc3, #c9a0d6);
}

.mini-scale-val {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--dark-soft);
    width: 14px;
    text-align: right;
    flex-shrink: 0;
}

.meal-preview-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.meal-preview-tag {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    background: var(--sage-bg);
    color: var(--sage);
}

/* =============================================
   Group Card
   ============================================= */

.group-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 8px 32px var(--sage-bg);
}

.group-card:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 40px var(--sage-bg);
    transform: translateY(-2px);
}

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

.group-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--sage);
    fill: none;
    stroke-width: 1.8;
}

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

.group-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.15rem;
}

.group-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* =============================================
   Detail Header
   ============================================= */

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.back-btn:hover { background: var(--sage-bg); border-color: var(--sage-bg); }

.back-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.detail-title { flex: 1; }

.detail-name {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--dark);
}

.detail-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* =============================================
   Segment Toggle (Diary / Chat)
   ============================================= */

.segment-toggle {
    display: flex;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    margin-bottom: 1.25rem;
}

.segment-btn {
    flex: 1;
    padding: 0.55rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.segment-btn.active {
    background: var(--card);
    color: var(--dark);
    box-shadow: var(--shadow);
}

/* =============================================
   Diary Entry
   ============================================= */

.diary-entry {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: 0 8px 32px var(--sage-bg);
}

.diary-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.diary-date {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.diary-meal-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.diary-unread {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--terracotta);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.diary-body {
    padding: 0 1.25rem 1.25rem;
    display: none;
}

.diary-entry.open .diary-body { display: block; }

.diary-chevron {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.diary-entry.open .diary-chevron { transform: rotate(180deg); }

/* Meal */
.meal {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.meal:last-child { border-bottom: none; }

.meal-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sage);
    margin-bottom: 0.35rem;
}

.meal-photo {
    margin-bottom: 0.6rem;
    border-radius: 12px;
    overflow: hidden;
}

.meal-photo img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.meal-foods {
    font-size: 0.88rem;
    color: var(--dark);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

/* Scales */
.scales {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.scale {
    flex: 1;
}

.scale-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.scale-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-warm);
    overflow: hidden;
}

.scale-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition);
}

.scale-fill.hunger { background: linear-gradient(90deg, var(--sage), var(--sage-light)); }
.scale-fill.satiety { background: linear-gradient(90deg, var(--terracotta), var(--terracotta-light)); }

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.tag {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 500;
}

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

.tag-symptom {
    background: var(--terracotta-bg);
    color: var(--terracotta);
}

/* =============================================
   Chat
   ============================================= */

.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 56px - 80px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.chat-date-sep {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
}

.message {
    display: flex;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.message-bubble {
    max-width: 80%;
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    position: relative;
}

.message-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-align: right;
}

.message.curator { justify-content: flex-end; }

.message.curator .message-bubble {
    background: var(--sage-bg);
    color: var(--dark);
    border-bottom-right-radius: 4px;
}

.message.client .message-bubble {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--dark);
    border-bottom-left-radius: 4px;
}

.message-sender-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sage);
    margin-bottom: 0.2rem;
}

/* Chat Input */
.chat-input-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    align-items: flex-end;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 24px;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--dark);
    outline: none;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    transition: border-color var(--transition);
}

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

.chat-input::placeholder { color: var(--text-muted); }

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--terracotta);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.send-btn:hover { background: #9b6baf; transform: scale(1.05); }

.send-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* =============================================
   Forms / Modals
   ============================================= */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--dark);
    outline: none;
    transition: border-color var(--transition);
    -webkit-appearance: none;
}

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

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238681a5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 0.5rem;
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input { position: absolute; opacity: 0; }

.radio-label {
    display: block;
    padding: 0.65rem;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.radio-option input:checked + .radio-label {
    background: var(--sage-bg);
    color: var(--sage);
    border-color: var(--sage);
}

/* Checkbox */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

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

.checkbox-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.checkbox-item.checked .checkbox-box {
    background: var(--sage);
    border-color: var(--sage);
}

.checkbox-item.checked .checkbox-box::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    margin-top: -2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
}

.btn-primary {
    background: var(--sage);
    color: #fff;
    box-shadow: 0 4px 12px rgba(137, 135, 218, 0.3);
}

.btn-primary:hover { background: #7573c8; transform: translateY(-1px); }

.btn-secondary {
    background: transparent;
    color: var(--dark);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: var(--sage-bg); border-color: var(--sage-bg); }

.btn-danger {
    background: transparent;
    color: #c07878;
    border: 1.5px solid #e8cccc;
}

.btn-danger:hover { background: #fdf0f0; }

/* FAB */
.fab {
    position: fixed;
    bottom: calc(56px + 1rem + env(safe-area-inset-bottom, 0px));
    right: calc(50% - 240px + 1rem);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    z-index: 50;
}

.fab:hover { transform: scale(1.1); }

.fab svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

@media (max-width: 480px) {
    .fab { right: 1rem; }
}

/* =============================================
   Settings
   ============================================= */

.settings-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px var(--sage-bg);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.settings-label {
    font-size: 0.9rem;
    color: var(--dark);
}

.time-input {
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--dark);
    outline: none;
    width: 100px;
    text-align: center;
}

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

/* Profile avatar */
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sage-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar svg {
    width: 28px;
    height: 28px;
    stroke: var(--sage);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Settings menu items */
.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--dark);
    text-decoration: none;
    transition: opacity var(--transition);
}

.settings-menu-item:last-child { border-bottom: none; }
.settings-menu-item:hover { opacity: 0.7; }

.settings-menu-item svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.settings-link { color: var(--sage); }
.settings-link svg { stroke: var(--sage); }

/* Logout button */
.btn-logout {
    background: #ee6b6e;
    color: #fff;
    box-shadow: 0 4px 20px rgba(238, 107, 110, 0.25);
}

.btn-logout:hover { background: #d95558; transform: translateY(-1px); }

.btn-logout svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =============================================
   Feed (Group Posts)
   ============================================= */

.feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feed-post {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 1.25rem;
    transition: all var(--transition);
    box-shadow: 0 8px 32px var(--sage-bg);
}

.feed-post-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.feed-post-author {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--dark);
}

.feed-post-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.feed-post-food {
    font-size: 0.9rem;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.feed-post-comment {
    font-size: 0.85rem;
    color: var(--dark-soft);
    font-style: italic;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Expandable details */
.feed-post-details {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--sage);
    cursor: pointer;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.feed-post-details svg {
    width: 16px;
    height: 16px;
    stroke: var(--sage);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--transition);
}

.feed-post-details-body {
    display: none;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.feed-post.details-open .feed-post-details-body { display: block; }
.feed-post.details-open .feed-post-details .diary-chevron { transform: rotate(180deg); }

/* Actions bar */
.feed-post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}

.feed-reactions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    flex: 1;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition);
}

.reaction-chip span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.reaction-chip:hover {
    border-color: var(--sage);
    background: var(--sage-bg);
}

.feed-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all var(--transition);
    flex-shrink: 0;
}

.feed-action-btn:hover { background: var(--bg-warm); color: var(--sage); }

.feed-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feed-comment-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: auto;
    padding: 0 0.5rem;
    border-radius: 16px;
}

.feed-comment-btn span {
    font-size: 0.75rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Emoji picker */
.emoji-picker {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.emoji-pick {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 10px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.emoji-pick:hover { background: var(--sage-bg); transform: scale(1.15); }

/* Thread (comments) */
.feed-thread {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.thread-comment {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.thread-comment:last-of-type { border-bottom: none; }

.thread-comment-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.15rem;
}

.thread-comment-text {
    font-size: 0.85rem;
    color: var(--dark-soft);
    line-height: 1.5;
}

.thread-comment-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.thread-input-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0 0;
    align-items: center;
}

.thread-input {
    flex: 1;
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--dark);
    outline: none;
    transition: border-color var(--transition);
}

.thread-input:focus { border-color: var(--sage); }
.thread-input::placeholder { color: var(--text-muted); }

/* =============================================
   Empty State
   ============================================= */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: var(--sage-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--sage);
    fill: none;
    stroke-width: 1.5;
}

.empty-title {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-text {
    font-size: 0.88rem;
    max-width: 280px;
    margin: 0 auto;
}

/* =============================================
   Confirm Dialog
   ============================================= */

.dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(79, 75, 114, 0.3);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.dialog-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.75rem;
    max-width: 340px;
    width: 100%;
    box-shadow: var(--shadow-hover);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dialog-title {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.dialog-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.dialog-actions {
    display: flex;
    gap: 0.75rem;
}

.dialog-actions .btn { flex: 1; padding: 0.7rem; font-size: 0.88rem; }

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

/* =============================================
   Toast
   ============================================= */

.toast {
    position: fixed;
    bottom: calc(72px + 1.5rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 300;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s ease 2s forwards;
    box-shadow: var(--shadow-hover);
}

@keyframes fadeOut { to { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* =============================================
   View Transitions
   ============================================= */

.view-enter {
    animation: viewIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* =============================================
   Login Screen
   ============================================= */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 2rem 1.25rem;
}

.login-card {
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.login-logo {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(79, 75, 114, 0.06);
}

.btn-google:hover {
    border-color: var(--sage-light);
    box-shadow: var(--shadow);
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-demo-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.login-demo-divider::before,
.login-demo-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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