[hidden]{display:none!important}:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#182235;background:#f4f6fa}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{border:0;border-radius:9px;background:#2563eb;color:white;padding:10px 15px;cursor:pointer;font-weight:600}button:hover{filter:brightness(.94)}button:focus-visible,input:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}button.subtle,.nav button,.back{background:#e9eef7;color:#1e293b}.danger{background:#dc2626}header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:15px max(16px,calc((100vw - 1200px)/2));background:white;border-bottom:1px solid #e3e8f0}.brand{font-size:22px;font-weight:800;color:#2563eb}.header-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.header-actions button{font-size:13px;padding:8px 10px}main{max-width:1200px;margin:24px auto;padding:0 16px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px;flex-wrap:wrap}.toolbar h1{font-size:clamp(20px,3vw,30px);margin:0}.nav{display:flex;gap:6px}.nav button{min-width:38px}.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));background:#dce3ed;gap:1px;border:1px solid #dce3ed;border-radius:12px;overflow:hidden}.weekday{background:#edf2fa;text-align:center;font-size:12px;font-weight:700;padding:13px 2px}.cell{background:white;min-height:132px;padding:8px;min-width:0;cursor:pointer}.cell:hover{background:#f8fbff}.cell.muted{background:#f8f9fc;color:#9ba6b6}.day-number{display:inline-flex;justify-content:center;align-items:center;width:28px;height:28px;border-radius:50%;font-weight:700;font-size:13px}.current .day-number{background:#2563eb;color:white}.event-chip{display:block;border:0;width:100%;text-align:left;margin-top:5px;padding:5px 7px;border-radius:5px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:white}.more{font-size:11px;color:#475569;margin-top:5px}.back{margin-bottom:16px}.day-event{background:white;border-radius:12px;padding:17px;margin:10px 0;border-left:6px solid;box-shadow:0 2px 10px #1b2c4610;cursor:pointer}.day-event strong{display:block;margin:6px 0}.day-event p{white-space:pre-wrap;margin-bottom:0;color:#64748b}.empty{padding:45px 20px;text-align:center;background:white;border-radius:12px;color:#64748b}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:18px}.panel{background:white;border-radius:16px;padding:30px;box-shadow:0 10px 45px #263c5a1a}.login-panel{width:min(100%,390px)}.login-panel h1{margin:0;color:#2563eb}.login-panel p{color:#64748b}.login-panel button{width:100%;margin-top:15px}label{display:block;font-size:13px;font-weight:700;margin:13px 0;color:#334155}input,textarea,select{display:block;width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:11px;margin-top:6px;background:white;color:#0f172a}.error{color:#dc2626!important}dialog{border:0;border-radius:16px;box-shadow:0 15px 60px #0f172a50;width:min(94vw,490px);max-height:90vh;overflow:auto;padding:0}dialog::backdrop{background:#0f172a80}.dialog-form{padding:22px}.dialog-form h2{margin:0 0 15px}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;margin-top:20px}.actions .danger{margin-right:auto}.user-row{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid #e2e8f0;flex-wrap:wrap}.user-row button{font-size:12px;padding:7px 9px}.user-row .controls{display:flex;gap:5px}#toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:#172033;color:white;border-radius:9px;padding:11px 18px;display:none;z-index:5;max-width:90vw;text-align:center}@media(max-width:650px){header{align-items:flex-start}.brand{font-size:18px}.header-actions{justify-content:flex-end}#who{width:100%;text-align:right;font-size:12px}.toolbar{gap:10px}.toolbar h1{order:-1;width:100%}.calendar{border-radius:8px}.weekday{font-size:10px;padding:10px 0}.cell{min-height:88px;padding:3px}.day-number{width:23px;height:23px;font-size:12px}.event-chip{font-size:9px;padding:4px 3px;margin-top:3px}.more{font-size:9px}.dialog-form{padding:18px}}

/* RESPONSIVE MOBILE LAYOUT */

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

header, main, .toolbar, .calendar {
    min-width: 0;
    max-width: 100%;
}

.calendar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

