:root {
  color-scheme: light;
  --bg: oklch(0.975 0.014 255);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.952 0.018 255);
  --surface-3: oklch(0.985 0.012 88);
  --ink: oklch(0.19 0.055 267);
  --muted: oklch(0.41 0.04 262);
  --line: oklch(0.86 0.018 252);
  --brand: #000c84;
  --brand-soft: oklch(0.94 0.045 267);
  --brand-ink: oklch(0.99 0.004 255);
  --accent: #f8ae31;
  --warn: #f8ae31;
  --danger: #d61c21;
  --success: #5aa232;
  --info: oklch(0.48 0.14 255);
  --shadow: 0 4px 8px rgb(0 12 132 / 8%);
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in oklch, var(--accent), transparent 82%), transparent 310px),
    linear-gradient(180deg, var(--bg), oklch(0.955 0.016 255));
  color: var(--ink);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100svh;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 104px;
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: clamp(112px, 23vw, 156px);
  height: auto;
  flex: 0 0 auto;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklch, var(--surface), var(--brand-soft) 28%);
  padding: 6px;
  box-shadow: var(--shadow);
}

.mode-tab {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 66px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 10px 11px;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.mode-tab strong,
.mode-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tab strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.1;
}

.mode-tab span {
  font-size: 0.76rem;
  font-weight: 750;
  white-space: normal;
}

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

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

.mode-tab:active,
.tab:active,
.primary-button:active,
.ghost-button:active,
.status-button:active {
  transform: translateY(1px);
}

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

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

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

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,
.cleaning-editor input,
.cleaning-editor textarea,
.cleaning-share-panel textarea,
.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: var(--radius);
  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,
.cleaning-editor input:focus,
.cleaning-editor textarea:focus,
.cleaning-share-panel textarea: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;
}

.analysis-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 4px;
  margin-bottom: 12px;
}

.cleaning-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

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

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

.analysis-summary .metric {
  min-height: 68px;
  box-shadow: none;
}

.analysis-summary .metric strong {
  font-size: 1.12rem;
  line-height: 1.15;
}

.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: var(--radius);
  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.31 0.11 58);
}

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

.pill.info {
  background: color-mix(in oklch, var(--brand), white 88%);
  color: var(--brand);
}

.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;
}

.room-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

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

.ses-panel {
  grid-template-columns: 1fr;
}

.ses-card .actions {
  gap: 6px;
}

.ses-note {
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  padding: 9px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.public-checkin .mode-switch,
.public-checkin .tabbar,
.public-checkin .date-picker {
  display: none;
}

.public-checkin .app-shell {
  max-width: 760px;
  padding-bottom: 28px;
}

.traveler-establishment {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 13px;
}

.traveler-establishment h3,
.traveler-establishment p {
  margin: 0;
}

.traveler-establishment p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.checkin-form .checkbox-row,
.settings-panel .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink);
}

.checkin-form .checkbox-row input,
.settings-panel .checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}

.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;
}

.cleaning-panel {
  margin-bottom: 12px;
}

.cleaning-detail-lines {
  display: grid;
  gap: 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.cleaning-detail-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cleaning-detail-line strong {
  color: var(--ink);
}

.cleaning-editor {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.cleaning-editor summary {
  min-height: 34px;
  cursor: pointer;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 850;
}

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

.cleaning-editor label,
.cleaning-notes {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cleaning-editor span,
.cleaning-notes span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.cleaning-notes {
  margin-top: 9px;
}

.cleaning-share-panel {
  margin-bottom: 12px;
}

.cleaning-share-panel h3 {
  margin-top: 0;
}

.cleaning-share-panel textarea {
  width: 100%;
  resize: vertical;
  font-size: 0.88rem;
  line-height: 1.4;
}

.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: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 7px;
  font-size: 0.76rem;
  font-weight: 850;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.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.31 0.11 58);
}

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

.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: color-mix(in oklch, var(--surface), var(--surface-3) 35%);
  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: var(--radius);
  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: 8px;
  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-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.availability-note,
.availability-booking {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  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;
}

.rental-analysis-card,
.rental-invoice-card {
  gap: 12px;
}

.rental-profit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profit-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px 10px;
}

