:root {
    --bg: #ffffff;
    --surface: #f6f6f6;
    --surface-strong: #f2f2f2;
    --surface-muted: #fafafa;
    --text: #434343;
    --text-strong: #4b4b4b;
    --text-soft: #9d9d9d;
    --line: #ededed;
    --shadow: 0 8px 24px rgba(44, 44, 44, 0.12);
    --purple: #6236ff;
    --purple-soft: #f3eeff;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        "Aptos",
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    background: transparent;
    color: inherit;
}

.sideload {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    color: var(--text);
    text-align: center;
}

.auth-state {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(180deg, #fcfcfc 0%, #ffffff 64%);
}

.auth-state__card {
    width: 100%;
    max-width: 280px;
    padding: 28px 22px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(24, 24, 24, 0.1);
    text-align: center;
}

.auth-state__brand {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, #6f4dff 0%, #5027ee 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 0.88;
    letter-spacing: -0.03em;
}

.auth-state__title {
    margin: 0 0 10px;
    color: #444;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-state__message {
    margin: 0;
    color: #8f8f8f;
    font-size: 14px;
    line-height: 1.45;
}

.auth-state__button {
    min-width: 120px;
    min-height: 40px;
    margin-top: 18px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--purple);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sideload a {
    color: var(--purple);
}

.app {
    position: relative;
    min-height: 100vh;
    padding: 14px 14px 24px;
    background: linear-gradient(180deg, #fcfcfc 0%, #ffffff 64%);
}

.app__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.brand__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding-top: 2px;
    border-radius: 12px;
    background: linear-gradient(180deg, #6f4dff 0%, #5027ee 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.02em;
    box-shadow: 0 6px 12px rgba(98, 54, 255, 0.22);
}

.brand__title {
    margin: 0;
    color: #3f3f3f;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    cursor: pointer;
    color: #747474;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-button--ghost {
    width: 28px;
    height: 28px;
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-bottom: 14px;
    background: linear-gradient(180deg, rgba(252, 252, 252, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%);
    backdrop-filter: blur(8px);
}

.select {
    position: relative;
    margin-bottom: 10px;
    z-index: 2;
}

.select[data-open="true"] {
    z-index: 30;
}

.select__trigger,
.search {
    width: 100%;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 0 10px 0 11px;
    color: var(--text);
    cursor: pointer;
}

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

.select__icon,
.select__option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #6e6e6e;
}

.select__icon svg,
.select__option-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.select__label,
.select__meta {
    white-space: nowrap;
}

.select__label {
    font-size: 15px;
    font-weight: 500;
}

.select__meta {
    color: #a2a2a2;
    font-size: 12px;
    font-weight: 500;
}

.select__caret {
    display: inline-flex;
    align-items: center;
    color: #9e9e9e;
}

.select__caret svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.select[data-open="true"] .select__caret svg {
    transform: rotate(180deg);
}

.select__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 31;
    display: none;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.select[data-open="true"] .select__menu {
    display: block;
}

.select__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    cursor: pointer;
}

.select__option + .select__option {
    border-top: 1px solid var(--line);
}

.select__option.is-selected {
    background: #fafafa;
}

.search-row {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    background: #fff;
    box-shadow:
        0 4px 18px rgba(31, 31, 31, 0.1),
        inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.search:focus-within {
    box-shadow:
        0 6px 20px rgba(31, 31, 31, 0.12),
        inset 0 0 0 2px rgba(98, 54, 255, 0.28);
}

.search__icon {
    display: inline-flex;
    color: #a5a5a5;
}

.search__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #5e5e5e;
    background: transparent;
    font-size: 15px;
}

.search input::placeholder {
    color: #b9b9b9;
}

.search-row__filter {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(31, 31, 31, 0.1);
}

.search-row__dot {
    position: absolute;
    top: 3px;
    right: 4px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--purple);
}

.filter-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    width: min(100%, 258px);
    padding: 12px 14px 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(25, 25, 25, 0.16);
}

.filter-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.filter-panel__row + .filter-panel__row {
    border-top: 1px solid var(--line);
}