@media screen and (max-width: 650px) {

    header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }

    .header-actions {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    #who {
        width: auto;
        text-align: left;
    }

    main {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 12px 6px;
    }

    .toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        width: 100%;
        margin-bottom: 16px;
    }

    .toolbar h1 {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        font-size: 22px;
        margin: 0;
    }

    .nav {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        gap: 5px;
        min-width: 0;
    }

    .nav button {
        min-width: 0;
        padding: 9px 11px;
        font-size: 13px;
    }

    #add {
        grid-column: 2;
        grid-row: 2;
        padding: 9px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .calendar {
        display: grid;
        width: 100%;
        max-width: 100%;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 1px;
        border-radius: 8px;
    }

    .weekday {
        min-width: 0;
        padding: 9px 0;
        font-size: 10px;
        text-align: center;
    }

    .cell {
        min-width: 0;
        min-height: 72px;
        padding: 3px;
        overflow: hidden;
    }

    .day-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .event-chip {
        width: 100%;
        max-width: 100%;
        padding: 3px 2px;
        font-size: 9px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    dialog {
        max-width: calc(100vw - 20px);
    }
}

/* MOBILE VIEWPORT WIDTH CORRECTION */

@media screen and (max-width: 650px) {

    html, body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: clip !important;
    }

    #app {
        width: 100dvw !important;
        max-width: 100dvw !important;
        min-width: 0 !important;
        overflow-x: clip !important;
    }

    header, main {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    main {
        margin: 0 !important;
        padding: 10px 6px !important;
    }

    .toolbar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .calendar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }

    .weekday, .cell {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .nav {
        min-width: 0 !important;
    }

    .nav button {
        min-width: 0 !important;
    }

    #add {
        min-width: 0 !important;
    }
}

/* Prevent iPhone auto-zoom when focusing form fields */

@media screen and (max-width: 650px) {

    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    .login-panel input {
        font-size: 16px !important;
        min-height: 44px;
    }

    .dialog-form input,
    .dialog-form textarea,
    .dialog-form select {
        font-size: 16px !important;
    }
}

/* Standalone app safe areas */
@media (display-mode: standalone) {
    body {
        min-height: 100dvh;
    }

    header {
        padding-top: max(15px, env(safe-area-inset-top));
    }

    main {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* FLYNNTASTIC_DESKTOP_HEADER_V1 */
@media (min-width: 901px) {
    header .header-actions {
        margin-left: auto;
        justify-content: flex-end;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    header #who {
        width: auto;
        flex: 0 0 auto;
        text-align: right;
        white-space: nowrap;
        margin-right: 8px;
    }

    header .header-actions button {
        width: 125px;
        min-width: 125px;
        flex: 0 0 125px;
        text-align: center;
        white-space: nowrap;
    }
}

/* FLYNNTASTIC_DESKTOP_HEADER_RIGHT_ALIGN_V2 */
@media (min-width: 901px) {

    /* Give the header the full available screen width */
    header {
        padding-left: 16px !important;
        padding-right: 16px !important;
        width: 100%;
    }

    /* Keep Calendar on the left */
    header .brand {
        margin-right: auto;
    }

    /* Push username and buttons to the far right */
    header .header-actions {
        margin-left: auto !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Keep every button the same size */
    header .header-actions button {
        width: 125px !important;
        min-width: 125px !important;
        flex: 0 0 125px !important;
    }
}

/* FLYNNTASTIC_MOBILE_EQUAL_HEADER_BUTTONS_V1 */
@media (max-width: 900px) {

    header .header-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        width: 100% !important;
    }

    /* Equal-width buttons, including username */
    header .header-actions > button,
    header .header-actions > .account-menu > button,
    header .header-actions > .account-menu {
        width: 125px !important;
        min-width: 125px !important;
        flex: 0 0 125px !important;
        box-sizing: border-box !important;
    }

    header .header-actions > .account-menu > button {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* FLYNNTASTIC_MOBILE_HEADER_GRID_V3 */
@media (max-width: 650px) {

    header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    header .header-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    header .header-actions > button,
    header .header-actions > .account-menu {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: none !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    header .header-actions > .account-menu > button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    header #who {
        display: none !important;
    }
}
