/* ==========================================================================
   Meja FX — satu halaman, digambar sendiri.
   Palet: kayu hangat + krem kertas. Tidak ada aset gambar dari luar.
   ========================================================================== */

:root {
  --paper: #f6ecdc;
  --paper-2: #fbf4e7;
  --cream: #fffaf0;
  --wall: #efe0c9;
  --wall-shade: #e2cfb2;
  --wood: #b6834f;
  --wood-dark: #8a5c31;
  --wood-light: #d3a171;
  --floor: #e3c39b;
  --floor-line: #cfa87c;
  --ink: #372a1d;
  --ink-soft: #5c4a37;
  --muted: #8b765c;
  --line: #e3d2b7;
  --line-soft: #efe3ce;
  --green: #2f8f5f;
  --green-soft: #d8ecd9;
  --red: #c1554a;
  --red-soft: #f5dcd6;
  --amber: #bf8225;
  --amber-soft: #f6e6c6;
  --blue: #4a6fa5;
  --sans: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  background: radial-gradient(120% 120% at 50% 0%, #fbf3e4 0%, #ecdcbf 60%, #dfc9a6 100%);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: grid;
  /* minmax(0, 1fr) wajib: tanpa ini kolom mengikuti min-content dan halaman
     bisa melebar melewati layar ponsel. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 36px minmax(0, 1fr) 46px;
  height: 100vh;
  height: 100dvh;
}

/* ------------------------------------------------------------------ tape */

.tape {
  background: #1c2336;
  color: #e9ecf6;
  overflow: hidden;
  border-bottom: 1px solid #0c1120;
  display: flex;
  align-items: center;
}

.tape-track {
  display: flex;
  width: max-content;
  animation: tape-roll 64s linear infinite;
  will-change: transform;
}

@keyframes tape-roll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.tape-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 36px;
  white-space: nowrap;
  border-right: 1px solid #2c3550;
}

.tape-sym {
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f1f3fa;
}

.tape-last {
  color: #cfd5e6;
}

.tape-chg {
  font-weight: 600;
}

.tape-chg.up {
  color: #5fd39a;
}

.tape-chg.down {
  color: #f4837a;
}

.tape-src {
  color: #7d869f;
  font-size: 10px;
}

.tape-empty {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8a93ad;
  padding-left: 18px;
}

/* ------------------------------------------------------------ desk view */

.desk-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px 58px;
  gap: 8px;
  padding: 8px 8px 0;
  min-height: 0;
}

.desk-view.no-rail {
  grid-template-columns: minmax(0, 1fr) 0 58px;
}

.desk-view.no-rail .rail {
  display: none;
}

/* -------------------------------------------------------------- ruangan */

.room {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--wall);
  box-shadow:
    inset 0 0 0 1px #d9c3a2,
    0 18px 40px rgba(90, 62, 30, 0.18);
  min-height: 0;
  container-type: size;
}

