/* iOS-native skin — layered on top of styles.css */
:root {
    --ios-bg: #F2F2F7;
    --ios-card: #FFFFFF;
    --ios-card-2: #F2F2F7;
    --ios-label: #000000;
    --ios-secondary: #3C3C43;
    --ios-tertiary: #3C3C4399;
    --ios-separator: rgba(60, 60, 67, 0.18);
    --ios-blue: #007AFF;
    --ios-red: #FF3B30;
    --ios-green: #34C759;
    --ios-orange: #FF9500;
    --ios-yellow: #FFCC00;
    --ios-purple: #AF52DE;
    --ios-pink: #FF2D55;
    --ios-indigo: #5856D6;
    --ios-teal: #30B0C7;
    --ios-gray1: #8E8E93;
    --ios-gray2: #AEAEB2;
    --ios-gray3: #C7C7CC;
    --ios-gray4: #D1D1D6;
    --ios-gray5: #E5E5EA;
    --ios-gray6: #F2F2F7;
    --ios-radius: 14px;
    --ios-radius-sm: 10px;
    --ios-radius-lg: 18px;
    --ios-tap: 44px;
    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Helvetica Neue", Inter, sans-serif;
}

body.dark-mode {
    --ios-bg: #000000;
    --ios-card: #1C1C1E;
    --ios-card-2: #2C2C2E;
    --ios-label: #FFFFFF;
    --ios-secondary: rgba(235, 235, 245, 0.88);
    --ios-tertiary: rgba(235, 235, 245, 0.56);
    --ios-separator: rgba(84, 84, 88, 0.48);
    --ios-gray5: #2C2C2E;
    --ios-gray6: #1C1C1E;
}

/* ============ Base ============ */
html, body {
    font-family: var(--ios-font);
    background: var(--ios-bg);
    color: var(--ios-label);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

body {
    background: var(--ios-bg) !important;
}

button, input, textarea, select {
    font-family: var(--ios-font);
    letter-spacing: -0.01em;
}

/* Hide old SVG chevron that came with date selector */
.top-bar .chevron { display: none !important; }

/* ============ Top Bar (iOS large-title style) ============ */
.top-bar {
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--ios-separator);
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    gap: 4px;
    box-shadow: none;
    min-height: calc(44px + env(safe-area-inset-top));
}

body.dark-mode .top-bar {
    background: rgba(28, 28, 30, 0.82);
}

.top-bar .dark-toggle,
.top-bar .date-arrow,
.top-bar .refresh-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--ios-gray5);
    color: var(--ios-label);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 17px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
}

.top-bar .dark-toggle:active,
.top-bar .date-arrow:active,
.top-bar .refresh-btn:active {
    opacity: 0.55;
    transform: scale(0.94);
}

.top-bar .date-arrow svg,
.top-bar .refresh-btn svg {
    width: 18px;
    height: 18px;
}

.top-bar .date-selector {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.top-bar #displayDate,
.top-bar .current-date {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-label);
    letter-spacing: -0.02em;
}

.today-btn {
    background: var(--ios-blue) !important;
    color: #fff !important;
    border-radius: 100px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    border: none !important;
}

.sync-status {
    font-size: 16px;
}

.version-badge {
    font-size: 10px;
    color: var(--ios-tertiary);
    background: transparent;
    padding: 0 4px;
}

/* Top bar overflow button */
.topbar-more {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--ios-gray5);
    color: var(--ios-label);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.topbar-more:active { opacity: 0.55; transform: scale(0.94); }

/* Top bar overflow menu */
.topbar-menu {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 52px);
    right: 12px;
    background: rgba(250, 250, 250, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    border-radius: 14px;
    border: 0.5px solid var(--ios-separator);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    padding: 4px;
    min-width: 180px;
    z-index: 999;
}

body.dark-mode .topbar-menu {
    background: rgba(44, 44, 46, 0.88);
}

.topbar-menu-item {
    background: transparent;
    border: none;
    padding: 11px 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-label);
    border-radius: 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-family: var(--ios-font);
}

.topbar-menu-item:active { background: var(--ios-gray5); }

.topbar-menu-version {
    display: block;
    padding: 6px 14px 8px;
    font-size: 11px;
    color: var(--ios-tertiary);
    text-align: center;
    border-top: 0.5px solid var(--ios-separator);
    margin-top: 2px;
}

