/* BPH SYSTEMS — Hospitality chapter: guest journey with a phone, staff operations tablet, hotel apps.
   Devices are dark in both themes. */

.hotel {
  position: relative;
  padding: clamp(110px, 16vh, 200px) var(--pad-x) clamp(120px, 18vh, 220px);
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.hotel__intro { max-width: 1100px; }

/* ---------- guest journey ---------- */
.gj {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(40px, 7vw, 120px);
  margin-block-start: clamp(60px, 10vh, 120px);
}
.gj__steps { padding-block-end: 14vh; }
.gstep {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 440px;
  opacity: 0.22;
  transition: opacity 0.6s var(--ease);
}
.gstep.is-active { opacity: 1; }
.gstep__num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--accent); }
.gstep__title { margin-block: 14px 16px; font-size: clamp(26px, 2.3vw, 38px); font-weight: 500; letter-spacing: -0.02em; }
.gstep p { font-size: 17px; line-height: 1.6; color: var(--muted); }

.gj__stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: flex-start; justify-content: center; padding-block-start: max(84px, 9vh); }
.gj__device { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }

.phone {
  --pfg: #eef1f5;
  --pmuted: rgba(238, 241, 245, 0.55);
  --pacc: #f2b870;
  position: relative;
  width: 290px;
  height: 570px;
  border-radius: 46px;
  background: linear-gradient(180deg, #171a1f, #0e1013);
  border: 10px solid #1d2025;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 40px 90px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  color: var(--pfg);
}
.phone__notch { position: absolute; top: 8px; left: 50%; width: 92px; height: 24px; margin-left: -46px; border-radius: 14px; background: #000; z-index: 3; }
.phone__bar { position: absolute; top: 12px; inset-inline: 22px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; z-index: 2; }
.phone__hotel { font-weight: 500; color: var(--pmuted); font-size: 10px; }

.scr {
  position: absolute;
  inset: 48px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.scr.is-on { opacity: 1; transform: none; }
.scr__kicker { margin-top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--pacc); }
.scr__title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.scr__hint { font-size: 12px; color: var(--pmuted); text-align: center; }

/* 1 · QR */
.qr { position: relative; width: 190px; height: 190px; margin: 16px auto 4px; }
.qr__code {
  position: absolute; inset: 22px; border-radius: 6px;
  background:
    linear-gradient(90deg, #eef1f5 0 22%, transparent 22% 30%, #eef1f5 30% 38%, transparent 38% 52%, #eef1f5 52% 60%, transparent 60% 70%, #eef1f5 70% 100%) 0 0 / 100% 14%,
    linear-gradient(90deg, transparent 0 12%, #eef1f5 12% 26%, transparent 26% 44%, #eef1f5 44% 50%, transparent 50% 64%, #eef1f5 64% 84%, transparent 84%) 0 14% / 100% 14%,
    linear-gradient(90deg, #eef1f5 0 8%, transparent 8% 20%, #eef1f5 20% 34%, transparent 34% 58%, #eef1f5 58% 72%, transparent 72% 90%, #eef1f5 90%) 0 28% / 100% 14%,
    linear-gradient(90deg, transparent 0 18%, #eef1f5 18% 30%, transparent 30% 40%, #eef1f5 40% 56%, transparent 56% 76%, #eef1f5 76% 86%, transparent 86%) 0 42% / 100% 14%,
    linear-gradient(90deg, #eef1f5 0 14%, transparent 14% 32%, #eef1f5 32% 46%, transparent 46% 62%, #eef1f5 62% 70%, transparent 70% 80%, #eef1f5 80%) 0 56% / 100% 14%,
    linear-gradient(90deg, transparent 0 6%, #eef1f5 6% 24%, transparent 24% 36%, #eef1f5 36% 42%, transparent 42% 66%, #eef1f5 66% 92%, transparent 92%) 0 70% / 100% 14%,
    linear-gradient(90deg, #eef1f5 0 28%, transparent 28% 44%, #eef1f5 44% 58%, transparent 58% 68%, #eef1f5 68% 100%) 0 84% / 100% 16%;
  background-repeat: no-repeat;
  opacity: 0.9;
}
.qr__corner { position: absolute; width: 30px; height: 30px; border: 3px solid var(--pacc); }
.qr__corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.qr__corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.qr__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.qr__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.qr__line { position: absolute; left: 12px; right: 12px; top: 20px; height: 2px; background: var(--pacc); box-shadow: 0 0 14px var(--pacc); animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { to { top: 166px; } }
.scr__ok {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(95, 211, 154, 0.14);
  color: #8fe0b4;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
}
.scr.is-on .scr__ok { animation: okIn 0.5s 1.4s var(--ease) forwards; }
@keyframes okIn { to { opacity: 1; transform: none; } }

/* 2 · key */
.key { position: relative; width: 170px; height: 170px; margin: 18px auto 4px; display: grid; place-items: center; }
.key__core { position: relative; z-index: 1; display: grid; place-items: center; width: 118px; height: 118px; border-radius: 50%; background: var(--pacc); color: #1a1208; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; }
.key__wave { position: absolute; inset: 26px; border-radius: 50%; border: 2px solid var(--pacc); opacity: 0; animation: wave 2s ease-out infinite; }
.key__wave--2 { animation-delay: 1s; }
@keyframes wave { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }
.key--off .key__core { background: #2a2e34; color: var(--pmuted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: auto; }
.chips i { font-style: normal; font-size: 11px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }

/* 3 · room */
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.t2 { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); font-size: 11px; color: var(--pmuted); }
.t2 b { font-size: 18px; color: var(--pfg); font-weight: 600; }
.t2--on { background: rgba(242, 184, 112, 0.18); }
.t2--wide { flex-direction: row; justify-content: space-between; align-items: center; }
.t2--wide b { font-size: 13px; color: var(--pacc); }
.bar { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar em { display: block; height: 100%; background: var(--pacc); }
.scenes { display: flex; gap: 6px; }
.scenes i { flex: 1; font-style: normal; text-align: center; font-size: 12px; padding: 9px 0; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.scenes i.is-on { background: var(--pacc); color: #1a1208; font-weight: 600; }

/* 4 · 5 · lists */
.list { list-style: none; display: grid; gap: 8px; margin-top: 6px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.list li span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list b { font-size: 13.5px; font-weight: 600; }
.list small { font-size: 11px; color: var(--pmuted); }
.list em { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: rgba(242, 184, 112, 0.18); color: var(--pacc); white-space: nowrap; }
.list li.is-done em { background: rgba(95, 211, 154, 0.16); color: #8fe0b4; }
.list em.qty { background: rgba(255, 255, 255, 0.1); color: var(--pfg); min-width: 28px; text-align: center; }
.list em.add { background: var(--pacc); color: #1a1208; }
.order { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--pacc); color: #1a1208; font-size: 12px; }
.order b { font-size: 12.5px; }
.track { display: flex; gap: 4px; }
.track i { flex: 1; font-style: normal; font-size: 10px; text-align: center; padding-top: 8px; border-top: 3px solid rgba(255, 255, 255, 0.12); color: var(--pmuted); }
.track i.is-on { border-color: var(--pacc); color: var(--pfg); }

/* 6 · bill */
.folio { list-style: none; margin-top: 6px; }
.folio li { display: flex; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); font-size: 13px; color: var(--pmuted); }
.folio b { color: var(--pfg); font-weight: 600; font-family: var(--mono); font-size: 12.5px; }
.folio__total { border-bottom: 0 !important; }
.folio__total span { color: var(--pfg); font-weight: 600; }
.folio__total b { color: var(--pacc); font-size: 15px; }

/* 7 · check-out */
.out { display: grid; gap: 8px; margin-top: 6px; }
.out__row { display: flex; justify-content: space-between; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); font-size: 13px; }
.out__row b { color: #8fe0b4; }

/* common-language log under the phone */
.gj__log {
  --fg: #e9edf3;
  width: min(460px, 100%);
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(233, 237, 243, 0.62);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
}
.gj__log-k { color: #f2b870; font-weight: 600; letter-spacing: 0.14em; margin-inline-end: 10px; }
.gj__log .p { color: #e9edf3; }
.gj__log .bph { color: #f2b870; }
.gj__log .arr { color: rgba(233, 237, 243, 0.3); }
.gj__log.is-new { animation: logFlash 0.8s ease; }
@keyframes logFlash { from { box-shadow: 0 0 0 2px rgba(242, 184, 112, 0.6); } to { box-shadow: 0 0 0 0 rgba(242, 184, 112, 0); } }

/* ---------- staff & manager operations ---------- */
.hops { margin-block-start: clamp(100px, 16vh, 200px); }
.hops__head { max-width: 900px; margin-block-end: clamp(36px, 5vh, 56px); }
.roles2 { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 26px; }
.roles2 li { padding: 8px 14px; border-radius: 999px; font-size: 13px; border: 1px solid rgba(127, 127, 127, 0.28); }

.tablet {
  --tfg: #e9edf3;
  --tmuted: rgba(233, 237, 243, 0.55);
  --tline: rgba(255, 255, 255, 0.07);
  max-width: 1100px;
  margin-inline: auto;
  padding: 18px;
  border-radius: 30px;
  background: #111316;
  border: 12px solid #1d2025;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 40px 100px rgba(17, 18, 20, 0.28);
  color: var(--tfg);
}
.tablet__top { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 14px; font-size: 12px; color: var(--tmuted); }
.tablet__brand { font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; font-size: 10.5px; color: #f2b870; }
.tablet__time { font-family: var(--mono); color: var(--tfg); }
.tablet__tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.ttab {
  flex: none;
  font: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--tline);
  background: transparent;
  color: var(--tmuted);
  cursor: pointer;
}
.ttab[aria-selected="true"] { background: rgba(242, 184, 112, 0.16); border-color: rgba(242, 184, 112, 0.5); color: var(--tfg); }
.ttab:focus-visible { outline: 2px solid #f2b870; outline-offset: 2px; }
.tview { min-height: 340px; animation: dlIn 0.4s var(--ease); }
.tview[hidden] { display: none; }
.tview__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tview__kpis div { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.tview__kpis b { display: block; font-size: 24px; font-weight: 300; letter-spacing: -0.02em; }
.tview__kpis span { font-size: 12px; color: var(--tmuted); }

.rooms { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.room { display: grid; place-items: center; height: 30px; border-radius: 7px; font-family: var(--mono); font-size: 10px; color: rgba(255, 255, 255, 0.85); transition: background 0.6s; }
.room.is-changed { animation: roomPing 1.2s ease; }
@keyframes roomPing { 0% { box-shadow: 0 0 0 0 rgba(242, 184, 112, 0.9); } 100% { box-shadow: 0 0 0 8px rgba(242, 184, 112, 0); } }
.st-occ { background: #33465a; }
.st-ready { background: #2b7a54; }
.st-dirty { background: #a95c35; }
.st-clean { background: #b8923c; }
.st-dnd { background: #61499a; }
.st-maint { background: #8a3030; }
.legend2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 14px; font-size: 11.5px; color: var(--tmuted); }
.legend2 i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: -8px; }

.feed { list-style: none; display: grid; gap: 6px; }
.feed li { display: grid; grid-template-columns: 52px minmax(0, 0.9fr) minmax(0, 1.4fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 13px; }
.feed time { font-family: var(--mono); font-size: 11.5px; color: var(--tmuted); }
.feed b { font-weight: 600; }
.feed span { color: var(--tmuted); }
.feed em { font-style: normal; color: var(--tfg); }
.feed i { font-style: normal; font-size: 11px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.feed i.ok { background: rgba(95, 211, 154, 0.14); color: #8fe0b4; }
.feed i.run { background: rgba(242, 184, 112, 0.16); color: #f2c78f; }
.feed i.new { background: rgba(140, 170, 220, 0.16); color: #b7cbef; }
.feed i.dnd { background: rgba(140, 110, 210, 0.2); color: #c9b6f2; }
.feed i.warn { background: rgba(242, 184, 112, 0.16); color: #f2c78f; }
.feed i.crit { background: rgba(255, 110, 90, 0.16); color: #ffb0a0; }
.feed li.is-crit { box-shadow: inset 3px 0 0 #ff7a62; }
.feed li.is-warn { box-shadow: inset 3px 0 0 #f2b870; }
.feed--compact { margin-top: 14px; }
.tnote { margin-top: 14px; font-size: 12px; color: var(--tmuted); }

.infra { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ibox { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.ibox span { font-size: 12px; color: var(--tmuted); }
.ibox b { font-size: 20px; font-weight: 600; }
.ibox b.ok { color: #8fe0b4; }
.ibox b.warn { color: #f2c78f; }
.ibox small { font-size: 11.5px; color: var(--tmuted); }

.pbar { display: grid; grid-template-columns: 90px minmax(0, 1fr) 44px; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; color: var(--tmuted); }
.pbar i { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.pbar em { display: block; height: 100%; background: #f2b870; border-radius: 8px; }
.pbar b { color: var(--tfg); font-weight: 600; text-align: end; }

/* ---------- hotel apps ---------- */
.happs { margin-block-start: clamp(100px, 16vh, 200px); }
.happs__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-block-start: clamp(36px, 5vh, 56px); }
.happ { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 18px; background: var(--card, rgba(255, 255, 255, 0.03)); border: 1px solid var(--line, rgba(255, 255, 255, 0.08)); }
.happ:nth-child(2) { transition-delay: 0.06s; }
.happ:nth-child(3) { transition-delay: 0.12s; }
.happ:nth-child(4) { transition-delay: 0.18s; }
.happ__k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.happ h4 { font-size: 19px; font-weight: 600; }
.happ p { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.hint-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 26px; }
.hint-chips li { padding: 8px 14px; border-radius: 999px; font-size: 13px; border: 1px solid rgba(127, 127, 127, 0.25); color: var(--muted); }

[data-theme="light"] .hotel { --card: #ffffff; --line: rgba(17, 18, 20, 0.1); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .happs__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .infra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .gj { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .gj__stage { order: -1; height: auto; padding-block: 12px; align-items: center; z-index: 2; background: linear-gradient(to bottom, var(--bg) 85%, transparent); }
  .phone { width: 220px; height: 400px; border-radius: 36px; border-width: 8px; }
  .scr { inset: 40px 12px 14px; gap: 8px; }
  .scr__title { font-size: 20px; }
  .qr { width: 130px; height: 130px; margin-top: 6px; }
  @keyframes scan { to { top: 108px; } }
  .key { width: 120px; height: 120px; margin-top: 6px; }
  .key__core { width: 86px; height: 86px; font-size: 11px; }
  .t2 { padding: 8px; } .t2 b { font-size: 14px; }
  .list li { padding: 8px; }
  .gj__log { font-size: 10.5px; padding: 8px 12px; }
  .gstep { min-height: 60vh; justify-content: flex-end; padding-block-end: 4vh; }
  .gj__steps { padding-block-end: 8vh; }
  .tview__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed li { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .feed li span { grid-column: 2 / -1; grid-row: 2; }
  .rooms { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tablet { border-width: 8px; padding: 12px; border-radius: 22px; }
}
@media (max-width: 560px) {
  .happs__grid, .infra { grid-template-columns: minmax(0, 1fr); }
}

/* 4 · calls over SIP */
.list--call li { padding: 10px 12px; }
.list--call .call-btn { background: rgba(95, 211, 154, 0.16); color: #8fe0b4; }
.list--call li:first-child .call-btn { background: #5fd39a; color: #0d2117; }
.callcard {
  margin-top: auto;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(95, 211, 154, 0.2), rgba(95, 211, 154, 0.08));
  border: 1px solid rgba(95, 211, 154, 0.35);
}
.callcard__top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--pfg); }
.callcard__top b { margin-inline-start: auto; font-family: var(--mono); font-size: 12px; }
.callcard__dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd39a; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: 0.3; } }
.callcard__btns { display: flex; gap: 6px; margin-top: 10px; }
.callcard__btns i { flex: 1; font-style: normal; text-align: center; font-size: 10.5px; padding: 7px 0; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.callcard__btns i.end { background: #e2554a; color: #fff; }
.scr[data-s="4"] .callcard { opacity: 0; transform: translateY(8px); }
.scr[data-s="4"].is-on .callcard { animation: okIn 0.5s 1.2s var(--ease) forwards; }
.feed li.is-live { box-shadow: inset 3px 0 0 #5fd39a; }
@media (max-width: 900px) {
  .list--call li { padding: 6px 8px; }
  .list--call li:nth-child(n+3) { display: none; }
  .callcard { padding: 8px; }
}
