﻿/* Extracted from to_do.html inline <style> blocks */

/* === Block 1 === */
@supports (-webkit-touch-callout: none) {
        input,
        select,
        textarea {
            font-size: 16px !important;
        }
    }

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Center table and all content */
    #table { max-width: min(900px, 100%); margin: 0 auto; width: 100%; overflow-x: clip; }
    #table td,
    #table th {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-width: 100% !important;
    }

    .swipe-row.notification-row-highlight {
        background: rgba(255, 89, 30, 0.16) !important;
        box-shadow: inset 0 0 0 2px rgba(255, 89, 30, 0.36);
    }

    .swipe-row.notification-row-highlight .swipe-element {
        background: transparent !important;
    }

    .swipe-row.notification-row-focus {
        animation: notificationRowPulse 1.8s ease-out 2;
    }

    @keyframes notificationRowPulse {
        0% { box-shadow: inset 0 0 0 2px rgba(255, 89, 30, 0.9); }
        100% { box-shadow: inset 0 0 0 2px rgba(255, 89, 30, 0.18); }
    }
  
  /* ToDo Suchergebnisse */
  #todo-search-results {
    max-height: 200px;
    overflow-y: auto;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    margin-top: 4px;
  }
  #todo-search-results .search-result-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    border-bottom: 1px solid #333;
  }
  #todo-search-results .search-result-item:hover {
    background: #2a2a2a;
  }
  #todo-search-results .search-result-item:last-child {
    border-bottom: none;
  }

    .todo-shortage-modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.68);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 12080;
        padding: 16px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 16px);
        box-sizing: border-box;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .todo-shortage-modal {
        width: min(760px, 100%);
        max-height: calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 32px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #1a1a1a;
        border: 1px solid #111;
        border-radius: 14px;
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
        color: #f4efe7;
        margin: auto 0;
    }

    @supports (height: 100dvh) {
        .todo-shortage-modal {
            max-height: calc(100dvh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 32px);
        }
    }

    .todo-shortage-modal-head {
        padding: 18px 20px 12px;
        border-bottom: 1px solid #111;
        background: linear-gradient(180deg, rgba(181, 111, 0, 0.18), rgba(26, 26, 26, 0.98));
    }

    .todo-shortage-modal-title {
        margin: 0;
        font-size: 22px;
        line-height: 1.2;
        color: #ffd089;
    }

    .todo-shortage-modal-subtitle {
        margin: 8px 0 0;
        color: #e9dcc7;
        font-size: 14px;
        line-height: 1.45;
    }

    .todo-shortage-modal-body {
        padding: 16px 20px 20px;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .todo-shortage-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .todo-shortage-item {
        background: #090909;
        border: 1px solid #111;
        border-radius: 12px;
        padding: 14px 14px 12px;
    }

    .todo-shortage-item-head {
        display: flex;
        gap: 10px;
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    .todo-shortage-item-meta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .todo-shortage-item-name {
        font-size: 16px;
        font-weight: 700;
        color: #fff3dd;
        line-height: 1.3;
    }

    .todo-shortage-item-link {
        color: inherit;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 208, 137, 0.34);
    }

    .todo-shortage-item-link:hover {
        color: #ffd089;
        border-bottom-color: rgba(255, 208, 137, 0.72);
    }

    .todo-shortage-add-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: 1px solid rgba(76, 175, 80, 0.42);
        border-radius: 999px;
        padding: 5px 10px;
        background: rgba(76, 175, 80, 0.12);
        color: #b9f1bb;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

    .todo-shortage-add-button:hover {
        background: rgba(76, 175, 80, 0.2);
        border-color: rgba(76, 175, 80, 0.58);
        color: #dcffdd;
    }

    .todo-shortage-item-status {
        flex-shrink: 0;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #ffb86b;
        background: rgba(181, 111, 0, 0.16);
        border: 1px solid #111;
        border-radius: 999px;
        padding: 5px 9px;
    }

    .todo-shortage-item-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .todo-shortage-item-planned {
        margin: 2px 0 8px;
        font-size: 12px;
        font-weight: 700;
        color: #7ee0a0;
        background: rgba(46, 160, 87, 0.14);
        border: 1px solid #111;
        border-radius: 8px;
        padding: 5px 9px;
    }

    .todo-shortage-stat {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid #111;
        border-radius: 10px;
        padding: 10px 11px;
    }

    .todo-shortage-stat-label {
        display: block;
        font-size: 11px;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: #b8afa2;
        margin-bottom: 5px;
    }

    .todo-shortage-stat-value {
        display: block;
        font-size: 15px;
        font-weight: 700;
        color: #f5f0e8;
    }

    .todo-shortage-modal-actions {
        margin-top: 16px;
        display: flex;
        justify-content: flex-end;
    }

    @media (max-width: 640px) {
        .todo-shortage-item-head {
            flex-direction: column;
        }

        .todo-shortage-item-meta {
            width: 100%;
            justify-content: flex-start;
        }

        .todo-shortage-item-grid {
            grid-template-columns: 1fr;
        }
    }
  
  /* Custom tooltip for ingredient usage */
  .ingredient-tooltip-wrapper {
    position: relative;
    display: inline-block;
  }
  
  .ingredient-tooltip-content {
    visibility: hidden;
    position: absolute;
    z-index: 1000;
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 0;
    width: min(350px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: pre-line;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
  }
  
  .ingredient-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 15px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
  }
  
  .ingredient-tooltip-wrapper:hover .ingredient-tooltip-content {
    visibility: visible;
    opacity: 1;
  }

    .todo-diet-badges {
        display: inline-flex;
        gap: 6px;
        margin-top: 0;
        flex-wrap: nowrap;
        white-space: nowrap;
        max-width: 100%;
    }

    .todo-name-row {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        max-width: 100%;
        min-width: 0;
    }

    .todo-name-row strong.centered {
        margin: 0;
        line-height: 1.2;
        display: block;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .todo-name-title {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        max-width: 100%;
        min-width: 0;
    }

    .todo-portion-badge-open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 0;
        height: 30px;
        background-color: #4CAF50;
        color: #222;
        padding: 0 8px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 700;
        border: none;
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .diet-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 20px;
        padding: 0 6px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.24);
        background: rgba(0, 0, 0, 0.42);
        color: #f5f7fa;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
    }

    .diet-vegan { color: #76e593; border-color: rgba(118, 229, 147, 0.6); }
    .diet-glutenfrei { color: #ffd56a; border-color: rgba(255, 213, 106, 0.6); }
    .diet-laktosefrei { color: #9fd7ff; border-color: rgba(159, 215, 255, 0.6); }
        .diet-alkohol { color: #ffb36a; border-color: rgba(255, 179, 106, 0.6); }
  
  .tooltip-item-ok {
    color: #4CAF50;
  }
  
  .tooltip-item-fail {
    color: #ff6666;
  }

    .todo-top-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin: 10px auto 14px;
        max-width: 900px;
    }

    .todo-top-actions .ke-btn {
        min-width: 170px;
    }

    .wer-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    .done-week-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #5f6a73;
        border-radius: 8px !important;
        padding: 6px 10px !important;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.25;
        color: #cdd7e0;
        text-decoration: none;
        background: rgba(120, 130, 140, 0.14);
        white-space: normal !important;
        text-align: center;
        width: auto !important;
        min-width: 0 !important;
        max-width: min(100%, 360px) !important;
    }

    .done-week-toggle:hover {
        background: rgba(120, 130, 140, 0.24);
        color: #e4ebf2;
    }

    .week-overview-overlay {
        position: fixed;
        top: var(--ke-content-safe-top, var(--top-nav-height, 64px));
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.72);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 12500;
        padding: 12px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 12px);
        box-sizing: border-box;
    }

    .week-overview-panel {
        width: min(920px, 100%);
        max-height: calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #000;
        border: 1px solid #1f9f44;
        border-radius: 12px;
        padding: 14px;
        box-sizing: border-box;
    }

    .week-overview-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 10px;
    }

    .week-overview-tools {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .week-overview-search {
        flex: 1 1 280px;
        min-width: 220px;
        background: #050505;
        border: 1px solid #2c3f52;
        border-radius: 8px;
        color: #e7edf4;
        padding: 8px 10px;
    }

    .week-overview-filter {
        background: #08101a;
        border: 1px solid #2c3f52;
        color: #dbe5ef;
        border-radius: 8px;
        padding: 8px 10px;
    }

    .week-overview-month {
        border: 1px solid #1f2b1f;
        border-radius: 10px;
        background: #050505;
        padding: 10px;
    }

    .week-overview-month-title {
        color: #4CAF50;
        font-weight: 700;
        font-size: 14px;
        margin-bottom: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .week-overview-week-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 7px 8px;
        border: 1px solid #1f2f42;
        border-radius: 8px;
        text-decoration: none;
        color: #d5dce3;
        margin-bottom: 6px;
        background: #070b10;
        font-size: 13px;
    }

    .week-overview-week-link:hover {
        background: #0e1620;
    }

    .week-overview-week-link.is-selected {
        border-color: #4CAF50;
        box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.35) inset;
    }

    .week-overview-week-link.is-current {
        border-color: #f9a825;
    }

    .week-overview-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 22px;
        height: 22px;
        border-radius: 999px;
        background: #1f9f44;
        color: #fff;
        font-weight: 700;
        font-size: 12px;
        padding: 0 7px;
    }

    .week-overview-count.is-done {
        background: #6f7780;
        color: #f2f5f8;
    }

    #ingredients-total-modal-backdrop {
        padding: 12px;
        box-sizing: border-box;
        align-items: center;
    }

    #ingredients-total-modal-backdrop .email-modal-content {
        width: calc(100vw - 24px) !important;
        max-width: 920px !important;
        max-height: 88vh !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        margin: 0;
    }

    #ingredients-total-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    @media (max-width: 640px) {
        #ingredients-total-modal-backdrop .email-modal-content {
            padding: 14px;
        }
    }

    .wer-header-row .done-week-toggle {
        flex: 0 1 auto;
    }

    .done-row .swipe-element {
        opacity: 0.72;
        filter: grayscale(0.55);
        border-left: 3px solid #7f8791;
    }

    .done-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 8px;
        padding: 2px 7px;
        border-radius: 999px;
        border: 1px solid #8e959d;
        background: rgba(130, 138, 146, 0.18);
        color: #c8ced5;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .todo-routine-backdrop {
        position: fixed;
        top: var(--ke-content-safe-top, var(--top-nav-height, 64px));
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.76);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 18px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 18px);
        z-index: 3400;
    }

    .todo-routine-backdrop.open {
        display: flex;
    }

    .todo-routine-modal {
        width: min(680px, 100%);
        max-height: min(calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 36px), 900px);
        overflow-y: auto;
        background: #000;
        border: 1px solid #111;
        border-radius: 18px;
        box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52);
        color: #f5f7fa;
        padding: 18px;
    }

    .todo-routine-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
    }

    .todo-routine-title {
        margin: 0;
        font-size: 24px;
        line-height: 1.1;
    }

    .todo-routine-copy {
        color: #d7dde5;
        font-size: 14px;
        line-height: 1.5;
        margin: 0;
    }

    .todo-routine-items,
    .todo-routine-settings-list {
        display: grid;
        gap: 10px;
        margin-top: 14px;
    }

    .todo-routine-item {
        display: grid;
        grid-template-columns: 28px 1fr;
        gap: 12px;
        align-items: flex-start;
        padding: 12px;
        border: 1px solid #111;
        border-radius: 12px;
        background: #000;
        cursor: pointer;
        transition: border-color 0.15s;
    }

    .todo-routine-item.is-important {
        border-color: #cc2222;
        background: #000;
    }

    .todo-routine-item.is-checked {
        border-color: #1a6e3a !important;
        opacity: 0.65;
    }

    .todo-routine-item.is-checked strong,
    .todo-routine-item.is-checked .todo-routine-item-detail {
        text-decoration: line-through;
        color: #666;
    }

    /* custom checkbox */
    .todo-routine-item input[type="checkbox"] {
        display: none;
    }

    .todo-routine-item-check-box {
        width: 22px;
        height: 22px;
        border-radius: 6px;
        border: 2px solid #333;
        background: #000;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: border-color 0.15s, background 0.15s;
        margin-top: 1px;
    }

    .todo-routine-item.is-checked .todo-routine-item-check-box {
        border-color: #1a6e3a;
        background: #1a6e3a;
    }

    .todo-routine-item.is-important .todo-routine-item-check-box {
        border-color: #cc2222;
    }

    .todo-routine-item.is-important.is-checked .todo-routine-item-check-box {
        border-color: #1a6e3a;
        background: #1a6e3a;
    }

    .todo-routine-item-check-box::after {
        content: '';
        display: none;
        width: 5px;
        height: 10px;
        border: 2px solid #fff;
        border-top: none;
        border-left: none;
        transform: rotate(45deg) translateY(-1px);
    }

    .todo-routine-item.is-checked .todo-routine-item-check-box::after {
        display: block;
    }

    .todo-routine-item strong {
        display: block;
        margin-bottom: 4px;
    }

    .todo-routine-item-detail {
        color: #a8b0ba;
        font-size: 13px;
        line-height: 1.45;
    }

    .todo-routine-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 18px;
        flex-wrap: wrap;
    }

    .todo-routine-summary {
        margin-top: 14px;
        padding: 12px;
        border-radius: 12px;
        border: 1px solid #111;
        background: #000;
    }

    .todo-routine-summary ul {
        margin: 8px 0 0;
        padding-left: 18px;
    }

    .todo-routine-settings-grid {
        display: grid;
        gap: 14px;
    }

    .todo-routine-settings-card {
        padding: 14px;
        border-radius: 14px;
        border: 1px solid #111;
        background: #000;
    }

    .todo-routine-settings-card h3 {
        margin: 0 0 10px;
        font-size: 18px;
    }

    .todo-routine-settings-field {
        display: grid;
        gap: 6px;
        margin-bottom: 10px;
    }

    .todo-routine-settings-field label {
        font-size: 12px;
        color: #bcc5ce;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .todo-routine-settings-field input,
    .todo-routine-settings-field textarea {
        width: 100%;
        border-radius: 10px;
        border: 1px solid #111;
        background: #000;
        color: #f5f7fa;
        padding: 10px 12px;
        box-sizing: border-box;
    }

    .todo-routine-settings-item-row {
        padding: 10px;
        border: 1px solid #111;
        border-radius: 12px;
        background: #000;
        margin-bottom: 10px;
    }

    .todo-routine-settings-item-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
    }

    .todo-routine-settings-item-order {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .todo-routine-settings-note {
        margin-top: 10px;
        color: #97a2ad;
        font-size: 12px;
    }

    /* ===== Light Mode Overrides ===== */
    [data-theme="light"] #todo-search-results {
        background: var(--ke-surface) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] #todo-search-results .search-result-item {
        border-bottom-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] #todo-search-results .search-result-item:hover {
        background: var(--ke-surface-2) !important;
    }
    [data-theme="light"] .todo-shortage-modal {
        background: var(--ke-surface) !important;
        border-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .todo-shortage-modal-head {
        background: linear-gradient(180deg, rgba(181, 111, 0, 0.10), rgba(245, 245, 245, 0.98)) !important;
        border-bottom-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-shortage-modal-title {
        color: var(--ke-warning) !important;
    }
    [data-theme="light"] .todo-shortage-modal-subtitle {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-shortage-item {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-shortage-item-name {
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .todo-shortage-item-link {
        border-bottom-color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-shortage-add-button {
        background: rgba(76, 175, 80, 0.15) !important;
        border-color: rgba(76, 175, 80, 0.5) !important;
        color: #16a34a !important;
    }
    [data-theme="light"] .todo-shortage-item-status {
        background: rgba(181, 111, 0, 0.12) !important;
        border-color: var(--ke-border) !important;
        color: #d97706 !important;
    }
    [data-theme="light"] .todo-shortage-item-planned {
        background: rgba(46, 160, 87, 0.12) !important;
        border-color: var(--ke-border) !important;
        color: #16a34a !important;
    }
    [data-theme="light"] .todo-shortage-stat {
        background: rgba(0, 0, 0, 0.04) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-shortage-stat-label {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-shortage-stat-value {
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .ingredient-tooltip-content {
        background-color: var(--ke-surface) !important;
        color: var(--ke-text) !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.15) !important;
    }
    [data-theme="light"] .ingredient-tooltip-content::after {
        border-color: var(--ke-surface) transparent transparent transparent !important;
    }
    [data-theme="light"] .todo-diet-badges {
        gap: 4px;
    }
    [data-theme="light"] .diet-badge {
        background: rgba(0, 0, 0, 0.08) !important;
        border-color: rgba(0, 0, 0, 0.15) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .diet-vegan { color: #16a34a !important; border-color: rgba(22, 163, 74, 0.4) !important; }
    [data-theme="light"] .diet-glutenfrei { color: #d97706 !important; border-color: rgba(217, 119, 6, 0.4) !important; }
    [data-theme="light"] .diet-laktosefrei { color: #2563eb !important; border-color: rgba(37, 99, 235, 0.4) !important; }
    [data-theme="light"] .diet-alkohol { color: #ea580c !important; border-color: rgba(234, 88, 12, 0.4) !important; }
    [data-theme="light"] .done-week-toggle {
        border-color: var(--ke-border) !important;
        color: var(--ke-text-muted) !important;
        background: rgba(0, 0, 0, 0.06) !important;
    }
    [data-theme="light"] .done-week-toggle:hover {
        background: rgba(0, 0, 0, 0.10) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .week-overview-panel {
        background: var(--ke-surface) !important;
        border-color: var(--ke-success) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .week-overview-search {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .week-overview-filter {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .week-overview-month {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .week-overview-week-link {
        background: var(--ke-surface) !important;
        border-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .week-overview-week-link:hover {
        background: var(--ke-surface-2) !important;
    }
    [data-theme="light"] .week-overview-count {
        background: var(--ke-success) !important;
        color: #fff !important;
    }
    [data-theme="light"] .week-overview-count.is-done {
        background: var(--ke-text-muted) !important;
        color: #fff !important;
    }
    [data-theme="light"] .todo-routine-backdrop {
        background: rgba(0, 0, 0, 0.5) !important;
    }
    [data-theme="light"] .todo-routine-modal {
        background: var(--ke-surface) !important;
        border-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .todo-routine-copy {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-routine-item {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-routine-item.is-important {
        border-color: #dc2626 !important;
        background: var(--ke-surface-2) !important;
    }
    [data-theme="light"] .todo-routine-item.is-checked strong,
    [data-theme="light"] .todo-routine-item.is-checked .todo-routine-item-detail {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-routine-item-check-box {
        border-color: var(--ke-border) !important;
        background: var(--ke-surface) !important;
    }
    [data-theme="light"] .todo-routine-item.is-checked .todo-routine-item-check-box {
        border-color: var(--ke-success) !important;
        background: var(--ke-success) !important;
    }
    [data-theme="light"] .todo-routine-item.is-important .todo-routine-item-check-box {
        border-color: #dc2626 !important;
    }
    [data-theme="light"] .todo-routine-item-detail {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-routine-summary {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-routine-settings-card {
        background: var(--ke-surface-2) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-routine-settings-field label {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .todo-routine-settings-field input,
    [data-theme="light"] .todo-routine-settings-field textarea {
        background: var(--ke-surface) !important;
        border-color: var(--ke-border) !important;
        color: var(--ke-text) !important;
    }
    [data-theme="light"] .todo-routine-settings-item-row {
        background: var(--ke-surface) !important;
        border-color: var(--ke-border) !important;
    }
    [data-theme="light"] .todo-routine-settings-note {
        color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .done-row .swipe-element {
        filter: grayscale(0.2) !important;
        border-left-color: var(--ke-text-muted) !important;
    }
    [data-theme="light"] .done-badge {
        border-color: var(--ke-border) !important;
        background: rgba(0, 0, 0, 0.06) !important;
        color: var(--ke-text-muted) !important;
    }

/* === Block 2 === */
/* Coverage indicator styling */
    .todo-coverage { margin-left: 8px; display:inline-flex; align-items:center; font-size: 12px; padding: 2px 6px; border-radius: 4px; width: fit-content; }
    .todo-coverage.coverage-complete { background: #27ae60; color: #fff; font-weight: bold; padding: 1px 3px; font-size: 11px; width: auto; max-width: fit-content; }
    .todo-coverage.coverage-missing { background: #e67e22; color: #fff; padding: 1px 4px; font-size: 11px; max-width: fit-content; }
    .todo-coverage .info-icon { display:inline-flex; width:16px; height:16px; border-radius:50%; background:var(--ke-surface-2); color:var(--ke-text-muted); align-items:center; justify-content:center; font-size:12px; line-height:16px; cursor:default; }
    .todo-coverage .percent { font-weight:600; }
    .todo-coverage .percent.p0 { color:#e74c3c; }      /* 0-19% rot */
    .todo-coverage .percent.p20 { color:#e67e22; }     /* 20-39% orange */
    .todo-coverage .percent.p40 { color:#f1c40f; }     /* 40-59% gelb */
    .todo-coverage .percent.p60 { color:#2ecc71; }     /* 60-79% grün */
    .todo-coverage .percent.p80 { color:#27ae60; }     /* 80-99% dunkelgrün */
    .todo-coverage .percent.p100 { color:#2ecc71; }    /* 100% grün */
    .todo-coverage[title] { position: relative; }
    .todo-coverage:hover::after { content: attr(title); position:absolute; top: 125%; left:0; white-space:nowrap; background:var(--ke-surface-2); color:var(--ke-text); border:1px solid var(--ke-border); padding:6px 8px; border-radius:4px; z-index:10; }

    /* Stil für den "Neu erstellen" Button */
    .create-new {
        background-color: #4CAF50;
        color: white;
        padding: 10px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        width: 100%;
        margin-top: 5px;
    }

    .create-new:hover {
        background-color: #45a049;
    }

    /* Bemerkung im Row komprimiert anzeigen */
    .remark {
        color: #ddd;
        font-size: 14px;
        margin-top: 3px;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        line-clamp: 2; /* standard */
        -webkit-line-clamp: 2; /* max 2 Zeilen */
        -webkit-box-orient: vertical;
        max-width: 50ch;
        cursor: pointer;
    }

    .remark-view-backdrop {
        position: fixed;
        top: var(--ke-content-safe-top, var(--top-nav-height, 64px));
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0,0,0,0.7);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 2500;
        padding: 12px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 12px);
        box-sizing: border-box;
    }

    .remark-view-modal {
        background: #000;
        border: 2px solid #4CAF50;
        border-radius: 10px;
        width: 90%;
        max-width: 700px;
        max-height: calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px);
        padding: 16px;
        color: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
        overflow-y: auto;
    }

    .remark-view-modal h3 {
        margin: 0 0 8px 0;
        font-size: 18px;
        text-align: center;
        color: #4CAF50;
    }

    .remark-view-text {
        font-size: 14px;
        color: #eee;
        margin-top: 6px;
    }

    .done-remark-backdrop {
        position: fixed;
        top: var(--ke-content-safe-top, var(--top-nav-height, 64px));
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0,0,0,0.7);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 2400;
        padding: 12px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 12px);
        box-sizing: border-box;
    }

    .done-remark-modal {
        background: #000;
        border: 2px solid #4CAF50;
        border-radius: 10px;
        width: 90%;
        max-width: 600px;
        max-height: calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px);
        padding: 16px;
        color: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
        overflow-y: auto;
    }

    .done-remark-modal h3 {
        margin: 0 0 8px 0;
        font-size: 18px;
        text-align: center;
        color: #4CAF50;
    }

    .done-remark-modal textarea {
        width: 100%;
        min-height: 90px;
        border: 1px solid #444;
        background: #000;
        color: #fff;
        border-radius: 8px;
        padding: 8px;
        box-sizing: border-box;
    }
    /* Modal for optional Bemerkung when creating/adding ToDo */
    .remark-modal-backdrop { position: fixed; top: var(--ke-content-safe-top, var(--top-nav-height, 64px)); right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 12px; padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 12px); box-sizing: border-box; }
    .remark-modal { background: #000; border-radius: 10px; width: 90%; max-width: 900px; padding: 16px; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.8); border: 2px solid #4CAF50; max-height: calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px); overflow-y: auto; }
    .remark-modal h3 { margin: 0 0 8px 0; font-size: 18px; text-align: center; }
    .remark-modal .hint { font-size: 13px; color: #ccc; margin-bottom: 8px; text-align: center; }
    .remark-modal textarea { width: 100%; min-height: 90px; border: 1px solid #444; background: #000; color: #fff; border-radius: 8px; padding: 8px; box-sizing: border-box; }
    .remark-modal .actions { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
    
    /* Date picker modal */
    .date-picker-modal-backdrop { 
        position: fixed; 
        top: var(--ke-content-safe-top, var(--top-nav-height, 64px));
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0,0,0,0.7); 
        display: none; 
        align-items: center; 
        justify-content: center; 
        z-index: 12000; 
        padding: 12px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 12px);
        box-sizing: border-box;
    }
    .date-picker-modal-backdrop[style*="display: flex"] { 
        display: flex !important;
    }
    .date-picker-modal { 
        background: #000; 
        border: 2px solid #4CAF50;
        border-radius: 12px; 
        width: min(92vw, 760px);
        max-width: 760px;
        max-height: calc(100vh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px);
        padding: 24px; 
        color: #fff; 
        box-shadow: 0 10px 40px rgba(0,0,0,0.8); 
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    @supports (height: 100dvh) {
        .remark-modal {
            max-height: calc(100dvh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px);
        }
        .date-picker-modal {
            max-height: calc(100dvh - var(--ke-content-safe-top, var(--top-nav-height, 64px)) - var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) - 24px);
        }
    }
    .weekday-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1 1 auto;
        min-height: 0;
        max-height: 500px;
        overflow-y: auto;
        padding: 10px 8px 4px;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .week-row {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 6px;
    }
    .weekday-btn {
        position: relative;
        background: #333;
        border: 2px solid #555;
        border-radius: 8px;
        padding: 10px 6px;
        color: #fff;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
        font-size: 12px;
        min-height: 70px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .weekday-btn:hover {
        background: #444;
        border-color: #64b5f6;
        transform: scale(1.05);
    }
    .weekday-btn.today {
        background: rgba(255, 152, 0, 0.2);
        border-color: #ff9800;
        font-weight: bold;
    }
    .weekday-btn.weekend {
        background: rgba(100, 100, 100, 0.15);
        border-color: #666;
        opacity: 0.8;
    }
    .weekday-btn.weekend:hover {
        opacity: 1;
    }
    .weekday-btn.weekday-name {
        font-size: 11px;
        font-weight: bold;
        color: #4CAF50;
    }
    .weekday-btn.weekday-date {
        font-size: 16px;
    }
    .todo-count-badge {
        position: absolute;
        top: -7px;
        right: -7px;
        background: #4CAF50;
        color: white;
        font-size: 10px;
        line-height: 1;
        font-weight: bold;
        padding: 3px 5px;
        border-radius: 10px;
        min-width: 16px;
        height: 16px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #1b1b1b;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        z-index: 3;
    }
    @media (max-width: 640px) {
        .date-picker-modal {
            width: min(92vw, 420px);
            padding: 18px;
        }

        .week-row {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        .weekday-btn {
            min-height: 88px;
        }
    }
    .remark-modal .actions button,
    .done-remark-modal .actions button,
    .remark-view-modal .actions button {
        flex: 1;
        padding: 10px 16px;
        border: 1px solid var(--ke-warning, #ff9800);
        border-radius: 8px;
        background: rgba(255, 152, 0, 0.15);
        color: #ffd8a8;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .remark-modal .actions button:hover,
    .done-remark-modal .actions button:hover,
    .remark-view-modal .actions button:hover {
        background: rgba(255, 152, 0, 0.25);
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
    }
    .remark-modal .actions .ok,
    .done-remark-modal .actions .ok,
    .remark-view-modal .actions .ok {
        background: rgba(76, 175, 80, 0.25);
        border-color: #4CAF50;
        color: #a5d6a7;
    }
    .remark-modal .actions .ok:hover,
    .done-remark-modal .actions .ok:hover,
    .remark-view-modal .actions .ok:hover {
        background: rgba(76, 175, 80, 0.35);
        box-shadow: 0 2px 4px rgba(76, 175, 80, 0.4);
    }

/* === Block 3 === */
/* Tooltip styling for bestand details */
    .tooltip-container {
        position: relative;
        cursor: help;
        display: inline-block;
    }
    
    .tooltip-box {
        display: none;
        background-color: #000;
        color: #fff;
        text-align: left;
        border: 2px solid #27ae60;
        border-radius: 6px;
        padding: 12px;
        position: fixed;
        z-index: 99999;
        width: 320px;
        max-width: 90vw;
        box-shadow: 0 8px 24px 0 rgba(0,0,0,0.9);
        font-size: 0.85em;
        font-weight: normal;
        white-space: normal;
        line-height: 1.5;
        pointer-events: none;
    }

    .tooltip-box.tooltip-box-floating {
        z-index: 2147483647;
        max-height: min(70vh, 560px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        pointer-events: auto;
    }
    
    .tooltip-box::after {
        display: none;
    }
    
    .tooltip-box div {
        padding: 6px 0;
        border-bottom: 1px solid #444;
    }
    
    .tooltip-box div:last-child {
        border-bottom: none;
    }
    
    /* Inline actions row uses KE buttons for consistency */
    .todo-actions { display:flex; flex-direction:column; gap:6px; align-items:center; }
    .todo-inline-actions { 
        position: absolute; 
        right: 10px; 
        top: 50%; 
        transform: translateY(-50%); 
        display: flex; 
        gap: 8px; 
        align-items: center; 
        flex-wrap: nowrap; 
        max-width: calc(100% - 8px);
    }
    .todo-main-actions {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        flex-wrap: nowrap;
    }

    .todo-main-actions-top {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .todo-main-actions-top .todo-calendar-btn,
    .todo-main-actions .bestand-button {
        min-width: 102px;
        justify-content: center;
    }

    .todo-main-actions .bestand-button {
        align-self: center;
        padding: 8px 14px !important;
        min-width: 96px;
        flex: 0 0 auto;
    }
    .item-info { position: relative; padding-right: 150px; }
    .mache-ich-button.assigned { filter: brightness(0.92); }
    .bestand-button { touch-action: pan-y; }
    /* Priority triangle button (bigger, with exclamation) */
    .todo-prio-btn {
        position: relative;
        width: 0;
        height: 0;
        border-left: 14px solid transparent;
        border-right: 14px solid transparent;
        border-bottom: 22px solid #9e9e9e;
        background: transparent;
        padding: 0;
        margin-right: 10px;
        cursor: pointer;
        display: inline-block;
        vertical-align: middle;
        /* allow vertical scrolling gestures over the button */
        touch-action: pan-y;
    }
    .todo-prio-btn.prio-0 { border-bottom-color: #9e9e9e; opacity: 0.8; }
    .todo-prio-btn.prio-1 { border-bottom-color: #2e7d32; }
    .todo-prio-btn.prio-2 { border-bottom-color: #ff9800; }
    .todo-prio-btn.prio-3 { border-bottom-color: #e53935; }
    .todo-prio-btn:focus { outline: none; }
    .todo-prio-btn::after {
        content: '!';
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: -18px; /* centers inside 22px triangle */
        font-size: 13px;
        line-height: 1;
        font-weight: 800;
        color: #111;
        text-shadow: 0 0 2px rgba(255,255,255,0.3);
        pointer-events: none;
    }
    .todo-prio-btn.prio-1::after,
    .todo-prio-btn.prio-2::after,
    .todo-prio-btn.prio-3::after { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
    
    /* Calendar button */
    .todo-calendar-btn {
        position: relative;
        background: transparent;
        border: 2px solid #64b5f6;
        border-radius: 6px;
        padding: 4px 8px;
        font-size: 18px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        touch-action: pan-y;
        transition: all 0.2s;
    }
    .todo-calendar-btn:hover {
        background: rgba(100, 181, 246, 0.1);
        transform: scale(1.05);
    }

    @media (max-width: 540px) {
        .todo-top-actions .ke-btn {
            min-width: 0;
            width: 100%;
            font-size: 14px !important;
            padding: 8px 10px !important;
            border-radius: 8px !important;
        }

        .wer-header-row {
            align-items: flex-start;
        }

        .done-week-toggle {
            width: 100%;
            max-width: 100%;
            justify-content: flex-start;
            text-align: left;
        }

        .item-info {
            padding-right: 0;
            overflow: visible;
        }

        .todo-inline-actions {
            position: static;
            transform: none;
            margin-top: 8px;
            justify-content: flex-start;
            flex-wrap: wrap;
            max-width: 100%;
            gap: 6px;
        }

        .todo-main-actions {
            width: auto;
            max-width: 100%;
            flex-wrap: nowrap;
        }

        .todo-main-actions-top {
            width: auto;
            flex: 0 0 auto;
        }

        .todo-main-actions-top .todo-calendar-btn {
            min-width: 0;
            flex: 0 1 auto;
        }

        .todo-main-actions .bestand-button {
            min-width: 96px;
            width: auto !important;
            flex: 0 0 auto;
            align-self: center;
            padding: 8px 14px !important;
        }

        .todo-prio-btn {
            margin-right: 2px;
        }

        .ingredient-tooltip-content {
            right: auto;
            left: 0;
            width: min(320px, calc(100vw - 24px));
        }
    }
    .todo-calendar-btn .date-badge {
        font-size: 11px;
        font-weight: bold;
        color: #64b5f6;
        white-space: nowrap;
    }
    .todo-calendar-btn.date-overdue {
        border-color: #e53935;
        background: rgba(229, 57, 53, 0.1);
    }
    .todo-calendar-btn.date-overdue .date-badge {
        color: #e53935;
    }
    .todo-calendar-btn.date-today {
        border-color: #ff9800;
        background: rgba(255, 152, 0, 0.1);
    }
    .todo-calendar-btn.date-today .date-badge {
        color: #ff9800;
    }
    .todo-calendar-btn.date-soon {
        border-color: #fdd835;
        background: rgba(253, 216, 53, 0.1);
    }
    .todo-calendar-btn.date-soon .date-badge {
        color: #f9a825;
    }
    
    /* More CSS below... */
    /* Priority menu */
    .prio-menu { position:absolute; background:#1b1b1b; color:#fff; border:1px solid #444; border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,0.5); min-width:160px; z-index:3200; display:none; padding:6px 0; }
    .prio-menu .opt { padding:8px 12px; cursor:pointer; display:flex; align-items:center; gap:8px; }
    .prio-menu .opt:hover { background:#2a2a2a; }
    .prio-dot { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 10px solid #9e9e9e; }
    .prio-dot.p0 { border-bottom-color:#9e9e9e; opacity:0.7; }
    .prio-dot.p1 { border-bottom-color:#2e7d32; }
    .prio-dot.p2 { border-bottom-color:#ff9800; }
    .prio-dot.p3 { border-bottom-color:#e53935; }
    /* Floating user dropdown */
    /* Einheitliches User-Auswahl Modal - Verbessertes Design */
    .user-select-modal { 
        position: fixed; 
        top: var(--ke-content-safe-top, var(--top-nav-height, 64px));
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0,0,0,0.7); 
        backdrop-filter: blur(4px);
        display: none; 
        align-items: center; 
        justify-content: center; 
        z-index: 3100;
        animation: fadeIn 0.2s ease-out;
        padding: 12px;
        padding-bottom: calc(var(--ke-content-safe-bottom, calc(var(--bottom-nav-height, 60px) + var(--footer-height, 42px))) + 12px);
        box-sizing: border-box;
    }
    .user-select-modal.visible { display: flex; }
    .user-select-modal-content { 
        background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
        border: 2px solid #4CAF50;
        border-radius: 16px; 
        padding: 24px; 
        max-width: 420px; 
        width: 90%; 
        max-height: 85vh; 
        overflow-y: auto;
        box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 1px rgba(255,255,255,0.1);
        color: #fff;
        animation: slideUp 0.3s ease-out;
    }
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    @keyframes slideUp {
        from { transform: translateY(30px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .user-select-modal h3 { 
        margin: 0 0 20px 0; 
        font-size: 20px; 
        font-weight: 600;
        text-align: center;
        color: #fff;
        letter-spacing: 0.3px;
    }
    .user-select-modal-options { 
        display: flex; 
        flex-direction: column; 
        gap: 10px;
        margin-bottom: 20px;
    }
    .user-select-option { 
        display: flex; 
        align-items: center; 
        padding: 14px 16px; 
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 10px; 
        cursor: pointer; 
        transition: all 0.2s ease;
    }
    .user-select-option:hover { 
        background: rgba(255,255,255,0.1);
        border-color: rgba(76, 175, 80, 0.4);
        transform: translateX(2px);
    }
    .user-select-option input[type="radio"] { 
        margin-right: 14px; 
        cursor: pointer;
        width: 18px;
        height: 18px;
        accent-color: #4CAF50;
    }
    .user-select-option label { 
        flex: 1; 
        cursor: pointer; 
        margin: 0;
        font-size: 15px;
        line-height: 1.4;
    }
    .user-select-option label .username {
        font-weight: 600;
        color: #fff;
        display: block;
    }
    .user-select-option label .email {
        color: #aaa;
        font-size: 13px;
        margin-top: 2px;
        display: block;
    }
    .user-select-modal-buttons { 
        display: flex; 
        gap: 12px; 
        margin-top: 20px; 
    }
    .user-select-modal-buttons button { 
        flex: 1; 
        padding: 12px 20px; 
        border: none; 
        border-radius: 10px; 
        font-weight: 600; 
        cursor: pointer; 
        font-size: 15px;
        transition: all 0.2s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .user-select-modal-buttons .cancel { 
        background: rgba(255,255,255,0.08);
        color: #ddd;
        border: 1px solid rgba(255,255,255,0.15);
    }
    .user-select-modal-buttons .cancel:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }
    .user-select-modal-buttons .ok { 
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        color: #fff;
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
    .user-select-modal-buttons .ok:hover {
        background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
        box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
        transform: translateY(-1px);
    }
    .user-select-modal-buttons button:active { 
        transform: scale(0.98);
    }

/* === Block 4 === */
/* Kategorie-Überschrift in der ToDo-Liste */
        .category-header .td2 { font-weight: 600; padding: 6px 4px; text-align: left; }
        /* Compact header rows: don't inherit the global 75px cell height */
        #table tr.group-header td,
        #table tr.category-header td {
            height: auto;
            min-height: 0;
            padding-top: 4px;
            padding-bottom: 4px;
            line-height: 1.2;
            vertical-align: middle;
        }
        /* Optional fine-tuning per header type */
        #table tr.group-header td.td1 { font-size: 16px; }
        #table tr.category-header td.td2 { font-size: 14px; }

        /* Light Mode Overrides */
        [data-theme="light"] #table tr.group-header td,
        [data-theme="light"] .group-header td {
            background-color: var(--ke-surface-2) !important;
            color: var(--ke-text) !important;
            border-color: var(--ke-border) !important;
        }
        [data-theme="light"] #table tr.category-header td,
        [data-theme="light"] .category-header td {
            background-color: var(--ke-surface) !important;
            color: var(--ke-text) !important;
        }
        [data-theme="light"] #table td {
            border-color: var(--ke-border) !important;
        }
        [data-theme="light"] .swipe-element {
            background-color: var(--ke-surface) !important;
            border-color: var(--ke-border) !important;
            color: var(--ke-text) !important;
        }
        [data-theme="light"] .swipe-element strong,
        [data-theme="light"] .swipe-element .centered {
            color: var(--ke-text) !important;
        }
        [data-theme="light"] .swipe-element .item-details {
            color: var(--ke-text) !important;
        }
        [data-theme="light"] .swipe-element .item-details .remark {
            color: var(--ke-text-muted) !important;
        }
        [data-theme="light"] .done-week-toggle {
            color: var(--ke-text) !important;
            border-color: var(--ke-border) !important;
            background: rgba(0, 0, 0, 0.06) !important;
        }
        [data-theme="light"] .todo-portion-badge-open {
            background-color: var(--ke-success) !important;
            color: #fff !important;
        }
        /* Light mode overrides for calendar buttons and priority indicators */
        [data-theme="light"] .todo-calendar-btn {
            border-color: var(--ke-primary) !important;
            background: rgba(37, 99, 235, 0.08) !important;
        }
        [data-theme="light"] .todo-calendar-btn .date-badge {
            color: var(--ke-primary) !important;
        }
        [data-theme="light"] .todo-calendar-btn.date-overdue {
            border-color: #e53935 !important;
            background: rgba(229, 57, 53, 0.12) !important;
        }
        [data-theme="light"] .todo-calendar-btn.date-overdue .date-badge {
            color: #e53935 !important;
        }
        [data-theme="light"] .todo-calendar-btn.date-today {
            border-color: #ff9800 !important;
            background: rgba(255, 152, 0, 0.12) !important;
        }
        [data-theme="light"] .todo-calendar-btn.date-today .date-badge {
            color: #ff9800 !important;
        }
        [data-theme="light"] .todo-calendar-btn.date-soon {
            border-color: #fdd835 !important;
            background: rgba(253, 216, 53, 0.12) !important;
        }
        [data-theme="light"] .todo-calendar-btn.date-soon .date-badge {
            color: #f9a825 !important;
        }
        [data-theme="light"] .todo-prio-btn.prio-0 { border-bottom-color: #9e9e9e; opacity: 0.8; }
        [data-theme="light"] .todo-prio-btn.prio-1 { border-bottom-color: #2e7d32; }
        [data-theme="light"] .todo-prio-btn.prio-2 { border-bottom-color: #ff9800; }
        [data-theme="light"] .todo-prio-btn.prio-3 { border-bottom-color: #e53935; }
        [data-theme="light"] .todo-prio-btn::after { color: #111; text-shadow: 0 0 2px rgba(255,255,255,0.5); }
        [data-theme="light"] .todo-prio-btn.prio-1::after,
        [data-theme="light"] .todo-prio-btn.prio-2::after,
        [data-theme="light"] .todo-prio-btn.prio-3::after { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }

/* === Block 5 === */
.tb-m-dim-group { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.tb-m-dim-group label { color:var(--ke-text-muted); font-size:.83em; width:170px; flex-shrink:0; }
.tb-m-stars span { font-size:1.5em; cursor:pointer; color:var(--ke-text-muted); transition:color .12s; user-select:none; }
.tb-m-stars span.lit { color:var(--ke-warning); }
.tb-chip { background:var(--ke-surface); border:1px solid var(--ke-border); color:var(--ke-text); border-radius:20px; padding:4px 12px; font-size:.8em; cursor:pointer; }
.tb-chip.active { background:rgba(34,197,94,.2); border-color:var(--ke-success); color:var(--ke-success); }

