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

html {
    scroll-behavior: smooth
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px
}

/* Custom Scrollbar Styling */
.calendar::-webkit-scrollbar,
.activity-blocks::-webkit-scrollbar {
    width: 8px
}

.calendar::-webkit-scrollbar-track,
.activity-blocks::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px
}

.calendar::-webkit-scrollbar-thumb,
.activity-blocks::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px
}

.calendar::-webkit-scrollbar-thumb:hover,
.activity-blocks::-webkit-scrollbar-thumb:hover {
    background: #555
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px
}

.app-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    align-items: flex-start
}

.sidebar {
    flex: 0 0 250px;
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    align-self: flex-start
}

.sidebar h3 {
    margin-bottom: 15px;
    color: #333;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #fafafa;
    z-index: 5;
    padding: 5px 0
}

.activity-blocks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px
}

.activity-block {
    padding: 10px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    cursor: grab;
    text-align: center;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2)
}

.activity-block:active {
    cursor: grabbing
}

.calendar {
    flex: 1;
    background: #fff
}

.calendar-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1px;
    position: sticky;
    top: 130px;
    z-index: 12;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
}

.day-header,
.time-header {
    background: #667eea;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: bold
}

.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 0; /* ✅ Kein Gap - Linien via border-top */
    background: #fff;
    padding-bottom: 20px
}

.time-slot {
    background: #fafafa;
    color: #555;
    padding: 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: flex-start; /* Oben ausrichten */
    justify-content: center;
    padding-top: 4px;
    border-top: 2px solid #d0d0d0 /* Gleiche Linie wie hour-line */
}

/* ========================================
   VISUELLE GRID-HIERARCHIE
   Sichtbare Linien nur bei timeStep-Intervallen
   ======================================== */

.calendar-cell {
    background: #fff;
    min-height: 30px;
    border: none; /* Standard: Keine Linie */
    position: relative
}

/* Halbe-Stunden-Linien (subtil) */
.calendar-cell.half-hour-line {
    border-top: 1px solid #e8e8e8
}

/* Stündliche Linien (prominent) */
.calendar-cell.hour-line {
    border-top: 2px solid #d0d0d0
}

/* Tagesanfang (sehr prominent, blau) */
.calendar-cell.day-start {
    border-top: 3px solid #667eea
}

/* Responsive: Mobile dünnere Linien */
@media (max-width: 768px) {
    .calendar-cell.half-hour-line {
        border-top: 1px solid #e0e0e0
    }

    .calendar-cell.hour-line {
        border-top: 1px solid #bbb /* Dünner auf Mobile */
    }

    .calendar-cell.day-start {
        border-top: 2px solid #667eea
    }

    .time-slot {
        border-top: 1px solid #bbb;
        font-size: 10px
    }
}

.calendar-cell.drop-zone {
    background: #e8ecfc;
    border: 2px dashed #667eea
}

.scheduled-block {
    /* ✅ Grid-Positionierung via JavaScript (gridRowStart/End, gridColumn) */
    position: relative; /* ✅ Needed für absolute-positioned children (resize-handles, remove-btn) */
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    cursor: move;
    z-index: 5;
    /* ✅ Verbesserter Schatten für Abgrenzung bei fehlenden Grid-Linien */
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),       /* Standard-Schatten */
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);  /* Subtile Bottom-Border */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin: 2px
}

.scheduled-block.resize-top,
.scheduled-block.resize-bottom {
    cursor: ns-resize !important
}

.scheduled-block.resizing {
    opacity: .8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5)
}

.scheduled-block.dragging {
    opacity: 0;
    border: 2px dashed #666
}

.resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 15;
    cursor: ns-resize;
    transition: all 0.2s ease
}

.scheduled-block:hover .resize-handle {
    height: 4px;
    background: rgba(255, 255, 255, 0.5)
}

.resize-handle-top {
    top: 0
}

.resize-handle-bottom {
    bottom: 0
}

.scheduled-block:hover .resize-handle:hover {
    height: 6px;
    background: rgba(255, 255, 255, .7)
}

.remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, .8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    color: #333;
    display: none
}

.scheduled-block:hover .remove-btn {
    display: block
}

.controls {
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    background: #fff;
    z-index: 15;
    padding: 10px 0
}

.btn {
    padding: 8px 16px;
    margin: 0 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold
}

.btn-primary {
    background: #667eea;
    color: #fff
}

.btn-secondary {
    background: #6c757d;
    color: #fff
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .5)
}

.modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    max-width: 90%
}

.modal h3 {
    margin-bottom: 20px;
    color: #333
}

.form-group {
    margin-bottom: 15px
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit
}

.form-group textarea {
    resize: vertical;
    min-height: 60px
}

.color-picker {
    width: 50px !important;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px
}

/* Saved Plans List */
.saved-plans-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 16px 0;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-item:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateX(4px);
}

.plan-item-info {
    flex: 1;
}

.plan-item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.plan-item-date {
    font-size: 12px;
    color: #6c757d;
}

.plan-item-actions {
    display: flex;
    gap: 8px;
}

.plan-item-actions button {
    padding: 6px 12px;
    font-size: 12px;
}

.empty-plans-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.activity-item {
    position: relative;
    margin-bottom: 8px
}

.activity-controls {
    position: absolute;
    top: 2px;
    right: 2px;
    display: none;
    gap: 3px;
    z-index: 20
}

.activity-item:hover .activity-controls {
    display: flex
}

.btn-small {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9)
}

.btn-edit {
    color: #f39c12
}

.btn-delete {
    color: #dc3545
}

.activity-management {
    margin-bottom: 15px;
    text-align: center;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    background: #fafafa;
    z-index: 5;
    padding: 5px 0
}

/* App Header & Logo Styles */
.app-header {
    margin-bottom: 30px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 20;
    padding: 10px 0;
    margin: -10px 0 20px 0
}

.logo-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px
}

.logo-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #667eea
}

.logo-button:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05)
}

.logo-button:active {
    transform: scale(0.95)
}

.logo-icon {
    width: 32px;
    height: 32px;
    stroke: currentColor
}

.logo-title-wrapper h1 {
    margin: 0
}

/* Welcome Screen Styles */
.welcome-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px
}

.welcome-screen.active {
    display: flex
}

.welcome-card {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.5s ease-out
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.welcome-title {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.2
}

.welcome-description {
    font-size: 1.1em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 40px
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 15px
}

.btn-large {
    font-size: 1.2em;
    padding: 18px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1)
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15)
}

.btn-large:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
}

/* Main App Container */
#main-app {
    display: none
}

#main-app.active {
    display: block
}

/* Responsive Design */

/* Tablet Landscape (1024px - 768px) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 15px;
        border-radius: 8px
    }

    .sidebar {
        flex: 0 0 180px;
        padding: 12px
    }

    .sidebar h3 {
        font-size: 1em
    }

    .calendar-grid,
    .calendar-header {
        grid-template-columns: 60px repeat(7, 1fr)
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.9em;
        min-height: 44px
    }

    .activity-block {
        min-height: 50px;
        padding: 12px 10px
    }

    .calendar-cell {
        min-height: 40px
    }
}

/* Tablet Portrait & Mobile Landscape (768px - 480px) */
@media (max-width: 768px) {
    body {
        padding: 10px
    }

    .container {
        padding: 10px;
        min-height: 500px
    }

    .app-layout {
        flex-direction: column;
        gap: 15px
    }

    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-height: 180px;
        padding: 10px
    }

    .sidebar h3 {
        font-size: 0.9em;
        margin-bottom: 10px
    }

    .activity-blocks {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 5px;
        gap: 10px
    }

    .activity-block {
        min-width: 120px;
        flex-shrink: 0
    }

    .calendar {
        width: 100%;
        overflow-x: auto
    }

    .calendar-grid,
    .calendar-header {
        grid-template-columns: 50px repeat(7, minmax(80px, 1fr));
        min-width: 650px
    }

    h1 {
        font-size: 1.3em;
        margin-bottom: 15px
    }

    .logo-icon {
        width: 24px;
        height: 24px
    }

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

    .btn {
        margin: 0;
        width: 100%;
        font-size: 0.85em
    }

    /* Welcome Screen Anpassungen */
    .welcome-card {
        padding: 40px 30px
    }

    .welcome-title {
        font-size: 2em
    }

    .welcome-description {
        font-size: 1em
    }

    .btn-large {
        font-size: 1.1em;
        padding: 15px 25px
    }
}