.filter-panel__row--time {
    padding-top: 0;
}

.filter-panel__label {
    color: #525252;
    font-size: 14px;
    font-weight: 600;
}

.time-pills {
    display: flex;
    gap: 8px;
}

.time-pills__pill,
.stepper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--surface);
    color: #8c8c8c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.time-pills__pill.is-active {
    color: #6b6b6b;
}

.time-pills__pill {
    cursor: default;
}

.filter-panel__action {
    width: 100%;
    justify-content: flex-start;
    color: #7f7f7f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.filter-panel__action-icon {
    display: inline-flex;
    margin-right: 8px;
    color: #999;
}

.filter-panel__action-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.stepper {
    justify-content: space-between;
    min-width: 58px;
    padding-right: 8px;
}

.stepper__arrows {
    display: inline-flex;
    color: #9c9c9c;
}

.stepper__arrows svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.filter-panel__tags {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.filter-panel__tags-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.filter-panel__clear {
    padding: 0;
    color: var(--purple);
    font-size: 14px;
    cursor: pointer;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-chip {
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: #7d7d7d;
    font-size: 12px;
    line-height: 24px;
    cursor: pointer;
}

.tag-chip.is-active {
    background: var(--purple);
    color: #fff;
}

.rooms {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group {
    overflow: hidden;
    border-radius: 14px;
}

.group.is-highlighted {
    background: #f7f7f7;
}

.group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 36px;
    padding: 0 2px;
    color: #8a8a8a;
    cursor: pointer;
}

.group__title {
    font-size: 15px;
    font-weight: 500;
}

.group__caret {
    display: inline-flex;
    color: #9e9e9e;
    transition: transform 0.2s ease;
}

.group__caret svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.group[data-collapsed="false"] .group__caret {
    transform: rotate(180deg);
}

.group__body {
    display: grid;
    gap: 2px;
    padding: 4px 0 6px;
}

.group[data-collapsed="true"] .group__body {
    display: none;
}

.room-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 60px;
    padding: 8px 0;
    text-align: left;
    border-radius: 14px;
}

.room-card--interactive {
    cursor: pointer;
}

.room-card--interactive:hover {
    background: rgba(98, 54, 255, 0.04);
}

.room-card.is-attached {
    background: rgba(98, 54, 255, 0.08);
}

.room-card__thumb {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2a3146 0%, #886d45 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.room-card__thumb[data-thumb="lisbon"] {
    background: linear-gradient(135deg, #3e1912 0%, #8e2a20 52%, #1d1d1d 100%);
}

.room-card__thumb[data-thumb="new-york"] {
    background: linear-gradient(135deg, #80631a 0%, #ce9b33 46%, #2e4e36 100%);
}

.room-card__thumb[data-thumb="paris"] {
    background: linear-gradient(135deg, #16253e 0%, #1d4675 58%, #6f8ead 100%);
}

.room-card__thumb[data-thumb="london"] {
    background: linear-gradient(135deg, #5a4a35 0%, #8b6f4b 54%, #d1b083 100%);
}

.room-card__thumb[data-thumb="riga"] {
    background: linear-gradient(135deg, #9f5521 0%, #d98d4e 50%, #f0c18c 100%);
}

.room-card__thumb--empty {
    display: grid;
    place-items: center;
    background: #ebebeb;
    color: #b8b8b8;
}

.room-card__thumb--empty svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.room-card__content {
    min-width: 0;
}

.room-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-card__name {
    margin: 0 0 2px;
    color: #535353;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.room-card__meta {
    margin: 0;
    color: #a0a0a0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.room-card__badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(98, 54, 255, 0.12);
    color: var(--purple);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
}

.room-card__capacity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 6px;
    color: #656565;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.room-card__capacity svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.empty-state {
    padding: 22px 0 8px;
    color: #9d9d9d;
    font-size: 14px;
}

.attach-error {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff3f3;
    color: #b64040;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 320px) {
    .brand__title {
        font-size: 19px;
    }

    .select__meta {
        display: none;
    }

    .filter-panel {
        width: 100%;
    }
}
