.rooms-brand {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.rooms-nav-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  text-decoration: none;
}

.rooms-page > .topbar > .topbar-inner,
.rooms-shell { max-width: 1080px; }

.rooms-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

#rooms-create-back {
  gap: 5px;
  min-height: 42px;
  color: var(--ink);
  justify-self: start;
}

#rooms-create-form input::placeholder { color: var(--muted); opacity: .9; }

.rooms-section h1 {
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rooms-muted, .rooms-section > p {
  color: var(--muted);
}

.rooms-back {
  display: inline-block;
  width: fit-content;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  text-underline-offset: 3px;
}

.rooms-section, .rooms-stack, .rooms-fieldset, .rooms-form {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.rooms-section { padding: 16px 18px; }
.rooms-section h2 { font-size: 17px; }
.rooms-section > p, .rooms-fieldset > p { font-size: 13px; }

.rooms-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 13rem);
  align-items: end;
  gap: 8px;
}

.rooms-fieldset { margin: 0; padding: 0; border: 0; }
.rooms-fieldset legend { margin-bottom: 4px; padding: 0; font-size: 13px; font-weight: 650; }
.rooms-hours-note { margin-inline-start: 8px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.rooms-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.rooms-hours select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: 16px;
  font-weight: 500;
}

.rooms-hours-timeline { display: none; }

@media (min-width: 600px) and (pointer: fine) {
  .has-room-hours .rooms-hours-selects { display: none; }

  .rooms-hours-timeline {
    display: block;
    padding: 0 44px 58px;
    user-select: none;
  }

  .rooms-hours-ticks {
    position: relative;
    height: 16px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }

  .rooms-hours-ticks > * {
    position: absolute;
    inset-inline-start: var(--hours-position);
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .rooms-hours-track {
    position: relative;
  }

  .rooms-hours-grid { pointer-events: none; }

  .rooms-hours-handle {
    --hours-handle-inset: 2px;
    position: absolute;
    inset-block: 0 -27px;
    inset-inline-start: calc(var(--hours-position) - var(--hours-handle-inset));
    width: 18px;
    border-radius: 3px;
    color: var(--accent);
    cursor: ew-resize;
    touch-action: none;
  }

  .rooms-hours-handle::before {
    position: absolute;
    z-index: 1;
    inset-block: 0 14px;
    inset-inline-start: var(--hours-handle-inset);
    width: 3px;
    border-radius: 2px;
    background: currentColor;
    content: "";
    pointer-events: none;
    transform: translateX(-50%);
  }

  .rooms-hours-handle[data-hours-handle="startSlot"] {
    inset-inline: auto calc(100% - var(--hours-position) - var(--hours-handle-inset));
  }

  .rooms-hours-handle[data-hours-handle="startSlot"]::before {
    inset-inline: auto var(--hours-handle-inset);
    transform: translateX(50%);
  }

  .rooms-hours-track[data-stacked-labels] .rooms-hours-handle[data-hours-handle="endSlot"] {
    inset-block-end: -55px;
  }

  .rooms-hours-handle-label {
    position: absolute;
    z-index: 2;
    inset-block-end: 0;
    inset-inline-start: var(--hours-handle-inset);
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--accent);
    color: var(--panel);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    transform: translateX(-50%);
  }

  .rooms-hours-handle[data-hours-handle="startSlot"] .rooms-hours-handle-label {
    inset-inline: auto var(--hours-handle-inset);
    transform: translateX(50%);
  }

  .rooms-hours-handle [data-hours-time] { font-variant-numeric: tabular-nums; }
  .rooms-hours-handle:hover { color: var(--accent-hover); }
  .rooms-hours-handle:hover .rooms-hours-handle-label { background: var(--accent-hover); }
  .rooms-hours-handle:focus-visible .rooms-hours-handle-label { outline: 2px solid var(--focus); outline-offset: 2px; }

  @media (forced-colors: active) {
    .rooms-hours-handle-label { border: 1px solid ButtonText; }
    .rooms-hours-handle::before { forced-color-adjust: none; background: ButtonText; }
  }
}

.rooms-theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rooms-theme-choice {
  position: relative;
}

.rooms-theme-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.rooms-theme-swatch {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--room-theme-background, var(--paper));
  color: var(--room-list-text, var(--accent));
}

