:root {
  --bg: #e7f0ea;
  --surface: #fff;
  --ink: #13261c;
  --muted: #5c7266;
  --line: #d3e3d9;
  --brand: #0e6a3a;
  --brand-deep: #084e2a;
  --on: #f3fff7;
  --soft: #c6ecd6;
  --empty: #e5f6ec;
  --empty-ink: #0d5c32;
  --busy: #fde8ea;
  --busy-ink: #9f1239;
  --soon: #fff3c4;
  --soon-ink: #8a5600;
  --over: #ffd6d6;
  --over-ink: #9f1212;
  --dirty: #e11d2e;
  --maint: #d5dae1;
  --maint-ink: #3a4450;
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; font-size: 21px; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, .btn, .room, nav a, .back { cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; }
a.btn, .back { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.app { width: 100%; min-height: 100dvh; margin: 0; padding: 0 0 6.6rem; }
.hero { background: var(--brand); color: var(--on); border-radius: 0; padding: 0.85rem 0.8rem 1rem; }
.back {
  width: auto;
  min-height: 3.2rem;
  margin: 0 0 0.7rem;
  padding: 0 1.1rem;
  border-radius: 1rem;
  background: #fff;
  color: var(--brand-deep);
  font-weight: 800;
  font-size: 1.05rem;
  border: 0;
  box-shadow: 0 4px 0 #06361e;
}
.back:active { transform: translateY(3px); box-shadow: 0 1px 0 #06361e; }
.hero h1 { margin: 0; font-size: 1.45rem; letter-spacing: 0.04em; }
.hero p { color: var(--soft); margin: 0.25rem 0 0; }
.grid { display: grid; gap: 0.55rem; padding: 0.7rem; }
.grid.hotel { grid-template-columns: repeat(5, 1fr); }
.grid.massage { grid-template-columns: repeat(2, 1fr); }
.grid.hotel .room { min-height: 6.4rem; padding: 0.45rem 0.15rem; }
.grid.hotel .room b { font-size: 1.35rem; }
.grid.hotel .room span { font-size: 0.72rem; }
.grid.massage .room { min-height: 9rem; }
.grid.massage .room b { font-size: 2.4rem; }
.room {
  min-height: 8.6rem;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.35rem;
  padding: 0.7rem 0.35rem;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  box-shadow: 0 5px 0 rgba(8, 40, 24, 0.18);
}
.room:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(8, 40, 24, 0.18); }
.room b { display: block; font-size: 2rem; line-height: 1; }
.room span { font-size: 0.92rem; font-weight: 650; }
.room.empty { background: var(--empty); color: var(--empty-ink); }
.room.busy { background: var(--busy); color: var(--busy-ink); }
.room.soon { background: var(--soon); color: var(--soon-ink); }
.room.over { background: var(--over); color: var(--over-ink); }
.room.dirty { background: var(--dirty); color: #fff; }
.room.hole {
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}
.pad { padding: 0 0.7rem; }
.card, form.card { background: var(--surface); border-radius: 1.4rem; padding: 1rem; margin: 0.75rem 0.7rem 0; box-shadow: 0 4px 0 rgba(8, 40, 24, 0.08); }
.login { max-width: 28rem; margin: 0.75rem auto; }
label { display: block; font-size: 1rem; font-weight: 650; margin-top: 0.7rem; }
label:has(input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.8rem;
  margin-top: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-radius: 1.05rem;
  border: 2px solid #b7d0c2;
  background: #f7fbf8;
  box-shadow: 0 4px 0 #c5d8cc;
}
label:has(input[type="radio"]:checked) {
  border-color: var(--brand);
  background: var(--empty);
  box-shadow: 0 4px 0 #8fbfa4;
}
input, select { width: 100%; min-height: 3.4rem; border: 2px solid #b7d0c2; border-radius: 1rem; padding: 0 0.9rem; margin-top: 0.3rem; font: inherit; font-size: 1.05rem; background: #fff; }
.btn {
  min-height: 4.4rem;
  border: 0;
  border-radius: 1.1rem;
  background: var(--brand);
  color: var(--on);
  font-weight: 800;
  font-size: 1.25rem;
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.75rem 0.8rem;
  box-shadow: 0 5px 0 #06361e;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #06361e; }
.btn.alt { background: var(--brand-deep); box-shadow: 0 5px 0 #042616; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid #b7d0c2; box-shadow: 0 5px 0 #c5d8cc; }
.btn.warn { background: var(--dirty); color: #fff; box-shadow: 0 5px 0 #8d1020; }
nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0.4rem;
  background: #e7f0ea;
  border-top: 0;
  z-index: 5;
  padding: 0.45rem 0.45rem 0.55rem;
}
nav a {
  flex: 1;
  text-align: center;
  min-height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  background: #fff;
  border-radius: 1rem;
  border: 2px solid #d3e3d9;
  box-shadow: 0 4px 0 #c5d8cc;
}
nav a.on { background: var(--brand); color: var(--on); border-color: var(--brand-deep); box-shadow: 0 4px 0 #06361e; }
nav a:active { transform: translateY(3px); box-shadow: 0 1px 0 #c5d8cc; }
.err { color: var(--over-ink); font-weight: 700; }
.row { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; }
.row .btn { width: auto; flex: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.7rem 0.4rem; }
.legend span, .legend .room { min-height: 0; box-shadow: none; border-width: 0; border-radius: 999px; padding: 0.4rem 0.75rem; font-size: 0.85rem; font-weight: 700; }
.muted { color: var(--muted); font-size: 0.95rem; }
.room-panel { padding: 0.7rem 0.75rem 0.85rem; }
.room-panel h2 { margin: 0; }
.room-panel p { margin: 0.25rem 0; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.hours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; margin-top: 0.45rem; grid-column: 1 / -1; }
.hours button {
  min-height: 4rem;
  border-radius: 0.9rem;
  border: 2px solid #b7d0c2;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 3px 0 #c5d8cc;
}
.hours button.on { background: var(--brand); color: var(--on); border-color: var(--brand-deep); box-shadow: 0 3px 0 #06361e; }
.hours button:disabled { opacity: 0.4; }
.due {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
  padding: 0.75rem 0.6rem;
  border-radius: 1rem;
  background: #fff3c4;
  color: #6a3d00;
  font-size: 1.85rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
}
.total, .hours .hour-note { grid-column: 1 / -1; margin: 0.15rem 0 0; text-align: center; }
.total { font-size: 1.6rem; font-weight: 800; color: var(--brand-deep); }
.plans label { min-height: 4.4rem; font-size: 1.2rem; padding: 0.55rem 0.65rem; }
.plan-toggle {
  min-height: 4.4rem;
  border-radius: 1.05rem;
  border: 2px solid #b7d0c2;
  background: #f7fbf8;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 0 #c5d8cc;
}
.plan-toggle.on { background: var(--brand); color: var(--on); border-color: var(--brand-deep); box-shadow: 0 4px 0 #06361e; }
.agree { margin-top: 0.4rem; }
.agree[hidden] { display: none; }
.agree .pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
.agree label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  margin: 0;
  padding: 0.2rem;
  border-radius: 0.9rem;
  border: 2px solid #b7d0c2;
  background: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 3px 0 #c5d8cc;
}
.agree input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.agree label:has(input:checked) { background: var(--brand); color: var(--on); border-color: var(--brand-deep); box-shadow: 0 3px 0 #06361e; }
.plans small { font-size: 1.05rem; }
.plans input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.plans label { position: relative; }
.plans small { display: block; font-weight: 800; }
.pair { display: grid; gap: 0.4rem; margin-top: 0.4rem; }
.pair label { margin-top: 0; }
.inline { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; align-items: end; }
.inline .btn { width: auto; min-width: 4.6rem; margin: 0; min-height: 3rem; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.45rem; }
.actions form { display: contents; }
.actions .btn { margin: 0; min-height: 4.2rem; font-size: 1.15rem; padding: 0.4rem 0.45rem; box-shadow: 0 3px 0 #06361e; }
.actions .btn.alt { box-shadow: 0 3px 0 #042616; }
.actions .btn.ghost { box-shadow: 0 3px 0 #c5d8cc; }
.actions .btn.warn { box-shadow: 0 3px 0 #8d1020; }
.actions .mini { grid-column: 1 / -1; margin: 0; }
.actions .mini input, .pair input, .pair select, .inline input, .inline select { min-height: 2.7rem; margin-top: 0.15rem; }
@media (min-width: 800px) {
  .room-panel { max-width: 980px; margin-left: auto; margin-right: auto; }
  .actions { grid-template-columns: repeat(4, 1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .pair { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .grid.hotel { grid-template-columns: repeat(5, 1fr); }
  .grid.massage { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.7rem; }
}
@media (min-width: 1100px) {
  .grid.hotel { grid-template-columns: repeat(5, 1fr); }
  .grid.massage { grid-template-columns: repeat(2, 1fr); }
}
@media print { nav, .no-print { display: none !important; } .app { padding: 0; } }

/* Phone first 9:16 */
html { height: 100%; }
body { min-height: 100dvh; }
@media (max-width: 899px) {
  html { font-size: 4.35vw; }
  .app {
    width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
  }
  
  .grid.hotel .room { min-height: 5.6rem; }
}

/* Computer 16:9 stage */
@media (min-width: 900px) {
  html { font-size: 18px; }
  body {
    background:
      radial-gradient(1200px 600px at 10% -10%, #cfe8d8 0%, transparent 55%),
      radial-gradient(900px 500px at 110% 10%, #d7eee2 0%, transparent 50%),
      #dce8e1;
    display: flex;
    justify-content: center;
    align-items: stretch;
  }
  .app {
    width: min(100vw, calc(100dvh * 16 / 9));
    max-width: 1600px;
    min-height: 100dvh;
    max-height: 100dvh;
    margin: 0 auto;
    background: var(--bg);
    box-shadow: 0 0 0 1px #c5d8cc, 0 18px 50px rgba(8,40,24,.12);
    overflow: auto;
  }
  .hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem 1.1rem;
  }
  .grid.hotel { grid-template-columns: repeat(6, 1fr); padding: 0.9rem 1.1rem; }
  .grid.massage { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.9rem 1.1rem; }
  .grid.hotel .room, .grid.massage .room { min-height: 7.2rem; }
  nav { max-width: 1600px; width: min(100vw, calc(100dvh * 16 / 9)); left: 50%; transform: translateX(-50%); }
}

.grid.hotel { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.grid.hotel .room.hole {
  visibility: hidden;
  pointer-events: none;
  min-height: 6.4rem;
  height: 6.4rem;
  opacity: 0;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}

.grid.massage { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* MASSAGE-2COL */
.grid.massage { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

.split-2 { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 900px) {
  .split-2 { grid-template-columns: 1fr 1fr; gap: 0.4rem; padding: 0 0.4rem; }
}
.split-2 .card { margin-top: 0.55rem; }

.split-2 h3 { margin: 0.8rem 0 0.3rem; font-size: 1.05rem; }
.room-line { align-items: flex-start; font-size: 0.92rem; border-bottom: 1px solid var(--line); padding: 0.35rem 0; }
.room-line span { flex: 1; }

.head-sum { align-items: baseline; margin: 0 0 0.35rem; }
.head-sum h2 { margin: 0; }
.head-sum b { font-size: 1.55rem; color: var(--brand-deep); white-space: nowrap; }
