:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface-2: #1f3050;
    --text: #e8e8e8;
    --text-muted: #a0a0b0;
    --primary: #4a90d9;
    --primary-hover: #5ba0e9;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --bottom-nav-height: 64px;
    --top-bar-height: 52px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[x-cloak] { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow: hidden;
    touch-action: manipulation;
}

/* --- Auth Screen --- */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
}

.auth-container {
    width: 100%;
    max-width: 360px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* --- Inputs --- */
.input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

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

.autocomplete-wrap {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-2);
}

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

.autocomplete-item:hover,
.autocomplete-item:focus {
    background: var(--primary);
    color: #fff;
}

.input-large {
    font-size: 24px;
    text-align: center;
    padding: 20px;
}

.textarea {
    resize: none;
    min-height: 80px;
}

.textarea.tall {
    min-height: 120px;
}

/* --- Buttons --- */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    color: white;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    border-radius: var(--radius);
}

.btn-stop {
    background: var(--danger);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
}

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

.error-text {
    color: var(--danger);
    font-size: 14px;
    text-align: center;
}

/* --- Toggle Group --- */
.toggle-group {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--surface-2);
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    background: var(--surface);
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

/* --- App Shell --- */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--surface-2);
    height: var(--top-bar-height);
    flex-shrink: 0;
}

.tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s;
}

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

.settings-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--bottom-nav-height);
}

.screen {
    padding: 16px;
}

/* --- Handover Card --- */
.handover-card {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    cursor: pointer;
}

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

.handover-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--warning);
    letter-spacing: 0.5px;
}

.dismiss-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.handover-summary {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Timer Cards --- */
.timers-section {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 16px;
    border-left: 4px solid var(--primary);
}

.timer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.timer-label {
    font-weight: 600;
    font-size: 14px;
}

.timer-child {
    font-size: 12px;
    color: var(--text-muted);
}

.timer-display {
    font-family: 'SF Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.timer-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-cancel {
    background: var(--surface-2);
    color: var(--text-muted);
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    line-height: 1;
}

/* --- Action Grid --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    min-height: 88px;
}

.action-btn:active {
    transform: scale(0.95);
    background: var(--surface-2);
}

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

/* --- Bottom Sheet --- */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 12px 20px calc(20px + var(--safe-bottom));
    z-index: 101;
    max-height: 80dvh;
    overflow-y: auto;
}

.sheet-enter {
    transition: transform 0.3s ease-out;
}

.sheet-leave {
    transition: transform 0.2s ease-in;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    margin: 0 auto 16px;
}

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

.sheet-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
}