/* ============ Week glance (pill strip) ============ */
.week-glance {
    padding: 12px 16px 4px;
    background: var(--ios-bg);
    gap: 6px;
    border-bottom: none;
    box-shadow: none;
}

.week-day {
    background: var(--ios-card);
    border: 0.5px solid var(--ios-separator);
    border-radius: 14px;
    padding: 8px 4px;
    min-width: 44px;
    box-shadow: none;
    color: var(--ios-label);
    transition: transform 0.12s, background 0.12s;
}

.week-day {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.week-day:active { transform: scale(0.95); }

.week-day.selected {
    background: var(--ios-blue);
    border-color: var(--ios-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.week-day.selected .week-day-name,
.week-day.selected .week-day-emoji { color: #fff; }

.week-day.today-marker::after {
    background: var(--ios-red) !important;
}

.week-day-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ios-tertiary);
    text-transform: uppercase;
}

.week-day-emoji {
    font-size: 20px;
    margin-top: 2px;
}

.week-day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 3px;
}

.week-day-dot.empty { background: transparent; }
.week-day-dot.good { background: var(--ios-green); }
.week-day-dot.soft { background: var(--ios-orange); }
.week-day-dot.wet { background: var(--ios-red); }

.week-day.selected .week-day-dot.good,
.week-day.selected .week-day-dot.soft,
.week-day.selected .week-day-dot.wet {
    background: rgba(255, 255, 255, 0.85);
}

/* ============ Food hero (iOS-styled) ============ */
.food-hero {
    margin: 12px 16px 16px;
    border-radius: 20px;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 0;
    border: none;
}

.food-hero-header {
    padding: 14px 16px 4px;
    background: transparent;
}

.food-hero-day {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

.food-hero-today {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.food-hero-menu {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    border: none;
}

.food-hero-body {
    padding: 8px 20px 20px;
}

.food-hero-emoji {
    font-size: 72px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.food-hero-protein {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 2px 0 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.food-hero-pills {
    gap: 10px;
    margin-top: 8px;
}

.food-pill {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 14px;
    padding: 12px 14px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
}

.food-pill-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.food-pill-value {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
}

.food-pill-icon {
    font-size: 22px;
}

.food-hero-more {
    background: rgba(255, 255, 255, 0.18);
    border: 0.5px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 14px;
}

.food-hero-more-details {
    background: rgba(255, 255, 255, 0.12);
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 4px 14px;
    margin-top: 10px;
}

.food-detail-row {
    padding: 9px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.15);
}

.food-detail-row:last-child { border-bottom: none; }
.food-detail-row span:first-child {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.food-hero-prep {
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
}

.food-hero-prep strong { font-weight: 700; color: #fff; }

/* Food dropdown menu — iOS context menu style */
.food-menu {
    background: rgba(250, 250, 250, 0.82);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-radius: 14px;
    border: 0.5px solid var(--ios-separator);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    padding: 4px;
    min-width: 220px;
}

body.dark-mode .food-menu {
    background: rgba(44, 44, 46, 0.88);
}

.food-menu-item {
    padding: 11px 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-label);
    border-radius: 10px;
    background: transparent;
    border: none;
    text-align: left;
    letter-spacing: -0.01em;
}

.food-menu-item:active { background: var(--ios-gray5); }
.food-menu-item-danger { color: var(--ios-red); }

/* ============ Inset grouped sections ============ */
.main-grid {
    padding: 0 16px 100px;
    gap: 22px;
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    background: var(--ios-bg);
}

.section {
    background: var(--ios-card);
    border-radius: var(--ios-radius);
    box-shadow: none;
    border: 0.5px solid var(--ios-separator);
    padding: 0;
    overflow: hidden;
    margin: 0;
}

.section-header {
    padding: 14px 16px 10px;
    border-bottom: 0.5px solid var(--ios-separator);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: transparent;
}

.section-header.compact {
    padding: 12px 14px;
    flex-wrap: wrap;
}

.section-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

.text-btn {
    background: transparent;
    color: var(--ios-blue);
    font-size: 15px;
    font-weight: 500;
    padding: 4px 6px;
    border: none;
    letter-spacing: -0.01em;
    border-radius: 6px;
}

.text-btn:active { opacity: 0.55; }

/* Pattern alerts */
.pattern-alerts {
    margin: 0 16px 16px;
}

.pattern-alert {
    border-radius: var(--ios-radius);
    padding: 12px 14px;
    background: var(--ios-card);
    border: 0.5px solid var(--ios-separator);
    border-left: 3px solid var(--ios-orange);
    box-shadow: none;
    font-size: 14px;
    color: var(--ios-label);
}

.pattern-alert.warning { border-left-color: var(--ios-orange); }
.pattern-alert.info { border-left-color: var(--ios-blue); }
.pattern-alert.good { border-left-color: var(--ios-green); }
.pattern-alert.danger { border-left-color: var(--ios-red); }

/* ============ Medicines ============ */
.medicines-section .time-blocks {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
}

.time-block {
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--ios-separator);
    background: transparent;
}

.time-block:last-child { border-bottom: none; }

.time-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ios-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    gap: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.time-label svg { width: 14px; height: 14px; }

.med-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.med-pill {
    background: var(--ios-gray5);
    border-radius: 100px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-label);
    box-shadow: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    transition: background 0.15s, transform 0.1s;
}

.med-pill:active { transform: scale(0.96); }

.med-pill.given {
    background: var(--ios-green);
    color: #fff;
}

.med-pill .check-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--ios-gray2);
    background: transparent;
    display: inline-block;
}

.med-pill.given .check-icon {
    background: #fff;
    border-color: #fff;
    color: var(--ios-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.med-pill.given .check-icon::after {
    content: "✓";
    font-size: 11px;
    font-weight: 800;
    color: var(--ios-green);
}

.med-name { font-weight: 500; }
.med-dose { font-size: 11px; opacity: 0.75; }
.empty-message { color: var(--ios-tertiary); font-size: 13px; font-style: normal; }

/* ============ Behavior chips ============ */
.behavior-section .behavior-container { padding: 6px 14px 14px; }

.behavior-category {
    padding: 8px 0;
    border-bottom: 0.5px solid var(--ios-separator);
}

.behavior-category:last-child { border-bottom: none; }

.behavior-category-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--ios-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.behavior-chips-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.behavior-chips-scroll::-webkit-scrollbar { display: none; }

.behavior-chip {
    background: var(--ios-gray5);
    border-radius: 100px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ios-label);
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.behavior-chip.active,
.behavior-chip.selected {
    background: var(--ios-blue);
    color: #fff;
}

.behavior-chip.positive.active { background: var(--ios-green); }
.behavior-chip.negative.active { background: var(--ios-red); }
.behavior-chip.warning.active { background: var(--ios-orange); }

/* ============ Avoid lists ============ */
.avoid-section .avoid-grid {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.avoid-box {
    background: transparent;
    border-radius: 0;
    padding: 12px 16px;
    border: none;
    border-bottom: 0.5px solid var(--ios-separator);
    box-shadow: none;
}

.avoid-box:last-child { border-bottom: none; }

.avoid-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--ios-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.avoid-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 14px;
}

.avoid-list li {
    font-size: 13px;
    color: var(--ios-secondary);
    padding: 2px 0;
    position: relative;
    padding-left: 12px;
}

.avoid-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--ios-gray2);
}

/* ============ Sleep ============ */
.sleep-section .section-header.compact {
    padding: 12px 14px 12px 16px;
    flex-direction: row;
    flex-wrap: nowrap;
}

.sleep-buttons {
    display: flex;
    gap: 6px;
}

.sleep-btn {
    background: var(--ios-gray5);
    border-radius: 100px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-label);
    border: none;
    box-shadow: none;
    min-height: 34px;
}

