/* Studio portal — auth panel chrome (English UI; bottlelist.css for base theme) */

/**
 * Pull-to-refresh: #portalPullShift is translated by JS so the whole shell moves.
 * Indicator is a light hint in the gap above (opacity), not a separate sliding layer.
 */
.portal-pull-shift {
    will-change: transform;
}

.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 11;
    display: flex;
    justify-content: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
    pointer-events: none;
}

.pull-to-refresh[hidden] {
    display: none !important;
}

.pull-to-refresh-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(233, 237, 243, 0.78);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Text hidden until LABEL_SHOW_FRACTION — no empty gap beside the icon before that */
.pull-to-refresh-label {
    overflow: hidden;
    white-space: nowrap;
    max-width: 0;
    flex-shrink: 0;
    transition: max-width 0.2s ease-out;
}

.pull-to-refresh-label.pull-to-refresh-label--show {
    max-width: 14rem;
}

.pull-to-refresh-icon {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    color: rgba(255, 216, 74, 0.85);
    transition: transform 0.05s linear;
}

.pull-to-refresh--ready .pull-to-refresh-label {
    color: rgba(255, 230, 160, 0.95);
}

.pull-to-refresh--ready .pull-to-refresh-icon {
    color: rgba(255, 230, 160, 0.98);
}

.auth-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -4px -4px 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(233, 237, 243, 0.95);
}

.auth-panel-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(233, 237, 243, 0.85);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.auth-panel-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.auth-create-hint {
    font-size: 12px;
    color: rgba(233, 237, 243, 0.72);
    margin: 0 0 10px;
    line-height: 1.4;
}

.auth-mode-switch {
    margin: 10px 0 0;
    font-size: 12px;
}

.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: rgba(255, 216, 74, 0.88);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.auth-link-btn:hover {
    color: rgba(255, 230, 160, 0.95);
}

/* Week calendar (Nextcloud feed) */
.cal-intro {
    margin-bottom: 8px;
}

.cal-feed-hint {
    font-size: 12px;
    color: rgba(255, 200, 140, 0.9);
    margin: 0 0 10px;
}

/* Room tabs */
.cal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.cal-tab {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(233, 237, 243, 0.85);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.2;
}

.cal-tab:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.cal-tab.is-active {
    border-color: rgba(255, 216, 74, 0.45);
    background: rgba(255, 216, 74, 0.1);
    color: rgba(255, 240, 200, 0.98);
    font-weight: 600;
}

.cal-wrap {
    margin-top: 12px;
}

.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.cal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1 1 auto;
    text-align: center;
    min-width: 160px;
}

.cal-week-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 6px;
}

.cal-week-allday {
    display: grid;
    grid-template-columns: 44px repeat(7, minmax(88px, 1fr));
    gap: 4px;
    margin-bottom: 8px;
    min-width: min(100%, 780px);
}

