:root {
    --ppd: 24px;
    --row-h: 40px;
    --gutter-w: 200px;
    --header-h: 36px;
}

.tl-grid {
    display: grid;
    grid-template-columns: repeat(var(--total-days), var(--ppd));
    grid-auto-rows: min-content;
    position: relative;
    background-image: linear-gradient(to right, rgba(15,23,42,0.06) 1px, transparent 1px);
    background-size: var(--ppd) 100%;
}

.tl-row {
    grid-column: 1 / -1;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
    min-height: var(--row-h);
}

.tl-row:nth-child(even) { background: #fafafa; }

.tl-bar {
    position: absolute;
    top: 4px;
    height: 22px;
    border-radius: 5px;
    color: white;
    font-size: 12px;
    line-height: 1;
    padding: 0 8px;
    display: flex;
    align-items: center;
    cursor: grab;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
    will-change: transform, width;
}

.tl-bar:active { cursor: grabbing; }

.tl-bar .resize-handle {
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
}
.tl-bar .resize-handle.left  { left: 0; }
.tl-bar .resize-handle.right { right: 0; }

.tl-popover {
    position: fixed;
    z-index: 100;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    padding: 12px 14px;
    min-width: 240px;
    max-width: 320px;
    font-size: 13px;
    color: #1e293b;
    pointer-events: none;
}
.tl-popover .pop-title { font-weight: 600; margin-bottom: 6px; }
.tl-popover .pop-row { display: flex; gap: 8px; margin-top: 4px; color: #475569; font-size: 12px; }
.tl-popover .pop-row .lbl { color: #94a3b8; min-width: 60px; }
.tl-popover .pop-status {
    display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px;
    font-weight: 500;
}
.pop-status.todo        { background: #f1f5f9; color: #475569; }
.pop-status.in_progress { background: #dbeafe; color: #1e40af; }
.pop-status.blocked     { background: #fee2e2; color: #991b1b; }
.pop-status.done        { background: #dcfce7; color: #166534; }

.tl-today-marker {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: #ef4444;
    pointer-events: none;
    z-index: 5;
}

.tl-header {
    height: var(--header-h);
    display: grid;
    grid-template-columns: repeat(var(--total-days), var(--ppd));
    border-bottom: 1px solid #e2e8f0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 4;
}

.tl-header-cell {
    font-size: 11px;
    color: #64748b;
    border-right: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-gutter {
    width: var(--gutter-w);
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
    background: white;
}

.tl-gutter-row {
    height: var(--row-h);
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    color: #1e293b;
}