.rooms-theme-swatch::before {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.rooms-theme-choice input:checked + span { border-color: currentColor; }

.rooms-theme-choice input:checked + span::after {
  grid-area: 1 / 1;
  width: 7px;
  height: 12px;
  border: solid var(--room-theme-background, var(--paper));
  border-width: 0 2px 2px 0;
  content: "";
  transform: translateY(-1px) rotate(45deg);
}

.rooms-theme-choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
fieldset:disabled .rooms-theme-choice input { cursor: default; }

@media (forced-colors: active) {
  .rooms-theme-choice input:checked + span { border-color: Highlight; }
  .rooms-theme-swatch::before { border: 1px solid CanvasText; }
  .rooms-theme-choice input:checked + span::after { border-color: CanvasText; }
}

.rooms-title-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rooms-title-field > .rooms-name-input { flex: 1; }
.rooms-title-field > #rooms-name-suffix { flex: none; }

.rooms-title-field > .rooms-name-input[aria-invalid="true"] { border-color: #9f2336; }

.rooms-name-error {
  color: #9f2336;
  font-size: 12px;
  font-weight: 500;
}

.rooms-name-error:not(:empty) { margin-block-start: 4px; }

.rooms-name-field {
  position: relative;
  display: block;
  min-inline-size: 0;
}

.rooms-name-field .rooms-name-input { padding-inline-end: 6rem; }
.rooms-name-input:not(:focus) { text-overflow: ellipsis; }

.rooms-name-limit {
  position: absolute;
  inset-inline-end: 10px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  pointer-events: none;
}

.rooms-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 8px;
}

.rooms-actions button, .rooms-save-row > button { min-height: 44px; }

.rooms-save-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.rooms-save-result {
  max-block-size: 44px;
  overflow-y: auto;
  font-size: 13px;
}

.rooms-reload {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rooms-reload:focus-visible { outline-offset: -1px; }

.rooms-invite-policy {
  display: flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.rooms-invite-policy input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

#room-invitation-policy-feedback {
  display: block;
  block-size: 2.8em;
  overflow-y: auto;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rooms-members-list {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.rooms-members-list > li:not(.rooms-group-create-row), .rooms-group-create {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.rooms-member-info { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.rooms-member-name, .rooms-member-name > .member-name-text { display: block; }
.rooms-remove-member-name {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
}

.rooms-member-role { flex: none; color: var(--muted); font-size: 12px; }
.rooms-leave-note { margin-top: 4px; block-size: 3.2em; overflow-y: auto; }
.rooms-member-role-button { min-inline-size: 10em; white-space: nowrap; }
.rooms-members-list > li:not(.rooms-group-create-row) > button { min-height: 44px; flex-shrink: 0; }
.rooms-members-list .rooms-actions { flex-shrink: 0; }
.rooms-group-controls {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.rooms-group-controls h3 { font-size: 15px; }
.rooms-group-controls > p { font-size: 13px; }

#room-groups-list > [data-group] > :first-child {
  flex: 1 1 auto;
  min-inline-size: 0;
  max-inline-size: 100%;
}

#room-groups-list .schedule-name { display: block; }
#room-group-delete-description { overflow-wrap: anywhere; }

.rooms-group-create {
  width: 100%;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  text-align: start;
}
.rooms-group-create:hover { background: var(--paper); }

.rooms-group-members {
  display: grid;
  gap: 2px;
  max-block-size: min(260px, 38dvh);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rooms-group-members label {
  display: flex;
  min-block-size: 40px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.rooms-group-members label:hover { background: var(--paper); }
.rooms-group-members input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.rooms-group-dialog-actions { justify-content: flex-end; }
.rooms-feedback:empty:not(.rooms-feedback-slot) { display: none; }
.rooms-feedback {
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.rooms-feedback-slot { block-size: 2.8em; overflow-y: auto; }
.rooms-feedback[data-error="true"] { color: #9f2336; }
.rooms-centered-dialog { text-align: center; }
.rooms-centered-dialog .settings-confirm-actions { justify-content: center; }
.rooms-centered-dialog .settings-confirm-actions > button { min-inline-size: 6.5em; }

.rooms-start {
  max-width: 720px;
  gap: 12px;
  margin-top: clamp(8px, 4vw, 38px);
  padding: clamp(18px, 5vw, 40px);
}

.rooms-start h1 {
  font-size: clamp(23px, 5vw, 35px);
  line-height: 1.4;
}

.rooms-start > p { font-size: 14px; }
.rooms-start .rooms-nav-link { min-height: 44px; }

@media (max-width: 480px) {
  .rooms-section:not(.rooms-start) { padding: 12px; }
  .rooms-nav-link { min-height: 42px; }
  .rooms-inline-form { grid-template-columns: minmax(0, 1fr); }
  .rooms-members-list > li:not(.rooms-group-create-row) { align-items: flex-start; flex-direction: column; }
}

.rooms-embed { min-width: 0; }
.rooms-embed .topbar,
.rooms-embed #rooms-error-back { display: none; }

.rooms-embed .rooms-shell { width: 100%; padding: clamp(12px, 4vw, 21px); }
.rooms-embed .rooms-start { margin-top: 0; padding: 12px; }
.rooms-embed #rooms-error { margin: 0; }
