/* Hosted Floor adaptations. The extension remains unchanged unless the
   web-floor adapter adds .hosted-floor to <html>. */
.hosted-tools,
.hosted-popover {
  display: none;
}

.hosted-floor .hosted-tools {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 2px;
}

.hosted-floor #officeMapBtn,
.hosted-floor .topnav a[href="options.html"],
.hosted-floor #officeSignOutBtn,
.hosted-floor #floorPulseStrategy,
.hosted-floor .fc-actions,
.hosted-floor #flrExecBtn,
.hosted-floor #sessionEndBtn,
.hosted-floor .jnl-pnl-edit-btn,
.hosted-floor #pnlEditModal,
.hosted-floor .mm-slot-actions,
.hosted-floor #mm-captureExec1h,
.hosted-floor #back {
  display: none !important;
}

.hosted-icon-btn,
.hosted-account-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.68);
  color: var(--ink-2);
  cursor: pointer;
}

.hosted-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hosted-icon-btn svg { width: 17px; height: 17px; }
.hosted-icon-btn:hover,
.hosted-icon-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--accent-mid); background: var(--accent-soft); }
.hosted-bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--stop);
  color: #fff;
  font: 800 8px/13px var(--font-mono);
}

.hosted-account-btn {
  min-height: 34px;
  border-radius: 7px;
  padding: 3px 7px 3px 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.hosted-account-btn > svg { width: 12px; height: 12px; color: var(--ink-4); }
.hosted-avatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, rgba(124,131,255,.30), rgba(77,210,154,.14));
  border: 1px solid rgba(124,131,255,.36);
  color: #eef0ff;
  font: 800 10px var(--font-mono);
  text-transform: uppercase;
}
.hosted-account-copy { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.hosted-account-copy strong { max-width: 94px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font: 700 11px var(--font-sans); white-space: nowrap; }
.hosted-account-copy small { color: var(--ink-4); font: 650 8px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }

.hosted-floor .hosted-popover {
  position: fixed;
  z-index: 3000;
  top: 66px;
  right: 12px;
  width: min(370px, calc(100vw - 24px));
  max-height: min(520px, calc(100dvh - 82px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(10, 12, 17, 0.985);
  box-shadow: 0 22px 64px rgba(0,0,0,.62);
  backdrop-filter: blur(18px);
}
.hosted-floor .hosted-popover:not([hidden]) { display: flex; flex-direction: column; }
.hosted-popover header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}
.hosted-popover header div { display: flex; flex-direction: column; gap: 2px; }
.hosted-popover header span { color: var(--accent); font: 750 8px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.hosted-popover header strong { color: var(--ink); font: 750 15px var(--font-sans); }
.hosted-popover header button { appearance: none; border: 0; background: transparent; color: var(--ink-3); font: 650 10px var(--font-sans); cursor: pointer; }
.hosted-popover header button:hover { color: var(--ink); }
.hosted-notification-list { min-height: 120px; overflow-y: auto; }
.hosted-notification {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px 13px;
  text-align: left;
  cursor: pointer;
}
.hosted-notification:hover { background: rgba(255,255,255,.025); }
.hosted-notification.unread { background: rgba(124,131,255,.045); }
.hosted-notification-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--ink-4); }
.hosted-notification.signal .hosted-notification-dot { background: var(--accent); box-shadow: 0 0 8px rgba(124,131,255,.55); }
.hosted-notification.trade .hosted-notification-dot { background: var(--take); }
.hosted-notification.risk .hosted-notification-dot { background: var(--stop); }
.hosted-notification.news .hosted-notification-dot { background: var(--wait); }
.hosted-notification-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hosted-notification-copy strong { color: var(--ink); font: 700 11px var(--font-sans); }
.hosted-notification-copy span { color: var(--ink-3); font: 500 10px/1.4 var(--font-sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hosted-notification time { color: var(--ink-4); font: 600 8px var(--font-mono); white-space: nowrap; }
.hosted-empty { margin: 0; padding: 30px 18px; color: var(--ink-4); font: 550 11px var(--font-sans); text-align: center; }

.hosted-account-menu { width: 258px !important; padding: 10px; gap: 8px; }
.hosted-account-summary { display: flex; align-items: center; gap: 10px; padding: 5px; }
.hosted-account-summary .hosted-avatar { width: 36px; height: 36px; }
.hosted-account-summary div { min-width: 0; display: flex; flex-direction: column; }
.hosted-account-summary strong { color: var(--ink); font: 750 13px var(--font-sans); overflow: hidden; text-overflow: ellipsis; }
.hosted-account-summary small { color: var(--ink-3); font: 550 10px var(--font-sans); overflow: hidden; text-overflow: ellipsis; }
.hosted-session-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 7px; border-top: 1px solid var(--line); color: var(--ink-4); font: 650 9px var(--font-mono); text-transform: uppercase; }
.hosted-session-row strong { color: var(--take); }
.hosted-signout { appearance: none; min-height: 34px; border: 1px solid rgba(229,115,115,.25); border-radius: 5px; background: rgba(229,115,115,.07); color: var(--stop); font: 700 10px var(--font-sans); cursor: pointer; }

.auth-brand span { display: inline-flex; align-items: baseline; gap: 6px; }

@media (max-width: 960px) {
  .hosted-floor,
  .hosted-floor body { min-height: 100%; height: auto; overflow: auto; overscroll-behavior-y: none; }
  .hosted-floor body.auth-booting,
  .hosted-floor body.auth-locked { height: auto; min-height: 100dvh; overflow: auto; }
  .hosted-floor .app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
    gap: 8px;
    padding: max(7px, env(safe-area-inset-top)) 7px max(9px, env(safe-area-inset-bottom));
  }
  .hosted-floor .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 9px;
    padding: 8px;
    border-radius: 7px;
    background: rgba(12, 15, 20, .97);
    backdrop-filter: blur(18px);
  }
  .hosted-floor .crest { width: 34px; height: 34px; }
  .hosted-floor .brand { flex: 1; }
  .hosted-floor .brand .name { font-size: 14px; }
  .hosted-floor .brand .by { display: inline; font-size: 8px; }
  .hosted-floor .brand .sub { display: block; font-size: 8px; }
  .hosted-floor .hosted-tools { grid-column: 3; grid-row: 1; margin-left: auto; }
  .hosted-floor .hosted-account-copy { display: none; }
  .hosted-floor .hosted-account-btn { width: 34px; padding: 3px; justify-content: center; }
  .hosted-floor .hosted-account-btn > svg { display: none; }
  .hosted-floor .topnav { grid-column: 1 / -1; grid-row: 2; order: initial; width: auto; padding-top: 7px; border-top: 1px solid var(--line); }
  .hosted-floor .topnav:has(.navbtn:not([style*="display: none"])) { display: flex; }
  .hosted-floor .navbtn { min-height: 30px; padding: 5px 9px; }
  .hosted-floor .topbar-stats-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(140px, 0.8fr);
    width: 100%;
    margin: 0;
    padding: 8px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    gap: 8px;
    align-items: stretch;
  }
  .hosted-floor .topbar .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 0;
  }
  .hosted-floor .stat { padding: 0 9px; border-right: 1px solid var(--line); }
  .hosted-floor .stat:last-child { border-right: 0; }
  .hosted-floor .stat .v { font-size: 13px; }
  .hosted-floor .stat .l { font-size: 7px; }
  .hosted-floor .dash-how-mount {
    max-width: none;
    align-self: center;
    justify-self: end;
  }
  .hosted-floor .dash-how-mount .leverage-how-trigger {
    width: 100%;
    min-height: 34px;
  }
  .hosted-floor .avatar-rail,
  .hosted-floor .live-badge { display: none; }
  .hosted-floor .scene-wrap {
    flex: 0 0 clamp(260px, 38vh, 350px);
    height: clamp(260px, 38vh, 350px);
    min-height: 260px;
    border-radius: 7px;
  }
  html.mobile-floor.hosted-floor .scene-wrap,
  .hosted-floor.mobile-floor .scene-wrap {
    display: none !important;
    flex: none;
    height: 0;
    min-height: 0;
  }
  html.mobile-floor.hosted-floor .hubtab[data-tab="learning"],
  html.mobile-floor.hosted-floor .hubtab[data-tab="relay"],
  html.mobile-floor.hosted-floor .hubtab[data-tab="signals"],
  html.mobile-floor.hosted-floor .hubpane[data-pane="learning"],
  html.mobile-floor.hosted-floor .hubpane[data-pane="relay"],
  html.mobile-floor.hosted-floor .hubpane[data-pane="signals"] {
    display: none !important;
  }
  .hosted-floor .market-flow { left: 12px; right: 12px; bottom: 11px; }
  .hosted-floor .panels { flex: none; overflow: visible; gap: 8px; }
  .hosted-floor .floor-command,
  .hosted-floor .panel,
  .hosted-floor .setup-events { border-radius: 7px; }
  .hosted-floor .fc-map { grid-template-columns: 1fr; padding: 9px 10px; }
  /* Pulse stays a single compact status row on mobile. */
  .hosted-floor .fc-pulse {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    min-height: 0;
  }
  .hosted-floor .fc-pulse .fc-head {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .hosted-floor .fc-pulse .fc-title { font-size: 11px; }
  .hosted-floor .fc-pulse .fc-strategy,
  .hosted-floor .fc-pulse .fc-timing,
  .hosted-floor .fc-pulse .fc-meta { display: none; }
  .hosted-floor .fc-pulse .fp-state { padding: 2px 6px; font-size: 9px; }
  .hosted-floor .fc-pulse .fc-actions { flex: 0 0 auto; gap: 5px; }
  .hosted-floor .fc-pulse .fp-toggle {
    min-height: 26px;
    padding: 3px 8px;
    font-size: 9px;
  }
  .hosted-floor .fc-pulse .fp-toggle.on { width: 26px; height: 26px; padding: 0; }
  .hosted-floor .fc-pulse .fp-toggle.impulse { padding: 3px 7px; font-size: 8px; }
  .hosted-floor .fc-pulse .fp-toggle.impulse.on {
    width: auto;
    height: auto;
    padding: 3px 7px;
  }
  .hosted-floor .fc-pulse .fp-toggle svg { width: 11px; height: 11px; }
  .hosted-floor .fc-map .fc-head { flex-wrap: wrap; gap: 7px; }
  .hosted-floor .fc-map .fc-timing { margin-left: auto; font-size: 8px; }
  .hosted-floor .fc-map .fc-meta,
  .hosted-floor .fc-meta { font-size: 9px; }
  .hosted-floor .fc-read-inner { padding: 10px; }
  .hosted-floor .fc-thumb-wrap,
  .hosted-floor .fc-thumb { width: 64px; height: 48px; }
  .hosted-floor .fc-feeds-strip { padding: 7px 10px 8px; }
  .hosted-floor .hub { min-height: 480px; max-height: none; }
  /* Pin hub tabs on mobile: wrap + no free drag scroll. */
  .hosted-floor .hub-tabs {
    flex-wrap: wrap;
    row-gap: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-overflow-scrolling: auto;
    scrollbar-width: none;
  }
  .hosted-floor .hub-tabs::-webkit-scrollbar { display: none; }
  .hosted-floor .hubtab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 10px;
    touch-action: manipulation;
    -webkit-user-drag: none;
    user-select: none;
  }
  .hosted-floor .hubpane.active { min-height: 410px; }
  .hosted-floor .pb { max-height: none; }
  .hosted-floor .setup-events { max-height: none; }
  .hosted-floor .foot { display: none; }
  .hosted-floor .hosted-popover {
    top: auto;
    left: 7px;
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    width: auto !important;
    max-height: min(72dvh, 620px);
    border-radius: 9px;
  }
  /* PNL share sheet sits above sticky topbar; header + actions stay reachable */
  .hosted-floor .pnl-card-modal,
  .hosted-floor .pnl-edit-modal {
    z-index: 220;
  }
  .hosted-floor .pnl-card-dialog {
    max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 10px));
  }
  .hosted-floor .pnl-card-preview {
    max-height: min(48dvh, 340px);
  }
  .hosted-floor .pnl-card-preview .wtsc-stage {
    min-width: 0;
    max-height: min(44dvh, 300px);
  }
  .hosted-floor .hosted-account-menu { left: auto; max-width: 300px; }
  .hosted-floor .auth-gate { place-items: stretch; padding: 0; background: var(--bg); }
  .hosted-floor .auth-shell {
    width: 100%;
    height: auto;
    max-height: none;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .hosted-floor .auth-story { order: -1; }
  .hosted-floor .auth-card { order: 0; }
  .hosted-floor .auth-title { font-size: 24px; }
  .hosted-floor .auth-field input { min-height: 50px; font-size: 16px; }
  .hosted-floor .auth-submit,
  .hosted-floor .auth-request { width: 100%; min-height: 50px; }
  .hosted-floor .auth-continue { display: none; }
}

@media (max-width: 520px) {
  .hosted-floor .topbar-stats-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .hosted-floor .app { padding-left: 5px; padding-right: 5px; }
  .hosted-floor .topbar { gap: 6px; padding: 7px; }
  .hosted-floor .hosted-tools { gap: 5px; }
  .hosted-floor .scene-wrap { flex-basis: 250px; height: 250px; min-height: 250px; }
  html.mobile-floor.hosted-floor .scene-wrap { display: none !important; }
  .hosted-floor .room-label { max-width: 190px; }
  .hosted-floor .hubtab { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hosted-floor .market-flow-track,
  .hosted-floor .live-badge::before { animation: none !important; }
}
