:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --paper: #fffdf7;
  --ink: #171717;
  --muted: #66645d;
  --line: #d9d2c4;
  --green: #138a55;
  --green-dark: #0d5e3e;
  --amber: #c07816;
  --red: #b43b3b;
  --blue: #365d8d;
  --shadow: 0 16px 44px rgba(24, 22, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.74), rgba(244, 241, 232, 0.96)),
    repeating-linear-gradient(90deg, rgba(23, 23, 23, 0.035) 0 1px, transparent 1px 76px);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 8px 18px rgba(19, 138, 85, 0.18);
}

.primary:hover {
  background: var(--green-dark);
}

.secondary {
  background: #1c1b18;
  color: white;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.top-actions,
.button-row,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ebe4d6;
}

.tab-button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tab-button.active {
  background: #171717;
  color: #fffdf7;
  box-shadow: 0 8px 18px rgba(23, 23, 23, 0.12);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 36px;
  display: grid;
  gap: 14px;
}

.tab-page {
  display: grid;
  gap: 14px;
}

.tab-page[hidden] {
  display: none;
}

.panel {
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero-panel {
  padding: 14px 18px;
}

.floor-hero {
  display: flex;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #2c3034;
  border-radius: 8px;
  background: #171b1f;
  box-shadow: var(--shadow);
}

.floor-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 81vh;
  aspect-ratio: 3 / 2;
  background: #171b1f;
}

.floor-stage > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}

.floor-agent {
  --agent-size: 105px;
  --agent-scale: 1;
  --agent-face: 1;
  position: absolute;
  left: calc(var(--agent-x, 50) * 1%);
  top: calc(var(--agent-y, 80) * 1%);
  z-index: 2;
  width: var(--agent-size);
  height: var(--agent-size);
  pointer-events: none;
  transform: translate(-50%, -100%) scale(var(--agent-scale)) scaleX(var(--agent-face));
  transform-origin: 50% 100%;
  image-rendering: pixelated;
}

.floor-agent[hidden] {
  display: none;
}

.floor-agent-shadow {
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 10px;
  height: 9px;
  border-radius: 50%;
  background: rgba(39, 31, 24, 0.26);
  filter: blur(1px);
}

.floor-agent-sprite {
  position: absolute;
  inset: 0;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: calc(var(--agent-size) * 4) var(--agent-size);
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.95))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(2px 2px 0 rgba(20, 24, 28, 0.18));
  image-rendering: pixelated;
}

.floor-agent.is-idle .floor-agent-sprite {
  background-image: url("/assets/rainbow-broker-idle-transparent.png");
  animation: broker-idle 1040ms steps(4) infinite;
}

.floor-agent.is-walk .floor-agent-sprite {
  background-image: url("/assets/rainbow-broker-walk-transparent.png");
  background-size: calc(var(--agent-size) * 3) var(--agent-size);
  animation: broker-walk 420ms steps(3) infinite;
}

@keyframes broker-idle {
  to {
    background-position-x: calc(var(--agent-size) * -4);
  }
}

@keyframes broker-walk {
  to {
    background-position-x: calc(var(--agent-size) * -3);
  }
}

.floor-brain-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  align-items: center;
  gap: 18px;
  min-height: 520px;
  padding: 20px;
  border: 1px solid #242b2f;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 18, 20, 0.98), rgba(31, 36, 39, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 60px);
  box-shadow: var(--shadow);
}

.portfolio-monitor {
  width: min(100%, 650px);
  justify-self: stretch;
}

.monitor-bezel {
  padding: 14px;
  border: 1px solid #3c464b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #212930, #080b0e),
    #11161a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 46px rgba(0, 0, 0, 0.3);
}

.monitor-top,
.monitor-positions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monitor-top {
  margin-bottom: 12px;
  color: #f4f1e8;
}

.monitor-top h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.monitor-top .eyebrow {
  color: #9ea9a0;
}

.monitor-top > strong {
  min-width: 72px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3d4b43;
  border-radius: 5px;
  background: #0b110d;
  color: #9bd36b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.pixel-chart {
  position: relative;
  overflow: hidden;
  height: 230px;
  display: flex;
  align-items: stretch;
  gap: 5px;
  padding: 14px 12px 12px;
  border: 1px solid #2e3d32;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(11, 20, 13, 0.95), rgba(4, 8, 6, 0.97)),
    repeating-linear-gradient(0deg, rgba(146, 196, 124, 0.08) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(146, 196, 124, 0.08) 0 1px, transparent 1px 28px);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.45);
}

.pixel-bar {
  position: relative;
  z-index: 1;
  align-self: end;
  flex: 1;
  min-width: 8px;
  border: 1px solid rgba(0, 0, 0, 0.36);
  border-radius: 2px 2px 0 0;
  image-rendering: pixelated;
}

