:root {
  --bg: #f3f5f3;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #1f2a2e;
  --muted: #69777b;
  --border: #dce3e1;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --blue: #1d4ed8;
  --blue-soft: #e8efff;
  --renew: #166534;
  --renew-soft: #dcfce7;
  --renew-soft-dark: #98b58c;
  --checkout: #c2410c;
  --checkout-soft: #ffedd5;
  --uncleaned: #5c686c;
  --uncleaned-soft: #eef1f1;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(31, 42, 46, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(220, 227, 225, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.topbar-subtitle {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.text-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button {
  width: 40px;
  flex: 0 0 40px;
  padding: 0;
  font-size: 18px;
}

.text-button {
  padding: 0 13px;
  gap: 5px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.text-button.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.text-button.danger {
  border-color: #f2c5c0;
  color: var(--danger);
  background: #fff7f6;
}

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

.page-content {
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
}

.section {
  margin-bottom: 16px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--uncleaned);
  background: var(--uncleaned-soft);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.online {
  color: var(--accent-dark);
  background: #dff5f1;
}

.status-pill.error {
  color: var(--danger);
  background: #feeceb;
}

.room-groups {
  display: grid;
  gap: 16px;
}

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

.room-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.room-group-header h2,
.room-group-header h3 {
  margin: 0;
  font-size: 15px;
}

.room-group-header span {
  color: var(--muted);
  font-size: 12px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  padding: 10px;
}

.room-card {
  position: relative;
  display: flex;
  min-height: 82px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--uncleaned-soft);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    transform 120ms ease,
    background 120ms ease;
}

.room-card:active {
  transform: scale(0.98);
}

.room-card[data-status="renew"] {
  border-color: #a7dfbd;
  background: var(--renew-soft);
}

.room-card[data-status="checkout"] {
  border-color: #fdba74;
  background: var(--checkout-soft);
}

.room-card[data-status="pending"] {
  border-color: #fda4af;
  background: #ffe4e6;
}

.room-card[data-status="done"] {
  border-color: #67e8f9;
  background: #cffafe;
}