.sleep-btn.selected {
    background: var(--ios-green);
    color: #fff;
}

.sleep-btn.bad.selected {
    background: var(--ios-red);
}

/* ============ Bowel/potty ============ */
.bowel-section { padding: 0; }

.bowel-section .section-header.compact {
    padding: 12px 14px 6px 16px;
    border-bottom: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.bowel-section .section-header.compact h3 {
    align-self: flex-start;
}

.potty-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    width: 100%;
}

.potty-btn {
    background: var(--ios-gray5);
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-label);
    border: none;
    box-shadow: none;
    min-height: 40px;
}

.potty-btn:active { transform: scale(0.97); background: var(--ios-gray4); }
.potty-btn.soft { color: var(--ios-orange); }
.potty-btn.wet { color: var(--ios-red); }

.potty-custom-time {
    padding: 8px 16px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 0.5px solid var(--ios-separator);
    border-bottom: 0.5px solid var(--ios-separator);
    margin-top: 4px;
}

.custom-time-label {
    font-size: 12px;
    color: var(--ios-tertiary);
    font-weight: 500;
}

.time-input {
    background: var(--ios-gray5);
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: var(--ios-label);
    font-family: var(--ios-font);
}

.potty-btn-small {
    background: var(--ios-gray5);
    border-radius: 8px;
    padding: 6px 10px;
    border: none;
    font-size: 14px;
    min-width: 36px;
    min-height: 32px;
}