.sheet-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.sheet-close:hover {
    color: var(--text);
    background: var(--surface-2);
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.btn-timer-start {
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
}

.btn-timer-start:active {
    transform: scale(0.95);
}

.sheet-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sheet-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sheet-sublabel {
    font-size: 15px;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.calc-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: var(--radius-sm);
    margin: 4px 0 8px;
}
.calc-result .calc-label {
    font-size: 14px;
    color: var(--text-dim);
}
.calc-result .calc-value {
    font-size: 16px;
    font-weight: 700;
    color: #2ecc71;
}

.quick-options {
    display: flex;
    gap: 8px;
}

.qopt {
    flex: 1;
    padding: 14px 12px;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.qopt.sm {
    padding: 10px 8px;
    font-size: 13px;
}

.qopt.active {
    border-color: var(--primary);
    background: rgba(74, 144, 217, 0.15);
}

.mood-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.mood-btn {
    width: 52px;
    height: 52px;
    font-size: 28px;
    background: var(--surface-2);
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-btn.sm {
    font-size: 16px;
    width: 44px;
    height: 44px;
    color: var(--text);
}

.mood-btn.active {
    border-color: var(--primary);
    transform: scale(1.1);
}

/* --- History --- */
.history-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.history-tabs, .view-toggle, .range-selector {
    display: flex;
    gap: 4px;
}

.htab, .vtab, .rbtn {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.htab.active, .vtab.active, .rbtn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.nav-arrow {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-label {
    font-size: 15px;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}

/* --- Agenda --- */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.agenda-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.agenda-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.agenda-type {
    font-weight: 600;
    font-size: 14px;
}

.agenda-info {
    font-size: 12px;
    color: var(--text-muted);
}

.agenda-child-tag {
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
    opacity: 0.85;
}

.agenda-time {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.agenda-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 4px;
}

/* --- Timeline --- */
.timeline-view {
    overflow-y: auto;
    max-height: calc(100dvh - 280px);
}

.timeline-container {
    position: relative;
}

.timeline-hour {
    display: flex;
    align-items: flex-start;
    min-height: 40px;
    border-bottom: 1px solid var(--surface-2);
}

.hour-label {
    width: 48px;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 4px;
    text-align: right;
    padding-right: 8px;
    flex-shrink: 0;
}

.hour-track {
    flex: 1;
    display: flex;
    gap: 4px;
    padding: 4px 0;
    min-height: 36px;
}

.timeline-event {
    width: 24px;
    min-height: 20px;
    border-radius: 4px;
    opacity: 0.8;
}

/* --- Stats --- */
.stats-header {
    margin-bottom: 16px;
}

.stats-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-title-row h2 {
    font-size: 20px;
    font-weight: 700;
}

.stats-range {
    display: flex;
    gap: 4px;
}

.child-stats-section {
    margin-bottom: 24px;
}

.child-stats-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.export-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--surface-2);
}

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

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    z-index: 200;
    box-shadow: var(--shadow);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

.toast-action {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

/* --- Bottom Nav --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 50;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 0.2s;
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 15px;
}

/* --- Biometric / Divider --- */
.biometric-section {
    margin-top: 16px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 12px 0;
    color: var(--text-muted);
    font-size: 13px;
}

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

.divider span {
    padding: 0 12px;
}

.btn-biometric {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-biometric:hover {
    background: linear-gradient(135deg, #7b93f5, #8b5fb5);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* --- Settings Screen --- */
.screen-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 0 4px;
}

.settings-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface-2);
}

.setting-item:last-of-type {
    border-bottom: none;
}

.setting-label {
    font-size: 13px;
    color: var(--text-muted);
}

.setting-value {
    font-size: 14px;
    font-weight: 600;
}

.setting-value.mono {
    font-family: 'SF Mono', monospace;
    font-size: 13px;
    letter-spacing: 1px;
}

.hint-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

.children-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.child-card {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 12px;
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.child-card-body {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.child-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.child-card-details {
    flex: 1;
    min-width: 0;
}

.child-card-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.child-card-info strong {
    font-size: 15px;
}

.child-nickname {
    font-size: 13px;
    color: var(--text-muted);
}

.child-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.child-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.btn-icon:hover {
    opacity: 1;
    background: var(--surface-3, rgba(255,255,255,0.1));
}

.btn-icon-danger:hover {
    opacity: 1;
    background: rgba(231, 76, 60, 0.2);
}

.icon-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.icon-option {
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background: var(--surface-3, rgba(255,255,255,0.05));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.icon-option.active {
    border-color: var(--primary);
    background: rgba(74, 144, 217, 0.15);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary);
    color: white;
}

.add-form {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: -4px;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
}

.color-dot.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.form-actions .btn {
    flex: 1;
}

.btn-outline {
    background: transparent;
    border: 2px dashed var(--text-muted);
    color: var(--text-muted);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.full-width {
    width: 100%;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

.member-name {
    font-size: 14px;
    font-weight: 600;
}

.member-role {
    font-size: 11px;
    text-transform: capitalize;
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--surface-2);
    border-radius: 24px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #2ecc71;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

/* --- Reminders --- */
.screen-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.btn-back:active {
    background: var(--surface-2);
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.reminder-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-radius: 12px;
    padding: 12px 14px;
    gap: 10px;
}

.reminder-card.reminder-inactive {
    opacity: 0.5;
}

.reminder-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.reminder-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reminder-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.reminder-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.reminder-child-tag {
    background: rgba(74, 144, 217, 0.2);
    color: #4a90d9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.reminder-dose {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reminder-card-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.toggle-switch.sm {
    width: 36px;
    height: 20px;
}

.toggle-switch.sm .toggle-slider::before {
    height: 14px;
    width: 14px;
}

.toggle-switch.sm input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.reminder-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.reminder-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.reminder-type-btn span:first-child {
    font-size: 1.4rem;
}

.reminder-type-btn.active {
    border-color: #4a90d9;
    background: rgba(74, 144, 217, 0.1);
}

.day-picker {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.day-btn {
    flex: 1;
    padding: 6px 2px;
    border: 1.5px solid var(--surface-2);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.day-btn.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}

/* --- Utility --- */
@media (prefers-color-scheme: light) {
    body:not(.dark) {
        --bg: #f5f5f5;
        --surface: #ffffff;
        --surface-2: #eaeaea;
        --text: #1a1a1a;
        --text-muted: #666666;
    }
}
