:root {
  color-scheme: light;
  --bg: oklch(0.975 0.006 185);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.948 0.012 185);
  --ink: oklch(0.22 0.025 210);
  --muted: oklch(0.42 0.025 210);
  --line: oklch(0.86 0.012 190);
  --brand: oklch(0.42 0.085 185);
  --brand-ink: oklch(0.99 0.004 185);
  --warn: oklch(0.62 0.15 58);
  --danger: oklch(0.55 0.18 25);
  --success: oklch(0.48 0.12 150);
  --info: oklch(0.50 0.10 245);
  --shadow: 0 18px 50px rgb(20 46 52 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100svh;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 14px 92px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 2px 18px;
}

.kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.date-picker,
.search-box,
.availability-panel label,
.booking-form label,
.settings-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.date-picker input,
.search-box input,
.availability-panel input,
.availability-panel select,
.booking-form input,
.booking-form select,
.booking-form textarea,
.settings-panel input,
.settings-panel select,
.settings-panel textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.date-picker input:focus,
.search-box input:focus,
.availability-panel input:focus,
.availability-panel select:focus,
.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus,
.settings-panel input:focus,
.settings-panel select:focus,
.settings-panel textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand), transparent 78%);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.metric {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow);
}

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

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
}

.subtle {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.item,
.room-card,
.settings-panel,
.empty-state {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.item {
  display: grid;
  gap: 9px;
  padding: 13px;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.success {
  background: color-mix(in oklch, var(--success), white 82%);
  color: oklch(0.30 0.11 150);
}

.pill.warn {
  background: color-mix(in oklch, var(--warn), white 82%);
  color: oklch(0.34 0.10 58);
}

.pill.danger {
  background: color-mix(in oklch, var(--danger), white 84%);
  color: oklch(0.34 0.13 25);
}

.pill.info {
  background: color-mix(in oklch, var(--info), white 84%);
  color: oklch(0.32 0.10 245);
}

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

.room-card {
  min-height: 154px;
  padding: 13px;
}

.room-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.room-number strong {
  font-size: 1.6rem;
}

.room-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.room-card .room-name {
  margin-bottom: 5px;
  color: var(--ink);
  font-weight: 850;
}

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

.task-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.task-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  padding: 0 2px 8px;
}

.task-column-head h3 {
  margin: 0;
}

.task-column-head span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

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

.task-column-list .empty-state {
  box-shadow: none;
  padding: 16px 12px;
}

.cleaning-task {
  gap: 11px;
}

.status-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.status-button {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 7px;
  font-size: 0.76rem;
  font-weight: 850;
}

.status-button[aria-pressed="true"] {
  color: var(--ink);
  border-color: transparent;
}

.status-button.warn[aria-pressed="true"] {
  background: color-mix(in oklch, var(--warn), white 82%);
  color: oklch(0.34 0.10 58);
}

.status-button.info[aria-pressed="true"] {
  background: color-mix(in oklch, var(--info), white 84%);
  color: oklch(0.32 0.10 245);
}

.status-button.success[aria-pressed="true"] {
  background: color-mix(in oklch, var(--success), white 82%);
  color: oklch(0.30 0.11 150);
}

.rental-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.legend-item i {
  width: 12px;
  height: 12px;
  border: 1px solid rgb(20 46 52 / 18%);
  border-radius: 999px;
  background: var(--legend-color);
}

.rental-extra {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.rental-support {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.rental-support summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.rental-support div {
  margin-top: 8px;
}

.rental-support p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.rental-support p:last-child {
  margin-bottom: 0;
}

.availability-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.availability-panel > label:first-child,
.availability-panel > label:last-of-type,
.availability-panel .form-row,
.search-hint {
  grid-column: 1 / -1;
}

.search-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.availability-results {
  display: grid;
  gap: 10px;
}

.availability-card {
  overflow: hidden;
}

.rental-days {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rental-day {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid rgb(20 46 52 / 18%);
  border-radius: 7px;
  background: var(--day-color);
  color: oklch(0.20 0.025 210);
  font-size: 0.74rem;
  font-weight: 900;
}

.availability-notes {
  display: grid;
  gap: 7px;
}

.availability-note,
.availability-booking {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px 10px;
}

.availability-note summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.availability-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.availability-booking {
  display: grid;
  gap: 3px;
}

.availability-booking strong {
  overflow-wrap: anywhere;
}

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

.primary-button,
.ghost-button,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 13px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  background: var(--brand);
  color: var(--brand-ink);
}

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

.ghost-button.danger,
.icon-button.danger {
  color: var(--danger);
}

.booking-form {
  display: grid;
  gap: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-warning {
  margin: 0;
  border-radius: 8px;
  background: color-mix(in oklch, var(--warn), white 84%);
  color: oklch(0.34 0.10 58);
  padding: 11px 12px;
  font-weight: 750;
}

.import-status {
  margin: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 11px 12px;
  font-weight: 750;
  line-height: 1.35;
}

.import-status.success {
  background: color-mix(in oklch, var(--success), white 84%);
  color: oklch(0.30 0.11 150);
}

.import-status.warn {
  background: color-mix(in oklch, var(--warn), white 84%);
  color: oklch(0.34 0.10 58);
}

.settings-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  overflow: hidden;
}

.settings-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.35;
}

.empty-state {
  padding: 22px 16px;
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 6px;
  color: var(--muted);
}

.tabbar {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklch, var(--surface), transparent 8%);
  padding: 5px;
  box-shadow: 0 18px 60px rgb(20 46 52 / 18%);
}

.tab {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.tab.active {
  background: var(--brand);
  color: var(--brand-ink);
}

@media (max-width: 420px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
    padding-bottom: 156px;
  }

  h1 {
    font-size: 1.58rem;
  }

  h2 {
    font-size: 1.12rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-picker {
    width: 100%;
  }

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

  .form-row,
  .availability-panel,
  .rooms-grid {
    grid-template-columns: 1fr;
  }

  .tabbar {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .view.active {
    animation: view-in 160ms ease-out;
  }

  @keyframes view-in {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