.bowel-log { padding: 10px 16px 14px; }

.bowel-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bowel-chip {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ios-label);
}

.bowel-chip.soft { background: rgba(255, 149, 0, 0.12); border-color: rgba(255, 149, 0, 0.3); }
.bowel-chip.wet { background: rgba(255, 59, 48, 0.12); border-color: rgba(255, 59, 48, 0.3); }
.bowel-chip .del {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--ios-gray1);
    font-size: 18px;
    padding: 0 6px;
}

/* ============ Notes ============ */
.notes-section .daily-notes-input {
    background: transparent;
    border: none;
    padding: 10px 16px 14px;
    font-size: 15px;
    color: var(--ios-label);
    font-family: var(--ios-font);
    min-height: 80px;
    width: 100%;
    resize: vertical;
    letter-spacing: -0.01em;
    line-height: 1.45;
}

.notes-section .daily-notes-input:focus { outline: none; }

.save-status {
    font-size: 12px;
    color: var(--ios-tertiary);
    font-weight: 500;
}

.save-status.saved { color: var(--ios-green); }
.save-status.saving { color: var(--ios-orange); }

/* ============ Growth ============ */
.growth-section .growth-display {
    padding: 12px 16px 16px;
    min-height: 52px;
}

.growth-empty {
    color: var(--ios-tertiary);
    font-size: 14px;
}

.growth-stats {
    display: flex;
    gap: 20px;
}

.growth-stat { display: flex; flex-direction: column; gap: 2px; }
.growth-value { font-size: 22px; font-weight: 700; color: var(--ios-label); letter-spacing: -0.02em; }
.growth-label { font-size: 11px; color: var(--ios-tertiary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.growth-date { color: var(--ios-tertiary); font-size: 12px; margin-left: auto; align-self: center; }

/* ============ AI insights ============ */
.ai-insights-section {
    margin: 0 16px 22px;
    background: var(--ios-card);
    border-radius: var(--ios-radius);
    border: 0.5px solid var(--ios-separator);
    box-shadow: none;
    overflow: hidden;
}

.ai-insights-header {
    padding: 14px 16px 10px;
    border-bottom: 0.5px solid var(--ios-separator);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-insights-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ai-refresh-btn {
    background: transparent;
    color: var(--ios-blue);
    font-size: 15px;
    font-weight: 500;
    border: none;
    padding: 4px 6px;
}

.ai-insights-content {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ios-secondary);
}

/* ============ Visual timeline ============ */
.visual-timeline {
    margin: 0 16px 22px;
    background: var(--ios-card);
    border-radius: var(--ios-radius);
    border: 0.5px solid var(--ios-separator);
    box-shadow: none;
    padding: 14px 12px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0 4px 10px;
}

.timeline-day {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: 10px;
    padding: 6px 2px;
    color: var(--ios-label);
}

.timeline-day.today {
    background: var(--ios-blue);
    border-color: var(--ios-blue);
    color: #fff;
}

.timeline-date { font-size: 10px; font-weight: 600; }
.timeline-food { font-size: 18px; }
.timeline-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ios-gray3);
    display: inline-block;
    margin: 0 1px;
}

.timeline-dot.normal { background: var(--ios-green); }
.timeline-dot.soft { background: var(--ios-orange); }
.timeline-dot.wet { background: var(--ios-red); }

/* ============ Floating Action Button ============ */
.floating-fab {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ios-blue);
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.floating-fab:active { transform: scale(0.9); }

.fab-plus {
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    margin-top: -1px;
}

/* ============ Bottom tab bar (iOS) ============ */
.bottom-nav {
    background: rgba(249, 249, 249, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    border-top: 0.5px solid var(--ios-separator);
    box-shadow: none;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    bottom: 0;
    gap: 0;
    height: auto;
    display: flex;
    justify-content: space-around;
}

body.dark-mode .bottom-nav {
    background: rgba(22, 22, 24, 0.86);
}

.nav-item {
    background: transparent !important;
    color: var(--ios-tertiary);
    font-size: 10px;
    font-weight: 500;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 8px;
    letter-spacing: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    border: none;
}

.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--ios-blue); }
.nav-item:active { opacity: 0.55; }

