/* ==================== CSS Custom Properties ==================== */

:root {
    /* Entry type colors */
    --color-sleep: #6c5ce7;
    --color-feeding: #00b894;
    --color-diaper: #0984e3;
    --color-temperature: #e84393;
    --color-activity: #636e72;
    --color-note: #fdcb6e;
    --color-growth: #f39c12;

    /* Temperature zones */
    --color-temp-cold: #74b9ff;
    --color-temp-normal: #55efc4;
    --color-temp-elevated: #fdcb6e;
    --color-temp-fever: #ff7675;
    --color-temp-high-fever: #c0392b;

    /* Status colors */
    --color-danger: #c0392b;
    --color-warning: #e67e22;

    /* Neutral palette */
    --color-bg: #f0f0f0;
    --color-surface: #fff;
    --color-border: #e0e0e0;
    --color-border-light: #eee;
    --color-text: #111;
    --color-text-secondary: #333;
    --color-text-muted: #666;
    --color-text-faint: #888;
    --color-text-disabled: #999;
    --color-primary: #222;
    --color-primary-hover: #333;
}

/* ==================== Utility Classes ==================== */

.hidden { display: none !important; }
.invisible { opacity: 0; }

/* ==================== Shared Components (pb-*) ==================== */

/* Cards */
.pb-card {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
}

.pb-card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.pb-card-body {
    padding: 0;
}

/* Buttons */
.pb-btn {
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
    font-size: 13px;
    padding: 6px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.pb-btn:active {
    transform: scale(0.98);
}

.pb-btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.pb-btn-primary:hover {
    opacity: 0.85;
}

.pb-btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.pb-btn-secondary:hover {
    border-color: var(--color-text-faint);
}

.pb-btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.pb-btn-danger:hover {
    opacity: 0.85;
}

.pb-btn-ghost {
    background: none;
    color: var(--color-text-muted);
    padding: 4px 8px;
}

.pb-btn-ghost:hover {
    color: var(--color-text);
}

/* Forms */
.pb-form-group {
    margin-bottom: 16px;
}

.pb-label {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.pb-input {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.pb-input:focus {
    border-color: var(--color-text-faint);
}

.pb-select {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.pb-select:focus {
    border-color: var(--color-text-faint);
}

/* Modals */
.pb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pb-modal {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.pb-modal-body {
    padding: 16px;
}

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

/* Tasks */
.pb-task-list {
    list-style: none;
    font-size: 13px;
    line-height: 1.4;
}

.pb-task-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: grab;
}

.pb-task-item.dragging {
    opacity: 0.5;
}

.pb-task-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    margin: 0;
}

.pb-task-text {
    flex: 1;
    cursor: text;
}

.pb-task-text:hover {
    background: #f7f7f7;
}

.pb-task-delete {
    color: #ccc;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: auto;
    cursor: pointer;
}

.pb-task-item:hover .pb-task-delete {
    opacity: 1;
}

.pb-task-delete:hover {
    color: var(--color-text-faint);
}

.pb-task-delete.confirm {
    color: var(--color-danger);
    opacity: 1;
}

/* Tags & Badges */
.pb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    background: var(--color-bg);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.pb-tag {
    font-size: 11px;
    color: var(--color-text-disabled);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.pb-tag:hover {
    color: var(--color-text-muted);
}

/* Sections */
.pb-section-title {
    font-size: 11px;
    color: var(--color-text-disabled);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pb-section-content {
    font-size: 13px;
    white-space: pre-wrap;
    color: var(--color-text-secondary);
}

/* Menus */
.pb-menu {
    display: none;
    position: absolute;
    z-index: 100;
    min-width: 160px;
    background: var(--color-surface);
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-top: 4px;
}

.pb-menu.show {
    display: block;
}

.pb-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.pb-menu-item:hover {
    background: #f5f5f5;
}

.pb-menu-item i {
    font-size: 16px;
    color: var(--color-text-muted);
}

.pb-menu-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: 4px 0;
}

/* Typography */
.pb-text-muted {
    color: var(--color-text-muted);
}

.pb-text-sm {
    font-size: 13px;
}

.pb-text-xs {
    font-size: 11px;
}

/* State */
.pb-danger {
    color: var(--color-danger);
}

.pb-warning {
    color: var(--color-warning);
}

.pb-overdue {
    color: var(--color-danger);
    font-weight: 600;
}

/* Spacing */
.pb-mt-sm { margin-top: 8px; }
.pb-mt-md { margin-top: 16px; }
.pb-mb-sm { margin-bottom: 8px; }
.pb-mb-md { margin-bottom: 16px; }

/* ==================== Fonts ==================== */

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    src: url("../vendor/montserrat/montserrat-regular.62ffba818ac6.woff2") format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    src: url("../vendor/montserrat/montserrat-medium.5e81cf779358.woff2") format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    src: url("../vendor/montserrat/montserrat-semibold.4c1e5674955b.woff2") format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    src: url("../vendor/montserrat/montserrat-bold.c5b559e1cafc.woff2") format('woff2');
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: #f0f0f0;
    color: #111;
    line-height: 1.4;
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

#filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

#filter-buttons {
    display: flex;
    gap: 4px;
}

#filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
}


.wv-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.wv-toggle-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.wv-toggle-btn:not(:last-child) {
    border-right: 1px solid #ddd;
}

.wv-toggle-btn:hover {
    background: #f5f5f5;
}

.wv-toggle-btn.active {
    background: #222;
    color: #fff;
}

#search {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 300px;
    outline: none;
}

#search:focus {
    border-color: #999;
}

#search::placeholder {
    color: #aaa;
}

.filter-btn {
    padding: 6px 12px;
    background: transparent;
    color: #777;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-btn:hover {
    color: #111;
}

.filter-btn.active {
    background: #222;
    color: #fff;
}

main {
    padding: 16px;
    min-height: calc(100vh - 57px);
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    text-align: center;
    padding: 40px;
}

.empty-state-icon {
    font-size: 72px;
    color: #ccc;
    margin-bottom: 24px;
    opacity: 0.8;
}

.empty-state-title {
    font-size: 22px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 15px;
    color: #999;
    margin-bottom: 32px;
    max-width: 300px;
    line-height: 1.5;
}

.empty-state-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 12px;
    color: #666;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.empty-state-action:hover {
    border-color: #222;
    border-style: solid;
    color: #222;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.empty-state-action i {
    font-size: 20px;
}

#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.project-card {
    padding: 14px;
    height: 100%;
}

.add-project-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    border: 2px dashed #ddd;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    padding: 0;
}

.add-project-card:hover {
    border-color: #999;
    background: #fafafa;
}

.add-project-card i {
    font-size: 32px;
    color: #ccc;
    transition: color 0.15s;
}

.add-project-card:hover i {
    color: #888;
}

@media (max-width: 1400px) {
    #projects-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #projects-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #projects-container {
        grid-template-columns: 1fr;
    }

    main {
        padding: 12px;
    }

    #filters {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    #filter-buttons {
        flex-wrap: wrap;
    }

    #filter-right {
        justify-content: space-between;
    }

    #search {
        width: 100%;
        flex: 1;
    }
}

/* .card-header base styles now in .pb-card-header */

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 8px;
}

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

.context-menu-wrapper {
    position: relative;
}

.context-menu-trigger {
    font-size: 16px;
    color: #bbb;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.context-menu-trigger:hover {
    color: #666;
    background: #f0f0f0;
}

.context-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-top: 4px;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item i {
    font-size: 16px;
    color: #666;
}

.context-menu-item[data-action="delete"] {
    color: #c0392b;
}

.context-menu-item[data-action="delete"] i {
    color: #c0392b;
}

.context-menu-item[data-action="delete"]:hover {
    background: #fdf2f2;
}

.context-menu-submenu {
    position: relative;
}

.context-menu-item.has-submenu {
    display: flex;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 14px;
    margin-left: auto;
}

.context-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-left: 4px;
}

.context-submenu.show {
    display: block;
}

.date-picker-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.date-item-display {
    cursor: default;
}

.date-item-display:hover {
    color: inherit;
}

.date-item-display:not(.deadline-soon):not(.deadline-urgent):not(.deadline-overdue),
.date-item-display:not(.deadline-soon):not(.deadline-urgent):not(.deadline-overdue):hover {
    color: #888;
}

/* .context-menu-divider base styles now in .pb-menu-divider */

.toggle-item .section-check {
    transition: opacity 0.15s;
}

.context-menu-item.confirm {
    background: #c0392b;
    color: #fff;
}

.context-menu-item.confirm i {
    color: #fff;
}

/* .folder-tag base styles now in .pb-tag */

