/* Minimalist full‑screen planner styling */
html,
body {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #fafafa;
    overflow: hidden;
}

#controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

#planner {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    height: calc(100vh - 70px);
    /* subtract controls (40px) + header (30px) */
    position: relative;
    padding-bottom: 20px;
    /* ensure last time label visible */
    border-top: 1px solid #e0e0e0;
    /* connect with header row */
}

.time-axis {
    position: relative;
    border-right: 1px solid #e0e0e0;
}

.time-label {
    position: absolute;
    left: 0;
    width: 100%;
    font-size: 0.75rem;
    color: #666;
    text-align: right;
    padding-right: 4px;
}

.day-column {
    position: relative;
    border-left: 1px solid #e0e0e0;
    overflow: hidden;
}

.day-header {
    text-align: center;
    font-weight: bold;
    padding: 4px 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

/* hour lines */
.hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

/* event styling */
.event {
    position: absolute;
    left: 2%;
    width: 96%;
    border-radius: 4px;
    color: #fff;
    font-size: 0.75rem;
    padding: 1px 4px;
    /* reduced top padding for short events */
    box-sizing: border-box;
    cursor: pointer;
}

.event.office {
    background: #1976d2;
}

.event.home {
    background: #388e3c;
}

.event.pause {
    background: #9e9e9e;
}

.event .label {
    font-weight: bold;
}

.event .time {
    display: inline;
    font-size: 0.65rem;
    margin-left: 4px;
}

.event .close-btn,
.event .type-btn {
    position: absolute;
    top: 2px;
    width: 16px;
    height: 16px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.event:hover .close-btn,
.event:hover .type-btn {
    opacity: 1;
}

.event .close-btn {
    right: 2px;
}

.event .type-btn {
    right: 20px;
}

/* drag handles */
.drag-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    cursor: ns-resize;
    background: transparent;
    transition: background 0.2s;
}

.drag-handle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.drag-handle.top {
    top: 0;
}

.drag-handle.bottom {
    bottom: 0;
}

/* header row styling to align with planner columns */
#headerRow {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 2;
    height: 30px;
    /* fixed height */
}

.time-header {
    /* empty placeholder for time column */
}

/* ensure planner starts below header */
#planner {
    padding-bottom: 20px;
    /* ensure last time label visible */
}