:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #111827;
  --muted: #6b7280;
  --line: #d9dee7;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #15803d;
  --danger: #dc2626;
  --warning: #b45309;
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --hover-bg: #eef2f7;
  --weekday-bg: #eef2f7;
  --calendar-hover: #f8fafc;
  --outside-bg: #f8fafc;
  --outside-text: #a1a8b3;
  --input-bg: #ffffff;
  --label: #374151;
  --inactive-bg: #f8fafc;
  --event-label-bg: rgba(255, 255, 255, 0.84);
  --event-label-text: #111827;
  --neutral-badge-bg: #eef2f7;
  --neutral-badge-text: #374151;
  --pill-bg: #ffffff;
  --pill-text: #374151;
  --modal-backdrop: rgba(15, 23, 42, 0.45);
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  --bg: #10131a;
  --surface: #171b24;
  --surface-alt: #202634;
  --text: #f3f6fb;
  --muted: #a5afbf;
  --line: #343c4d;
  --primary: #6b96ff;
  --primary-dark: #84aaff;
  --success: #22c55e;
  --danger: #f05252;
  --warning: #f59e0b;
  --topbar-bg: rgba(16, 19, 26, 0.94);
  --hover-bg: #252c3a;
  --weekday-bg: #202634;
  --calendar-hover: #1d2330;
  --outside-bg: #141923;
  --outside-text: #647086;
  --input-bg: #101722;
  --label: #d7deea;
  --inactive-bg: #141923;
  --event-label-bg: rgba(248, 250, 252, 0.9);
  --event-label-text: #111827;
  --neutral-badge-bg: #273244;
  --neutral-badge-text: #d8e0ee;
  --pill-bg: #101722;
  --pill-text: #d8e0ee;
  --modal-backdrop: rgba(2, 6, 14, 0.68);
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(22, 163, 74, 0.08), transparent 40%),
    var(--bg);
}

.auth-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand,
.topbar-title,
.user-menu,
.calendar-controls,
.view-toolbar,
.modal-header,
.modal-actions,
.color-row {
  display: flex;
  align-items: center;
}

.auth-brand {
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 8px solid #2563eb;
  border-top-color: #16a34a;
  border-right-color: #f59e0b;
  border-radius: 8px;
}

.brand-mark.small {
  width: 26px;
  height: 26px;
  border-width: 5px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
}