.folder-select {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 1px 4px;
    background: #fff;
    cursor: pointer;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    cursor: text;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 3px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-title:hover {
    background: #f7f7f7;
}

.title-edit {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.card-dates {
    display: flex;
    justify-content: space-between;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    position: relative;
}

.date-item:hover {
    color: #111;
}

.date-item i {
    font-size: 14px;
}

.date-icon-trigger {
    cursor: pointer;
}

.date-icon-trigger:hover {
    color: #111;
}

.date-item.deadline-soon {
    color: #e67e22;
}

.date-item.deadline-urgent {
    color: #c0392b;
}

.date-item.deadline-overdue {
    color: #c0392b;
    font-weight: 600;
}

.date-clear {
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: 2px;
}

.date-item:hover .date-clear {
    opacity: 1;
}

.date-clear:hover {
    color: #999;
}

.date-picker {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.date-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 180px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-top: 4px;
}

.date-menu.show {
    display: block;
}

.date-menu-left {
    right: auto;
    left: 0;
}

.date-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.date-menu-item:hover {
    background: #f5f5f5;
}

.date-menu-item i {
    font-size: 16px;
    color: #666;
}

.card-section {
    margin-bottom: 10px;
}

.card-section:last-child {
    margin-bottom: 0;
}

/* .section-title base styles now in .pb-section-title */

.add-task-icon {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
}

.add-task-icon:hover {
    opacity: 1;
}

/* .section-content base styles now in .pb-section-content */

.editable-section {
    cursor: text;
    padding: 3px 5px;
    margin: -3px -5px;
    border-radius: 3px;
    min-height: 18px;
}

.editable-section:hover {
    background: #f7f7f7;
}

/* .task-list base styles now in .pb-task-list */
/* .task-item base styles now in .pb-task-item */

/* .delete-task base styles now in .pb-task-delete */

.drag-handle {
    color: #ccc;
    font-size: 12px;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:hover {
    color: #999;
}

/* .task-item checkbox and .task-text base styles now in .pb-task-checkbox / .pb-task-text */

.inline-edit {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    padding: 3px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    outline: none;
    background: #fff;
}

.inline-edit:focus {
    border-color: #888;
}

textarea.inline-edit {
    resize: vertical;
    min-height: 50px;
}

.section-edit {
    width: 100%;
    margin: -3px -5px;
}

.task-edit {
    flex: 1;
}

.details-btn {
    padding: 2px 8px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #999;
    font-size: 11px;
    cursor: pointer;
}

.details-btn:hover {
    border-color: #999;
    color: #666;
}

mark {
    background: #ff0;
    color: inherit;
    padding: 0;
}

.recently-completed {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
}

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

.recently-completed-title {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.show-all-icon {
    font-size: 14px;
    color: #aaa;
    cursor: pointer;
    opacity: 0.6;
}

.show-all-icon:hover {
    opacity: 1;
    color: #666;
}

.completed-list .task-item {
    opacity: 0.6;
}

.completed-list .task-item:hover {
    opacity: 1;
}

.completed-text {
    text-decoration: line-through;
    color: #888;
}

.completed-date {
    font-size: 11px;
    color: #aaa;
    margin-left: auto;
}

/* ==================== Baby Tracker ==================== */

.baby-nav {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: env(safe-area-inset-top) 16px 0 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.baby-nav-logo {
    height: 24px;
    width: auto;
    margin-right: 8px;
    align-self: center;
}

.baby-nav-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-burger-wrapper {
    position: relative;
}

.nav-burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.15s, color 0.15s;
}

.nav-burger:hover {
    background: #f0f0f0;
    color: #333;
}

.nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 180px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    margin-top: 6px;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.nav-menu-item:hover {
    background: #f5f5f5;
}

.nav-menu-item i {
    font-size: 18px;
    color: #666;
}

.nav-menu-chevron {
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.2s;
}

.nav-menu-chevron.open {
    transform: rotate(90deg);
}

/* Submenu (flies out to the left) */

.nav-submenu {
    position: absolute;
    right: 100%;
    bottom: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    margin-right: 4px;
}

.nav-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.nav-submenu-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-submenu-label i {
    font-size: 16px;
    color: #666;
}

/* Toggle Switch */

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 22px;
    transition: background 0.2s;
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active .toggle-slider {
    background: #222;
}

.toggle-switch.active .toggle-slider::before {
    transform: translateX(18px);
}

.baby-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.baby-nav-link:hover {
    color: #333;
}

.baby-nav-link.active {
    color: #111;
    border-bottom-color: #111;
}

.baby-nav-link i {
    font-size: 18px;
}

.screensaver {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.screensaver.active {
    display: flex;
}

body.screensaver-active {
    overflow: hidden;
}

.screensaver-grid {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 32px;
    width: 95vw;
    max-width: 1200px;
    padding: 24px;
}

.ss-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.ss-logo {
    height: 80px;
    width: auto;
    opacity: 0.55;
}

.ss-datetime {
    /* Column-flex so the sundial child stretches to the parent's natural
       width — same as the clock above — and sunrise/sunset land flush with
       the clock's left/right edges. */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    line-height: 1.1;
}

.ss-date {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 4px;
}

.ss-time {
    font-size: 56px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
}

.ss-section { display: flex; flex-direction: column; }
.ss-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.ss-sun {
    display: inline-flex;
    gap: 12px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.55);
}

/* Sundial under the clock — sunrise left-aligned, sunset right-aligned;
   width matches the time block above so the two timestamps frame it. */
.ss-sundial {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.55);
}
.ss-sundial:empty { display: none; }
.ss-sundial .ss-sun-rise,
.ss-sundial .ss-sun-set { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ss-sundial .ss-sun-rise i { font-size: 14px; color: #ffb74a; }
.ss-sundial .ss-sun-set  i { font-size: 14px; color: #6fa6ff; }

/* Sun / rain rows — same flex layout as `.ss-hours` so the per-slot cells
   line up column-for-column with the icon strip above. flex/gap/padding
   must match `.ss-hour` to avoid sub-pixel drift across columns. */
.ss-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 18px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.ss-row-cell {
    position: relative;
    flex: 1;
    min-width: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ss-row-cell--day { flex: 1.2; }
#ss-row-sun .ss-row-cell  { color: rgba(255, 220, 130, 0.85); }
#ss-row-rain .ss-row-cell { color: rgba(160, 200, 240, 0.85); }

#ss-graph-sun, #dashboard-graph-sun { position: relative; }
.ss-bar-sun {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}
.ss-bar-sun-rise { color: #d49500; }
.ss-bar-sun-set  { color: #5b8def; }
.screensaver .ss-bar-sun-rise,
.screensaver .ss-bar-sun-set { color: rgba(255, 255, 255, 0.85); }
.ss-sun:empty { display: none; }
.ss-sun .ss-sun-rise,
.ss-sun .ss-sun-set { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.ss-sun .ss-sun-rise i,
.ss-sun .ss-sun-set i { font-size: 14px; line-height: 1; }
.dashboard-page .ss-sun { color: var(--color-text-muted); }
.dashboard-page .ss-sun .ss-sun-rise { color: #d49500; }
.dashboard-page .ss-sun .ss-sun-set  { color: #5b8def; }

.screensaver-weather {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 4px;
    align-items: center;
}

.ss-legend {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.ss-legend i {
    font-size: 14px;
}

.ss-hours {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    color: rgba(255, 255, 255, 0.7);
    width: 100%;
}

.ss-hour {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.ss-hour.ss-day-boundary::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    width: 2px;
    background: rgba(255, 255, 255, 0.55);
}

.ss-hour-label {
    font-size: 11px;
    opacity: 0.55;
    letter-spacing: 0.5px;
}

.ss-hour-icon {
    width: 100%;
    max-width: 36px;
    height: auto;
    aspect-ratio: 1 / 1;
    color: rgba(255, 255, 255, 0.75);
    stroke: currentColor;
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ss-hour-temp {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

/* Per-block sun (%) and rain (mm) rendered as text under the temp value.
   Empty span when the block has no precipitation / no sun reported, so the
   row collapses visually instead of showing a phantom "0". */
.ss-hour-sun, .ss-hour-rain {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.55);
    min-height: 1em;
    line-height: 1.1;
}
.ss-hour-sun  { color: rgba(255, 220, 130, 0.85); }
.ss-hour-rain { color: rgba(160, 200, 240, 0.85); }
.ss-hour-sun:empty, .ss-hour-rain:empty { min-height: 1em; }
.ss-hour-sun i, .ss-hour-rain i { font-size: 11px; margin-right: 2px; }

.ss-hour.ss-day {
    flex: 1.2;
    border-left: 1px solid rgba(255, 255, 255, 0.45);
    padding-left: 6px;
}

.ss-hour.ss-day .ss-hour-label {
    font-weight: 600;
    opacity: 0.85;
    text-transform: uppercase;
}

.ss-hour-temp-range {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ss-hour-temp-range .lo { opacity: 0.55; margin-right: 2px; }

.ss-graph {
    display: block;
    width: 100%;
    height: 22px;
    overflow: visible;
}

.ss-graph-line {
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 1.4;
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ss-graph-bar {
    fill: rgba(255, 255, 255, 0.6);
}

.ss-graph-grid {
    stroke: rgba(255, 255, 255, 0.55);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.screensaver-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    max-width: 520px;
    min-width: 0;
}

.ss-bottom-col { min-width: 0; }
.screensaver-garbage {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 18px;
}
.screensaver-garbage-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.screensaver-garbage-when {
    min-width: 70px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}
.screensaver-garbage-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}
.screensaver-garbage-name {
    color: rgba(255, 255, 255, 0.95);
}
.screensaver-quote {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.screensaver-author {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    text-align: center;
}

.baby-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

/* === Dashboard (colored variant of screensaver layout) === */
.baby-nav-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.dashboard-page {
    display: flex;
    justify-content: center;
    padding: 12px 8px;
    background: var(--color-bg);
}

.dashboard-page .screensaver-grid {
    width: 100%;
    max-width: none;
    padding: 0;
    gap: 28px;
}

.dashboard-page .ss-header {
    display: none;
}

.dashboard-page .ss-section-weather {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 16px;
}

.dashboard-page .ss-date {
    color: var(--color-text-muted);
}

.dashboard-page .ss-time {
    color: var(--color-text);
}

.dashboard-page .ss-section-title {
    color: var(--color-text-muted);
}

.dashboard-page .ss-legend {
    color: var(--color-text-muted);
}

/* === Screensaver mode (CSS-only switch via body.screensaver-active) === */
body.screensaver-active { background: #000 !important; overflow: hidden; }
body.screensaver-active .baby-nav,
body.screensaver-active .subnav,
body.screensaver-active nav { display: none !important; }
body.screensaver-active .dashboard-page {
    position: fixed; inset: 0;
    background: #000;
    padding: 40px 32px;
    z-index: 9999;
    display: block;
}
body.screensaver-active .dashboard-page .screensaver-grid {
    gap: 36px;
}
body.screensaver-active .dashboard-page .ss-header {
    display: flex;
    color: #fff;
}
.ss-logo--screensaver { display: none; }
body.screensaver-active .ss-logo--normal { display: none; }
body.screensaver-active .ss-logo--screensaver { display: block; }
body.screensaver-active .dashboard-page .ss-date { color: rgba(255,255,255,0.5); }
body.screensaver-active .dashboard-page .ss-time { color: #fff; }

body.screensaver-active .ss-section-plan {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #fff;
}
body.screensaver-active .ss-section-title { color: rgba(255,255,255,0.4) !important; }
body.screensaver-active .ss-section-title i { color: rgba(255,255,255,0.4) !important; }

body.screensaver-active .plan-day-divider { background: rgba(255,255,255,0.18) !important; }
body.screensaver-active .plan-day-label-main { color: #fff !important; }
body.screensaver-active .plan-day-label-sub  { color: rgba(255,255,255,0.5) !important; }

body.screensaver-active .plan-cell i { color: rgba(255,255,255,0.85) !important; opacity: 1; }
body.screensaver-active .plan-cell .ti-sunrise,
body.screensaver-active .plan-cell .ti-sunset { color: rgba(255,255,255,0.7) !important; }
body.screensaver-active .plan-cell--label { color: rgba(255,255,255,0.5) !important; }
body.screensaver-active .plan-cell--temp { color: rgba(255,255,255,0.6) !important; opacity: 1; }
body.screensaver-active .plan-cell--sun {
    background: none !important;
    -webkit-text-fill-color: rgba(255,255,255,0.6);
    color: rgba(255,255,255,0.6) !important;
}
body.screensaver-active .plan-cell--rain { color: rgba(255,255,255,0.6) !important; }

body.screensaver-active .plan-row-icon i { color: rgba(255,255,255,0.55) !important; }

body.screensaver-active .plan-bar {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.22) !important;
    color: rgba(255,255,255,0.75) !important;
    text-shadow: none !important;
}
body.screensaver-active .plan-bar.plan-bar--dark-text {
    background: rgba(255,255,255,0.55) !important;
    color: rgba(0,0,0,0.78) !important;
    text-shadow: none !important;
}
/* The bit of colour that stays — bin-coloured trash reminders. Icons get
   their fill from inline styles; we just adjust the outline glow on dark bg. */
body.screensaver-active .plan-reminder i {
    text-shadow:
        0 0 2px rgba(0, 0, 0, 0.85),
        0 0 4px rgba(0, 0, 0, 0.55) !important;
}

.dashboard-page .ss-section-plan,
.dashboard-page .ss-section-garten {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dashboard-page .ss-section-garten {
    margin-top: 12px;
    max-width: 50%;
}
@media (max-width: 720px) {
    .dashboard-page .ss-section-garten { max-width: none; }
}

/* === Dashboard 2×2 navigation cards (Baby / Briefing / Bewässerung / Heim) === */
.dashboard-page .dashboard-cards {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 720px) {
    .dashboard-page .dashboard-cards { grid-template-columns: 1fr; }
}
.dashboard-page .dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-height: 120px;
    transition: border-color 0.15s, transform 0.1s;
}
.dashboard-page .dashboard-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
}
.dashboard-page .dashboard-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dashboard-page .dashboard-card-head i {
    font-size: 18px;
    color: var(--color-primary);
}
.dashboard-page .dashboard-card-body {
    flex: 1;
    font-size: 13px;
    color: var(--color-text-muted);
}
.dashboard-page .dashboard-card-body:empty::before {
    content: "—";
    opacity: 0.4;
}
.ss-garbage-addr { color: var(--color-text-muted); font-weight: 400; text-transform: none; letter-spacing: normal; font-size: 11px; }

/* === Garten card === */
.garten-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.garten-row {
    display: grid;
    grid-template-columns: 22px 100px 1fr;
    align-items: center;
    column-gap: 10px;
    font-size: 12px;
}
.garten-row.garten-row--list { align-items: start; }
.garten-row > i {
    color: var(--color-text-muted);
    font-size: 14px;
    text-align: center;
}
.garten-label {
    color: var(--color-text-muted);
    font-weight: 500;
}
.garten-value { color: var(--color-text); }
.garten-muted { color: var(--color-text-muted); opacity: 0.7; }

.garten-cistern-bar {
    position: relative;
    height: 18px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    overflow: hidden;
}
.garten-cistern-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, #0ea5e9, #06b6d4);
}
.garten-cistern-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text);
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

.garten-forecast-days {
    display: flex;
    gap: 6px;
}
.garten-forecast-day {
    flex: 1;
    display: grid;
    grid-template-rows: auto 36px auto;
    align-items: end;
    justify-items: center;
    gap: 2px;
}
.garten-forecast-label {
    font-size: 10px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
.garten-forecast-bar {
    width: 14px;
    height: 36px;
    background: rgba(14, 165, 233, 0.10);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.garten-forecast-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, #0ea5e9, #06b6d4);
    border-radius: 2px 2px 0 0;
}
.garten-forecast-pct {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.garten-program-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.garten-program {
    display: grid;
    grid-template-columns: 1fr auto auto;
    column-gap: 12px;
    font-size: 11px;
    color: var(--color-text);
}
.garten-program-name { font-weight: 500; }
.garten-program-when { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.garten-program-duration {
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: right;
}

/* Screensaver styling for Garten — same B&W treatment as Tagesplanung */
body.screensaver-active .ss-section-garten {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #fff;
}
body.screensaver-active .garten-label { color: rgba(255, 255, 255, 0.5) !important; }
body.screensaver-active .garten-value,
body.screensaver-active .garten-cistern-pct,
body.screensaver-active .garten-forecast-pct,
body.screensaver-active .garten-program-name { color: #fff !important; }
body.screensaver-active .garten-program-when,
body.screensaver-active .garten-program-duration,
body.screensaver-active .garten-forecast-label { color: rgba(255, 255, 255, 0.5) !important; }
body.screensaver-active .garten-row > i { color: rgba(255, 255, 255, 0.55) !important; }
body.screensaver-active .garten-cistern-bar,
body.screensaver-active .garten-forecast-bar {
    background: rgba(255, 255, 255, 0.08) !important;
}
body.screensaver-active .garten-cistern-fill,
body.screensaver-active .garten-forecast-fill {
    background: rgba(255, 255, 255, 0.4) !important;
}
body.screensaver-active .garten-cistern-pct {
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6) !important;
}

.plan-strip-combined {
    width: 100%;
}
.plan-stack-combined {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}
.plan-combined-row {
    display: flex;
    align-items: center;
    column-gap: 0;
}
.plan-combined-row > .plan-row-icon {
    flex: 0 0 22px;
}
/* Day-section paddings give breathing room around each absolutely-positioned
   .plan-day-divider; the line itself spans the full stack height so it stays
   continuous across the inter-row gaps. */
.plan-combined-row > :nth-child(n+2):not(:last-child) {
    padding-right: 6px;
}
.plan-combined-row > :nth-child(n+3) {
    padding-left: 6px;
}
.plan-day-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
    pointer-events: none;
    z-index: 1;
}
.plan-day-headers {
    padding-bottom: 2px;
}
.plan-day-header {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 6px;
    line-height: 1.1;
    min-width: 0;
}
.plan-day-label-main { font-weight: 600; font-size: 13px; color: var(--color-text); }
.plan-day-label-sub { font-size: 11px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.plan-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--color-text-muted);
}
/* Track-lane icons (haus/sport/freizeit/müll/familie/baby) sit at the top of
   their (possibly multi-level / wrapped-text) row so they line up with the
   first bar level rather than floating in the vertical center. align-self
   overrides the parent row's align-items: center; padding-top fine-tunes
   the icon's vertical offset within the first-level bar slot. */
.plan-combined-row.plan-row-data > .plan-row-icon {
    align-self: flex-start;
    padding-top: 3px;
}
.plan-row-icon i { font-size: 13px; }
.plan-row-cells {
    display: grid;
    /* grid-template-columns set inline per day: repeat(N, 1fr) */
}
.plan-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    line-height: 1;
    position: relative;
    z-index: 5;
}
.plan-cell i { font-size: 16px; color: var(--color-text); opacity: 0.85; }
.plan-cell .ti-sunrise { font-size: 13px; color: #f59e0b; opacity: 1; }
.plan-cell .ti-sunset  { font-size: 13px; color: #c2410c; opacity: 1; }
.plan-cell--label {
    font-size: 9px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
.plan-row-data { min-height: 20px; }
/* Small breathing space between the weather rows and the first track lane. */
.plan-combined-row:not(.plan-row-data) + .plan-row-data {
    margin-top: 6px;
}
.plan-row-bars {
    position: relative;
    min-height: 16px;
}
.plan-bar {
    position: absolute;
    top: 1px;
    bottom: 1px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 8px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: 0.02em;
    padding: 0 2px;
    overflow: hidden;
    /* allow wrapping inside narrow bars; break long words if needed so the
       label stays inside the bar instead of being clipped flat. */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.plan-bar--haus {
    background: rgba(217, 119, 6, 0.20);
    border: 1px solid rgba(217, 119, 6, 0.32);
    color: rgba(124, 65, 0, 0.85);
}
.plan-bar--sport {
    background: rgba(30, 136, 229, 0.20);
    border: 1px solid rgba(30, 136, 229, 0.32);
    color: rgba(15, 75, 130, 0.85);
}
.plan-bar--freizeit {
    background: rgba(168, 85, 247, 0.20);
    border: 1px solid rgba(168, 85, 247, 0.32);
    color: rgba(88, 28, 135, 0.85);
}
.plan-bar--familie {
    background: rgba(225, 29, 72, 0.20);
    border: 1px solid rgba(225, 29, 72, 0.32);
    color: rgba(136, 19, 55, 0.85);
}
.plan-bar--baby {
    background: rgba(14, 165, 233, 0.20);
    border: 1px solid rgba(14, 165, 233, 0.32);
    color: rgba(7, 89, 133, 0.85);
}
.plan-bar--garbage {
    border: 1px solid rgba(0, 0, 0, 0.18);
    /* background set inline from ZAW colour */
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}
.plan-bar--garbage.plan-bar--dark-text {
    color: rgba(0, 0, 0, 0.82);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}
.plan-reminder {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    line-height: 1;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 1px;
}
.plan-reminder i {
    /* dark outline keeps the (possibly bright/white) bin colour readable
       on both light dashboard and dark screensaver backgrounds. */
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.85),
        0 0 2px rgba(0, 0, 0, 0.55);
}

.plan-cell--temp,
.plan-cell--sun,
.plan-cell--rain {
    font-size: 8px;
    font-variant-numeric: tabular-nums;
    height: 11px;
    opacity: 0.7;
}
.plan-cell--temp { color: var(--color-text-muted); }
.plan-cell--sun {
    background: linear-gradient(90deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    opacity: 0.85;
}
.plan-cell--rain { color: #1e88e5; }

.plan-rest-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.garbage-day {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 90px;
    background: var(--pb-card-bg, #fff);
}
.garbage-day-header { text-align: center; line-height: 1.1; }
.garbage-day-weekday { font-weight: 600; font-size: 12px; color: var(--color-text); }
.garbage-day-date { font-size: 10px; color: var(--color-text-muted); margin-top: 2px; }
.garbage-day-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: stretch;
}
.garbage-chip {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 4px 2px;
    border-radius: 3px;
    line-height: 1.15;
    word-break: break-word;
}
.garbage-day-empty { color: var(--color-text-muted); font-size: 11px; opacity: 0.5; padding-top: 4px; }

@media (max-width: 720px) {
    .plan-rest-row { grid-template-columns: repeat(3, 1fr); }
}

.dashboard-page .ss-hours {
    color: var(--color-text);
}

.dashboard-page .ss-hour-label {
    color: var(--color-text-muted);
    opacity: 1;
}

.dashboard-page .ss-hour-icon {
    color: #4a90e2;
}

.dashboard-page .ss-hour-temp {
    color: var(--color-text);
}

.dashboard-page .ss-graph-line { stroke: var(--color-text); }
.dashboard-page .ss-graph-bar  { fill: var(--color-text-muted); }
.dashboard-page .ss-graph-line.ss-graph-temp-line { stroke: #e63946; }
.dashboard-page .ss-graph-bar.ss-graph-sun-bar   { fill: #f4a300; }
.dashboard-page .ss-graph-bar.ss-graph-wind-bar  { fill: #43a047; }
.dashboard-page .ss-graph-bar.ss-graph-rain-bar  { fill: #1976d2; }
.dashboard-page .ss-graph-grid { stroke: var(--color-border); }
.dashboard-page .ss-hour.ss-day-boundary::before { background: var(--color-border); }
.dashboard-page .ss-hour.ss-day { border-left-color: var(--color-border); }
.dashboard-page .ss-hour-temp-range { color: var(--color-text); }

.baby-charts-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .baby-charts-row {
        grid-template-columns: 1fr;
    }
}

/* .baby-planned-card base styles now in .pb-card */

.baby-planned-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.baby-planned-header i {
    font-size: 18px;
    color: #666;
}

.baby-task-add-icon {
    margin-left: auto;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    transition: color 0.15s;
}

.baby-task-add-icon:hover {
    color: #888;
}

/* Baby Task List */

.baby-task-list {
    margin-top: 10px;
}

.baby-task-item {
    padding: 4px 0;
}

.baby-task-drag-handle {
    color: #ccc;
    font-size: 12px;
    cursor: grab;
}

.baby-task-drag-handle:hover {
    color: #999;
}

/* .baby-task-item checkbox styles now in .pb-task-checkbox */

.baby-task-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.baby-task-title {
    cursor: text;
    padding: 1px 3px;
    margin: -1px -3px;
    border-radius: 3px;
}

.baby-task-title:hover {
    background: #f7f7f7;
}

.baby-task-title a {
    color: inherit;
    text-decoration: none;
}

.baby-task-title a:hover {
    text-decoration: underline;
}

.baby-task-done .baby-task-title {
    text-decoration: line-through;
    opacity: 0.45;
}

.baby-task-due {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

.baby-task-repeat-icon {
    font-size: 13px;
    color: #bbb;
    flex-shrink: 0;
}

.baby-task-overdue {
    color: #c0392b;
    font-weight: 600;
}

.baby-task-urgent {
    color: #c0392b;
    font-weight: 600;
}

.baby-task-delete {
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}

.baby-task-item:hover .baby-task-delete {
    opacity: 1;
}

.baby-task-delete:hover {
    color: #999;
}

.baby-task-delete.confirm {
    color: #c0392b;
    opacity: 1;
}

.baby-task-input-form {
    margin-top: 6px;
}

.baby-task-input {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    padding: 5px 8px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    outline: none;
    background: transparent;
    color: #333;
}

.baby-task-input:focus {
    border-style: solid;
    border-color: #ccc;
    background: #fff;
}

.baby-task-input::placeholder {
    color: #bbb;
}

.baby-task-editing {
    display: block;
    padding: 6px 0;
}

.baby-task-edit-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.baby-task-edit-row {
    display: flex;
    gap: 6px;
}

.baby-task-edit-details {
    flex-wrap: wrap;
}

.baby-task-edit-input {
    font-family: inherit;
    font-size: 13px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    background: #fff;
    flex: 1;
    min-width: 0;
}

.baby-task-edit-input:focus {
    border-color: #999;
}

.baby-task-edit-sm {
    flex: 1;
    min-width: 80px;
}

.baby-task-edit-xs {
    flex: 0 0 60px;
    min-width: 0;
}

.baby-task-edit-actions {
    display: flex;
    gap: 4px;
}

.baby-task-edit-actions .baby-save-btn,
.baby-task-edit-actions .baby-cancel-btn {
    padding: 3px 10px;
    font-size: 13px;
}

.baby-chart-carousel {
}

.baby-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.baby-carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    font-size: 18px;
}

.baby-carousel-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.baby-carousel-slides {
    position: relative;
}

.baby-carousel-slide {
    display: none;
}

.baby-carousel-slide.active {
    display: block;
}

.baby-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.baby-section-title i {
    font-size: 18px;
    color: #666;
}

.baby-chart-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.baby-chart-section:last-child {
    margin-bottom: 0;
}

.baby-chart {
    position: relative;
    width: 100%;
}

.baby-chart svg {
    display: block;
    width: 100%;
}

.baby-chart-empty {
    text-align: center;
    padding: 40px 16px;
    color: #999;
    font-size: 13px;
}

/* Shared chart styles */

.baby-chart-axis text {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    fill: #bbb;
}

.baby-chart-lifeday {
    font-size: 9px;
    fill: #999;
}

.baby-chart-axis line,
.baby-chart-axis .domain {
    stroke: #eee;
}

.baby-chart-grid line {
    stroke: #f5f5f5;
}

.baby-chart-grid .domain {
    display: none;
}

.baby-chart-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.baby-chart-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    fill: #aaa;
    font-weight: 500;
}

/* Weight Chart */

.weight-chart-line {
    fill: none;
    stroke: var(--color-sleep);
    stroke-width: 2;
}

.weight-chart-area {
    fill: var(--color-sleep);
    opacity: 0.04;
}

.weight-chart-dot {
    fill: var(--color-sleep);
    stroke: #fff;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.15s;
}

.weight-chart-target-area {
    fill: var(--color-temp-normal);
    opacity: 0.15;
}

.weight-chart-target-line {
    fill: none;
    stroke: var(--color-feeding);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
    opacity: 0.6;
}

.feeding-chart-line {
    fill: none;
    stroke: var(--color-feeding);
    stroke-width: 2;
}

.feeding-chart-trend-linear {
    fill: none;
    stroke: var(--color-feeding);
    stroke-width: 1.2;
    stroke-dasharray: 5 4;
    opacity: 0.35;
}

.feeding-chart-trend-weight {
    fill: none;
    stroke: #6b8e9e;
    stroke-width: 1.2;
    stroke-dasharray: 2 3;
    opacity: 0.55;
}

.feeding-chart-axis-right text {
    fill: #6b8e9e;
}

.feeding-chart-axis-right line,
.feeding-chart-axis-right path {
    stroke: #6b8e9e;
    opacity: 0.4;
}

.feeding-chart-ref-line {
    stroke: #6b8e9e;
    stroke-width: 1;
    stroke-dasharray: 2 4;
    opacity: 0.25;
}

.feeding-chart-forecast-bg {
    fill: #f3f4f6;
    opacity: 0.6;
}

.feeding-chart-forecast-divider {
    stroke: #cbd5e1;
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: 0.7;
}

.feeding-chart-legend-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    fill: var(--color-text-muted);
}

.feeding-chart-area {
    fill: var(--color-feeding);
    opacity: 0.04;
}

.feeding-chart-dot {
    fill: var(--color-feeding);
    stroke: #fff;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.15s;
}

.feeding-chart-bar {
    fill: #f3f4f6;
}

.feeding-chart-last-badge rect {
    fill: #f3f4f6;
    stroke: #e5e7eb;
    stroke-width: 1;
}

.feeding-chart-last-badge text {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    fill: var(--color-text);
}

.feeding-chart-last-label {
    fill: var(--color-text-muted);
}

.feeding-chart-last-value {
    font-weight: 600;
}

.weight-chart-baseline {
    stroke: #e0e0e0;
    stroke-width: 1;
    stroke-dasharray: 5 4;
}

.weight-chart-baseline-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    fill: #ccc;
}

.weight-chart-pct-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    fill: var(--color-feeding);
    font-weight: 600;
}

.weight-chart-pct-label.weight-chart-change-negative {
    fill: #e17055;
}

/* Temperature Chart */

.temp-chart-line {
    fill: none;
    stroke: var(--color-temperature);
    stroke-width: 2;
}

.temp-chart-dot {
    stroke: #fff;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.15s;
}

.temp-chart-zone-line {
    stroke: #eee;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.temp-chart-zone-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.5;
}

/* Day Timeline Chart */

.baby-day-chart {
    padding: 8px 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.baby-day-chart svg {
    display: block;
    min-width: 100%;
}

.daychart-future {
    fill: #f8f8f8;
}

.daychart-now-line {
    stroke: #e57373;
    stroke-width: 1.5;
}

.daychart-lane-bg {
    fill: #fafafa;
}

.daychart-lane-sep {
    stroke: #eee;
    stroke-width: 1;
}

.daychart-lane-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 15px;
}


.daychart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1 1 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    background: #f5f5f5;
    padding: 2px 4px;
    border-radius: 10px;
    white-space: nowrap;
}

.daychart-badge i {
    font-size: 13px;
}

.daychart-lane-marker {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.daychart-lane-marker i {
    font-size: 12px;
}

.daychart-tick {
    stroke: #ccc;
    stroke-width: 1;
}

.daychart-hour {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    fill: #aaa;
}

.daychart-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
}

.daychart-icon-label {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}

.daychart-icon-label i {
    font-size: 13px;
}

.daychart-temp-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 600;
}

.daychart-clickable {
    cursor: pointer;
}

.baby-entry-highlight {
    background: #fff9c4;
    transition: background 0.3s;
}

.daychart-sleep-bar {
    fill: var(--color-sleep);
    opacity: 0.55;
}

.daychart-sleep-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 600;
    fill: #fff;
}


.baby-quick-actions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.baby-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    transition: opacity 0.15s, transform 0.1s;
}

.baby-quick-btn:hover {
    opacity: 0.9;
}

.baby-quick-btn:active {
    transform: scale(0.97);
}

.baby-quick-btn i {
    font-size: 22px;
}

.baby-btn-sleep { background: var(--color-sleep); }
.baby-btn-feeding { background: var(--color-feeding); }
.baby-btn-diaper { background: var(--color-diaper); }
.baby-btn-temperature { background: var(--color-temperature); }
.baby-btn-activity { background: var(--color-activity); }
.baby-btn-note { background: var(--color-note); color: #333; }
.baby-btn-growth { background: var(--color-growth); }

/* Feeding Menu */

.feeding-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
}

.feeding-menu-section {
    margin-bottom: 8px;
}

.feeding-menu-section:last-child {
    margin-bottom: 0;
}

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

.feeding-type-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--color-feeding);
    border-radius: 6px;
    background: #fff;
    color: var(--color-feeding);
    cursor: pointer;
    transition: all 0.15s;
}

.feeding-type-btn.active {
    background: var(--color-feeding);
    color: #fff;
}

.feeding-type-btn:hover:not(.active) {
    background: #f0fdf9;
}

.feeding-amount-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.feeding-amount-btn {
    padding: 6px 0;
    min-width: 44px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f8f8;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.feeding-amount-btn:hover {
    background: var(--color-feeding);
    color: #fff;
    border-color: var(--color-feeding);
}

.feeding-amount-btn:active {
    transform: scale(0.95);
}

/* Diaper Menu */

.diaper-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
}

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

.diaper-type-btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--color-diaper);
    border-radius: 6px;
    background: #fff;
    color: var(--color-diaper);
    cursor: pointer;
    transition: all 0.15s;
}

.diaper-type-btn:hover {
    background: var(--color-diaper);
    color: #fff;
}

.diaper-type-btn:active {
    transform: scale(0.95);
}

.diaper-type-btn.active {
    background: var(--color-diaper);
    color: #fff;
}

.diaper-temp-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.diaper-temp-btn {
    padding: 6px 0;
    min-width: 44px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    color: #fff;
}

.diaper-temp-btn:active {
    transform: scale(0.95);
}

.temp-cold {
    background: var(--color-temp-cold);
}

.temp-cold:hover {
    background: #5a9fd4;
}

.temp-normal {
    background: #888;
    color: #fff;
}

.temp-normal:hover {
    background: #666;
    color: #fff;
}

.temp-elevated {
    background: #e67e22;
    color: #fff;
}

.temp-elevated:hover {
    background: #d35400;
    color: #fff;
}

.temp-fever {
    background: #e74c3c;
}

.temp-fever:hover {
    background: var(--color-danger);
}

.temp-high-fever {
    background: var(--color-temp-high-fever);
}

.temp-high-fever:hover {
    background: #96281b;
}

.diaper-temp-skip {
    width: 100%;
    background: #fff;
    border: 1px dashed #ccc;
    color: #888;
}

.diaper-temp-skip:hover {
    background: #f0f0f0;
    color: #555;
}

/* Note Menu */

.note-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
}

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

.note-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--color-note);
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
}

.note-type-btn:hover {
    background: #ffeaa7;
}

.note-type-btn.active {
    background: var(--color-note);
    color: #333;
}

.note-type-btn:active {
    transform: scale(0.95);
}

.note-type-btn i {
    font-size: 16px;
}

.note-fields {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-fields label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
}

.note-fields label span {
    color: #888;
    font-weight: 500;
}

.note-fields input {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    background: #fff;
}

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

.note-save-btn {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: var(--color-note);
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.note-save-btn:hover {
    opacity: 0.9;
}

.note-save-btn:active {
    transform: scale(0.98);
}

/* Weight Numpad */

.note-value-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.note-value-row input {
    flex: 1;
    min-width: 0;
    font-size: 22px !important;
    font-weight: 700;
    text-align: center;
    padding: 12px 8px !important;
    letter-spacing: 2px;
}

.weight-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 160px;
    flex-shrink: 0;
}

.numpad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-height: 44px;
}

.numpad-btn:hover {
    background: #e9ecef;
}

.numpad-btn:active {
    background: #dee2e6;
    transform: scale(0.95);
}

.numpad-clear {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.numpad-clear:hover {
    background: #ffe69c;
}

.numpad-delete {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.numpad-delete:hover {
    background: #f1aeb5;
}

/* Activity Fields */

.activity-fields {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-fields label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
}

.activity-fields label span {
    color: #888;
    font-weight: 500;
}

.activity-fields input {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    background: #fff;
}

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

.activity-save-btn {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: var(--color-activity);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.activity-save-btn:hover {
    opacity: 0.9;
}

.activity-save-btn:active {
    transform: scale(0.98);
}

/* Temperature Menu */

.temperature-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
}

.temperature-menu .diaper-temp-buttons {
    display: flex;
}

/* Activity Menu */

.activity-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
}

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

.activity-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--color-activity);
    border-radius: 6px;
    background: #fff;
    color: var(--color-activity);
    cursor: pointer;
    transition: all 0.15s;
}

.activity-type-btn:hover,
.activity-type-btn.active {
    background: var(--color-activity);
    color: #fff;
}

.activity-type-btn:active {
    transform: scale(0.95);
}

.activity-type-btn i {
    font-size: 16px;
}

/* Growth Menu */

.growth-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 16px;
}

.growth-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.growth-fields label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
}

.growth-fields label span {
    color: #888;
    font-weight: 500;
}

.growth-fields input {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    background: #fff;
}

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

.growth-save-btn {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: var(--color-growth);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.growth-save-btn:hover {
    opacity: 0.9;
}

.growth-save-btn:active {
    transform: scale(0.98);
}

/* Stats */

.baby-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.baby-stat-card {
    padding: 10px;
    text-align: center;
}

.baby-stat-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.baby-stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.baby-stat-feeding .baby-stat-value { color: var(--color-feeding); }
.baby-stat-sleep .baby-stat-value { color: var(--color-sleep); }
.baby-stat-diaper .baby-stat-value { color: var(--color-diaper); }
.baby-stat-growth .baby-stat-value { color: var(--color-growth); }

/* Day grouping */

.baby-day-group {
    margin-bottom: 8px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.baby-day-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    user-select: none;
}

.baby-day-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
}

.baby-day-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.baby-day-meta {
    font-size: 11px;
    color: #888;
}

.baby-day-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px 4px;
}

/* Arztbesuch Widget */
.baby-arztbesuch-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 10px;
    margin: 6px 12px;
    padding: 10px 14px;
    background: #f3e8fd;
    border: 1px solid #d9bfef;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.baby-arztbesuch-card:hover {
    background: #eddcf9;
}

.baby-arztbesuch-icon {
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    font-size: 22px;
    color: #8e44ad;
}

.baby-arztbesuch-content {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.baby-arztbesuch-title {
    font-weight: 600;
    font-size: 13px;
    color: #5b2d7a;
}

.baby-arztbesuch-time {
    font-size: 12px;
    color: #8e44ad;
}

.baby-arztbesuch-reason,
.baby-arztbesuch-notes {
    grid-column: 2;
    font-size: 12px;
    color: #6b3a8a;
    line-height: 1.4;
}

.baby-arztbesuch-reason {
    font-weight: 500;
}

.baby-arztbesuch-notes {
    opacity: 0.8;
}

.baby-day-entries-wrap {
    border-top: 1px solid #f0f0f0;
}

.baby-day-entries-wrap summary {
    list-style: none;
}

.baby-day-entries-wrap summary::-webkit-details-marker {
    display: none;
}

.baby-day-entries-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 11px;
    color: #aaa;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.baby-day-entries-toggle:hover {
    color: #666;
}

.baby-day-entries-toggle i {
    font-size: 14px;
}

.baby-day-entries-chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.baby-day-entries-wrap[open] .baby-day-entries-chevron {
    transform: rotate(180deg);
}

.baby-day-entries {
    padding: 6px 10px;
}

/* Entries Table */

.baby-entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    padding: 0 10px;
    margin: 6px 0;
}

.baby-entry-row {
    cursor: pointer;
    transition: background 0.12s;
}

.baby-entry-row:hover {
    background: #f7f7f7;
}

.baby-entry-row td {
    padding: 5px 6px;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid #f0f0f0;
}

.baby-entry-row:last-child td {
    border-bottom: none;
}

.baby-entry-icon-cell {
    width: 28px;
    text-align: center;
}

.baby-entry-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
}