/* Mobile Portrait (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
        min-height: 400px
    }

    h1 {
        font-size: 1.1em;
        margin-bottom: 10px
    }

    .logo-icon {
        width: 20px;
        height: 20px
    }

    .sidebar {
        max-height: 150px
    }

    .activity-block {
        min-width: 100px;
        font-size: 0.85em
    }

    .calendar-grid,
    .calendar-header {
        grid-template-columns: 45px repeat(7, minmax(70px, 1fr))
    }

    .time-slot {
        font-size: 10px;
        padding: 3px
    }

    .day-header,
    .time-header {
        padding: 8px 4px;
        font-size: 0.85em
    }

    .controls {
        grid-template-columns: 1fr;
        gap: 6px
    }

    .btn {
        font-size: 0.8em;
        padding: 12px 8px
    }

    .scheduled-block {
        font-size: 9px
    }

    /* Welcome Screen Anpassungen */
    .welcome-card {
        padding: 30px 20px
    }

    .welcome-title {
        font-size: 1.6em
    }

    .welcome-description {
        font-size: 0.95em
    }

    .btn-large {
        font-size: 1em;
        padding: 12px 20px
    }
}

/* ========================================
   KRITISCHE VERBESSERUNGEN
   ======================================== */

/* ========================================
   SCREEN-READER ONLY CLASS
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   TOUCH-OPTIMIERTE RESIZE-HANDLES
   WCAG 2.1 AAA: 44px Touch-Target
   ======================================== */

/* Touch-Target erweitern (unsichtbar, nur für Klickfläche) */
.resize-handle::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20px; /* Größere Klickfläche */
    background: transparent; /* Komplett unsichtbar */
    cursor: ns-resize;
}

.resize-handle-top::before {
    top: -18px;
}

.resize-handle-bottom::before {
    bottom: -18px;
    top: auto;
}

/* Touch-Geräte: Handles deutlicher */
@media (hover: none) and (pointer: coarse) {
    .resize-handle {
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
    }

    .resize-handle::after {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 30px;
        height: 3px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 1.5px;
    }
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

.scheduled-block {
    font-size: 13px; /* Desktop */
    line-height: 1.3;
    font-weight: 600;
}

/* Dynamische Anpassung basierend auf Block-Höhe */
.scheduled-block[data-height="small"] {
    font-size: 11px;
    padding: 2px 4px;
}

.scheduled-block[data-height="medium"] {
    font-size: 12px;
}

.scheduled-block[data-height="large"] {
    font-size: 13px;
    padding-top: 8px;
}

/* Tablet */
@media (max-width: 1024px) {
    .scheduled-block {
        font-size: 12px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .scheduled-block {
        font-size: 10px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Bessere Lesbarkeit */
        font-weight: 700;
    }
}

/* ========================================
   DRAG-PREVIEW-SYSTEM
   Transparente Vorschau während Drag & Drop
   ======================================== */

.drag-preview {
    /* Grid-Positionierung via JavaScript */
    position: relative;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;

    /* Transparenz & Border */
    opacity: 0.35;
    border: 2px dashed rgba(0, 0, 0, 0.5);

    /* Nicht interagierbar */
    pointer-events: none;

    /* Z-Index unter Blocks aber über Grid */
    z-index: 8;

    /* Pulsierende Animation */
    animation: pulse-preview 1.5s ease-in-out infinite;
}

/* Pulsieren für bessere Sichtbarkeit */
@keyframes pulse-preview {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(1.02);
    }
}

/* Kollisions-Zustand (rot) */
.drag-preview.collision {
    background-color: #e74c3c !important; /* Rot überschreibt Block-Farbe */
    border-color: #c0392b;
    opacity: 0.5;
    animation: pulse-collision 0.8s ease-in-out infinite;
}

@keyframes pulse-collision {
    0%, 100% {
        opacity: 0.4;
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
    }
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .drag-preview {
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* ========================================
   RESPONSIVE CALENDAR GRID
   7-Tage-Layout mit Horizontal-Scroll auf Mobile
   ======================================== */

/* Desktop (1024px+): Standard - bereits definiert */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .calendar-grid {
        grid-template-columns: 60px repeat(7, minmax(100px, 1fr));
        min-width: 760px;
    }

    .calendar {
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch; /* iOS Momentum */
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 50px repeat(7, minmax(90px, 1fr));
        min-width: 680px;
    }

    .calendar {
        scroll-snap-type: x proximity;
    }

    /* Scrollbar Styling */
    .calendar::-webkit-scrollbar {
        height: 6px;
    }

    .calendar::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 3px;
    }
}

/* Sehr kleine Mobile (< 480px) */
@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: 45px repeat(7, minmax(75px, 1fr));
        min-width: 570px;
    }
}

