:root {
    --teal: #008b8b;
    --teal-light: #00b4b4;
    --dark: #1a1f2e;
    --dark-mid: #252b3b;
    --dark-card: #2e3547;
    --text: #f0f4f8;
    --text-muted: #9aa5b8;
    --border: rgba(0, 139, 139, 0.2);
    --accent: #e8c84a;

    --col-width: 160px;
    --row-height: 48px;
    --time-width: 64px;
}
@media (max-width: 768px) {
    :root {
        --col-width: 110px;
        --row-height: 42px;
        --time-width: 48px;
    }
}

@media (max-width: 480px) {
    :root {
        --col-width: 80px;
        --row-height: 36px;
        --time-width: 40px;
    }
}
.scroll-wrap *{ 
    box-sizing: border-box; margin: 0; padding: 0; 
    
}
/* ── GRID ── */
.planner {
    display: grid;
    grid-template-columns: var(--time-width) repeat(5, var(--col-width));
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-x: hidden;
    overflow-y: visible;
    width: fit-content;
    margin: 20px;
}

/* Day headers */
.header-corner {
    background: var(--dark-card);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.day-header {
    background: var(--dark-card);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.day-header .day-name {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal-light);
}

.day-header .day-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Time labels */
.time-label {
    background: var(--dark-mid);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    height: var(--row-height);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 6px 10px 0 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Cells */
.cell {
    height: var(--row-height);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    background: var(--dark);
}

.cell:last-child,
.cell:nth-child(6n) {
    /* last column */
}

/* Half-hour dashed separator */
.cell::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px dashed rgba(255, 255, 255, 0.04);
}

/* ── ACTIVITY BLOCKS ── */
.activity {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    z-index: 2;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}
.activity .act-location{
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity .act-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity .act-time, .activity .act-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.75;
    margin-top: 2px;
}

/* Color variants */
.act-teal {
    background: rgba(0, 139, 139, 0.25);
    border-left-color: var(--teal);
    color: #7fe8e8;
}

.act-amber {
    background: rgba(232, 200, 74, 0.2);
    border-left-color: var(--accent);
    color: #f0d97a;
}

.act-rose {
    background: rgba(219, 90, 120, 0.22);
    border-left-color: #db5a78;
    color: #f0a0b4;
}

.act-violet {
    background: rgba(140, 100, 230, 0.22);
    border-left-color: #8c64e6;
    color: #c4aaff;
}

.act-sky {
    background: rgba(56, 160, 220, 0.22);
    border-left-color: #38a0dc;
    color: #90ccf4;
}

.act-green {
    background: rgba(80, 180, 110, 0.22);
    border-left-color: #50b46e;
    color: #90d4a8;
}
.span-1 {
    height: calc(var(--row-height) - 6px);
    min-height: calc(var(--row-height) - 6px);
}
.span-1-half {
    height: calc(var(--row-height) * 1.5 - 6px);
    min-height: calc(var(--row-height) * 1.5 - 6px);
}
.span-3-half {
    height: calc(var(--row-height) * 3.5 - 6px);
    min-height: calc(var(--row-height) * 3.5 - 6px);
}
.span-half{
    height: calc(var(--row-height) / 2 - 6px);
    min-height: calc(var(--row-height) / 2 - 6px);
}
/* Utility: span N rows */
.span-2 {
    height: calc(var(--row-height) * 2 - 6px);
    min-height: calc(var(--row-height) * 2 - 6px);
}

.span-3 {
    height: calc(var(--row-height) * 3 - 6px);
    min-height: calc(var(--row-height) * 3 - 6px);
}

.span-4 {
    height: calc(var(--row-height) * 4 - 6px);
    min-height: calc(var(--row-height) * 4 - 6px);
}

.span-6 {
    height: calc(var(--row-height) * 6 - 6px);
    min-height: calc(var(--row-height) * 6 - 6px);
}

/* top-offset helpers: position inside the cell */
.top-0 {
    top: 4px;
}

.top-hf {
    margin-top: calc(var(--row-height) / 2 + 2px);
}

/* Current-time indicator (static example at 10:00 = row 5 from top) */
.now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(232, 200, 74, 0.7);
    z-index: 3;
    top: 0;
}

.now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── RESPONSIVE SCROLL ── */
.scroll-wrap {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 139, 139, 0.4) transparent;
}

.scroll-wrap::-webkit-scrollbar {
    height: 4px;
}

.scroll-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 139, 139, 0.4);
    border-radius: 4px;
}

.scroll-hint {
    display: none;
}

@media (max-width: 768px) {
    .scroll-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.72rem;
        color: var(--text-muted);
        margin-bottom: 8px;
    }

    .scroll-hint::before { content: '←'; color: var(--teal-light); }
    .scroll-hint::after  { content: '→'; color: var(--teal-light); }
}

@media (max-width: 480px) {
    .activity {
        padding: 4px 6px;
        font-size: 0.65rem;
    }

    .activity .act-time {
        display: none;
    }

    .day-header {
        padding: 8px 0;
    }

    .day-header .day-date {
        display: none;
    }
}
.activity:hover, .activity.clicked {
    background-color: #1a1f2e;
    filter: brightness(1.1);
    z-index: 100;
    height: fit-content;
    width: fit-content;
    cursor: pointer;
    /* ensure it paints above siblings */
    
}
