* {
    box-sizing: border-box;
}

:root {
    --bg: #0b0c10;
    --text: #eef0f6;
    --muted: rgba(238, 240, 246, .72);

    --surface: rgba(255, 255, 255, .06);
    --surface2: rgba(255, 255, 255, .04);
    --tile: rgba(255, 255, 255, .06);
    --tileHover: rgba(255, 255, 255, .085);

    --radius: 14px;
    --radius2: 12px;

    /* FULL pills (band colors) */
    --pillA: #ffd1a6;
    /* hell orange */
    --pillB: #ffe88a;
    /* gelb */
    --pillC: #bfe3ff;
    /* hellblau */
    --pillText: #2b2f36;
    /* dunkelgrau */

    --today: rgba(80, 160, 255, .95);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
    color: var(--text);

    background:
        radial-gradient(1100px 650px at 22% -8%, rgba(80, 160, 255, .18), transparent 60%),
        radial-gradient(900px 560px at 88% 0%, rgba(255, 140, 60, .14), transparent 65%),
        var(--bg);
    background-attachment: fixed;
}

@media (max-width: 900px) {
    body {
        background-attachment: scroll;
    }
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(11, 12, 16, .86);
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    font-weight: 900;
    letter-spacing: .4px;
    flex: 0 0 auto;
}

.title {
    font-weight: 900;
    font-size: 13px;
    line-height: 1.15;
}

.subtitle {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.monthnav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Fullscreen shell */
.wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Flat cards */
.card {
    background: linear-gradient(180deg, var(--surface), var(--surface2));
    border-radius: var(--radius);
    padding: 12px;
}

.cardhead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

h2 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 900;
}

h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 900;
}

.muted {
    color: var(--muted);
    font-size: 11.5px;
}

.tiny {
    font-size: 11.5px;
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.input,
.select {
    background: rgba(0, 0, 0, .22);
    color: var(--text);
    border-radius: 12px;
    padding: 9px 10px;
    font-size: 13px;
    outline: none;
    border: 0;
}

.input {
    min-width: 220px;
    flex: 1;
}

.btn {
    border: 0;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    color: #0b0c10;
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.btn.ghost {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    font-weight: 900;
}

.msg {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.hidden {
    display: none;
}

/* Main Tabs (month/upcoming) */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 900;
    font-size: 13px;
    border: 0;
    user-select: none;
}

.tab:hover {
    background: rgba(255, 255, 255, .11);
}

.tab:focus,
.tab:focus-visible {
    outline: none;
}

.tab.active {
    background: rgba(255, 255, 255, .92);
    color: #0b0c10;
}

/* Month layout */
.monthlayout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 10px;
    align-items: start;
    min-height: calc(100vh - 64px - 10px - 14px);
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11.5px;
    user-select: none;
}

.monthgrid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

/* Day tiles */
.daycell {
    border-radius: var(--radius2);
    padding: 6px;
    background: var(--tile);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    height: clamp(76px, 10.2vw, 104px);
    min-height: 76px;
}

.daycell:hover {
    background: var(--tileHover);
}

.daycell.blank {
    visibility: hidden;
    cursor: default;
}

.daycell .n {
    font-weight: 900;
    font-size: 11.5px;
    line-height: 1;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.daycell.today {
    background: linear-gradient(180deg, rgba(80, 160, 255, .18), rgba(255, 255, 255, .04));
}

.todayDot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--today);
    box-shadow: 0 0 0 3px rgba(80, 160, 255, .14);
}

/* Pills list */
.pills {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

/* FULL COLOR pills; NO borders; NO size changes on selected */
.pill {
    display: block;
    border-radius: 10px;
    /* more tile-like */
    padding: 4px 7px;
    font-size: 10.8px;
    line-height: 1.2;

    color: var(--pillText);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* important: fixed geometry */
    border: 0;
    box-shadow: none;
}

/* band fills */
.pill.band-a {
    background: var(--pillA);
}

.pill.band-b {
    background: var(--pillB);
}

.pill.band-c {
    background: var(--pillC);
}

/* selected: inset highlight (doesn't change size) */
.pill.selected {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25);
}

.more {
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--muted);
}

/* Right panel with internal tabs */
.sidepanel {
    border-radius: var(--radius2);
    padding: 10px;
    background: var(--tile);
    height: fit-content;
    position: sticky;
    top: 68px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sideTabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sideTab {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 900;
    font-size: 13px;
    border: 0;
}

.sideTab.active {
    background: rgba(255, 255, 255, .92);
    color: #0b0c10;
}

.panelSection {
    display: block;
}

.panelSection.hidden {
    display: none;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.form label {
    font-size: 11.5px;
    color: var(--muted);
}

.selectedBox {
    border-radius: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, .18);
}

/* Upcoming */
.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.item {
    border-radius: 12px;
    padding: 10px;
    background: var(--tile);
}

.item .top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.item .band {
    font-weight: 900;
    font-size: 13px;
}

.item .time {
    color: var(--muted);
    font-size: 11.5px;
}

.item .note {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11.5px;
}

@media (max-width: 900px) {
    .wrap {
        padding: 8px 8px 14px;
    }

    .card {
        padding: 10px;
    }

    .monthlayout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .sidepanel {
        position: static;
        top: auto;
    }
}

@media (max-width: 420px) {
    .monthgrid {
        gap: 4px;
    }

    .weekdays {
        gap: 4px;
    }

    .daycell {
        height: 72px;
        padding: 5px;
    }

    .pill {
        font-size: 10.2px;
    }
}