.wall {
  position: absolute;
  inset: 0 0 auto 0;
  height: 40%;
  background:
    linear-gradient(180deg, #f4e7d3 0%, #eee0c9 62%, #e6d5b9 100%);
}

.wall::after {
  /* dinding bawah: garis skirting supaya lantai tidak menyatu dengan dinding */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  background: linear-gradient(180deg, #d9c3a0, #c6ac85);
  box-shadow: 0 3px 6px rgba(103, 74, 40, 0.16);
}

.window {
  position: absolute;
  top: 11%;
  width: 10%;
  height: 30%;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #cfe4ef 0%, #e6f1f4 55%, #f3f7f3 100%);
  border: 6px solid #fdf8ee;
  box-shadow:
    inset 0 0 0 1px #cdd9dd,
    0 6px 12px rgba(103, 74, 40, 0.12);
}

.window::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 2px), #fdf8ee calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
    linear-gradient(180deg, transparent calc(46% - 2px), #fdf8ee calc(46% - 2px) calc(46% + 2px), transparent calc(46% + 2px));
}

.window::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: -16%;
  height: 22%;
  background: linear-gradient(180deg, #fdf8ee, #f3e9d8);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 3px 0 rgba(160, 130, 92, 0.25);
}

.whiteboard {
  position: absolute;
  left: 21%;
  top: 7%;
  width: 14%;
  height: 27%;
  margin: 0;
  padding: 6px 8px 4px;
  background: #fdfaf2;
  border: 5px solid #f7f1e3;
  border-radius: 4px;
  box-shadow:
    0 5px 12px rgba(103, 74, 40, 0.14),
    inset 0 0 0 1px #e6dccb;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.whiteboard figcaption {
  font-size: clamp(6px, 1.1cqw, 10px);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #a08e77;
}

.whiteboard svg {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.crest {
  position: absolute;
  left: 50%;
  top: 8%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  width: 30%;
}

.crest-title {
  font-size: clamp(16px, 4.4cqw, 40px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 2px;
  color: #8a5c31;
  text-shadow:
    0 1px 0 #fdf8ee,
    0 3px 0 rgba(160, 120, 74, 0.28);
}

.crest-sub {
  margin-top: 4px;
  font-size: clamp(6px, 1.3cqw, 11px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #a1835f;
}

.crest-title::before,
.crest-title::after {
  content: "";
  display: inline-block;
  width: clamp(14px, 4cqw, 44px);
  height: 2px;
  vertical-align: 0.35em;
  margin: 0 10px;
  background: linear-gradient(90deg, transparent, #bb9468 40%, #bb9468 60%, transparent);
}

.clock {
  position: absolute;
  left: 65%;
  right: auto;
  top: 9%;
  width: clamp(26px, 5.4cqw, 52px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffaf0, #f0e2ca);
  border: 4px solid #fdf8ee;
  box-shadow:
    0 4px 10px rgba(103, 74, 40, 0.18),
    inset 0 0 0 1px #ddcbb0;
}

.clock .hand {
  position: absolute;
  left: 50%;
  top: 22%;
  width: 2px;
  height: 30%;
  background: #7d6547;
  border-radius: 2px;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(48deg);
  animation: clock-hand 60s linear infinite;
}

.clock .hand::after {
  content: "";
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7d6547;
}

@keyframes clock-hand {
  to {
    transform: translateX(-50%) rotate(408deg);
  }
}

.shelf {
  position: absolute;
  left: 1.5%;
  top: 13%;
  width: 6%;
  height: 40%;
  border-radius: 4px;
  background: linear-gradient(90deg, #a97a48, #c2966a);
  box-shadow: 0 5px 10px rgba(103, 74, 40, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 5px 4px;
}

.shelf span {
  height: 12%;
  border-radius: 2px;
  background: linear-gradient(90deg, #f0e2ca, #dcc9a8);
  box-shadow: 0 1px 0 rgba(90, 62, 30, 0.12);
}

.shelf span:nth-child(2n) {
  background: linear-gradient(90deg, #d9a0a0, #c98b8b);
}

.shelf span:nth-child(3n) {
  background: linear-gradient(90deg, #a9c3cf, #8fadb9);
}

.wall-plant {
  position: absolute;
  right: 2%;
  top: 3%;
}

.plant {
  width: clamp(18px, 3.6cqw, 34px);
  height: clamp(18px, 3.6cqw, 34px);
}

.plant i {
  position: absolute;
  width: 46%;
  height: 62%;
  border-radius: 60% 10% 60% 10%;
  background: linear-gradient(160deg, #6fa87a, #3f7b52);
}

.plant i:nth-child(1) {
  left: 6%;
  top: 4%;
  transform: rotate(-24deg);
}

.plant i:nth-child(2) {
  right: 6%;
  top: 10%;
  transform: rotate(22deg) scale(0.86);
}

.plant i:nth-child(3) {
  left: 26%;
  top: 26%;
  transform: rotate(-4deg) scale(0.72);
  background: linear-gradient(160deg, #86bb8c, #4c8a5c);
}

.floor {
  position: absolute;
  inset: 40% 0 0 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(120, 84, 42, 0.1) 0 1.5px,
      transparent 1.5px 76px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(120, 84, 42, 0.07) 0 1.5px,
      transparent 1.5px 40px
    ),
    linear-gradient(180deg, #d3ad82 0%, #e6c7a0 26%, #e9cba5 100%);
  box-shadow: inset 0 8px 16px -12px rgba(90, 62, 30, 0.5);
}

.floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 90% at 50% 0%, transparent 40%, rgba(120, 84, 42, 0.16) 100%);
}

/* ---------------------------------------------------------- meja bundar */

.roundtable {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 34%;
  aspect-ratio: 1.95;
  display: grid;
  place-items: end center;
  z-index: 2;
}

.roundtable .rug {
  position: absolute;
  inset: -4% -12% -12% -12%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 12deg, rgba(196, 160, 112, 0.16) 0deg 3deg, transparent 3deg 12deg),
    radial-gradient(closest-side, #fdf6e6 0%, #f6e9cf 56%, #ecd9b6 100%);
  border: 7px solid #ddc39c;
  box-shadow:
    0 14px 24px rgba(90, 62, 30, 0.18),
    inset 0 0 0 5px rgba(255, 255, 255, 0.45);
}

.roundtable .rug::after {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 2px dashed #d3b58b;
}

.table-top {
  position: relative;
  width: 64%;
  aspect-ratio: 1.75;
  border-radius: 50%;
  border: 3px solid #b1854f;
  background:
    radial-gradient(52% 60% at 34% 22%, #f3e2c0 0%, #d9b988 44%, #ac8351 100%);
  box-shadow:
    inset 0 -9px 14px rgba(110, 76, 38, 0.35),
    inset 0 0 0 5px rgba(255, 243, 222, 0.28),
    0 16px 24px rgba(90, 62, 30, 0.26);
  margin-bottom: 14%;
}

.table-orn {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 2px solid rgba(140, 104, 62, 0.35);
}

.table-orn::before,
.table-orn::after {
  content: "";
  position: absolute;
  background: rgba(140, 104, 62, 0.28);
  border-radius: 50%;
}

.table-orn::before {
  inset: 22%;
}

.table-orn::after {
  inset: 42%;
}

.cup {
  position: absolute;
  left: 16%;
  top: 30%;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e8dcc6);
  box-shadow: 0 2px 4px rgba(90, 62, 30, 0.24);
}

.cup.second {
  left: 74%;
  top: 52%;
  background: radial-gradient(circle at 35% 30%, #f7d9d2, #d99c93);
}

.table-label {
  position: absolute;
  bottom: -6%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(7.5px, 1.45cqw, 12px);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(255, 250, 240, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(90, 62, 30, 0.12);
}

.table-label.is-hot {
  color: #a8452f;
  border-color: #e6bfae;
  background: #fdeee8;
}

/* ------------------------------------------------------------------ meja */

.desk {
  position: absolute;
  width: 24%;
  min-width: 132px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Posisi enam meja. Diatur di CSS, bukan inline, supaya layar sempit bisa
   menimpanya tanpa !important. */
.desk[data-agent="lead"] {
  left: 4%;
  top: 18%;
}
.desk[data-agent="market"] {
  left: 72%;
  top: 18%;
}
.desk[data-agent="research"] {
  left: 4%;
  top: 44%;
}
.desk[data-agent="strategist"] {
  left: 72%;
  top: 44%;
}
.desk[data-agent="risk"] {
  left: 4%;
  top: 70%;
}
.desk[data-agent="execution"] {
  left: 72%;
  top: 70%;
}

.desk .agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.5cqw, 5px);
  z-index: 2;
  margin-bottom: -9%;
}

.blob {
  position: relative;
  width: clamp(24px, 4.6cqw, 44px);
  aspect-ratio: 1;
  border-radius: 46% 46% 42% 42% / 52% 52% 46% 46%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.55), transparent 42%),
    var(--body, #8fa0bd);
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.18),
    0 4px 8px rgba(90, 62, 30, 0.22);
  animation: bob 3.4s ease-in-out infinite;
  transform-origin: bottom center;
}

.blob .eye {
  position: absolute;
  top: 40%;
  left: 26%;
  width: 17%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #2c2620;
}

.blob .eye.right {
  left: 57%;
}

.blob .eye::after {
  content: "";
  position: absolute;
  left: 22%;
  top: 14%;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.blob::after {
  /* senyum kecil */
  content: "";
  position: absolute;
  left: 40%;
  top: 62%;
  width: 20%;
  height: 9%;
  border-radius: 0 0 999px 999px;
  border-bottom: 2px solid rgba(44, 38, 32, 0.65);
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-3px) scaleY(1.02);
  }
}

.desk:nth-child(2) .blob {
  animation-delay: 0.4s;
}
.desk:nth-child(3) .blob {
  animation-delay: 0.8s;
}
.desk:nth-child(4) .blob {
  animation-delay: 1.2s;
}
.desk:nth-child(5) .blob {
  animation-delay: 1.6s;
}
.desk:nth-child(6) .blob {
  animation-delay: 2s;
}

.tag {
  text-align: center;
  background: rgba(255, 250, 240, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1px 7px 2px;
  box-shadow: 0 2px 5px rgba(90, 62, 30, 0.14);
  max-width: 100%;
}

.tag b {
  display: block;
  font-size: clamp(6.5px, 1.25cqw, 10.5px);
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--ink);
  white-space: nowrap;
}

.tag i {
  display: block;
  font-style: normal;
  font-size: clamp(6px, 1.1cqw, 9.5px);
  color: var(--muted);
  white-space: nowrap;
}

.tag .stance {
  font-family: var(--mono);
  font-size: clamp(6px, 1.1cqw, 9.5px);
  font-weight: 600;
}

.tag .stance.long {
  color: var(--green);
}
.tag .stance.short {
  color: var(--red);
}
.tag .stance.neutral {
  color: var(--muted);
}

/* meja kayu: permukaan + papan nama */

.tabletop {
  position: relative;
  width: 100%;
  aspect-ratio: 3.5;
  border-radius: 8px 8px 5px 5px;
  background:
    linear-gradient(180deg, #d8ab79 0%, #c1915e 42%, #a9784a 100%);
  box-shadow:
    0 10px 16px rgba(90, 62, 30, 0.24),
    inset 0 1px 0 rgba(255, 245, 225, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 0 8% 6%;
}

.tabletop::before {
  /* bibir meja */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 14%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #e3be8f, #cfa273);
}

.monitor {
  position: relative;
  width: 34%;
  aspect-ratio: 1.62;
  border-radius: 3px;
  background: #26303f;
  box-shadow:
    0 0 0 2px #4d5665,
    0 3px 6px rgba(0, 0, 0, 0.28);
  transform: translateY(-38%);
  overflow: hidden;
}

.monitor::after {
  content: "";
  position: absolute;
  left: 42%;
  bottom: -18%;
  width: 16%;
  height: 18%;
  background: #4d5665;
}

.monitor svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mug {
  width: 9%;
  aspect-ratio: 1;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(180deg, #fdf7ea, #e6d6bd);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.stack {
  width: 14%;
  height: 44%;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, #fdf7ea 0 3px, #ece0cb 3px 5px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);
}

.desk-plant {
  width: 8%;
  height: 46%;
  border-radius: 3px;
  background: linear-gradient(180deg, #d9a171, #b9825199);
  position: relative;
}

.desk-plant::after {
  content: "";
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: 80%;
  height: 120%;
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 40% 30%, #7cb089, #3f7b52);
}

.plate {
  margin-top: 2px;
  max-width: 100%;
  background: linear-gradient(180deg, #6f4a29, #5a3a1f);
  color: #f3e2c7;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: clamp(6.5px, 1.2cqw, 10px);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 205, 0.25),
    0 3px 6px rgba(60, 40, 20, 0.3);
}

/* status kecil di bawah plat */
.mood {
  margin-top: 3px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(6px, 1.1cqw, 9.5px);
  color: var(--ink-soft);
  background: rgba(255, 250, 240, 0.7);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}

.mood .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.mood .stance {
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 600;
  padding-left: 5px;
  border-left: 1px solid var(--line);
}

.mood .stance.long {
  color: var(--green);
}

.mood .stance.short {
  color: var(--red);
}

.mood .stance.neutral {
  color: var(--muted);
}

.desk[data-status="thinking"] .blob,
.desk[data-status="reading"] .blob {
  animation-duration: 2.2s;
}

.desk[data-status="arguing"] .blob {
  animation: wobble 0.7s ease-in-out infinite;
}

.desk[data-status="fighting"] .blob {
  animation: wobble 0.36s ease-in-out infinite;
}

@keyframes wobble {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-2px);
  }
}

.desk.is-talker .blob {
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.18),
    0 0 0 3px rgba(124, 92, 255, 0.45),
    0 4px 10px rgba(90, 62, 30, 0.22);
}

/* ------------------------------------------------------------- balon omong */

.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 22%;
  min-width: 84px;
  background: #fffdf7;
  border: 1px solid #e7d8bf;
  border-radius: 10px;
  padding: 5px 8px;
  font-size: clamp(7px, 1.3cqw, 11px);
  line-height: 1.35;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(90, 62, 30, 0.18);
  animation: bubble-in 0.18s ease-out;
}

.bubble b {
  display: block;
  font-size: 0.85em;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: #fffdf7;
  border-right: 1px solid #e7d8bf;
  border-bottom: 1px solid #e7d8bf;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% + 6px));
  }
}

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

.rail {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.97), rgba(250, 243, 231, 0.97));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(90, 62, 30, 0.14);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.rail-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.rail-head > div {
  flex: 1;
  min-width: 0;
}

.rail-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.rail-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.rail-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.rail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.rail-body::-webkit-scrollbar {
  width: 7px;
}

/* Tepi bawah dibuat memudar: isi yang terpotong terlihat seperti bisa
   digulir, bukan seperti panel yang rusak. */
.rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, rgba(250, 243, 231, 0), rgba(248, 240, 227, 0.96));
  pointer-events: none;
}

.rail-body::-webkit-scrollbar-thumb {
  background: #ded0b6;
  border-radius: 8px;
}

.block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.block-label {
  font-size: 9.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a3907a;
  font-weight: 700;
}

/* angka besar: satu-satunya yang harus terbaca dari jauh */
.bignum {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.bignum.up {
  color: var(--green);
}
.bignum.down {
  color: var(--red);
}
.bignum.flat {
  color: var(--ink-soft);
}

.bignum small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 4px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: #fffdf7;
}

.badge.paper {
  color: #4a6fa5;
  border-color: #c4d3e6;
  background: #eef3fa;
}

.badge.live {
  color: #a8452f;
  border-color: #e6bfae;
  background: #fdeee8;
}

.badge.testnet {
  color: #8a6a1f;
  border-color: #e4d3a5;
  background: #f8f0d8;
}

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

.badge.sample {
  color: #7a5aa8;
  border-color: #d8cbe9;
  background: #f3eefb;
}

/* fight meter */

.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.meter-state {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 999px;
}

.meter-state.quiet {
  color: var(--green);
  background: var(--green-soft);
}

.meter-state.warm {
  color: var(--amber);
  background: var(--amber-soft);
}

.meter-state.brawl {
  color: var(--red);
  background: var(--red-soft);
}

.meter-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9ecd9 0%, #f4e6c4 52%, #f3d3ca 100%);
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6fbf8e, #d9a24a 62%, #cf6a56);
  transform-origin: left center;
  transition: width 0.45s ease;
}

.meter-threshold {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: rgba(60, 45, 30, 0.45);
  border-radius: 2px;
}

.meter-row {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--muted);
}

.camps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.camp {
  font-size: 9.5px;
  border-radius: 6px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--ink-soft);
}

.camp.bull {
  border-color: #bfdcc2;
  background: #eef7ee;
  color: #2f7a4d;
}

.camp.bear {
  border-color: #e8c9c2;
  background: #fbeeea;
  color: #a8452f;
}

/* vonis */

.verdict {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf7;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.verdict-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.verdict-act {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.verdict-act.hold {
  color: #6a5a45;
  background: #f0e7d6;
}

.verdict-act.long {
  color: #2f7a4d;
  background: var(--green-soft);
}

.verdict-act.short {
  color: #a8452f;
  background: var(--red-soft);
}

.verdict-act.close {
  color: #8a6a1f;
  background: var(--amber-soft);
}

.verdict-sym {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.verdict-risk {
  margin-left: auto;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.verdict-why {
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.verdict-meta {
  font-size: 9px;
  color: #a3907a;
}

/* baris angka */

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  padding: 2px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.kv:last-child {
  border-bottom: 0;
}

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

.kv b {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
}

.kv b.up {
  color: var(--green);
}
.kv b.down {
  color: var(--red);
}

.note-line {
  font-size: 10px;
  line-height: 1.4;
  color: #9a6a2c;
  background: var(--amber-soft);
  border-radius: 7px;
  padding: 5px 7px;
}

.note-line.is-clear {
  color: #2f7a4d;
  background: #eaf4ea;
}

/* posisi */

.pos {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  font-size: 10.5px;
}

.pos-side {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.pos-side.long {
  color: #2f7a4d;
  background: var(--green-soft);
}

.pos-side.short {
  color: #a8452f;
  background: var(--red-soft);
}

.pos-sym {
  font-family: var(--mono);
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-pnl {
  font-family: var(--mono);
  font-weight: 600;
}

.pos-pnl.up {
  color: var(--green);
}
.pos-pnl.down {
  color: var(--red);
}

.pos-detail {
  font-size: 9.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: not-allowed;
  opacity: 0.75;
}

/* log */

.logline {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px;
  font-size: 10px;
  line-height: 1.4;
  padding: 3px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.logline:last-child {
  border-bottom: 0;
}

.logline time {
  font-family: var(--mono);
  font-size: 9px;
  color: #a3907a;
}

.logline .who {
  font-weight: 700;
  color: var(--ink-soft);
}

.logline.warn .text {
  color: #9a6a2c;
}

.logline.error .text {
  color: var(--red);
}

.rail-body code {
  font-family: var(--mono);
  font-size: 9.5px;
  background: #f4ecdd;
  border-radius: 4px;
  padding: 1px 4px;
  word-break: break-all;
}

.empty {
  font-size: 10.5px;
  color: #a3907a;
  font-style: italic;
  line-height: 1.4;
}

/* ikon rail */

.rail-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
}

.rail-icons button {
  width: 46px;
  padding: 7px 0 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
}

.rail-icons button span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7.5px;
  letter-spacing: 0;
}

.rail-icons svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-icons button:hover {
  background: rgba(255, 250, 240, 0.8);
  border-color: var(--line);
}

.rail-icons button.is-on {
  background: #fffdf7;
  border-color: var(--line);
  color: #8a5c31;
  box-shadow: 0 3px 8px rgba(90, 62, 30, 0.12);
}

/* -------------------------------------------------------------- statusbar */

.statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-size: 10.5px;
  color: var(--ink-soft);
}

.statusbar-mid {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pill {
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(90, 62, 30, 0.1);
  white-space: nowrap;
}

.pill:hover {
  border-color: #cbb28b;
}

.pill.is-on {
  background: #f1e6d2;
  border-color: #cbb28b;
}

.feed-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fffdf7;
  white-space: nowrap;
}

.feed-badge.sample {
  color: #7a5aa8;
  border-color: #d8cbe9;
  background: #f3eefb;
}

.feed-badge.live {
  color: #2f7a4d;
  border-color: #bfdcc2;
  background: #eef7ee;
}

.feed-badge.warn {
  color: #a8452f;
  border-color: #e6bfae;
  background: #fbeeea;
}

.feed-note {
  color: #9c8a72;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- drawer */

.drawer {
  position: fixed;
  left: 14px;
  bottom: 56px;
  width: min(380px, calc(100vw - 28px));
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(90, 62, 30, 0.28);
  z-index: 30;
  overflow: hidden;
}

.drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}

.drawer header button {
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.drawer-body {
  padding: 10px 12px 14px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 46vh;
  overflow-y: auto;
}

.drawer-body code {
  font-family: var(--mono);
  font-size: 9.5px;
  background: #f4ecdd;
  border-radius: 4px;
  padding: 1px 4px;
}

.drawer-body a {
  color: #6a4b9c;
}

/* ------------------------------------------------------- gerak & ukuran */

body.is-paused .tape-track,
body.is-paused .blob,
body.is-paused .clock .hand,
body.is-paused .bubble {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .tape-track,
  .blob,
  .clock .hand {
    animation: none;
  }
}

@media (max-width: 1080px) {
  .desk-view {
    grid-template-columns: minmax(0, 1fr) 0 52px;
  }

  .rail {
    position: absolute;
    right: 66px;
    top: 44px;
    bottom: 54px;
    width: min(296px, calc(100vw - 90px));
    z-index: 20;
  }

  .desk-view.no-rail .rail {
    display: none;
  }
}

/* Layar menengah: ikon saja, tanpa label yang terpotong. */
@media (max-width: 1180px) and (min-width: 721px) {
  .rail-icons button {
    padding: 9px 0;
  }

  .rail-icons button span {
    display: none;
  }
}

@media (max-width: 720px) {
  .crest-sub,
  .whiteboard {
    display: none;
  }

  .crest {
    top: 4%;
    width: 60%;
  }

  .crest-title {
    font-size: clamp(15px, 7cqw, 26px);
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .crest-title::before,
  .crest-title::after {
    display: none;
  }

  .room {
    aspect-ratio: 3 / 4.3;
    align-self: center;
    max-height: 100%;
  }

  .desk {
    width: 25%;
    min-width: 92px;
  }

  .desk[data-agent="lead"],
  .desk[data-agent="research"],
  .desk[data-agent="risk"] {
    left: 3%;
  }

  .desk[data-agent="market"],
  .desk[data-agent="strategist"],
  .desk[data-agent="execution"] {
    left: 68%;
  }

  .desk[data-agent="lead"],
  .desk[data-agent="market"] {
    top: 11%;
  }

  .desk[data-agent="research"],
  .desk[data-agent="strategist"] {
    top: 39%;
  }

  .desk[data-agent="risk"],
  .desk[data-agent="execution"] {
    top: 67%;
  }

  .roundtable {
    width: 44%;
    top: 50%;
  }

  /* Di meja selebar ini, nama peran lebih baik turun satu baris daripada
     dipotong jadi "Execution…". */
  .plate,
  .mood {
    white-space: normal;
    line-height: 1.15;
  }

  .desk-view {
    padding: 6px 6px 0;
  }
}