/* ============ Modals (iOS sheet) ============ */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.modal-sheet {
    background: var(--ios-card);
    border-radius: 16px 16px 0 0;
    padding: 10px 16px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
    color: var(--ios-label);
}

.modal-handle {
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: var(--ios-gray3);
    margin: 4px auto 12px;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-label);
    letter-spacing: -0.02em;
    text-align: center;
    margin: 0 0 14px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--ios-tertiary);
    text-align: center;
    margin: -8px 0 14px;
}

.btn-primary {
    background: var(--ios-blue);
    color: #fff;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    box-shadow: none;
    min-height: 50px;
}

.btn-primary:active { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.4; background: var(--ios-blue); }

.btn-ghost {
    background: var(--ios-gray5);
    color: var(--ios-label);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 500;
    border: none;
    min-height: 50px;
}

.btn-ghost:active { background: var(--ios-gray4); }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Bowel modal options */
.bowel-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.bowel-option {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: var(--ios-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: var(--ios-label);
}

.bowel-option.selected,
.bowel-option.active {
    background: rgba(0, 122, 255, 0.12);
    border-color: var(--ios-blue);
    color: var(--ios-blue);
}

.bowel-option.soft.selected { background: rgba(255, 149, 0, 0.12); border-color: var(--ios-orange); color: var(--ios-orange); }
.bowel-option.warning.selected,
.bowel-option.wet.selected { background: rgba(255, 59, 48, 0.12); border-color: var(--ios-red); color: var(--ios-red); }

.option-emoji { font-size: 22px; }
.option-label { font-weight: 500; }

.note-input {
    margin-top: 10px;
}

.note-input label {
    font-size: 13px;
    color: var(--ios-tertiary);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.note-input textarea {
    width: 100%;
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--ios-label);
    font-family: var(--ios-font);
    min-height: 70px;
}

/* ============ PIN gate (iOS lock screen vibe) ============ */
.pin-gate {
    background: var(--ios-bg);
}

.pin-container {
    background: transparent;
    box-shadow: none;
    padding: 40px 24px;
}

.pin-icon-img {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pin-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ios-label);
    letter-spacing: -0.03em;
    margin: 20px 0 6px;
}

.pin-subtitle {
    font-size: 15px;
    color: var(--ios-tertiary);
    margin-bottom: 28px;
}

.pin-dots {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-bottom: 24px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--ios-gray2);
    background: transparent;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.pin-dot.filled {
    background: var(--ios-label);
    border-color: var(--ios-label);
    transform: scale(1.15);
}

.pin-dots.shake { animation: pinShake 0.4s ease; }

@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.pin-dots.error .pin-dot.filled {
    background: var(--ios-red);
    border-color: var(--ios-red);
}