.profit-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.profit-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.rental-mini-calendar {
  display: grid;
  gap: 10px;
}

.calendar-month {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface-2), white 48%);
}

.calendar-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-month-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: capitalize;
}

.calendar-month-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.calendar-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-day {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
}

.calendar-day.reserved {
  border-color: rgb(20 46 52 / 18%);
  background: var(--day-color);
  color: oklch(0.20 0.025 210);
}

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

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

.calendar-day.empty {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

.rental-bookings {
  display: grid;
  gap: 7px;
}

.rental-booking-row summary {
  line-height: 1.3;
}

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

.invoice-party {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.invoice-party span,
.invoice-concept-row span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.invoice-party strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.invoice-party p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.invoice-concepts {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.invoice-concept-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
}

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

.invoice-concept-row strong,
.invoice-concept-row b {
  color: var(--ink);
}

.invoice-concept-row.deduction b {
  color: var(--danger);
}

.invoice-concept-row.total {
  background: var(--brand-soft);
}

.invoice-concept-row.total strong,
.invoice-concept-row.total b {
  font-size: 1rem;
  font-weight: 900;
}

.invoice-reservations {
  display: grid;
  gap: 7px;
}

.invoice-registry {
  display: grid;
  gap: 7px;
}

.invoice-registry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(116px, 150px);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.invoice-registry-row strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.15;
}

.invoice-registry-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.25;
}

.invoice-registry-row b {
  color: var(--ink);
  font-size: 0.9rem;
  white-space: nowrap;
}

.invoice-status-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 850;
}

.payment-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.payment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 850;
}

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

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

.rental-deposit-alert {
  border-color: color-mix(in oklch, var(--warn), var(--line) 42%);
  background: color-mix(in oklch, var(--warn), white 90%);
}

.rental-deposit-alert p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
}

.rental-deposit-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.rental-cost-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rental-cost-editor label {
  display: grid;
  gap: 4px;
}

.rental-cost-editor span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.rental-cost-editor input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
  font-weight: 850;
}

.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: var(--radius);
  border: 1px solid transparent;
  padding: 10px 13px;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.primary-button:hover,
.mode-tab.active:hover,
.tab.active:hover {
  background: color-mix(in oklch, var(--brand), black 10%);
}

.inline-button {
  width: auto;
  min-width: 128px;
}

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

.ghost-button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-button:hover,
.icon-button:hover,
.status-button:hover,
.tab:hover,
.mode-tab:hover {
  border-color: color-mix(in oklch, var(--brand), white 55%);
  background: color-mix(in oklch, var(--brand-soft), white 32%);
}

.ghost-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.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: var(--radius);
  background: color-mix(in oklch, var(--warn), white 84%);
  color: oklch(0.31 0.11 58);
  padding: 11px 12px;
  font-weight: 750;
}

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

.import-status {
  margin: 0;
  border-radius: var(--radius);
  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.31 0.11 58);
}

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

.invoice-settings {
  margin-top: 12px;
}

.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(auto-fit, minmax(86px, 1fr));
  gap: 4px;
  max-width: 940px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklch, var(--surface), transparent 4%);
  padding: 5px;
  box-shadow: 0 6px 14px rgb(0 12 132 / 14%);
}

.tab {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

@media (min-width: 760px) {
  .app-shell {
    padding-top: 24px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .topbar {
    padding-bottom: 22px;
  }

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

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

  .rooms-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack {
    gap: 12px;
  }
}

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

  h1 {
    font-size: 1.42rem;
  }

  h2 {
    font-size: 1.12rem;
  }

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

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

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .brand-logo {
    width: 126px;
  }

  .date-picker {
    width: 100%;
  }

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

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

  .rental-profit-grid {
    grid-template-columns: 1fr;
  }

  .form-row,
  .availability-panel,
  .cleaning-edit-grid,
  .rental-cost-editor,
  .invoice-party-grid,
  .invoice-registry-row,
  .rooms-grid {
    grid-template-columns: 1fr;
  }

  .invoice-registry-row b {
    white-space: normal;
  }

  .tabbar {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  }
}

@media (max-width: 360px) {
  .mode-tab {
    min-height: 70px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .mode-tab strong {
    font-size: 0.9rem;
  }

  .mode-tab span {
    white-space: normal;
  }
}

@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);
    }
  }
}

