:root {
    /* 主色：鼠尾草绿，低饱和沉静 */
    --primary: #7C9C8E;
    --primary-dark: #5E7B6E;
    --primary-light: #EEF3F0;
    --accent-sky: #A8C0D4;
    --accent-mint: #C8DCD2;
    /* 功能色：柔和不刺眼 */
    --success: #7BAE8A;
    --success-bg: #EDF5EF;
    --warning: #D4B582;
    --warning-bg: #F7F0E4;
    --danger: #C99090;
    --danger-bg: #F5EAEA;
    /* 文字：高对比度护眼 */
    --text: #2D3330;
    --text-secondary: #6B736E;
    --text-muted: #9CA3A0;
    /* 中性：暖白底，清晰边框 */
    --border: #E5E7E3;
    --border-strong: #D1D5D0;
    --bg: #FAFAF7;
    --card: #ffffff;
    /* 阴影：中性极轻，不带色 */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    /* 圆角：克制精致 */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-height: 58px;
    --header-bg: #FAFAF7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.page-app {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

/* ===== Login ===== */
.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F2F0EA;
    padding: 20px;
}

.login-wrap {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--card);
    border-radius: 20px;
    padding: 36px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.login-help {
    font-size: 13px;
    margin-bottom: 20px;
}

.login-help a {
    color: var(--primary);
    text-decoration: none;
}

.login-link {
    margin-top: 16px;
    font-size: 13px;
}

.login-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.error-msg {
    background: #fef2f2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 14px;
    text-align: left;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    height: 48px;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-block { width: 100%; }

/* ===== App ===== */
.app-header {
    flex-shrink: 0;
    background: var(--header-bg);
    color: var(--text);
    padding: 16px 18px 14px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 8px;
}

.btn-help-sm {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    margin-top: 2px;
    border: 1px solid var(--border);
    box-shadow: none;
}

.app-header h1 {
    font-size: 21px;
    font-weight: 600;
    color: #2D4A42;
    letter-spacing: 0.02em;
}

.user-greeting {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-tagline {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: 0;
}

body:not(.tab-home) .header-tagline {
    display: none;
}

.btn-logout {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--card);
}

.date-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.btn-date {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-xs);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-picker {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    text-align: center;
}

.btn-today {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.progress-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    backdrop-filter: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-value strong {
    font-size: 22px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.vitamin-hint {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.85;
}

/* ===== Slot List ===== */
.slot-list {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.slot-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
}

.slot-card.checked {
    border-left: 4px solid var(--success);
}

.slot-card.checked .slot-header {
    background: var(--success-bg);
}

.slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--primary-light);
    cursor: pointer;
    user-select: none;
}

.slot-title-wrap {
    flex: 1;
}

.slot-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.slot-time-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.slot-check-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.25s;
    margin-left: 12px;
}

.slot-check-btn.checked {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.slot-body {
    padding: 0 16px 14px;
}

.slot-card:not(.expanded) .slot-body {
    display: none;
}

.medicine-list {
    list-style: none;
    padding-top: 10px;
}

.medicine-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.medicine-item:last-child {
    border-bottom: none;
}

.medicine-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.medicine-dose {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
    margin-right: 8px;
}

.medicine-note {
    font-size: 11px;
    color: var(--warning);
    background: #fffbeb;
    padding: 2px 8px;
    border-radius: 4px;
}

.checked-time {
    font-size: 12px;
    color: var(--success);
    padding: 0 16px 12px;
    font-weight: 500;
}

.slot-card:not(.checked) .checked-time {
    display: none;
}

.skip-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--text-secondary);
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 100;
    white-space: nowrap;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Empty ===== */
.all-done {
    text-align: center;
    padding: 30px 20px;
    color: var(--success);
    font-size: 18px;
    font-weight: 600;
}

.all-done .emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

@media (min-width: 480px) {
    .slot-list, .main-content, .quick-cards {
        max-width: 480px;
        margin: 0 auto;
    }
}

/* ===== Tab Navigation ===== */
.main-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0;
    padding-bottom: 16px;
    background: var(--bg);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.bottom-nav {
    flex-shrink: 0;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    min-height: calc(var(--nav-height) + var(--safe-bottom));
    padding: 6px 4px calc(8px + var(--safe-bottom));
    background: var(--card);
    backdrop-filter: none;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 50;
    box-shadow: none;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    padding: 4px 2px;
    min-width: 0;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
    line-height: 1.1;
}