.pin-input-hidden {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.pin-submit {
    display: none; /* auto-submit on 4th digit now */
    background: var(--ios-blue);
    color: #fff;
    border-radius: 14px;
    padding: 14px 32px;
    font-size: 17px;
    font-weight: 600;
    min-height: 50px;
    min-width: 220px;
    border: none;
    margin-top: 18px;
}

.pin-error {
    color: var(--ios-red);
    font-size: 13px;
    font-weight: 500;
}

/* ============ Toasts ============ */
.toast-container {
    padding-bottom: env(safe-area-inset-bottom);
}

.toast {
    background: rgba(30, 30, 30, 0.92);
    color: #fff;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ============ Install banner ============ */
.install-banner {
    background: var(--ios-card);
    color: var(--ios-label);
    border-radius: var(--ios-radius);
    border: 0.5px solid var(--ios-separator);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    margin: 8px 16px;
    padding: 10px 14px;
    font-size: 14px;
}

.install-btn {
    background: var(--ios-blue);
    color: #fff;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border: none;
}

.dismiss-btn {
    background: transparent;
    color: var(--ios-gray1);
    border: none;
    font-size: 18px;
    padding: 4px 8px;
}

/* ============ History / trends modal ============ */
.modal-tabs {
    display: flex;
    background: var(--ios-gray5);
    border-radius: 9px;
    padding: 2px;
    margin: 0 0 16px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    color: var(--ios-label);
    border: none;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: 7px;
}

.tab-btn.active {
    background: var(--ios-card);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* History chips */
.history-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.summary-stat {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: var(--ios-radius);
    padding: 12px 10px;
    text-align: center;
}

.summary-stat.warning { background: rgba(255, 149, 0, 0.12); border-color: rgba(255, 149, 0, 0.3); }

.stat-value { font-size: 22px; font-weight: 700; color: var(--ios-label); letter-spacing: -0.02em; display: block; }
.stat-label { font-size: 11px; color: var(--ios-tertiary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.history-day {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: var(--ios-radius);
    padding: 12px 14px;
    margin-bottom: 8px;
}

.history-day.has-bad { border-left: 3px solid var(--ios-red); }
.day-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.day-date { font-size: 15px; font-weight: 600; }
.day-count { font-size: 12px; color: var(--ios-tertiary); }

.type-chip {
    display: inline-block;
    background: var(--ios-gray5);
    border-radius: 100px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
}

.day-note { font-size: 13px; color: var(--ios-secondary); margin-top: 6px; }

/* Trends cards */
.trend-card {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: var(--ios-radius);
    padding: 14px;
    margin-bottom: 10px;
}

.trend-card.chicken { border-left: 3px solid var(--ios-green); }
.trend-card.beef { border-left: 3px solid var(--ios-orange); }
.trend-card.turkey { border-left: 3px solid var(--ios-purple); }
.trend-card.pork { border-left: 3px solid var(--ios-blue); }

.trend-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.trend-emoji { font-size: 20px; }
.trend-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.trend-days { margin-left: auto; font-size: 11px; color: var(--ios-tertiary); }
.trend-section-label { font-size: 11px; font-weight: 700; color: var(--ios-tertiary); letter-spacing: 0.04em; text-transform: uppercase; margin: 6px 0 4px; }
.trend-metric { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.metric-label { font-size: 12px; min-width: 72px; color: var(--ios-secondary); }
.metric-bar { flex: 1; height: 6px; background: var(--ios-gray4); border-radius: 3px; overflow: hidden; }
.metric-fill { height: 100%; background: var(--ios-gray2); }
.metric-fill.good { background: var(--ios-green); }
.metric-fill.warning { background: var(--ios-orange); }
.metric-fill.bad { background: var(--ios-red); }
.metric-value { font-size: 12px; color: var(--ios-label); font-weight: 500; min-width: 70px; text-align: right; }

/* Date picker modal */
.date-picker-content { padding: 4px 0 8px; }
.date-picker-input {
    background: var(--ios-gray5);
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--ios-label);
    font-family: var(--ios-font);
    width: 100%;
    margin-bottom: 12px;
}

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

.date-quick-buttons .btn-ghost {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 40px;
}

/* Schedule grid */
.schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.schedule-day {
    background: var(--ios-gray6);
    border: 0.5px solid var(--ios-separator);
    border-radius: 10px;
    padding: 10px;
}

.schedule-day.today { border-color: var(--ios-blue); background: rgba(0, 122, 255, 0.08); }
.schedule-day.skipped { opacity: 0.5; }
.schedule-day-emoji { font-size: 20px; }

/* Override buttons */
.override-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 4px 0 12px;
}

.override-btn {
    background: var(--ios-gray5);
    border: 0.5px solid var(--ios-separator);
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ios-label);
}

.override-btn.skip { color: var(--ios-orange); }
.override-btn.reset { color: var(--ios-blue); }

.resume-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 2px;
    font-size: 14px;
    color: var(--ios-label);
}

.resume-checkbox input[type="checkbox"] { accent-color: var(--ios-blue); width: 18px; height: 18px; }

/* Growth form */
.growth-form { padding: 4px 0; }
.growth-input-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--ios-separator);
}

.growth-input-row:last-child { border-bottom: none; }
.growth-input-row label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ios-tertiary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.growth-input-row input {
    background: var(--ios-gray5);
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--ios-label);
    font-family: var(--ios-font);
}

/* Quick menu (FAB popover) */
.quick-menu-content {
    background: rgba(250, 250, 250, 0.9);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    border-radius: 14px;
    border: 0.5px solid var(--ios-separator);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 4px;
    margin-bottom: calc(130px + env(safe-area-inset-bottom));
}

body.dark-mode .quick-menu-content { background: rgba(44, 44, 46, 0.92); }

.quick-menu-content button {
    background: transparent;
    border: none;
    padding: 13px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-label);
    text-align: left;
    border-radius: 10px;
    display: block;
    width: 100%;
}

.quick-menu-content button:active { background: var(--ios-gray5); }