.room-number {
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.room-meta {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.room-type {
  color: var(--muted);
  font-size: 11px;
}

.room-status {
  font-size: 12px;
  font-weight: 800;
}

.room-card[data-status="renew"] .room-status {
  color: var(--renew);
}

.room-card[data-status="checkout"] .room-status {
  color: var(--checkout);
}

.room-card[data-status="pending"] .room-status {
  color: #be123c;
}

.room-card[data-status="done"] .room-status {
  color: #0e7490;
}

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

.summary-card {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.summary-card.renew {
  border-color: #b7e3c6;
  background: var(--renew-soft);
}

.summary-card.checkout {
  border-color: #fed7aa;
  background: var(--checkout-soft);
}

.summary-card.pending {
  border-color: #fecdd3;
  background: #ffe4e6;
}

.summary-card.done {
  border-color: #a5f3fc;
  background: #cffafe;
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-value {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.summary-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.loading-block,
.empty-block,
.error-block {
  padding: 30px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

.error-block {
  color: var(--danger);
  background: #fff8f7;
}

.role-page {
  background:
    linear-gradient(180deg, #e7f3f1 0, #f3f5f3 190px, #f3f5f3 100%);
}

.role-page .topbar {
  background: rgba(247, 251, 250, 0.94);
}

.role-intro {
  padding: 22px 4px 16px;
}

.role-intro h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.role-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.role-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 86px;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(31, 42, 46, 0.05);
}

.role-card.cleaner {
  border-left: 4px solid var(--accent);
}

.role-card.frontdesk {
  border-left: 4px solid var(--blue);
}

.role-card.owner {
  border-left: 4px solid #b45309;
}

.role-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #dff5f1;
  font-size: 17px;
  font-weight: 800;
}

.role-card.frontdesk .role-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.role-card.owner .role-icon {
  color: #92400e;
  background: #fef3c7;
}

.role-card h2 {
  margin: 0;
  font-size: 16px;
}

.role-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chevron {
  color: #8b9699;
  font-size: 24px;
  line-height: 1;
}

.filter-panel {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.date-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-soft);
}

.preset-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.preset-row::-webkit-scrollbar {
  display: none;
}

.preset-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preset-button.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #dff5f1;
}

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

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

.day-summary {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.day-date {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.day-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.mini-count {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--uncleaned-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-count.renew {
  color: var(--renew);
  background: var(--renew-soft);
}

.mini-count.checkout {
  color: var(--checkout);
  background: var(--checkout-soft);
}

.mini-count.pending {
  color: #be123c;
  background: #ffe4e6;
}

.mini-count.done {
  color: #0e7490;
  background: #cffafe;
}

.mini-count.renew-cleaning {
  color: var(--renew);
  background: var(--renew-soft);
}

.mini-count.checkout-cleaning {
  color: var(--checkout);
  background: var(--checkout-soft);
}

.expand-icon {
  color: var(--muted);
  font-size: 20px;
  transition: transform 150ms ease;
}

.day-card.open .expand-icon {
  transform: rotate(180deg);
}

.day-detail {
  display: none;
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}

.day-card.open .day-detail {
  display: block;
}

.room-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 10px;
}

.room-detail {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  background: var(--surface-soft);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}

.room-detail strong {
  font-size: 14px;
}

.room-detail.renew span {
  color: var(--renew);
  font-weight: 700;
}

.room-detail.checkout span {
  color: var(--checkout);
  font-weight: 700;
}

.room-detail.pending span {
  color: #be123c;
  font-weight: 700;
}

.room-detail.done span {
  color: #0e7490;
  font-weight: 700;
}

.owner-event-list {
  display: grid;
  gap: 12px;
}

.owner-event {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.owner-event-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.owner-event-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-dark);
  background: #dff5f1;
  font-size: 14px;
  font-weight: 800;
}

.owner-event-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.owner-event-header strong {
  font-size: 14px;
}

.owner-event-header > div span {
  color: var(--muted);
  font-size: 11px;
}

.owner-event-badge {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.owner-event-badge.done {
  color: var(--renew);
  background: var(--renew-soft);
}

.owner-event-badge.pending {
  color: var(--checkout);
  background: var(--checkout-soft);
}

.owner-edit-field {
  margin-top: 14px;
}

.owner-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.owner-event-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.owner-event-options button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.owner-event-options button.selected.renew {
  color: var(--renew);
  background: var(--renew-soft);
  box-shadow: inset 0 0 0 1px #86ce9f;
}

.owner-event-options button.selected.checkout {
  color: var(--checkout);
  background: var(--checkout-soft);
  box-shadow: inset 0 0 0 1px #fdba74;
}

.owner-event-options button.selected.done {
  color: #0e7490;
  background: #cffafe;
  box-shadow: inset 0 0 0 1px #67e8f9;
}

.owner-event-options button.selected.pending {
  color: #be123c;
  background: #ffe4e6;
  box-shadow: inset 0 0 0 1px #fda4af;
}

.owner-delete-link {
  margin-top: 10px;
  padding: 8px 0 0;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.owner-add-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #b9c6c2;
  border-radius: 8px;
  background: var(--surface-soft);
}

.owner-add-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.owner-add-heading strong {
  font-size: 14px;
}

.owner-add-heading span {
  color: var(--muted);
  font-size: 11px;
}

.owner-add-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.owner-add-actions .text-button {
  min-height: 44px;
  border-color: #bfd4cf;
  background: #fff;
}

.owner-edit-sheet {
  height: min(90vh, 780px);
}

.owner-edit-sheet .sheet-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sheet-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: end;
  justify-content: center;
  background: rgba(16, 24, 26, 0.48);
}

.sheet-overlay.open {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: sheet-in 160ms ease-out;
}

@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #cad2d0;
}

.sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-heading h2 {
  margin: 0;
  font-size: 20px;
}

.sheet-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.choice-button {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.choice-button strong {
  display: block;
  font-size: 16px;
}

.choice-button span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.choice-button[data-outcome="renew"].selected {
  border-color: #64b985;
  background: var(--renew-soft);
  box-shadow: inset 0 0 0 1px #64b985;
}

.choice-button[data-outcome="checkout"].selected {
  border-color: #f68b45;
  background: var(--checkout-soft);
  box-shadow: inset 0 0 0 1px #f68b45;
}

.sheet-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 8px;
  margin-top: 16px;
}

.sheet-actions.single {
  grid-template-columns: minmax(0, 1fr);
}

.sheet-actions .text-button {
  min-height: 48px;
}

.sheet-clear {
  grid-column: 1 / -1;
}

.action-stack {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.action-button {
  display: flex;
  min-height: 76px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
}

.action-button strong {
  font-size: 17px;
}

.action-button span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.action-button.modify {
  border-color: #bfdbfe;
  background: var(--blue-soft);
}

.action-button.modify strong {
  color: var(--blue);
}

.action-button.checkout {
  border-color: #fdba74;
  background: var(--checkout-soft);
}

.action-button.checkout strong {
  color: var(--checkout);
}

.action-button.renew {
  border-color: #a7dfbd;
  background: var(--renew-soft);
}

.action-button.renew strong {
  color: var(--renew);
}

.cleaning-actions {
  margin-top: 16px;
}

.task-card {
  padding: 14px;
  border: 1px solid #5e826c;
  border-radius: 8px;
  background: var(--renew-soft-dark);
}

.task-card.checkout {
  border-color: #fdba74;
  background: var(--checkout-soft);
}

.task-card strong {
  display: block;
  font-size: 16px;
}

.task-card.checkout strong {
  color: var(--checkout);
}

.task-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.checkout-confirm {
  border-color: var(--checkout);
  color: #fff;
  background: var(--checkout);
}

.cleaning-record-grid {
  display: grid;
  gap: 10px;
}

.cleaning-record {
  padding: 13px;
  border: 1px solid #a7dfbd;
  border-radius: 8px;
  background: var(--renew-soft);
}

.cleaning-record.checkout {
  border-color: #fdba74;
  background: var(--checkout-soft);
}

.cleaning-record header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cleaning-record h3 {
  margin: 0;
  font-size: 15px;
}

.cleaning-record header span {
  color: var(--muted);
  font-size: 12px;
}

.room-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.room-number-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
}

.empty-inline {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 15px;
  border-radius: 8px;
  color: #fff;
  background: #243034;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #9f261d;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}


/* ---------- Access code gate ---------- */
body.access-locked .app-shell,
body.access-locked .sheet-overlay,
body.access-locked .toast {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

body.access-locked .app-shell {
  opacity: 0.35;
}

.access-code-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 26, 0.6);
  backdrop-filter: blur(6px);
}

.access-code-overlay.open {
  display: flex;
}

.access-code-card {
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.access-code-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 28px;
}

.access-code-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.access-code-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.access-code-field {
  display: block;
  text-align: left;
  margin-bottom: 16px;
}

.access-code-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.access-code-field input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.access-code-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.access-code-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.access-code-actions .text-button {
  min-height: 46px;
}

.access-code-error {
  margin: 0 0 6px;
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.access-code-foot {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

@media (min-width: 560px) {
  .page-content {
    padding-inline: 20px;
  }

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

  .room-grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

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

.business-shell {
  max-width: 1180px;
}

[data-mode="business"] .business-filter {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

[data-mode="business"] .business-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

[data-mode="business"] .summary-value {
  font-size: clamp(17px, 3.5vw, 28px);
  overflow-wrap: anywhere;
}

[data-mode="business"] .business-note {
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

[data-mode="business"] .business-room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

[data-mode="business"] .business-room-card {
  min-width: 0;
  min-height: 140px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

[data-mode="business"] .business-room-card.has-orders {
  border-top: 3px solid var(--accent);
}

[data-mode="business"] .business-room-card.is-empty {
  color: var(--muted);
  background: var(--surface-soft);
  border-style: dashed;
}

[data-mode="business"] .business-room-heading,
[data-mode="business"] .business-order-heading,
[data-mode="business"] .business-order-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

[data-mode="business"] .business-room-heading {
  align-items: start;
}

[data-mode="business"] .business-room-heading h3 {
  margin: 0;
  min-width: 0;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

[data-mode="business"] .business-room-badge {
  flex-shrink: 0;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--accent-dark);
  background: var(--renew-soft);
  font-size: 11px;
}

[data-mode="business"] .is-empty .business-room-badge {
  color: var(--muted);
  background: var(--uncleaned-soft);
}

[data-mode="business"] .business-room-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 0;
  font-size: 12px;
  color: var(--muted);
}

[data-mode="business"] .business-room-total strong {
  color: var(--accent-dark);
  font-size: 24px;
  overflow-wrap: anywhere;
}

[data-mode="business"] .business-room-total small {
  font-size: 11px;
  font-weight: normal;
}

[data-mode="business"] .is-empty .business-room-total strong {
  color: var(--muted);
}

[data-mode="business"] .business-order-card {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  overflow-wrap: anywhere;
}

[data-mode="business"] .business-order-card:last-child {
  padding-bottom: 0;
}

[data-mode="business"] .business-channel {
  color: var(--muted);
  font-size: 11px;
}

[data-mode="business"] .business-room-section {
  --room-bg: #eff6ff;
  --room-border: #93c5fd;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--room-border);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--room-bg);
}

[data-mode="business"] .business-room-section:nth-child(5n + 2) {
  --room-bg: #f0fdf4;
  --room-border: #86efac;
}

[data-mode="business"] .business-room-section:nth-child(5n + 3) {
  --room-bg: #f5f3ff;
  --room-border: #c4b5fd;
}

[data-mode="business"] .business-room-section:nth-child(5n + 4) {
  --room-bg: #fffbeb;
  --room-border: #fcd34d;
}

[data-mode="business"] .business-room-section:nth-child(5n + 5) {
  --room-bg: #ecfeff;
  --room-border: #67e8f9;
}

[data-mode="business"] .business-room-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

[data-mode="business"] .business-room-section-heading h4 {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

[data-mode="business"] .business-room-section-heading .business-channel {
  flex-shrink: 0;
}

[data-mode="business"] .business-room-section .business-order-card {
  border-top: 0;
}

[data-mode="business"] .business-room-section .business-order-card + .business-order-card {
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

[data-mode="business"] .business-room-section.has-overdue .business-room-section-heading h4,
[data-mode="business"] .business-order-card.is-overdue,
[data-mode="business"] .business-order-card.is-overdue .business-channel,
[data-mode="business"] .business-order-card.is-overdue .business-order-money,
[data-mode="business"] .business-overdue-badge {
  color: var(--danger);
}

[data-mode="business"] .business-room-section .business-order-card.is-overdue {
  padding-left: 10px;
  border-left: 3px solid var(--danger);
}

[data-mode="business"] .business-overdue-badge {
  font-weight: 700;
}

[data-mode="business"] .business-order-money {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

[data-mode="business"] .business-order-footer {
  flex-wrap: wrap;
  margin-top: 10px;
}

[data-mode="business"] .business-order-footer .text-button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

[data-mode="business"] .business-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

[data-mode="business"] .business-adjustments {
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 12px;
}

[data-mode="business"] .business-adjustment > span:first-child {
  flex-shrink: 0;
}

[data-mode="business"] .business-adjustment > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

[data-mode="business"] .business-adjustment {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  white-space: pre-wrap;
}

[data-mode="business"] .business-negative,
[data-mode="business"] .business-edit-error {
  color: var(--danger);
}

[data-mode="business"] .business-edit-sheet {
  max-height: 90vh;
  overflow-y: auto;
}

[data-mode="business"] .business-entry {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

[data-mode="business"] .business-entry input {
  width: 100%;
  min-width: 0;
}

[data-mode="business"] .business-edit-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  [data-mode="business"] .business-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  [data-mode="business"] .business-room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  [data-mode="business"] .business-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-mode="business"] .business-summary .summary-card:last-child {
    grid-column: 1 / -1;
  }

  [data-mode="business"] .business-entry {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  [data-mode="business"] .business-remark-field {
    grid-column: 1;
    grid-row: 2;
  }

  [data-mode="business"] .business-entry button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 380px) {
  [data-mode="business"] .business-room-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-mode="bill"] [hidden] {
  display: none !important;
}

[data-mode="bill"] .bill-shell {
  max-width: 960px;
}

[data-mode="bill"] .section > h2 {
  font-size: 17px;
  margin: 0 0 14px;
}

[data-mode="bill"] .bill-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 16px;
}

[data-mode="bill"] .bill-account-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid #cfe1d6;
  border-radius: 16px;
  background: #f0f7f2;
}

[data-mode="bill"] .bill-account-card:last-child {
  border-color: #d5e1eb;
  background: #f2f6fa;
}

[data-mode="bill"] .bill-account-card strong {
  font-size: clamp(21px, 3.5vw, 34px);
  color: #244535;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-total-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px;
  color: #566b5e;
}

[data-mode="bill"] .bill-main-action {
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  font-size: 17px;
}

[data-mode="bill"] .bill-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px;
  border: 1px solid #dce6df;
  border-radius: 14px;
  background: #edf3ef;
}

[data-mode="bill"] .bill-nav a {
  text-align: center;
  padding: 12px 6px;
  border-radius: 10px;
  color: #627368;
}

[data-mode="bill"] .bill-nav a.active {
  background: #fff;
  color: #205e40;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 65, 43, 0.07);
}

[data-mode="bill"] .bill-alert,
[data-mode="bill"] .bill-save-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-alert {
  background: #fff3e7;
  color: #8b481d;
  border: 1px solid #efcfaa;
}

[data-mode="bill"] .bill-alert p {
  margin: 4px 0 0;
  font-size: 13px;
}

[data-mode="bill"] .bill-save-result {
  background: #eef7ef;
  color: #246240;
}

[data-mode="bill"] .bill-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

[data-mode="bill"] .bill-wide {
  grid-column: 1 / -1;
}

[data-mode="bill"] .field {
  min-width: 0;
}

[data-mode="bill"] .field input,
[data-mode="bill"] .field select,
[data-mode="bill"] .field textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9e1dc;
  border-radius: 12px;
  font: inherit;
  color: #263b30;
  background: #fff;
  box-sizing: border-box;
}

[data-mode="bill"] textarea {
  resize: vertical;
}

[data-mode="bill"] .bill-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

[data-mode="bill"] .bill-choice legend {
  margin-bottom: 10px;
  font-size: 14px;
  color: #53695c;
}

[data-mode="bill"] .bill-choice label {
  position: relative;
  cursor: pointer;
}

[data-mode="bill"] .bill-choice input {
  position: absolute;
  opacity: 0;
}

[data-mode="bill"] .bill-choice span {
  display: block;
  text-align: center;
  border: 1px solid #d9e1dc;
  border-radius: 10px;
  padding: 12px;
  background: #f6f8f6;
}

[data-mode="bill"] .bill-choice input:checked + span {
  color: #205e40;
  font-weight: 700;
  border-color: #548d6c;
  background: #edf7ef;
}

[data-mode="bill"] .bill-choice input:focus-visible + span {
  outline: 2px solid #548d6c;
  outline-offset: 2px;
}

[data-mode="bill"] .bill-choice input:disabled + span {
  opacity: 0.6;
  cursor: not-allowed;
}

[data-mode="bill"] button:disabled,
[data-mode="bill"] input:disabled,
[data-mode="bill"] select:disabled,
[data-mode="bill"] textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

[data-mode="bill"] .bill-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

[data-mode="bill"] .bill-note,
[data-mode="bill"] .bill-id {
  color: #6b7b72;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-error {
  color: #b42318;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

[data-mode="bill"] .bill-error:empty {
  display: none;
}

[data-mode="bill"] .bill-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

[data-mode="bill"] .bill-summary-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-mode="bill"] #bill-calculation {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-mode="bill"] .bill-summary > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: #f3f7f4;
  min-width: 0;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-summary span {
  font-size: 13px;
  color: #6b7b72;
}

[data-mode="bill"] .bill-record {
  padding: 16px;
  margin: 12px 0;
  border: 1px solid #dce6df;
  border-radius: 16px;
  background: #fff;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-record-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

[data-mode="bill"] .bill-record-button {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 120ms ease;
}

[data-mode="bill"] .bill-record-button:hover,
[data-mode="bill"] .bill-record-button:focus-visible {
  border-color: #7ba88d;
}

[data-mode="bill"] .bill-record-button .bill-record-heading {
  width: 100%;
}

[data-mode="bill"] .bill-record-purpose {
  flex: 1;
  min-width: 100px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-weight: 600;
}

[data-mode="bill"] .bill-record-meta {
  font-size: 13px;
  color: #5c7365;
}

[data-mode="bill"] .bill-balance-chain {
  font-weight: 600;
  color: #40584a;
}

[data-mode="bill"] .bill-description {
  white-space: pre-wrap;
  line-height: 1.6;
}

[data-mode="bill"] .bill-increase {
  color: #18704a;
}

[data-mode="bill"] .bill-decrease {
  color: #b34f18;
}

[data-mode="bill"] .bill-badge {
  padding: 4px 8px;
  border-radius: 8px;
  color: #625080;
  background: #f2edf8;
  font-size: 12px;
}

[data-mode="bill"] .bill-pagination {
  justify-content: center;
  margin: 18px 0 6px;
}

[data-mode="bill"] .bill-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

[data-mode="bill"] .bill-chips button {
  border: 1px solid #d9e1dc;
  background: #f6f8f6;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}

[data-mode="bill"] .bill-chips button.active {
  background: #e8f3eb;
  border-color: #7ba88d;
  color: #205e40;
  font-weight: 600;
}

[data-mode="bill"] .bill-account-filter {
  margin-top: 16px;
}

[data-mode="bill"] .bill-compare-heading,
[data-mode="bill"] .bill-compare-row {
  display: grid;
  grid-template-columns: 48px minmax(80px, 1fr) minmax(112px, 1.3fr);
  gap: 12px;
  align-items: center;
}

[data-mode="bill"] .bill-compare-heading {
  font-size: 13px;
  color: #718277;
  padding-bottom: 10px;
}

[data-mode="bill"] .bill-compare-row {
  padding: 14px 0;
  border-top: 1px solid #e4ece6;
}

[data-mode="bill"] .bill-compare-row > span {
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[data-mode="bill"] details {
  margin-top: 18px;
}

[data-mode="bill"] summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
}

[data-mode="bill"] .bill-detail-sheet {
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

[data-mode="bill"].bill-modal-open {
  overflow: hidden;
}

[data-mode="bill"] .bill-preview {
  background: #f1f6f2;
  border-radius: 12px;
  padding: 14px;
  margin: 0;
  line-height: 1.7;
}

[data-mode="bill"] .bill-detail-amount {
  font-size: 30px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-detail-balances {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f4f7f4;
}

[data-mode="bill"] .bill-detail-balances div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-wrap: anywhere;
}

[data-mode="bill"] .bill-detail-balances span {
  font-size: 13px;
  color: #718277;
}

[data-mode="bill"] .bill-danger-action {
  color: #a14e24;
  border: 1px solid #ebd2c0;
  margin-top: 16px;
}

[data-mode="bill"] .bill-edit-time {
  float: right;
  color: #33704d;
  font-weight: 400;
}

[data-mode="bill"] #bill-reenter {
  margin: 16px 0;
}

@media (max-width: 640px) {
  [data-mode="bill"] .page-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  [data-mode="bill"] .bill-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70;
    margin: 0;
    border-radius: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: #f8fbf9;
    box-shadow: 0 -4px 20px rgba(31, 59, 40, 0.06);
  }

  [data-mode="bill"] .bill-balances {
    gap: 10px;
  }

  [data-mode="bill"] .bill-account-card {
    padding: 16px 12px;
  }

  [data-mode="bill"] .bill-summary > div {
    padding: 10px 8px;
    font-size: 13px;
  }

  [data-mode="bill"] .bill-compare-heading,
  [data-mode="bill"] .bill-compare-row {
    gap: 8px;
    grid-template-columns: 36px minmax(70px, 1fr) minmax(112px, 1.2fr);
    font-size: 13px;
  }

  [data-mode="bill"] .bill-compare-row input {
    padding: 10px 8px;
  }

  [data-mode="bill"] .bill-form {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-mode="bill"] .bill-record {
    padding: 12px;
  }
}
