/* ------------------------------------------------------------------ */
/* XEX Cash — the four-seat demo                                       */
/* ------------------------------------------------------------------ */

:root {
  --navy: #004969;
  --navy-2: #005b83;
  --ice: #f6fafc;
  --ink: #0a2b3a;
  --muted: #6b8794;
  --muted-2: #93a9b4;
  --line: #e2edf3;
  --card: #ffffff;
  --ok: #0e9f6e;
  --ok-soft: #e8f7f0;
  --warn: #b45f06;
  --sh-1: 0 1px 2px rgba(9, 40, 55, 0.04), 0 8px 24px rgba(9, 40, 55, 0.05);
  --sh-2: 0 2px 6px rgba(9, 40, 55, 0.05), 0 18px 44px rgba(9, 40, 55, 0.09);
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: linear-gradient(180deg, #ffffff 0%, #f3f9fc 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100dvh;
}

/* ------------------------------- rail ----------------------------- */

.rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 20px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.brand em { font-style: normal; font-weight: 500; color: var(--muted); }

.rail-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.seats { display: flex; flex-direction: column; gap: 8px; }

.seat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}
.seat:hover { background: #f1f7fa; }
.seat:active { transform: scale(0.99); }
.seat.is-on {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--sh-1);
}
.seat .n {
  flex: 0 0 auto;
  width: 26px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}
.seat.is-on .n { color: var(--navy); }
.seat .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.seat .t strong { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.seat .t em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat--platform { margin-top: auto; border: 1px dashed var(--line); }
.seat--platform.is-on { border-style: solid; }

.rail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sim {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 73, 105, 0.06);
  color: #6d8b99;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rail-credit { font-size: 11px; color: var(--muted-2); }

/* ------------------------------- stage ---------------------------- */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 34px 28px 22px;
  min-width: 0;
  overflow: hidden;
}

.progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 73, 105, 0.07);
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--navy);
  transition: width 0.25s linear;
}

.scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  min-height: 0;
  flex: 0 1 auto;
}

.caption {
  margin: 0;
  min-height: 24px;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  max-width: 620px;
  transition: opacity 0.25s var(--ease);
}

.controls { display: flex; gap: 10px; }
.controls button {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.controls button:hover { background: #f2f8fb; }

/* ------------------------------- phone ---------------------------- */

.phone {
  position: relative;
  width: min(340px, 74vw);
  aspect-ratio: 340 / 600;
  max-height: min(78vh, 660px);
  padding: 9px;
  border-radius: 44px;
  background: linear-gradient(170deg, #e8f1f6, #d9e7ef);
  box-shadow: 0 2px 4px rgba(9, 40, 55, 0.06), 0 30px 60px rgba(9, 40, 55, 0.14);
  flex: 0 0 auto;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  border-radius: 36px;
  background: #f3f9fc;
  box-shadow: inset 0 0 0 1px rgba(9, 40, 55, 0.04);
  overflow: hidden;
}

.ph-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 0;
}
.ph-brand { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.ph-av {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e6f1f7;
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
}

.ph-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  min-height: 0;
  overflow: hidden;
}

.bal { display: flex; align-items: baseline; gap: 5px; }
.bal strong {
  font-size: 40px;
  font-weight: 680;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--ease);
}
.bal span { font-size: 12px; font-weight: 650; color: var(--muted-2); }
.bal.is-bump strong { animation: bump 0.5s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); color: var(--navy); }
  100% { transform: scale(1); }
}