/* Save-flash animation kept subtle */
.save-flash { animation: iosFlash 0.4s ease; }
@keyframes iosFlash {
    0% { background: rgba(52, 199, 89, 0.0); }
    50% { background: rgba(52, 199, 89, 0.18); }
    100% { background: transparent; }
}

/* ============ Pull-to-refresh indicator ============ */
.ptr-indicator {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 10px);
    left: 50%;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transform: translateY(-80px) scale(0.6);
    transition: transform 0.18s ease-out, opacity 0.18s ease-out;
    opacity: 0;
    pointer-events: none;
}

.ptr-indicator.ready,
.ptr-indicator.refreshing {
    opacity: 1;
}

body.dark-mode .ptr-indicator {
    background: rgba(44, 44, 46, 0.94);
}

.ptr-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--ios-gray3);
    border-top-color: var(--ios-blue);
    opacity: 0.45;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ptr-indicator.ready .ptr-spinner {
    opacity: 1;
    transform: rotate(180deg);
}

.ptr-indicator.refreshing .ptr-spinner {
    opacity: 1;
    animation: ptrSpin 0.7s linear infinite;
    transition: none;
}

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

/* During a drag-to-dismiss, kill the backdrop fade-in transition */
.modal .modal-sheet { will-change: transform; }

/* ============================================================
   Medicines Manager (v2) — unified catalog + schedule
   Uses iOS semantic tokens so light/dark both work for free.
   ============================================================ */

/* Dashboard extras */
.medicines-section .time-label .period-emoji { font-size: 1rem; margin-right: 4px; }
.med-time {
    font-size: 0.7rem; font-weight: 600; color: var(--ios-blue);
    background: rgba(0, 122, 255, 0.12); padding: 1px 6px; border-radius: 6px; margin-left: 6px;
    vertical-align: middle;
}
.meds-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 24px 16px; color: var(--ios-tertiary); font-size: 0.9rem;
}
.meds-empty .text-btn { color: var(--ios-blue); font-weight: 600; }