.pixel-bar.up {
  background:
    linear-gradient(180deg, #b6ec77 0 18%, #47a858 18% 64%, #1c5f3c 64%),
    #47a858;
  box-shadow: 0 0 9px rgba(80, 206, 105, 0.28);
}

.pixel-bar.down {
  background:
    linear-gradient(180deg, #f49a78 0 18%, #d64f3f 18% 64%, #70251f 64%),
    #d64f3f;
  box-shadow: 0 0 9px rgba(214, 79, 63, 0.22);
}

.pixel-bar.idle {
  background:
    linear-gradient(180deg, #556268 0 18%, #303a3f 18% 64%, #151b1f 64%),
    #303a3f;
}

.pixel-candle {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 9px;
  height: 100%;
  image-rendering: pixelated;
}

.candle-wick,
.candle-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(0, 0, 0, 0.42);
}

.candle-wick {
  width: 3px;
}

.candle-body {
  width: min(14px, 76%);
  min-height: 4px;
}

.pixel-candle.up .candle-wick,
.pixel-candle.up .candle-body {
  background: #54c765;
  box-shadow: 0 0 8px rgba(84, 199, 101, 0.24);
}

.pixel-candle.down .candle-wick,
.pixel-candle.down .candle-body {
  background: #d95847;
  box-shadow: 0 0 8px rgba(217, 88, 71, 0.2);
}

.pixel-candle.idle .candle-wick,
.pixel-candle.idle .candle-body {
  background: #6c787d;
}

.pixel-zero-line {
  position: absolute;
  z-index: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: rgba(207, 216, 210, 0.22);
}

.monitor-positions-head {
  margin: 14px 0 8px;
  color: #cfd8d2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.monitor-positions-head span:last-child {
  color: #9bd36b;
  text-transform: none;
  overflow-wrap: anywhere;
}

.floor-position-list {
  display: grid;
  gap: 7px;
}

.floor-position {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #2e3d32;
  border-left-width: 4px;
  border-radius: 5px;
  background: rgba(9, 16, 11, 0.9);
  color: #edf7e8;
}

.floor-position.up {
  border-left-color: #54c765;
}

.floor-position.down {
  border-left-color: #d95847;
}

.floor-position.idle {
  border-left-color: #556268;
}

.floor-position span,
.floor-position small,
.floor-position strong {
  display: block;
  min-width: 0;
}

.floor-position span strong {
  font-size: 14px;
}

.floor-position small {
  margin-top: 2px;
  color: #8fa28f;
  font-size: 11px;
  text-transform: uppercase;
}

.floor-position > strong {
  color: #f4f1e8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.empty-monitor-row {
  border-left-color: #556268;
  color: #a8b0aa;
}

.monitor-stand {
  width: 34%;
  height: 28px;
  margin: 0 auto;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #171d20, #0b0e10);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.blackberry-shell {
  width: min(430px, 100%);
  justify-self: center;
  padding: 12px;
  border: 1px solid #30383d;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #1c2328, #080a0c 74%),
    #11161a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 50px rgba(0, 0, 0, 0.28);
}

.phone-top {
  display: grid;
  grid-template-columns: 14px minmax(60px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 4px 10px;
}

.phone-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9bd36b;
  box-shadow: 0 0 10px rgba(155, 211, 107, 0.85);
}

.phone-speaker {
  height: 6px;
  border-radius: 999px;
  background: #07090a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #3d484d;
  border-radius: 999px;
  color: #cfd8d2;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.phone-state.good {
  color: #c7f6d6;
  border-color: #2b7048;
}

.phone-state.warn {
  color: #f1c778;
  border-color: #756337;
}

.phone-screen {
  padding: 10px;
  border: 1px solid #344036;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(19, 31, 22, 0.96), rgba(8, 13, 10, 0.98)),
    #0c120e;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.48),
    0 1px 0 rgba(255, 255, 255, 0.05);
}

.phone-screen-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #eef7e7;
}

.phone-screen-head img {
  width: 42px;
  height: 42px;
  border: 1px solid #425341;
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
}

.phone-screen-head strong,
.phone-screen-head small {
  display: block;
}

.phone-screen-head small {
  margin-top: 2px;
  color: #9fb39b;
  overflow-wrap: anywhere;
}

.phone-chat-log {
  min-height: 300px;
  max-height: 340px;
  border-color: #2c3a2d;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(14, 21, 14, 0.92), rgba(5, 9, 7, 0.95)),
    repeating-linear-gradient(0deg, rgba(130, 180, 115, 0.08) 0 1px, transparent 1px 25px);
}

.phone-chat-log .chat-bubble {
  max-width: min(84%, 310px);
  border: 1px solid #40523f;
  border-radius: 5px;
  background: #202a22;
  color: #e7f2df;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.phone-chat-log .chat-row.agent .chat-bubble,
.phone-chat-log .chat-row.user .chat-bubble {
  border-radius: 5px;
}

.phone-chat-log .chat-row.user .chat-bubble {
  border-color: #1f7a56;
  background: #10392d;
  color: #e3fff0;
}

.phone-compose {
  grid-template-columns: minmax(0, 1fr) 58px;
  margin-top: 10px;
}

.phone-compose input {
  min-height: 34px;
  border-color: #3b4a3b;
  border-radius: 5px;
  background: #0c130e;
  color: #edf7e8;
}

.phone-compose button {
  min-height: 34px;
  border-radius: 5px;
  padding: 0 8px;
  background: #4d5c52;
  box-shadow: none;
}

.blackberry-nav {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  gap: 8px;
  margin: 10px 18px 8px;
}

.blackberry-nav span {
  min-height: 24px;
  border: 1px solid #30383d;
  border-radius: 5px;
  background: linear-gradient(180deg, #242c31, #12171a);
}

.blackberry-nav .trackpad {
  border-color: #4e5c63;
  background: linear-gradient(180deg, #78858b, #3d474d);
}

.blackberry-keyboard {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
}

.blackberry-keyboard span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid #30383d;
  border-radius: 4px;
  background: linear-gradient(180deg, #252c31, #101417);
  color: #d7dedc;
  font-size: 10px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.eyebrow,
.label {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #faf7ee;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.good {
  color: var(--green-dark);
  border-color: rgba(19, 138, 85, 0.35);
}

.pill.warn {
  color: var(--amber);
  border-color: rgba(192, 120, 22, 0.42);
}

.pill.bad {
  color: var(--red);
  border-color: rgba(180, 59, 59, 0.42);
}

.good-text {
  color: var(--green-dark);
}

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

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.status-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.balance-line {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 12px;
  background: #fbf8ef;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.right {
  text-align: right;
}

.muted-cell,
.empty {
  color: var(--muted);
}

.broker-grid {
  min-height: 154px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 10px;
}

.broker {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #faf7ee;
}

.broker img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e7dfd0;
}

.broker div {
  padding: 9px;
  font-size: 13px;
}

.brain-panel {
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
}

.brain-profile {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.brain-profile img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}

.brain-profile strong,
.brain-profile small {
  display: block;
}

.brain-profile small {
  color: var(--muted);
  margin-top: 3px;
}

.chat-log {
  min-height: 260px;
  max-height: 390px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f6f2;
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(78%, 360px);
  padding: 9px 12px;
  border-radius: 18px;
  background: #e5e5ea;
  color: #171717;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-row.agent .chat-bubble {
  border-bottom-left-radius: 6px;
}

.chat-row.user .chat-bubble {
  background: #0a84ff;
  color: white;
  border-bottom-right-radius: 6px;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.form-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

input.saved-key {
  background: #fbf8ef;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 800;
}

input:disabled {
  background: #f3eee3;
  color: var(--muted);
}

.button-row {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.agent-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin: 12px 0;
  background: #fbf8ef;
}

.compact-box {
  margin: 4px 0 12px;
}

.admin-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line);
}

.mini-lines {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-balances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.agent-balances span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.key-panel {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.admin-panel {
  width: min(760px, 100%);
}

.admin-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbf8ef;
}

.admin-settings {
  max-width: 620px;
}

.installed-box {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(19, 138, 85, 0.28);
  border-radius: 8px;
  background: #f1fbf5;
}

.installed-box[hidden] {
  display: none;
}

.installed-box strong {
  color: var(--green-dark);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.broker-swap-grid {
  margin-top: 4px;
}

.full {
  width: 100%;
}

.mode-toggle {
  width: 100%;
  border-color: rgba(192, 120, 22, 0.36);
  background: #fff7e6;
  color: #7a430c;
  font-weight: 900;
}

.mode-toggle.live {
  border-color: rgba(19, 138, 85, 0.38);
  background: #eaf8ef;
  color: var(--green-dark);
}

.output,
.quote-output {
  min-height: 146px;
  max-height: 300px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #161714;
  color: #f2f0e8;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.compact-output {
  min-height: 126px;
  overflow-wrap: anywhere;
}

.swap-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf5;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.swap-status[data-tone="ok"] {
  border-color: rgba(19, 138, 85, 0.28);
  background: #eff9f2;
  color: var(--green-dark);
}

.swap-status[data-tone="error"] {
  border-color: rgba(192, 57, 43, 0.25);
  background: #fff2ef;
  color: #973326;
}

.decision {
  border-left: 4px solid var(--blue);
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #f7f7f4;
  border-radius: 0 8px 8px 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: #171717;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  z-index: 10;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .grid.two,
  .status-grid,
  .admin-gate {
    grid-template-columns: 1fr;
  }

  .quote-grid {
    grid-template-columns: 1fr;
  }

  .floor-brain-wrap {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .monitor-top h2 {
    font-size: 20px;
  }

  .pixel-chart {
    height: 190px;
  }

  .floor-stage {
    max-width: 69vh;
  }
}