.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--sh-1);
}
.row .gly {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: #eaf4f9;
  color: var(--navy);
}
.row .gly.ok { background: var(--ok-soft); color: var(--ok); }
.row .txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.row .txt strong { font-size: 13.5px; font-weight: 620; }
.row .txt span { font-size: 11.5px; color: var(--muted); }
.row .amt { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.row .amt.in { color: var(--ok); }
.row .amt.out { color: var(--ink); }

.receipt {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--sh-1);
  animation: rise 0.42s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.receipt .head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ok);
}
.receipt .big {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.receipt .big small { font-size: 11px; font-weight: 650; color: var(--muted-2); margin-left: 4px; }
.receipt dl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.receipt dl div { display: flex; justify-content: space-between; gap: 10px; }
.receipt dt { font-size: 11.5px; color: var(--muted); }
.receipt dd {
  margin: 0;
  font-size: 11.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.receipt dl div.is-total dt,
.receipt dl div.is-total dd { font-size: 12.5px; color: var(--ink); font-weight: 700; }

.sheet {
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--navy);
  color: #fff;
  animation: rise 0.42s var(--ease) both;
}
.sheet .lbl { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.66; }
.sheet .val { margin-top: 4px; font-size: 24px; font-weight: 680; letter-spacing: -0.03em; }
.sheet .split { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.sheet .split div { display: flex; justify-content: space-between; font-size: 11.5px; opacity: 0.85; }

.empty {
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--muted-2);
  font-size: 12.5px;
}

.sec {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 2px;
}

/* Sara's phone, shown beside Nareen's */
.scene.with-mini { align-items: flex-start; padding-top: 4px; }
.mini {
  width: min(230px, 58vw);
  padding: 16px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  animation: rise 0.5s var(--ease) both;
}
.mini .who { display: flex; align-items: center; gap: 10px; }
.mini .av {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e6f1f7;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}
.mini .who strong { display: block; font-size: 13.5px; }
.mini .who span { font-size: 11px; color: var(--muted); }
.mini .got {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.035em;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}
.mini .note { margin-top: 2px; font-size: 11.5px; color: var(--muted); }

/* ------------------------------ panels ---------------------------- */

.terminal {
  width: min(460px, 90vw);
  min-height: min(470px, 66vh);
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdfe, #f5fafc);
}
.term-head strong { display: block; font-size: 14.5px; font-weight: 680; letter-spacing: -0.01em; }
.term-head span { font-size: 11.5px; color: var(--muted); }
.term-head .live {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(14, 159, 110, 0.12);
}
.term-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  flex: 1 1 auto;
  justify-content: center;
}

.panel {
  width: 100%;
  max-width: 780px;
  min-height: min(340px, 56vh);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--sh-1);
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.015em;
}
.panel-head span { font-size: 12px; color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.kpi {
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: #f4f9fc;
}
.kpi span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi strong small { font-size: 10.5px; font-weight: 650; color: var(--muted-2); margin-left: 3px; }
.kpi.is-accent { background: var(--navy); }
.kpi.is-accent span { color: rgba(255, 255, 255, 0.6); }
.kpi.is-accent strong { color: #fff; }
.kpi.is-accent strong small { color: rgba(255, 255, 255, 0.6); }

table.grid {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
table.grid th {
  padding: 8px 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
  border-bottom: 1px solid var(--line);
}
table.grid th:first-child,
table.grid td:first-child { text-align: left; }
table.grid td {
  padding: 11px 10px;
  font-size: 13px;
  text-align: right;
  border-bottom: 1px solid #f1f7fa;
  animation: rise 0.4s var(--ease) both;
}
table.grid tr:last-child td { border-bottom: 0; }
table.grid td strong { font-weight: 650; }
table.grid td .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
table.grid tr.total td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }

.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef5f9;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--navy);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.note-line {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: #f4f9fc;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.note-line strong { color: var(--ink); }

/* ------------------------------ mobile ---------------------------- */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .rail {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .brand, .rail-note, .rail-foot, .seat .n, .seat .t em { display: none; }
  .seats { flex-direction: row; gap: 6px; }
  .seat {
    padding: 9px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    white-space: nowrap;
  }
  .seat.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
  .seat .t strong { font-size: 13px; }
  .seat--platform {
    margin-top: 0;
    margin-left: auto;
    border-style: solid;
  }

  .stage { padding: 18px 14px 14px; gap: 12px; justify-content: flex-start; }
  .scene { align-items: flex-start; }
  .caption { font-size: 14px; }
  .panel { padding: 16px; border-radius: var(--r-md); }
  .phone { width: min(300px, 86vw); aspect-ratio: 340 / 540; }
  .scene.with-mini { flex-direction: column; align-items: center; gap: 14px; }
  .mini { width: min(260px, 86vw); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.grid { min-width: 460px; }
}

/* ------------------------- stacked tables ------------------------- */

.mob-only { display: none; }

.lcard {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  margin-bottom: 8px;
  animation: rise 0.4s var(--ease) both;
}
.lcard--total { background: #f4f9fc; border-color: transparent; }
.lc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lc-top strong { font-size: 13.5px; font-weight: 650; }
.lc-top span { font-size: 13.5px; font-weight: 680; font-variant-numeric: tabular-nums; }
.lc-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

@media (max-width: 900px) {
  .desk-only { display: none; }
  .mob-only { display: block; }
}