.baby-dot-sleep { background: var(--color-sleep); }
.baby-dot-feeding { background: var(--color-feeding); }
.baby-dot-diaper { background: var(--color-diaper); }
.baby-dot-temperature { background: var(--color-temperature); }
.baby-dot-activity { background: var(--color-activity); }
.baby-dot-note { background: var(--color-note); color: #333; }
.baby-dot-growth { background: var(--color-growth); }

.baby-entry-time-cell {
    width: 44px;
    font-variant-numeric: tabular-nums;
    color: #555;
    font-weight: 500;
}

.baby-entry-type-cell {
    font-weight: 600;
    color: #333;
}

.baby-entry-value-cell {
    color: #555;
}

.baby-entry-notes-cell {
    color: #999;
    font-style: italic;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.baby-entry-actions-cell {
    width: 28px;
    text-align: center;
}

/* Edit Row — inline cell inputs */

.baby-edit-row {
    background: #fafafa;
}

.baby-edit-row td {
    padding: 5px 6px;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid #f0f0f0;
}

.baby-edit-cell {
    font-family: inherit;
    font-size: 13px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: inherit;
    width: 100%;
}

.baby-edit-cell:focus {
    border-color: #999;
    border-radius: 3px;
    background: #fff;
}

.baby-edit-cell-narrow {
    width: 70px;
}

.baby-edit-row .baby-entry-time-cell {
    width: auto;
    min-width: 110px;
}

select.baby-edit-cell {
    width: auto;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 14px;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 4px center;
}

select.baby-edit-cell:focus {
    background-color: #fff;
}

.baby-edit-unit {
    font-size: 12px;
    color: #888;
}

.baby-edit-row .baby-entry-actions-cell {
    white-space: nowrap;
}

.baby-edit-row .baby-entry-actions-cell button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    vertical-align: middle;
}

.baby-edit-row .baby-save-btn {
    background: #222;
    color: #fff;
}

.baby-edit-row .baby-save-btn:hover {
    opacity: 0.85;
}

.baby-edit-row .baby-cancel-btn {
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
}

.baby-edit-row .baby-cancel-btn:hover {
    color: #666;
    border-color: #999;
}

.baby-entry-row.filter-hidden {
    display: none;
}

/* Timeline entries (legacy card styles) */

.baby-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 6px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.15s;
}