.cal-week-allday-label {
    font-size: 10px;
    color: rgba(233, 237, 243, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 2px;
    align-self: start;
}

.cal-week-allday-cell {
    min-height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cal-week-allday-cell.cal-week-col-today {
    border-color: rgba(255, 216, 74, 0.3);
}

.cal-week-timetable {
    display: grid;
    grid-template-columns: 44px repeat(7, minmax(88px, 1fr));
    gap: 0 4px;
    min-width: min(100%, 780px);
    --cal-hour-pixels: 40px;
}

.cal-time-gutter {
    font-size: 10px;
    color: rgba(233, 237, 243, 0.45);
    padding-top: 0;
}

/* Same block as .cal-day-time-head so hour labels line up with the grid body. */
.cal-time-gutter-head {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

.cal-time-slot {
    height: var(--cal-hour-pixels);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-right: 4px;
    text-align: right;
    box-sizing: border-box;
}

.cal-day-time-col {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.cal-day-time-col.cal-week-col-today {
    border-color: rgba(255, 216, 74, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 216, 74, 0.12);
}

.cal-day-time-head {
    text-align: center;
    padding: 6px 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-week-dow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(233, 237, 243, 0.5);
}

.cal-week-daynum {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(233, 237, 243, 0.92);
    line-height: 1.2;
}

.cal-day-time-body {
    position: relative;
    height: calc(var(--cal-hour-count, 13) * var(--cal-hour-pixels));
    /* Let pointer drag work smoothly on touch without the page scrolling. */
    touch-action: none;
}

.cal-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.cal-block {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 9px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 216, 74, 0.18);
    color: rgba(255, 245, 210, 0.98);
    border: 1px solid rgba(255, 216, 74, 0.25);
    box-sizing: border-box;
    cursor: default;
}

.cal-block-mine {
    cursor: pointer;
    border-color: rgba(255, 216, 74, 0.45);
    background: rgba(255, 216, 74, 0.26);
}

.cal-block-mine:hover {
    background: rgba(255, 216, 74, 0.34);
}

/* Drag selection overlay for creating a booking (visible only while dragging). */
.cal-selection {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 9px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 5;
    background: rgba(120, 255, 160, 0.18);
    border: 1px solid rgba(120, 255, 160, 0.38);
    color: rgba(220, 255, 230, 0.98);
    box-sizing: border-box;
}

.cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
}

.cal-modal-note {
    font-size: 11px;
    color: rgba(233, 237, 243, 0.55);
    margin: 0 0 8px;
}

.cal-modal-form select.auth-input {
    cursor: pointer;
    background: rgba(0, 0, 0, 0.25);
}

.cal-pill {
    display: block;
    font-size: 10px;
    line-height: 1.25;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(255, 216, 74, 0.12);
    color: rgba(255, 237, 180, 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-pill-mine {
    cursor: pointer;
    border: 1px solid rgba(255, 216, 74, 0.35);
    background: rgba(255, 216, 74, 0.2);
}

.cal-pill-mine:hover {
    background: rgba(255, 216, 74, 0.28);
}

.cal-booker-link,
.cal-booker-text {
    display: inline;
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.2;
    color: rgba(255, 237, 180, 0.92);
    vertical-align: baseline;
}

.cal-booker-link {
    text-decoration: none;
}

.cal-booker-link:hover {
    color: rgba(255, 248, 220, 0.98);
}

.cal-modal-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.cal-error {
    color: rgba(255, 150, 130, 0.95);
    margin: 12px 0 0;
}

/* Add booking modal */
.cal-modal[hidden] {
    display: none !important;
}

.cal-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 24px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.cal-modal-panel {
    width: min(400px, 100%);
    max-height: calc(100vh - 96px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: var(--panel, #141823);
    padding: 14px 16px 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.cal-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.cal-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.cal-modal-form .auth-label:first-of-type {
    margin-top: 0;
}

.cal-modal-hint {
    font-size: 12px;
    color: rgba(255, 200, 120, 0.95);
    margin: 0 0 8px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow-y: auto;
}

.cal-notes-hint {
    font-weight: 400;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.45);
}

.cal-book-notes {
    resize: vertical;
    min-height: 72px;
    max-height: 200px;
}

/* Global loading overlay (ICS / merged schedule fetch) */
.portal-loading-overlay[hidden] {
    display: none !important;
}

.portal-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
}

.portal-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    border: 1px solid rgba(255, 216, 74, 0.22);
    border-radius: 14px;
    background: var(--panel, #141823);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    max-width: min(340px, 100%);
}

.portal-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 216, 74, 0.85);
    border-radius: 50%;
    animation: portal-spin 0.75s linear infinite;
}

@keyframes portal-spin {
    to {
        transform: rotate(360deg);
    }
}

.portal-loading-text {
    margin: 0;
    font-size: 13px;
    color: rgba(233, 237, 243, 0.88);
    text-align: center;
    line-height: 1.4;
}

.status-inline-msg:empty {
    display: none;
    margin: 0;
}

/* Compact phone layout for week calendar */
@media (max-width: 820px) {
    /* Prevent iPhone auto-zoom on focused form fields. */
    .auth-input,
    .auth-select,
    .cal-modal-form .auth-input,
    .cal-modal-form select.auth-input,
    input[type="date"],
    input[type="email"],
    input[type="password"],
    input[type="text"],
    select,
    textarea {
        font-size: 16px;
    }

    /* Use as much horizontal space as possible on phones. */
    .container {
        max-width: none;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .cal-wrap {
        margin-top: 8px;
        width: 100%;
    }

    .cal-modal {
        padding: 60px 8px 16px;
    }

    .cal-modal-panel {
        width: calc(100vw - 16px);
        max-width: none;
        overflow-x: hidden;
    }

    .cal-week-scroll {
        width: 100%;
        margin: 0;
        padding: 0 0 6px;
    }

    .cal-toolbar {
        gap: 6px;
        margin-bottom: 8px;
    }

    .cal-title {
        font-size: 0.95rem;
        min-width: 120px;
    }

    .cal-week-allday {
        display: none;
    }

    .cal-week-timetable {
        grid-template-columns: 24px repeat(7, minmax(40px, 1fr));
        gap: 0 2px;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        --cal-hour-pixels: 30px;
    }

    .cal-time-slot {
        font-size: 8px;
        padding-right: 1px;
    }

    .cal-day-time-head {
        padding: 6px 2px 6px;
        min-height: 46px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
    }

    .cal-week-dow {
        font-size: 8px;
        writing-mode: horizontal-tb;
        transform: none;
        letter-spacing: 0.02em;
        line-height: 1.1;
    }

    .cal-week-daynum {
        font-size: 0.72rem;
        writing-mode: horizontal-tb;
        transform: none;
        line-height: 1.05;
    }

    .cal-block,
    .cal-selection {
        left: 1px;
        right: 1px;
        border-radius: 3px;
        padding: 1px;
        font-size: 7px;
    }

    /* Keep iOS date-picker controls inside modal width. */
    .cal-modal-form .auth-input,
    .cal-modal-form input[type="date"],
    .cal-modal-form select.auth-input {
        display: block;
        inline-size: 100%;
        width: 100%;
        max-width: 100%;
        max-inline-size: 100%;
        min-width: 0;
        min-inline-size: 0;
        box-sizing: border-box;
        flex: 0 1 auto;
    }

    .cal-modal-form input[type="date"] {
        padding-right: 6px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: clip;
    }

    .cal-modal-form input[type="date"]::-webkit-calendar-picker-indicator {
        margin: 0;
        padding: 0;
    }

    /* iOS Safari: prevent intrinsic date control width from overflowing modal. */
    @supports (-webkit-touch-callout: none) {
        .cal-modal-form input[type="date"] {
            -webkit-appearance: none;
            appearance: none;
            background-clip: padding-box;
            padding-right: 28px;
        }

        .cal-modal-form input[type="date"]::-webkit-date-and-time-value {
            text-align: left;
        }

        .cal-modal-form input[type="date"]::-webkit-datetime-edit {
            padding: 0;
        }

        .cal-modal-form input[type="date"]::-webkit-calendar-picker-indicator {
            opacity: 0.85;
        }
    }
}

/* Top navigation: tab strip (not generic topbar buttons) */
.topbar-main {
    flex-wrap: wrap;
    row-gap: 10px;
}

.topbar-nav {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.topbar-nav-tab-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.topbar-nav-tab-icon {
    flex-shrink: 0;
    opacity: 0.75;
}

.topbar .topbar-nav-tab.is-active .topbar-nav-tab-icon {
    opacity: 1;
}

/* Reset bottlelist `.topbar button` so tabs are not chunky panels */
.topbar .topbar-nav-tab {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 34px;
    padding: 7px 8px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(233, 237, 243, 0.52);
    cursor: pointer;
    line-height: 1.15;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.topbar .topbar-nav-tab:hover {
    color: rgba(233, 237, 243, 0.88);
    border-color: transparent;
}

.topbar .topbar-nav-tab:focus-visible {
    outline: 2px solid rgba(255, 216, 74, 0.45);
    outline-offset: 2px;
}

.topbar .topbar-nav-tab.is-active {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(233, 237, 243, 0.94);
    font-weight: 600;
}

@media (max-width: 640px) {
    .topbar-nav {
        flex: 1 1 100%;
        order: 3;
        justify-content: stretch;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .auth-area {
        flex: 0 0 auto;
    }

    .topbar .topbar-nav-tab {
        min-height: 38px;
        padding: 8px 6px;
        font-size: 11px;
    }
}

/* Brand + single-line app name */
.topbar .brand {
    display: flex;
    align-items: center;
}

.topbar .brand-title {
    display: block;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
    color: rgba(233, 237, 243, 0.88);
    letter-spacing: 0.02em;
}

.topbar .brand-version {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(233, 237, 243, 0.45);
    letter-spacing: 0.04em;
    white-space: nowrap;
    user-select: none;
}

/* Dashboard */
.dash-controls-locked {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 180, 80, 0.35);
    background: rgba(255, 180, 80, 0.08);
    color: rgba(243, 220, 180, 0.95);
    font-size: 14px;
    line-height: 1.45;
}

.dash-controls-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}

.dash-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: var(--panel, #141823);
    padding: 16px 18px 18px;
    margin-bottom: 14px;
}

.dash-room-title {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 600;
}

/** Entry & Alarm: title + armed summary (Yale locked + alarm panel armed → green). */
.dash-entry-alarm-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-entry-alarm-heading-row .dash-room-title {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.dash-entry-secure-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 32px;
}

.dash-entry-secure-badge__img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.dash-entry-secure-badge__placeholder {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(233, 237, 243, 0.45);
    line-height: 1;
}

/* Same size as .dash-room-title (Next bookings, Entry & Alarm); align insets with .dash-card-heading */
.dash-controls-stack-heading {
    margin: 0;
    padding: 18px 18px 0px 18px;
    border: none;
    background: none;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
    box-sizing: border-box;
}

.dashboard-booking-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dash-booking-item {
    padding: 0;
}

/* Ongoing session — same gold system as .cal-block / .cal-block-mine */
.dash-booking-item.dash-booking-item--active {
    box-sizing: border-box;
    margin: 2px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255, 216, 74, 0.18);
    border: 1px solid rgba(255, 216, 74, 0.25);
}

.dash-booking-item.dash-booking-item--active.dash-booking-item--active-mine {
    background: rgba(255, 216, 74, 0.26);
    border-color: rgba(255, 216, 74, 0.45);
}

/* Aktiv pass + bokaren incheckad i passage — samma gröna system som .cal-selection (ny bokning drag) */
.dash-booking-item.dash-booking-item--active.dash-booking-item--active-checked-in {
    background: rgba(120, 255, 160, 0.18);
    border: 1px solid rgba(120, 255, 160, 0.38);
}

.dash-booking-item.dash-booking-item--active.dash-booking-item--active-checked-in.dash-booking-item--active-mine {
    background: rgba(120, 255, 160, 0.26);
    border-color: rgba(120, 255, 160, 0.48);
}

.dash-booking-item.dash-booking-item--active-checked-in .dash-booking-room {
    color: rgba(160, 255, 195, 0.92);
}

.dash-booking-item.dash-booking-item--active-checked-in .dash-booking-time {
    color: rgba(210, 255, 225, 0.88);
}

.dash-booking-item.dash-booking-item--active .dash-booking-time {
    margin-bottom: 0;
}

.dash-booking-room {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 216, 74, 0.85);
    margin: 0 0 6px;
    letter-spacing: 0.02em;
}

.dash-link-cal,
.dash-link-cal-edit {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.dash-link-cal:hover,
.dash-link-cal-edit:hover {
    opacity: 0.9;
}

.dash-booking-item .dash-booking-title {
    margin: 0 0 6px;
}

.dash-booking-item .dash-booking-booker {
    margin: 0 0 6px;
    font-size: 13px;
    color: rgba(233, 237, 243, 0.78);
}

.dash-booking-item .dash-booking-time {
    margin: 0 0 12px;
}

.dash-booking-sep {
    height: 1px;
    margin: 16px 0;
    border: none;
    background: rgba(255, 255, 255, 0.08);
}

.dash-empty {
    color: rgba(233, 237, 243, 0.72);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.dash-empty strong {
    color: rgba(255, 230, 160, 0.95);
    font-weight: 600;
}

.dash-booking-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 216, 74, 0.75);
    margin: 0 0 6px;
}

.dash-booking-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
}

.dash-booking-time {
    margin: 0 0 14px;
    font-size: 13px;
    color: rgba(233, 237, 243, 0.65);
}

.dash-card-heading {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.dash-controls-hint {
    font-size: 12px;
    color: rgba(233, 237, 243, 0.55);
    margin: 0 0 12px;
    line-height: 1.4;
}

.dash-controls-hint code {
    font-size: 11px;
    color: rgba(255, 216, 74, 0.7);
}

.dash-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dash-card-controls .dash-device-row {
    margin-top: 6px;
}

/** Accordion row: label + chevron only — no box around the section */
.dash-collapsible {
    margin-top: 14px;
}

.dash-collapsible-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 4px 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
}

.dash-collapsible-toggle:hover {
    opacity: 0.92;
}

.dash-collapsible-toggle:hover .dash-collapsible-chevron {
    opacity: 1;
}

.dash-collapsible-chevron {
    flex-shrink: 0;
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform 0.18s ease;
}

.dash-collapsible-toggle[aria-expanded="true"] .dash-collapsible-chevron {
    transform: rotate(0deg);
}

.dash-collapsible-toggle[aria-expanded="false"] .dash-collapsible-chevron {
    transform: rotate(-90deg);
}

.dash-collapsible-body {
    padding-top: 8px;
}

.dash-collapsible-body[hidden] {
    display: none !important;
}

/** Entry & Alarm (exempt users): own card below bookings */
.dash-access-log-panel {
    display: flex;
    flex-direction: column;
    margin: 18px 0 14px;
    padding: 14px 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: var(--panel, #141823);
}

/** Class `display:flex` would otherwise override UA [hidden] — empty strip without this */
.dash-access-log-panel[hidden] {
    display: none !important;
}

/** Dashboard: quick post to Slack (staff) */
.dash-slack-studio-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0 10px;
    padding: 14px 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: var(--panel, #141823);
}

.dash-slack-studio-panel[hidden] {
    display: none !important;
}

.dash-slack-studio-hint {
    margin: 0 0 4px;
    font-size: 0.86rem;
    opacity: 0.88;
    line-height: 1.35;
}

.dash-slack-studio-label {
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.9;
}

.dash-slack-studio-text {
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    width: 100%;
    min-height: 4.5rem;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.dash-slack-studio-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.dash-slack-studio-msg {
    margin: 0;
    font-size: 0.86rem;
    min-height: 1.2em;
}

.dash-slack-studio-msg.is-ok {
    color: rgba(120, 220, 160, 0.95);
}

.dash-slack-studio-msg.is-error {
    color: rgba(255, 150, 130, 0.95);
}

/** Dashboard: staff Web Push to selected portal user */
.dash-push-notify-panel .dash-push-optional {
    font-weight: 400;
    opacity: 0.75;
}

.dash-push-user-select {
    font: inherit;
    font-size: 0.95rem;
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    box-sizing: border-box;
}

.dash-push-user-input {
    font: inherit;
    font-size: 0.95rem;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    box-sizing: border-box;
}

.dash-access-log-inner {
    display: flex;
    flex-direction: column;
}

.dash-access-log-inner > .dash-collapsible:first-child {
    margin-top: 0;
}

.dash-access-log-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.dash-access-log-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dash-access-log-select {
    font: inherit;
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
}

/** Show ~5 rows; remainder scrolls (tune --dash-access-log-row-est if needed) */
.dash-access-log-scroll {
    --dash-access-log-row-est: 2.65rem;
    flex: none;
    max-height: calc(var(--dash-access-log-row-est) * 5);
    overflow-y: auto;
    margin-top: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.2);
}

.dash-access-log-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.86rem;
    text-align: left;
}

.dash-access-log-row:last-child {
    border-bottom: none;
}

.dash-access-log-name {
    font-weight: 600;
}

.dash-access-log-meta {
    font-size: 0.82rem;
    opacity: 0.82;
    word-break: break-word;
}

.dash-presence-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
}

.dash-presence-line {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.dash-presence-wifi-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.dash-presence-wifi-dot--on {
    background: #3d9a56;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.dash-presence-wifi-dot--off {
    background: #c44;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.dash-presence-wifi-dot--unk {
    background: #666;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.dash-presence-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

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

.dash-presence-btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font: inherit;
    font-size: 0.8rem;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
}

.dash-presence-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dash-presence-btn-danger {
    border-color: rgba(235, 90, 90, 0.45);
    background: rgba(235, 90, 90, 0.18);
}

.dash-presence-btn-danger:hover {
    background: rgba(235, 90, 90, 0.28);
}

.dash-presence-confirm {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.dash-presence-row.is-confirming-delete .dash-presence-confirm {
    display: inline-flex;
}

.dash-presence-row.is-confirming-delete [data-presence-delete-init] {
    display: none;
}

.dash-lamps-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1 1 200px;
    align-items: stretch;
}

.dash-lamps-group:empty {
    display: none;
}

.dash-toggle {
    flex: 1 1 140px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.dash-toggle:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.dash-toggle.is-on {
    border-color: rgba(255, 216, 74, 0.4);
    background: rgba(255, 216, 74, 0.1);
}

/** Read-only sensor rows — same shell as .dash-toggle, not interactive */
.dash-toggle.dash-toggle-readonly {
    cursor: default;
    pointer-events: none;
    user-select: none;
}

.dash-toggle.dash-toggle-readonly:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.dash-toggle-label {
    font-size: 14px;
    font-weight: 600;
}

.dash-toggle-state {
    font-size: 12px;
    color: rgba(233, 237, 243, 0.55);
}

.dash-toggle.is-on .dash-toggle-state {
    color: rgba(255, 230, 160, 0.95);
}

.dash-controls-msg {
    font-size: 12px;
    margin: 10px 0 0;
    min-height: 1.2em;
}

.dash-controls-msg.is-ok {
    color: rgba(130, 220, 160, 0.9);
}

.dash-controls-msg.is-error {
    color: rgba(255, 180, 140, 0.95);
}

.dash-projects-empty {
    margin-top: 8px;
}

/* Web Push (Account) */
.account-push-block {
    grid-column: 1 / -1;
}

.account-push-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