/* Manager sheet shell */
.med-manager { display: flex; flex-direction: column; height: 100%; }
.med-mgr-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.med-mgr-done {
    background: none; border: none; color: var(--ios-blue);
    font-size: 1.05rem; font-weight: 600; padding: 6px 4px; cursor: pointer;
}
.med-mgr-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.med-search {
    flex: 1; min-height: var(--ios-tap); padding: 0 14px;
    background: var(--ios-gray6); border: 1px solid var(--ios-separator);
    border-radius: var(--ios-radius-sm); font-size: 1rem; color: var(--ios-label);
    font-family: var(--ios-font);
}
.med-add-btn {
    min-height: var(--ios-tap); padding: 0 16px; white-space: nowrap;
    background: var(--ios-blue); color: #fff; border: none;
    border-radius: var(--ios-radius-sm); font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.med-add-btn:active { opacity: 0.82; }
.med-mgr-list { flex: 1; overflow-y: auto; padding-bottom: 48px; -webkit-overflow-scrolling: touch; }
.med-mgr-empty { text-align: center; color: var(--ios-tertiary); padding: 48px 20px; font-size: 0.95rem; }

/* Collapsed card */
.med-card {
    background: var(--ios-card); border: 1px solid var(--ios-separator);
    border-radius: var(--ios-radius); margin-bottom: 10px; overflow: hidden;
}
.med-card.paused { opacity: 0.6; }
.med-card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; min-height: var(--ios-tap); cursor: pointer;
}
.med-drag { color: var(--ios-gray3); cursor: grab; font-size: 1.05rem; flex-shrink: 0; }
.med-card-icon { font-size: 1.4rem; flex-shrink: 0; }
.med-card-main { flex: 1; min-width: 0; }
.med-card-name { font-size: 1rem; font-weight: 600; color: var(--ios-label); }
.med-paused-tag {
    font-size: 0.62rem; font-weight: 700; color: var(--ios-orange);
    text-transform: uppercase; margin-left: 6px;
}
.med-card-sched { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.med-chip-mini {
    font-size: 0.72rem; color: var(--ios-secondary); background: var(--ios-gray6);
    padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.med-unscheduled { font-size: 0.75rem; color: var(--ios-tertiary); font-style: italic; }
.med-card-caret { color: var(--ios-gray3); font-size: 1.3rem; flex-shrink: 0; }

/* Expanded editor */
.med-card.expanded { border-color: var(--ios-blue); }
.med-edit { padding: 4px 14px 16px; border-top: 1px solid var(--ios-separator); }
.med-edit-row2 { display: flex; gap: 8px; margin: 12px 0; }
.med-icon-input {
    width: 56px; text-align: center; font-size: 1.3rem; min-height: var(--ios-tap);
    border: 1px solid var(--ios-separator); border-radius: var(--ios-radius-sm);
    background: var(--ios-card-2); color: var(--ios-label);
}
.med-name-input {
    flex: 1; min-height: var(--ios-tap); padding: 0 12px; font-size: 1rem;
    border: 1px solid var(--ios-separator); border-radius: var(--ios-radius-sm);
    background: var(--ios-card-2); color: var(--ios-label); font-family: var(--ios-font);
}
.med-edit-label {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--ios-tertiary); margin: 16px 0 8px;
}
.med-when-list { display: flex; flex-direction: column; gap: 8px; }
.med-when-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.med-when-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 0 14px; border-radius: 999px; min-width: 130px;
    background: var(--ios-gray6); color: var(--ios-secondary);
    border: 1.5px solid transparent; font-size: 0.9rem; font-weight: 600; cursor: pointer;
    flex-shrink: 0;
}
.med-when-chip.on { background: var(--ios-blue); color: #fff; }
.med-when-emoji { font-size: 1rem; }
.med-when-amount {
    flex: 1; min-width: 110px; min-height: 40px; padding: 0 12px;
    border: 1px solid var(--ios-separator); border-radius: var(--ios-radius-sm);
    background: var(--ios-card-2); color: var(--ios-label); font-size: 0.9rem;
    font-family: var(--ios-font);
}
.med-when-time { display: inline-flex; align-items: center; gap: 4px; }
.med-when-time input[type="time"] {
    min-height: 40px; padding: 0 8px; border: 1px solid var(--ios-separator);
    border-radius: var(--ios-radius-sm); background: var(--ios-card-2);
    color: var(--ios-label); font-family: var(--ios-font);
}
.med-time-add {
    min-height: 40px; padding: 0 12px; background: none; white-space: nowrap;
    border: 1px dashed var(--ios-gray3); border-radius: var(--ios-radius-sm);
    color: var(--ios-blue); font-size: 0.85rem; cursor: pointer;
}
.med-time-clear {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: none;
    background: var(--ios-gray5); color: var(--ios-secondary); font-size: 1.05rem; cursor: pointer;
}
.med-notes {
    width: 100%; border: 1px solid var(--ios-separator); border-radius: var(--ios-radius-sm);
    background: var(--ios-card-2); color: var(--ios-label); padding: 10px 12px;
    font-size: 0.9rem; font-family: var(--ios-font); resize: vertical;
}
.med-edit-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.med-active-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--ios-label); cursor: pointer; }
.med-active-toggle input { width: 22px; height: 22px; accent-color: var(--ios-green); }
.med-delete-btn { background: none; border: none; color: var(--ios-red); font-size: 0.95rem; font-weight: 600; padding: 8px 4px; cursor: pointer; }

/* Undo toast */
.toast-undo { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.toast-undo-btn { background: none; border: none; color: var(--ios-blue); font-weight: 700; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }

/* ============================================================
   "Mark all" per-period header + Potty Training checklist
   ============================================================ */
.time-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.time-block-head .time-label { margin-bottom: 0; }
.med-markall {
    flex-shrink: 0; min-height: 30px; padding: 0 12px; border-radius: 999px;
    background: var(--ios-gray6); color: var(--ios-blue); border: none;
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.med-markall.done { background: rgba(52, 199, 89, 0.16); color: var(--ios-green); }
.med-markall:active { opacity: 0.7; }

.potty-training { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ios-separator); }
.potty-training-label {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--ios-tertiary); margin-bottom: 10px;
}
.pt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 38px; padding: 0 14px; border-radius: 999px;
    background: var(--ios-gray6); color: var(--ios-secondary);
    border: 1.5px solid transparent; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.pt-chip.on { background: var(--ios-blue); color: #fff; }
.pt-chip.on.pt_accident { background: var(--ios-red); }
.pt-chip-emoji { font-size: 1rem; }
.pt-item { display: inline-flex; align-items: center; gap: 4px; }
.pt-count {
    min-width: 20px; height: 20px; padding: 0 5px; margin-left: 2px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.28); color: #fff; font-size: 0.78rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.pt-dec {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: none; cursor: pointer;
    background: var(--ios-gray5); color: var(--ios-secondary); font-size: 1.25rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.pt-dec:active { opacity: 0.7; }