.baby-entry:hover {
    border-color: #ccc;
}

.baby-entry-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 16px;
}

.baby-entry-sleep .baby-entry-icon { background: var(--color-sleep); }
.baby-entry-feeding .baby-entry-icon { background: var(--color-feeding); }
.baby-entry-diaper .baby-entry-icon { background: var(--color-diaper); }
.baby-entry-temperature .baby-entry-icon { background: var(--color-temperature); }
.baby-entry-activity .baby-entry-icon { background: var(--color-activity); }
.baby-entry-note .baby-entry-icon { background: var(--color-note); color: #333; }
.baby-entry-growth .baby-entry-icon { background: var(--color-growth); }

.baby-entry-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.baby-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.baby-entry-label {
    font-size: 13px;
    font-weight: 600;
}

.baby-entry-time {
    font-size: 11px;
    color: #999;
}

.baby-entry-details {
    font-size: 13px;
    color: #555;
}

.baby-duration {
    color: #888;
    font-size: 12px;
}

.baby-active-sleep-card {
    background: #f3f0ff;
    border-color: #d5ccf7;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.baby-active-sleep-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-sleep);
    font-weight: 500;
    font-size: 14px;
}

.baby-active-sleep-info > i {
    font-size: 20px;
    animation: pulse-zzz 2s ease-in-out infinite;
}

.baby-active-sleep-timer {
    font-variant-numeric: tabular-nums;
}

.baby-reset-sleep-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-sleep);
    opacity: 0.4;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: opacity 0.15s;
}