/* ========================================
   TOAST NOTIFICATION SYSTEM
   ======================================== */

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 400px;
}

.toast.toast-visible {
    opacity: 1;
}

.toast.toast-hiding {
    animation: slideOutRight 0.3s ease-in;
}

.toast-error { border-left: 4px solid #dc3545; }
.toast-success { border-left: 4px solid #28a745; }
.toast-info { border-left: 4px solid #007bff; }
.toast-warning { border-left: 4px solid #ffc107; }

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.toast-error .toast-icon { background: #dc3545; color: white; }
.toast-success .toast-icon { background: #28a745; color: white; }
.toast-info .toast-icon { background: #007bff; color: white; }
.toast-warning .toast-icon { background: #ffc107; color: #333; }

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.toast-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
}

.toast-close:hover {
    color: #333;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

/* Collision-Highlight Animation */
.scheduled-block.collision-highlight {
    animation: collision-pulse 0.5s ease-in-out 4;
    z-index: 15 !important;
}

@keyframes collision-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
        border: 2px solid transparent;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(231, 76, 60, 0);
        border: 2px solid #e74c3c;
    }
}

/* Mobile Toast */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
    }
}

/* ========================================
   KEYBOARD FOCUS STYLES (WCAG 2.4.7 AA)
   ======================================== */

*:focus {
    outline: none; /* Wird durch :focus-visible ersetzt */
}

*:focus-visible {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
    border-radius: 4px;
    position: relative;
    z-index: 1000;
}

.scheduled-block.keyboard-focused {
    outline: 3px solid #FFD700; /* Gold für aktiven Block */
    outline-offset: 2px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    z-index: 10 !important;
}

.btn:focus-visible {
    outline: 3px solid #4CAF50;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(76, 175, 80, 0.2);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* ========================================
   CURSOR-FOLLOWING TOOLTIP
   ======================================== */

.block-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.92);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    max-width: 280px;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.block-tooltip.visible {
    opacity: 1;
}

.block-tooltip-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
}

.block-tooltip-time {
    font-size: 13px;
    margin-bottom: 4px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
}

.block-tooltip-description {
    font-size: 12px;
    color: #d0d0d0;
    margin-top: 6px;
    font-style: italic;
    line-height: 1.4;
}

/* Mobile: Optimierungen für Touch-Geräte */
@media (max-width: 768px) {
    .block-tooltip {
        font-size: 12px;
        padding: 10px 14px;
        max-width: 240px;
    }

    .block-tooltip-name {
        font-size: 13px;
    }

    .block-tooltip-time {
        font-size: 12px;
    }

    .block-tooltip-description {
        font-size: 11px;
    }
}

/* Touch-Geräte: Tooltip bleibt länger sichtbar */
@media (hover: none) and (pointer: coarse) {
    .block-tooltip {
        transition: opacity 0.2s ease-in-out;
    }
}