.print-invoice-head {
  display: none;
}

.print-invoice-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  * {
    box-shadow: none !important;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: white !important;
    color: #111827 !important;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-shell {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .topbar,
  .mode-switch,
  .tabbar,
  .availability-panel,
  .invoice-settings,
  .invoice-registry-panel,
  .rental-property-card,
  .rental-analysis-card:not(.rental-invoice-card),
  .rental-invoice-card .actions,
  .rental-invoice-card .item-head,
  .view:not(#view-rental-analysis) {
    display: none !important;
  }

  #view-rental-analysis {
    display: block !important;
  }

  #view-rental-analysis .section-head {
    display: block;
    margin: 0 0 6mm;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 4mm;
  }

  #view-rental-analysis .section-head h2 {
    margin: 0 0 1.5mm;
    color: #111827;
    font-size: 18pt;
    line-height: 1.15;
  }

  #view-rental-analysis .section-head .subtle,
  .search-hint {
    color: #4b5563 !important;
    font-size: 9pt;
  }

  .analysis-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 3mm;
    margin: 0 0 5mm;
  }

  .analysis-summary .metric {
    min-height: 0;
    border: 1px solid #d1d5db;
    border-radius: 0;
    padding: 3mm;
    page-break-inside: avoid;
  }

  .analysis-summary .metric strong {
    color: #111827;
    font-size: 12pt;
  }

  .analysis-summary .metric span {
    color: #4b5563;
    font-size: 8pt;
  }

  .availability-results {
    display: block;
  }

  .rental-invoice-card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 5mm;
    border: 1px solid #d1d5db;
    border-radius: 0;
    background: white !important;
    padding: 5mm;
  }

  .print-invoice-head {
    display: grid;
    grid-template-columns: 1fr 1.35fr 0.75fr;
    gap: 4mm;
    margin-bottom: 4mm;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 3mm;
  }

  .print-invoice-head span,
  .profit-metric span,
  .pill {
    color: #4b5563 !important;
    font-size: 8pt;
  }

  .print-invoice-head strong {
    display: block;
    margin-top: 1mm;
    color: #111827;
    font-size: 10pt;
    overflow-wrap: anywhere;
  }

  .rental-profit-grid {
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 3mm;
  }

  .invoice-party-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4mm;
    margin-bottom: 4mm;
  }

  .invoice-party {
    border: 1px solid #d1d5db;
    border-radius: 0;
    background: white !important;
    padding: 3mm;
  }

  .invoice-party span,
  .invoice-concept-row span {
    color: #4b5563 !important;
    font-size: 8pt;
  }

  .invoice-party strong {
    color: #111827;
    font-size: 10pt;
  }

  .invoice-party p {
    color: #4b5563;
    font-size: 8pt;
  }

  .invoice-concepts {
    border: 1px solid #d1d5db;
    border-radius: 0;
    margin-bottom: 4mm;
  }

  .invoice-concept-row {
    grid-template-columns: 1fr 32mm;
    padding: 2.5mm 3mm;
  }

  .invoice-concept-row + .invoice-concept-row {
    border-top: 1px solid #e5e7eb;
  }

  .invoice-concept-row.total {
    background: #f3f4f6 !important;
  }

  .invoice-reservations {
    gap: 2mm;
  }

  .monthly-reservation-row {
    border: 1px solid #e5e7eb;
    border-radius: 0;
    background: white !important;
    padding: 2mm 3mm;
  }

  .profit-metric {
    border: 1px solid #e5e7eb;
    border-radius: 0;
    background: #f9fafb !important;
    padding: 3mm;
  }

  .profit-metric strong {
    color: #111827;
    font-size: 11pt;
  }

  .item-meta {
    gap: 2mm;
    margin-top: 3mm;
  }

  .pill {
    min-height: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    background: white !important;
    padding: 1mm 2mm;
    color: #111827 !important;
    font-size: 8pt;
  }
}