.baby-reset-sleep-btn:hover {
    opacity: 1;
}

.baby-active-sleep-card .baby-end-sleep-reasons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.baby-active-sleep-card .baby-end-sleep-btn {
    padding: 6px 12px;
    font-size: 12px;
}

.baby-sleeping {
    color: var(--color-sleep);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.baby-sleeping i {
    animation: pulse-zzz 2s ease-in-out infinite;
}

@keyframes pulse-zzz {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.baby-end-sleep-btn {
    padding: 2px 8px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    background: var(--color-sleep);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.baby-end-sleep-btn:hover {
    opacity: 0.85;
}

.baby-end-sleep-reasons {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

.baby-end-reason {
    font-size: 12px;
    color: var(--color-sleep);
    font-weight: 500;
}

.baby-notes {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    font-style: italic;
}

.baby-entry-actions {
    display: flex;
    align-items: center;
}

.baby-delete {
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    padding: 4px;
}

.baby-entry:hover .baby-delete,
.baby-entry-row:hover .baby-delete {
    opacity: 1;
}

.baby-delete:hover {
    color: #999;
}

.baby-delete.confirm {
    color: #c0392b;
    opacity: 1;
}

/* Edit forms */

.baby-edit-form {
    flex: 1;
}

.baby-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.baby-edit-fields label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.baby-edit-fields label span {
    min-width: 70px;
    color: #888;
    font-weight: 500;
}

.baby-edit-fields input,
.baby-edit-fields select {
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    background: #fff;
}

.baby-edit-fields input:focus,
.baby-edit-fields select:focus {
    border-color: #999;
}

.baby-edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.baby-save-btn {
    padding: 4px 14px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.baby-save-btn:hover {
    opacity: 0.85;
}

.baby-cancel-btn {
    padding: 4px 14px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.baby-cancel-btn:hover {
    border-color: #999;
}

/* Edit Modal */

/* .baby-modal-overlay, .baby-modal, .baby-modal-header base styles now in .pb-modal-* */

.baby-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.baby-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
}

.baby-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* .baby-modal-body base styles now in .pb-modal-body */

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

.baby-modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.baby-modal-field label {
    font-size: 12px;
    font-weight: 500;
    color: #888;
}

/* .baby-modal-input and .baby-modal-actions base styles now in .pb-input / .pb-select / .pb-modal-actions */

.baby-modal-actions .baby-save-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 6px;
}

.baby-modal-actions .baby-cancel-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 6px;
}

.baby-modal-delete-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    margin-top: 4px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    background: none;
    color: #ccc;
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.baby-modal-delete-btn:hover {
    color: #c0392b;
    border-color: #e0c0c0;
}

.baby-modal-delete-btn.confirm {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

/* Flatpickr overrides */

.flatpickr-calendar {
    font-family: 'Montserrat', sans-serif;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--color-sleep);
    border-color: var(--color-sleep);
}

.flatpickr-day.today {
    border-color: var(--color-sleep);
}

.flatpickr-day.today:hover {
    background: var(--color-sleep);
    color: #fff;
    border-color: var(--color-sleep);
}

.baby-picker-datetime,
.baby-picker-date {
    cursor: pointer;
}

/* Empty state */

.baby-empty {
    text-align: center;
    padding: 60px 20px;
}

.baby-empty .empty-state-icon {
    font-size: 72px;
    color: #ddd;
    margin-bottom: 16px;
}

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

body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.login-container {
    background: var(--color-surface);
    padding: 32px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    width: 100%;
    max-width: 360px;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

/* .form-group, .form-label, .form-input base styles now in .pb-form-group / .pb-label / .pb-input */

.form-label {
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.form-input {
    padding: 10px 12px;
    border-radius: 4px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin-top: 8px;
}

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

.error-message {
    background: #fdf2f2;
    color: var(--color-danger);
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ==================== Briefing ==================== */

/* Mail-client split: folder tree left, content of the selected folder right. */
.briefing-fullscreen {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}
@media (max-width: 900px) {
    .briefing-fullscreen { grid-template-columns: 1fr; padding: 8px; }
}

/* ---------- Filters + folder tree (left pane) ---------- */

.briefing-tree-card {
    padding: 12px;
    position: sticky;
    top: 16px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

/* On a phone the left pane is a drawer: a full list of folders stacked above
   the article would push the reading pane off the first screen entirely. */
.briefing-tree-open {
    display: none;
    background: transparent;
    border: 0;
    padding: 0 4px 0 0;
    color: var(--color-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.briefing-tree-backdrop { display: none; }

@media (max-width: 900px) {
    .briefing-tree-open { display: inline-flex; align-items: center; }
    .briefing-tree-card {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1200;
        width: min(320px, 88vw);
        max-height: none;
        border-radius: 0;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        transform: translateX(-102%);
        transition: transform 0.18s ease;
    }
    body.briefing-tree-open .briefing-tree-card { transform: translateX(0); }
    body.briefing-tree-open .briefing-tree-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1199;
        background: rgba(0, 0, 0, 0.4);
    }
}

.briefing-tree-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}
.briefing-tree-header--folders {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

/* ---------- Page-wide filters ---------- */

.briefing-filters { display: flex; flex-direction: column; gap: 2px; }

.briefing-filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
}
.briefing-filter-toggle:hover { background: var(--color-bg); }
.briefing-filter-toggle > i { font-size: 15px; color: var(--color-text-muted); flex-shrink: 0; }
.briefing-filter-toggle.is-active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-accent, #3b82f6);
    font-weight: 600;
}
.briefing-filter-toggle.is-active > i { color: var(--color-accent, #3b82f6); }

.briefing-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.briefing-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* Chips are tap targets too, just denser than the reader buttons. */
    min-height: 30px;
    padding: 2px 8px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    cursor: pointer;
}
.briefing-filter-chip:hover { border-color: var(--color-text-muted); color: var(--color-text); }
.briefing-filter-chip i { font-size: 13px; }
.briefing-filter-chip.is-active {
    background: var(--color-accent, #3b82f6);
    border-color: var(--color-accent, #3b82f6);
    color: #fff;
    font-weight: 600;
}
.briefing-filter-chip-count {
    font-size: 10px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

.briefing-filter-reset {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: none;
}
.briefing-filter-reset:hover { color: var(--color-text); }
.briefing-tree-header i { font-size: 18px; color: var(--color-text-muted); }

.briefing-tree { display: flex; flex-direction: column; gap: 1px; }

.briefing-tree-row { display: flex; align-items: center; gap: 2px; }

.briefing-tree-heading {
    margin: 12px 0 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-faint);
}

.briefing-tree-node {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    line-height: 1.3;
}
.briefing-tree-node:hover { background: var(--color-bg); }
.briefing-tree-node.is-active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-accent, #3b82f6);
    font-weight: 600;
}
.briefing-tree-node.is-active > i { color: var(--color-accent, #3b82f6); }
.briefing-tree-node.is-disabled { opacity: 0.55; }
.briefing-tree-node.has-unread .briefing-tree-label { font-weight: 600; }
.briefing-tree-node > i { font-size: 15px; color: var(--color-text-muted); flex-shrink: 0; }

.briefing-tree-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.briefing-tree-count {
    font-size: 11px;
    color: var(--color-text-faint);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.briefing-tree-count--unread {
    background: var(--color-accent, #3b82f6);
    color: #fff;
    border-radius: 9px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
    font-weight: 600;
}
.briefing-tree-warn { font-size: 13px; color: #d9534f; flex-shrink: 0; }

.briefing-tree-toggle {
    background: none;
    border: 0;
    padding: 0;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-faint);
    cursor: pointer;
}
.briefing-tree-toggle:hover { color: var(--color-text); }
.briefing-tree-toggle i { font-size: 13px; transition: transform 0.12s ease; }
.briefing-tree-group.is-open .briefing-tree-toggle i { transform: rotate(90deg); }
.briefing-tree-toggle--empty { cursor: default; }

/* Issue list under a newspaper source — collapsed unless the group is open. */
.briefing-tree-children { display: none; flex-direction: column; gap: 1px; }
.briefing-tree-group.is-open .briefing-tree-children { display: flex; }
.briefing-tree-node--child {
    margin-left: 24px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.briefing-tree-empty { color: var(--color-text-muted); font-size: 12px; padding: 8px; }

/* ---------- Content pane (right) ---------- */

.briefing-content-card { padding: 16px; min-width: 0; }
/* Reading pane: the card fills the column, the text inside stops at a
   comfortable measure instead of stretching to ~1000px on a wide screen. */
.briefing-content-inner { max-width: 900px; }
.briefing-feed-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.briefing-feed-countlabel {
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-faint);
    flex-shrink: 0;
}

/* .briefing-weather-card base styles now in .pb-card */

.briefing-weather-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.briefing-weather-header i {
    font-size: 18px;
    color: var(--color-text-muted);
}

.briefing-weather-current {
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 14px;
}

.briefing-weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.briefing-weather-icon {
    width: 64px;
    height: 64px;
}

.briefing-weather-temp {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.briefing-weather-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 2px;
    margin-bottom: 10px;
}

.briefing-weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.briefing-weather-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.briefing-weather-detail i {
    font-size: 14px;
}

.briefing-weather-error {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.briefing-weather-error i {
    font-size: 20px;
    display: block;
    margin-bottom: 6px;
}

/* Hourly forecast */

.briefing-weather-hourly {
    display: flex;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 14px;
}

.briefing-hourly-item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background: var(--color-bg);
    border-radius: 8px;
}

.briefing-hourly-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.briefing-hourly-icon {
    width: 32px;
    height: 32px;
}

.briefing-hourly-temp {
    font-size: 14px;
    font-weight: 600;
}

.briefing-hourly-rain {
    font-size: 10px;
    color: #0984e3;
    margin-top: 2px;
}

.briefing-hourly-rain i {
    font-size: 10px;
}

/* Daily forecast */

.briefing-weather-forecast {
    display: flex;
    gap: 4px;
}

.briefing-forecast-day {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background: var(--color-bg);
    border-radius: 8px;
}

.briefing-forecast-weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.briefing-forecast-date {
    font-size: 10px;
    color: var(--color-text-faint);
    margin-bottom: 2px;
}

.briefing-forecast-icon {
    width: 32px;
    height: 32px;
}

.briefing-forecast-temps {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
}

.briefing-temp-max {
    font-weight: 600;
}

.briefing-temp-min {
    color: var(--color-text-faint);
}

.briefing-forecast-rain {
    font-size: 10px;
    color: #0984e3;
    margin-top: 2px;
}

.briefing-forecast-rain i {
    font-size: 10px;
}

/* ==================== Briefing Calendar ==================== */

.briefing-calendar-card {
    flex: 1;
    min-height: 0;
}

.briefing-calendar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.briefing-calendar-header i {
    font-size: 18px;
    color: var(--color-text-muted);
}

.briefing-calendar-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.briefing-calendar-day {
    padding: 8px 10px;
    border-radius: 6px;
}

.briefing-calendar-day:not(:last-child) {
    border-bottom: 1px solid var(--color-border-light);
}

.briefing-calendar-today {
    background: var(--color-bg);
}

.briefing-calendar-day-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.briefing-calendar-weekday {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.briefing-calendar-date {
    font-size: 12px;
    color: var(--color-text-muted);
}

.briefing-calendar-today-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-surface);
    background: var(--color-primary);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 2px;
}

.briefing-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 2px;
}

.briefing-calendar-event {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.4;
}

.briefing-calendar-allday {
    font-weight: 500;
}

.briefing-calendar-time {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    min-width: 90px;
}

.briefing-calendar-summary {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.briefing-calendar-empty {
    font-size: 12px;
    color: var(--color-text-faint);
    font-style: italic;
}

.briefing-calendar-error {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.briefing-calendar-error i {
    font-size: 20px;
    display: block;
    margin-bottom: 6px;
}

/* ==================== Briefing Feed ==================== */

.briefing-feed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.briefing-feed-header i {
    font-size: 18px;
    color: var(--color-text-muted);
}

/* ---------- Reader: one entry per screen, paged from the bottom bar ---------- */

/* Every entry of the folder is in the DOM; the JS shows exactly one. Without a
   fallback the pane would be blank if the script fails, so the first entry is
   marked current server-side. */
.briefing-entry { display: none; }
.briefing-entry.is-current { display: block; }

.briefing-entry {
    padding: 4px 0 8px;
    /* A read entry stays fully legible — the bar at the bottom carries the
       state, and dimming the text you are reading would be perverse. */
}

/* Newspaper-issue entries keep their amber accent, now as a left edge. */
.briefing-entry--pdf {
    border-left: 3px solid #f59e0b;
    padding-left: 12px;
}

.briefing-entry--pdf .briefing-feed-source {
    color: #b45309;
}

/* Eine Zeile statt zweier: links zurück, in der Mitte der Pfeil nach unten
   (nächster Beitrag), rechts der Gelesen-Schalter. Die drei Spalten sind
   1fr/auto/1fr, damit der Pfeil wirklich mittig sitzt und nicht von der
   Breite der Seitenelemente verschoben wird. */
.briefing-reader-nav {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 12px -16px -16px;
    padding: 5px 10px calc(5px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-radius: 0 0 8px 8px;
}
.briefing-reader-btn { justify-self: start; }
.briefing-reader-read { justify-self: end; }

/* On a phone the pager sits on the bottom edge of the screen, always. Sticky
   alone doesn't do that: it only pins while the card is taller than the
   viewport, so a short entry would leave the bar floating in the middle. */
@media (max-width: 900px) {
    .briefing-reader-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        border-radius: 0;
        /* Under the folder drawer (1200) and its backdrop (1199). */
        z-index: 1100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    }
    /* Reserve the bar's height so the last lines of an entry stay readable. */
    .briefing-content-card {
        padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    }
}

/* Nur Icons, keine Beschriftungen — die Leiste ist bewusst flach gehalten.
   Die Trefferfläche bleibt mit 34px auch auf dem Handy bedienbar, der
   mittlere Pfeil ist als Hauptaktion breiter. */
.briefing-reader-btn,
.briefing-reader-read,
.briefing-reader-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
}
.briefing-reader-btn i,
.briefing-reader-read i { font-size: 17px; }
.briefing-reader-next { width: 56px; }
.briefing-reader-next i { font-size: 20px; }
.briefing-reader-btn:hover:not(:disabled),
.briefing-reader-read:hover:not(:disabled),
.briefing-reader-next:hover:not(:disabled) { border-color: var(--color-text-muted); }
.briefing-reader-btn:disabled,
.briefing-reader-next:disabled { opacity: 0.35; cursor: default; }
.briefing-reader-read:disabled { opacity: 0.5; cursor: wait; }
.briefing-reader-read[aria-pressed="true"] {
    color: #2f6b3c;
    border-color: rgba(76, 152, 90, 0.5);
    background: rgba(76, 152, 90, 0.12);
}

.briefing-feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.briefing-feed-source {
    font-weight: 600;
}

.briefing-feed-issue {
    opacity: 0.75;
}

/* One entry per screen carries the page now, so it reads like an article
   rather than a list row: bigger headline, roomier body copy. */
.briefing-feed-headline {
    font-size: 19px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 4px 0 10px;
}

/* ---------- Leseansicht: der ganze Artikel unter dem Teaser ---------- */

.briefing-article {
    margin: 14px 0 4px;
    max-width: 68ch;
}

.briefing-article-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.briefing-article-toggle:hover { border-color: var(--color-text-muted); }
.briefing-article-toggle i { font-size: 16px; }

/* Der geladene Text bleibt beim Zuklappen im DOM — ein zweiter Klick soll ihn
   nicht erneut von der Datenbank holen müssen. */
.briefing-article-body { display: none; }
.briefing-article.is-open .briefing-article-body { display: block; }

.briefing-article-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.briefing-article-origin {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
    text-decoration: none;
}
.briefing-article-origin:hover { color: var(--color-text); }

/* Etwas größer und luftiger als der Teaser darüber: hier wird wirklich
   gelesen, nicht überflogen. */
.briefing-article-text p {
    font-size: 15.5px;
    line-height: 1.7;
    margin: 0 0 12px;
    color: var(--color-text);
}
.briefing-article-empty {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Vorschaubild aus dem Feed, zwischen Überschrift und Text. Die Höhe ist
   gedeckelt, weil die Quellen alles von 200px-Thumbnail bis 2000px-Aufmacher
   liefern und ein hohes Bild sonst den ganzen Lesebereich füllt. */
.briefing-feed-image {
    display: block;
    width: 100%;
    max-width: 640px;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--color-bg);
    margin: 0 0 12px;
}

/* Body copy is measure-limited: 900px of pane is a comfortable page width but
   an uncomfortable line length — the eye loses the line on the way back. */
.briefing-feed-summary {
    font-size: 15px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
    max-width: 68ch;
}

.briefing-feed-bullets {
    list-style: disc outside;
    margin: 0 0 12px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text-secondary);
    max-width: 68ch;
}

.briefing-feed-bullets li {
    margin-bottom: 2px;
}

/* Always-visible compact AI summary, directly under the headline. Styled as a
   card like the rest of the app (.pb-card), not as an indented quote — it is
   the entry's own content, not something cited from elsewhere. */
.briefing-feed-detail {
    margin: 6px 0 14px;
    padding: 12px 16px;
    border: 1px solid #d7e0f2;
    border-radius: 8px;
    /* A white card on the white reading pane disappears. The faint blue tint
       plus a soft lift is the one accent on an otherwise neutral page — it
       marks this block as the machine-written one at a glance. */
    background: #f7f9ff;
    box-shadow: 0 1px 3px rgba(15, 35, 95, 0.06);
}

.briefing-feed-detail-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e3eaf7;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4a5c7a;
}

.briefing-feed-detail-label i {
    font-size: 13px;
    color: #3b6bd6;
}

.briefing-feed-detail-body {
    font-size: 15px;
    line-height: 1.65;
    color: var(--color-text-primary);
    max-width: 68ch;
}

.briefing-feed-detail-body p {
    margin: 0 0 8px;
}
.briefing-feed-detail-body p:last-child { margin-bottom: 0; }

.briefing-feed-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.briefing-feed-topic {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-bg-muted, #f1f5f9);
    color: var(--color-text-secondary);
}

.briefing-feed-topic i {
    font-size: 13px;
}

/* Marks the tag that the active filter matched — makes it obvious why this
   entry survived the filter. */
.briefing-feed-topic.is-active {
    background: rgba(59, 130, 246, 0.14);
    color: var(--color-accent, #3b82f6);
    font-weight: 600;
}

.briefing-feed-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--color-accent, #3b82f6);
    text-decoration: none;
}

.briefing-feed-link:hover {
    text-decoration: underline;
}

.briefing-feed-empty {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.briefing-feed-empty i {
    font-size: 20px;
    display: block;
    margin-bottom: 6px;
}

/* ==================== Mobile ==================== */

@media (max-width: 768px) {
}

@media (max-width: 640px) {
    .baby-container {
        padding: 12px;
    }

    .baby-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .briefing-weather-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .baby-nav {
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }

    .baby-nav-link {
        padding: 12px 10px;
        gap: 0;
        font-size: 0;
    }

    .baby-nav-link i {
        font-size: 22px;
    }
}

/* ---------------------------------------------------------------------------
   Transit connections (/briefing/verbindungen/) — linear route diagrams.
   The horizontal line + node technique mirrors the vertical .briefing-feed
   timeline, rotated 90°.
   --------------------------------------------------------------------------- */
.briefing-fullscreen--single {
    grid-template-columns: 1fr;
}

/* Direction filter chips above the Verbindungen list (per-device, localStorage). */
.route-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
}
.route-filter-btn {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, background .15s, border-color .15s;
}
.route-filter-btn:hover { color: var(--color-text); border-color: var(--color-text-muted); }
.route-filter-btn.active {
    background: var(--color-accent, #3b82f6);
    border-color: var(--color-accent, #3b82f6);
    color: #fff;
}
.route-filter-btn:focus-visible {
    outline: 2px solid var(--color-accent, #3b82f6);
    outline-offset: 2px;
}
.route-geo-hint {
    align-self: center;
    margin-left: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.route-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 4px;
    color: var(--color-text-muted);
    font-size: 13px;
}
.route-notice--error { color: #c94f3c; }
.route-notice code {
    background: var(--color-bg);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

.route-directions {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.route-direction-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}
.route-direction-title i { color: var(--color-text-muted); }

.route-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route-slot {
    display: flex;
    align-items: center;
    gap: 12px;
}

.route-slot-label {
    flex: 0 0 66px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: right;
}

/* Scroll container for a single connection's stop sequence.
   overflow-y is pinned to hidden (not left implicit — a lone overflow-x:auto
   promotes overflow-y to auto per spec, which makes the diagram swallow vertical
   touch gestures so the page can't be scrolled). touch-action: pan-x keeps
   horizontal panning here while vertical drags scroll the page. */
.route {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    background: var(--color-bg, #f7f7f8);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 14px;
}
.route--cancelled { opacity: 0.55; }

.route-line-wrap {
    display: flex;
    align-items: flex-start;
    min-width: max-content;
    gap: 0;
}

.route-badge {
    align-self: center;
    flex: 0 0 auto;
    margin-right: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--color-accent, #3b82f6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.route-stop {
    flex: 1 1 0;
    min-width: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.route-name {
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

/* Fixed-height row that carries the dot; the connecting segment is drawn on it
   so it always lines up with the dot centre regardless of label height. */
.route-track {
    position: relative;
    height: 14px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent, #3b82f6);
    border: 2px solid var(--color-surface, #fff);
    box-shadow: 0 0 0 2px var(--color-border, #e2e8f0);
    z-index: 1;
}
.route-dot--cancelled { background: #c94f3c; box-shadow: 0 0 0 2px #e7a49a; }
/* Lücken-Marker für gekürzte Haltestellenlisten (nur erste/letzte N). */
.route-dot--gap {
    background: transparent;
    border-style: dashed;
    border-color: var(--color-text-muted, #94a3b8);
    box-shadow: none;
}
.route-stop--gap .route-name { color: var(--color-text-muted, #94a3b8); letter-spacing: 2px; }
.route-stop--gap .route-time { color: var(--color-text-muted, #94a3b8); font-weight: 500; }

/* Segment from this stop's dot centre to the next stop's dot centre. */
.route-stop:not(:last-child) .route-track::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    right: -50%;
    height: 2px;
    transform: translateY(-50%);
    background: var(--color-border, #e2e8f0);
    z-index: 0;
}

.route-time {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}
.route-time--delayed { color: #c94f3c; }
.route-delay {
    margin-left: 3px;
    font-size: 10px;
    font-weight: 700;
}

.route-none {
    flex: 1 1 auto;
    font-size: 12px;
    font-style: italic;
    color: var(--color-text-muted);
    padding: 8px 4px;
}

.route-updated {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
    margin-top: 16px;
    font-size: 11px;
    color: var(--color-text-muted);
}