.nav-label {
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    transform: scale(0.95);
}

/* ===== Compact Header ===== */
.date-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 14px;
    color: var(--text);
    box-shadow: none;
}

.btn-date-sm {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--primary);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.header-extra {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-sm {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-text {
    font-size: 12px;
    white-space: nowrap;
    color: #5A7A70;
}

.vitamin-hint-bar {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    background: #fffbeb;
    border-bottom: 1px solid #fef3c7;
}

/* ===== Quick Cards (懒人操作) ===== */
.quick-cards {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.card-icon {
    font-size: 24px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-stat {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.card-stat strong {
    font-size: 26px;
    color: var(--primary);
    font-weight: 700;
}

.card-stat.big strong {
    font-size: 36px;
}

.progress-bar-card {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar-card .progress-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

.quick-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-quick {
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.btn-quick:active, .btn-quick.tapped {
    transform: scale(0.92);
    background: #93c5fd;
}

.water-card .btn-quick {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-big-action {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.15s;
}

.btn-big-action:active {
    transform: scale(0.97);
}

.count-card .btn-big-action {
    background: #d1fae5;
    color: #047857;
}

.timer-card .btn-big-action.start {
    background: #fef3c7;
    color: #b45309;
}

.timer-card .btn-big-action.stop {
    background: #fee2e2;
    color: #dc2626;
}

.timer-card.running {
    border: 2px solid #fbbf24;
    background: #fffbeb;
}

.timer-display {
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    color: #b45309;
    font-variant-numeric: tabular-nums;
    margin: 8px 0;
    letter-spacing: 2px;
}

/* ===== Recent ===== */
.recent-section {
    padding: 0 14px 24px;
}

.recent-section h3 {
    font-size: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recent-section .hint {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
}

.recent-list {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.recent-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    gap: 10px;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-icon {
    font-size: 22px;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-name {
    font-size: 14px;
    font-weight: 500;
}

.recent-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-undo {
    border: none;
    background: #fef2f2;
    color: #ef4444;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== Timeline ===== */
.timeline-list {
    padding: 14px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.timeline-dot {
    font-size: 24px;
    width: 36px;
    text-align: center;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 15px;
    font-weight: 500;
}

.timeline-value {
    color: var(--primary);
    font-weight: 700;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== Mine ===== */
.mine-section {
    background: var(--card);
    margin: 14px;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.mine-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-head h3 {
    margin-bottom: 0;
}

.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 12px;
}

.btn-add-sm {
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.goal-setting {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn-goal {
    height: 40px;
    padding: 0 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-goal.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.goal-unit {
    font-size: 13px;
    color: var(--text-secondary);
}

.custom-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.custom-item-row:last-child {
    border-bottom: none;
}

.custom-icon {
    font-size: 24px;
}

.custom-info {
    flex: 1;
}

.custom-name {
    font-size: 15px;
    font-weight: 500;
}

.custom-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-delete {
    border: none;
    background: #fef2f2;
    color: #ef4444;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-logout-block {
    display: block;
    text-align: center;
    padding: 14px;
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #fecaca;
    border-radius: 10px;
}

.btn-help-link {
    display: block;
    text-align: center;
    padding: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--primary-light);
}

/* ===== Help page ===== */
.page-help {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 24px;
}

.help-header {
    background: var(--header-bg);
    color: var(--text);
    padding: 16px 16px 24px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.help-back {
    position: absolute;
    left: 16px;
    top: 18px;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 16px;
}

.help-header h1 {
    font-size: 22px;
    margin-bottom: 4px;
    color: #2D4A42;
    font-weight: 600;
}

.help-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.help-content {
    padding: 14px;
    max-width: 480px;
    margin: 0 auto;
}

.help-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.help-card.highlight {
    background: var(--primary-light);
    border: 1px solid var(--border);
}

.help-card h2 {
    font-size: 16px;
    margin-bottom: 10px;
}

.help-card p,
.help-card li {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}

.help-card ul,
.help-card ol {
    padding-left: 20px;
    margin: 0;
}

.help-card li {
    margin-bottom: 6px;
}

.help-tip {
    margin-top: 10px;
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    background: #f9fafb;
    padding: 8px 10px;
    border-radius: 8px;
}

.help-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    font-size: 13px !important;
}

.help-legend .dot {
    width: 8px;
    height: 8px;
    margin-right: 3px;
    vertical-align: middle;
}

.help-faq dt {
    font-weight: 700;
    font-size: 14px;
    margin-top: 10px;
}

.help-faq dt:first-child {
    margin-top: 0;
}

.help-faq dd {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0;
    line-height: 1.6;
}

.help-faq code {
    font-size: 12px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.help-footer {
    padding: 8px 0 20px;
}

.empty-hint {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.modal-body {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px calc(24px + var(--safe-bottom));
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-body h3 {
    font-size: 18px;
    margin-bottom: 18px;
    text-align: center;
}

.emoji-picker, .type-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emoji-opt {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 22px;
    cursor: pointer;
}

.emoji-opt.active, .type-opt.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.type-opt {
    flex: 1;
    min-width: calc(50% - 4px);
    height: 44px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
    height: 48px;
}

.btn-ghost {
    background: #f3f4f6;
    color: var(--text);
}

/* ===== Toilet / Period cards ===== */
.toilet-stats, .period-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.toilet-stats strong, .period-info strong {
    font-size: 24px;
    color: var(--primary);
}

.toilet-btns, .period-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-toilet {
    height: 56px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.btn-toilet.pee {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-toilet.poop {
    background: #fef3c7;
    color: #b45309;
}

.btn-period {
    height: 56px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-period.start {
    background: #fce7f3;
    color: #db2777;
}

.btn-period.day {
    background: #f3e8ff;
    color: #9333ea;
}

.period-card.today-marked {
    border: 2px solid #f9a8d4;
    background: #fdf2f8;
}

/* ===== Calendar ===== */
.calendar-wrap {
    padding: 14px 14px 24px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 700;
}

.btn-cal-nav {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--card);
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-cell {
    aspect-ratio: 1;
    border: none;
    background: var(--card);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    min-height: 44px;
}

.cal-cell.empty {
    background: transparent;
    cursor: default;
}

.cal-cell.today .cal-num {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-cell.selected {
    outline: 2px solid var(--primary);
}

.cal-num {
    font-size: 14px;
    font-weight: 600;
}

.cal-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    flex-wrap: wrap;
    justify-content: center;
}

.dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.dot.water { background: #3b82f6; }
.dot.pee { background: #10b981; }
.dot.poop { background: #f59e0b; }
.dot.period { background: #ec4899; }
.dot.med { background: #8b5cf6; }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
    font-size: 11px;
    color: var(--text-secondary);
}

.calendar-legend .dot {
    width: 8px;
    height: 8px;
    margin-right: 3px;
    vertical-align: middle;
}

.cal-day-detail {
    margin-top: 14px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.cal-detail-date {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cal-detail-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-view-day {
    width: 100%;
    height: 44px;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Stats ===== */
.stats-wrap {
    padding: 14px 14px 24px;
}

.stats-range {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.btn-range {
    flex: 1;
    min-width: calc(33% - 8px);
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 6px;
}

.stats-custom-range {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.stats-custom-range.hidden {
    display: none;
}

.stats-date-input {
    flex: 1;
    min-width: 120px;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
}

.stats-date-sep {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-stats-query {
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.stats-range-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}

.single-day-stats {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.single-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
}

.single-stat-row:last-child {
    border-bottom: none;
}

.single-stat-row strong {
    color: var(--primary);
    font-size: 16px;
}

.single-day-stats .progress-bar-card {
    margin: 4px 0 12px;
}

.btn-range.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-chip {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-val {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.stat-lbl {
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-block {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.chart-title small {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0 4px;
}

.chart-bar-item {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.4s ease;
}

.chart-bar.goal-hit {
    box-shadow: 0 0 0 2px var(--success);
}

.chart-labels {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    padding: 0 4px;
}

.chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 9px;
    color: var(--text-secondary);
    overflow: hidden;
}

/* ===== Exercise ===== */
.exercise-card .ex-sub-stat {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

.exercise-card .card-stat strong {
    font-size: 32px;
}

.ex-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ex-quick-chip {
    border: none;
    background: #fee2e2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ex-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    border-radius: 6px;
    background: rgba(220, 38, 38, 0.15);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

.exercise-card .btn-big-action.exercise-start {
    background: #fee2e2;
    color: #dc2626;
}

.exercise-card.running {
    border: 2px solid #f87171;
    background: #fef2f2;
}

.ex-timer-name {
    text-align: center;
    font-size: 14px;
    color: #dc2626;
    margin-bottom: 8px;
}

.modal-body-tall {
    max-height: 88vh;
}

.ex-cat-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.ex-cat-tab, .ex-cat-pick {
    flex: 1;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ex-cat-tab.active, .ex-cat-pick.active {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.exercise-item-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.ex-item-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

.ex-item-btn span {
    font-weight: 600;
}

.ex-item-btn.active {
    border-color: #ef4444;
    background: #fef2f2;
}

.ex-selected-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
}

.ex-duration-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.btn-ex-dur {
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.btn-ex-timer {
    grid-column: span 3;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #fef3c7;
    color: #b45309;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.dot.exercise { background: #ef4444; }
.dot.mood { background: #a855f7; }

/* ===== Exercise feeling ===== */
.ex-feeling-section {
    margin-bottom: 12px;
}

.ex-feeling-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ex-feeling-label span {
    font-weight: 400;
    font-size: 12px;
}

.ex-feeling-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ex-feeling-chip {
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ex-feeling-chip.active {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

/* ===== Mood card ===== */
.mood-card .mood-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.mood-quick-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 12px;
}

.mood-quick-btn {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: #f3e8ff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: inherit;
}

.mood-quick-btn span {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.mood-quick-btn:active {
    transform: scale(0.96);
    background: #e9d5ff;
}

.mood-slots-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.mood-slot-btn {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fafafa;
    padding: 8px 4px;
    cursor: pointer;
    font-family: inherit;
}

.mood-slot-btn.recorded {
    background: #f3e8ff;
    border-color: #c4b5fd;
}

.mood-slot-btn.picking {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px #e9d5ff;
}

.mood-slot-label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.mood-slot-emoji {
    font-size: 20px;
    line-height: 1.2;
}

.mood-picker {
    background: #F5F0FC;
    border-radius: 12px;
    padding: 10px;
    margin-top: 4px;
}

.mood-picker-title {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
}

.mood-picker .mood-quick-btn {
    height: 56px;
}

/* ===== Body metrics ===== */
.body-height-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.body-height-row label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.body-height-row input {
    flex: 1;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
}

.btn-save-height {
    height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.body-latest-card {
    background: #f0fdf4;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.body-latest-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.body-latest-values {
    font-size: 15px;
    line-height: 1.6;
}

.body-latest-values strong {
    color: var(--primary);
}

.body-history-title {
    font-size: 14px;
    margin: 12px 0 8px;
    color: var(--text-secondary);
}

.body-history-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.body-history-row span:first-child {
    width: 90px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.body-history-row span:nth-child(2) {
    flex: 1;
}

.body-history-row .slot-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.body-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.body-form-grid .form-group {
    margin-bottom: 0;
}

.body-form-grid input {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 15px;
}

.body-slot-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.body-slot-tab {
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.body-slot-tab.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.body-today-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.body-slot-card {
    background: #f9fafb;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.body-slot-card.recorded {
    background: #f0fdf4;
    border-color: #86efac;
}

.body-slot-card .slot-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.body-slot-card .slot-weight {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.body-slot-card .slot-weight.empty {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
}

.body-slot-card .slot-bmi {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.body-card .body-home-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.body-home-slot {
    background: var(--primary-light);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.body-home-slot.recorded {
    background: #f0fdf4;
}

.body-home-slot .label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.body-home-slot .value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.body-home-slot .value.muted {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
}

.body-card-actions {
    display: flex;
    gap: 8px;
}

.btn-body-detail {
    flex: 1;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.weight-chart-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.weight-chart-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.weight-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 130px;
    padding: 0 2px;
}

.weight-chart-day {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.weight-bar {
    width: 45%;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}

.weight-bar.morning { background: #3b82f6; }
.weight-bar.evening { background: #f59e0b; }

#bodyMetricsSection.mine-section {
    margin-bottom: 16px;
}

/* ===== Medicine schedule editor ===== */
.medicine-schedule-preview {
    margin-top: 8px;
}

.schedule-preview-row {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.schedule-preview-title {
    display: block;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.schedule-preview-meds {
    color: var(--text-secondary);
    line-height: 1.4;
}

.schedule-editor {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 12px;
}

.schedule-slot-edit {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}

.schedule-slot-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.schedule-slot-head .sched-input {
    flex: 1;
}

.sched-input {
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
    margin-bottom: 6px;
}

.sched-input.sm {
    width: 72px;
    flex-shrink: 0;
}

.sched-input.full {
    width: 100%;
}

.schedule-med-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.schedule-med-row .sched-input {
    flex: 1;
    min-width: 80px;
    margin-bottom: 0;
}

.sched-d3-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-delete-sm {
    border: none;
    background: #fee2e2;
    color: #dc2626;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-add-med {
    width: 100%;
    border: 1.5px dashed var(--border);
    background: #fff;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}

/* ===== Lazy home layout ===== */
.btn-back-today {
    border: none;
    background: #fff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 4px;
}

.home-progress-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hp-chip {
    font-size: 12px;
    background: var(--card);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.medicine-quick-card {
    border-left: 4px solid var(--primary);
}

.medicine-quick-card.done {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.med-quick-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.med-quick-info {
    flex: 1;
    min-width: 0;
}

.med-quick-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.med-quick-check {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.btn-med-more {
    width: 100%;
    margin-top: 10px;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.water-primary-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-water-primary {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.btn-water-more {
    width: 56px;
    height: 52px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.water-custom-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
    align-items: center;
}
.water-custom-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    background: #fff;
}
.water-custom-input:focus { outline: none; border-color: var(--primary); }
.water-custom-row .btn-quick { flex: 0 0 auto; }

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.grid-cell {
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}

.grid-cell-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.grid-cell-stat {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.grid-cell-btns {
    display: flex;
    gap: 6px;
}

.btn-grid {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-grid.stop {
    background: #fee2e2;
    color: #dc2626;
}

.btn-grid-text {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.mood-compact .mood-quick-row.compact {
    margin-bottom: 6px;
}

.mood-quick-btn.sm {
    height: 36px;
    font-size: 20px;
    border-radius: 8px;
}

.mood-slot-summary {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.mood-sum-item {
    flex: 1;
    text-align: center;
}

.body-home-slots.compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.body-home-slots.compact .body-home-slot {
    padding: 8px;
}

.body-home-slots.compact .value {
    font-size: 18px;
}

.ex-quick-row.compact {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.ex-quick-chip.sm {
    flex: 1;
    padding: 8px 4px;
    font-size: 16px;
    justify-content: center;
}

.timer-display.sm {
    font-size: 24px;
    margin: 4px 0;
}

.period-card.compact .period-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-period-single {
    flex: 1;
}

.btn-period-alt {
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px;
}

.recent-head {
    cursor: pointer;
    user-select: none;
}

.recent-toggle-icon {
    float: right;
    font-size: 12px;
    color: var(--text-secondary);
}

.recent-toggle-text {
    float: right;
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-right: 4px;
}

.recent-section:not(.expanded) .recent-list {
    max-height: 200px;
    overflow: hidden;
}

.recent-item.tappable {
    cursor: pointer;
}

.recent-item.tappable:active {
    background: #f3f4f6;
}

.recent-more-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px;
}

/* 体重快速记录：紧凑小弹框，靠上显示避开软键盘 */
#weightQuickModal {
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
#weightQuickModal .modal-body {
    max-width: 260px;
    width: calc(100% - 48px);
    padding: 14px 16px 12px;
    border-radius: 16px;
    max-height: 70vh;
    box-sizing: border-box;
    animation: none;
}
#weightQuickModal .modal-body h3 {
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
}
#weightQuickModal .modal-actions {
    margin-top: 10px;
    gap: 8px;
}
#weightQuickModal .modal-actions .btn {
    height: 36px;
    font-size: 13px;
    padding: 0 10px;
}

.weight-quick-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}

.weight-quick-input-wrap input {
    flex: 1;
    min-width: 0;
    height: 40px;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 10px;
}
.weight-quick-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
}

.weight-unit {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.mood-pick-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}

.btn-mood-slot-pick {
    height: 36px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

/* ===== Slot expand default ===== */
.slot-card .slot-body {
    display: block;
}

.slot-card.expanded .slot-body {
    display: block;
}