.topbar-title {
  gap: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.legend-toggle.is-active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.legend-panel {
  position: fixed;
  top: 78px;
  left: 22px;
  z-index: 35;
  width: min(520px, calc(100vw - 44px));
  max-height: calc(100vh - 90px);
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legend-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.legend-header.is-dragging {
  cursor: grabbing;
}

.legend-header button {
  cursor: pointer;
}

.legend-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.legend-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 166px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.legend-tabs {
  margin-bottom: 10px;
}

.legend-select-all,
.legend-filter-item,
.filter-row {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.legend-select-all {
  background: var(--surface);
}

.legend-filter-item.inactive {
  opacity: 0.66;
}

.legend-filter-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.legend-filter-text strong,
.legend-filter-text small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-filter-text small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.legend-item {
  display: grid;
  grid-template-columns: minmax(100px, 1.1fr) minmax(80px, 0.9fr) minmax(110px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.legend-item span,
.legend-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-item span:not(.swatch) {
  color: var(--muted);
  font-size: 0.88rem;
}

.tabs,
.segmented {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.tabs {
  justify-self: center;
}

.tab,
.segmented button,
.ghost-button,
.primary-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.tab,
.segmented button {
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
}

.tab.is-active,
.segmented button.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.primary-button,
.danger-button,
.ghost-button,
.icon-button {
  padding: 0 14px;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.danger-button {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.ghost-button,
.icon-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.ghost-button:hover,
.icon-button:hover {
  background: var(--hover-bg);
}

.icon-button {
  width: 38px;
  padding: 0;
  font-weight: 800;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
}

.theme-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.theme-icon::before,
.theme-icon::after {
  position: absolute;
  display: block;
  content: "";
}

.theme-icon::before {
  inset: 1px;
  border-radius: 999px;
  background: currentColor;
}

.theme-icon::after {
  top: -1px;
  left: 7px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
}

:root[data-theme="dark"] .theme-icon::before {
  inset: 5px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 -8px 0 -2px currentColor,
    0 8px 0 -2px currentColor,
    8px 0 0 -2px currentColor,
    -8px 0 0 -2px currentColor,
    6px 6px 0 -3px currentColor,
    -6px 6px 0 -3px currentColor,
    6px -6px 0 -3px currentColor,
    -6px -6px 0 -3px currentColor;
}

:root[data-theme="dark"] .theme-icon::after {
  display: none;
}

.user-menu {
  justify-content: end;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  max-width: 240px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-chip::before {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--user-color, #2563eb);
  content: "";
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.view-toolbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.view-toolbar h2,
.calendar-controls h2 {
  margin: 0;
  font-size: 1.3rem;
}

.toolbar-field {
  min-width: min(320px, 100%);
}

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

.calendar-controls {
  gap: 8px;
  flex-wrap: wrap;
}

.calendar {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.calendar-layout > .calendar {
  min-width: 0;
}

.calendar-filter-panel.is-hidden + .calendar {
  grid-column: 1 / -1;
}

.calendar-filter-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-filter-panel h3 {
  margin: 0;
  font-size: 0.95rem;
}

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

.weekday-row {
  border-bottom: 1px solid var(--line);
  background: var(--weekday-bg);
}

.weekday-row span {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-grid {
  grid-auto-rows: 190px;
}

.calendar.mode-day .weekday-row,
.calendar.mode-day .calendar-grid {
  grid-template-columns: minmax(0, 1fr);
}

.calendar.mode-week .calendar-grid {
  grid-auto-rows: 520px;
}

.calendar.mode-day .calendar-grid {
  grid-auto-rows: 640px;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-align: left;
}

.calendar-day:hover {
  background: var(--calendar-hover);
}

.calendar-day:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:nth-last-child(-n + 7) {
  border-bottom: none;
}

.calendar-day.outside {
  background: var(--outside-bg);
  color: var(--outside-text);
}

.calendar-day.today .day-number {
  color: #ffffff;
  background: var(--primary);
}

.day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 999px;
  font-weight: 750;
}

.day-events {
  display: grid;
  flex: 1 1 auto;
  gap: 5px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  align-content: start;
  grid-auto-rows: 28px;
  scrollbar-width: thin;
}

.reservation-event {
  display: flex;
  min-width: 0;
  height: 28px;
  align-items: center;
  border-radius: 0;
  background: var(--user-color, #2563eb);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.18);
  position: relative;
  z-index: 1;
}

.reservation-event.returned {
  background: #9ca3af;
  opacity: 0.72;
  filter: grayscale(0.55);
}

:root[data-theme="dark"] .reservation-event.returned {
  background: #6b7280;
  opacity: 0.7;
}

.reservation-placeholder {
  height: 28px;
  pointer-events: none;
  visibility: hidden;
}

.reservation-event.continues-before {
  margin-left: -8px;
}

.reservation-event.continues-after {
  margin-right: -8px;
}

.reservation-event.starts-here {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.reservation-event.ends-here {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.reservation-event span {
  min-width: 0;
  max-width: calc(100% - 8px);
  margin: 4px;
  overflow: hidden;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--event-label-text);
  background: var(--event-label-bg);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reservation-event .return-warning {
  position: relative;
  flex: 0 0 auto;
  width: 0;
  height: 0;
  max-width: none;
  margin: 0 8px 0 auto;
  overflow: visible;
  padding: 0;
  border-right: 10px solid transparent;
  border-bottom: 18px solid var(--danger);
  border-left: 10px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
}

.reservation-event .return-warning::after {
  content: "!";
  position: absolute;
  top: 4px;
  left: -3px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.surface,
.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.surface {
  padding: 18px;
}

.form-title {
  margin: 0;
  font-size: 1rem;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.compact {
  grid-template-columns: 150px minmax(0, 1fr);
}

label {
  display: grid;
  gap: 6px;
  color: var(--label);
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--input-bg);
}

select[multiple] {
  min-height: 146px;
  padding: 6px;
}

select[multiple] option {
  padding: 7px 8px;
  border-radius: 5px;
}

input[type="color"] {
  min-height: 42px;
  padding: 3px;
}

.checkbox-row {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.settings-form {
  max-width: 100%;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-panel {
  align-self: start;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-tile {
  display: grid;
  gap: 4px;
  min-height: 78px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-tile strong {
  font-size: 1.45rem;
  line-height: 1;
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.setting-admin-row {
  grid-template-columns: auto auto minmax(0, 1fr);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.setting-option-row {
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.setting-option-row input {
  margin-top: 1px;
}

.setting-option-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.setting-option-shell .ghost-button {
  align-self: center;
}

.setting-admin-row small,
.setting-option-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.list-item.inactive {
  background: var(--inactive-bg);
  opacity: 0.74;
}

.list-item-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.list-title {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.list-meta,
.details {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.history-list {
  display: grid;
  gap: 10px;
}

.active-reservations-admin {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.active-reservations-admin > .segmented,
.active-reservations-filters > .segmented {
  align-self: start;
  justify-self: start;
}

.active-reservations-filters {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}

.history-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.swatch,
.dual-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.18);
}

.dual-swatch {
  background: var(--user-color, #2563eb);
}

.conflict-badge {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  color: #7f1d1d;
  background: #fee2e2;
  font-size: 0.85rem;
  font-weight: 900;
}

:root[data-theme="dark"] .conflict-badge {
  color: #fecaca;
  background: #4a1717;
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--neutral-badge-text);
  background: var(--neutral-badge-bg);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-PENDING {
  color: #78350f;
  background: #fef3c7;
}

.status-APPROVED {
  color: #14532d;
  background: #dcfce7;
}

.status-REJECTED {
  color: #7f1d1d;
  background: #fee2e2;
}

.status-CANCELED {
  color: #374151;
  background: #e5e7eb;
}

:root[data-theme="dark"] .status-PENDING {
  color: #fde68a;
  background: #4a3512;
}

:root[data-theme="dark"] .status-APPROVED {
  color: #bbf7d0;
  background: #123820;
}

:root[data-theme="dark"] .status-REJECTED {
  color: #fecaca;
  background: #4a1717;
}

:root[data-theme="dark"] .status-CANCELED {
  color: #d8e0ee;
  background: #273244;
}

.availability-preview {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 24px;
}

.equipment-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 0.82rem;
}

.equipment-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-panel.small {
  width: min(460px, 100%);
}

.modal-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: #111827;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .tabs {
    justify-self: stretch;
    overflow-x: auto;
  }

  .user-menu,
  .view-toolbar {
    align-items: stretch;
    justify-content: start;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-filter-panel .checkbox-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  main {
    padding: 14px;
  }

  .auth-panel {
    padding: 20px;
  }

  .view-toolbar,
  .user-menu,
  .list-item-header {
    flex-direction: column;
  }

  .view-toolbar,
  .list-item-header {
    align-items: stretch;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .active-reservations-filters {
    grid-template-columns: 1fr;
  }

  .stats-summary {
    grid-template-columns: 1fr;
  }

  .setting-option-shell {
    grid-template-columns: 1fr;
  }

  .calendar-filter-panel .checkbox-list {
    grid-template-columns: 1fr;
  }

  .setting-option-shell .ghost-button {
    justify-self: end;
  }

  .calendar {
    overflow-x: auto;
  }

  .weekday-row,
  .calendar-grid {
    min-width: 760px;
  }

  .calendar.mode-day .weekday-row,
  .calendar.mode-day .calendar-grid {
    min-width: 0;
  }

  .calendar-grid {
    grid-auto-rows: 170px;
  }

  .legend-panel {
    top: 76px;
    left: 14px;
    width: calc(100vw - 28px);
  }

  .legend-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .legend-item span:not(.swatch) {
    grid-column: 1;
  }
}
