@import url("./src/community/community-theme.css?v=1");
:root {
  /* WrektView UI system: one palette, one spacing/radius language, one focus treatment. */
  --wv-bg: #0b0f14;
  --wv-chrome: #11161d;
  --wv-panel: #10151c;
  --wv-panel-raised: #111820;
  --wv-input: #0b1016;
  --wv-control: #1a222c;
  --wv-control-hover: #26303c;
  --wv-border-subtle: #242b35;
  --wv-border: #303946;
  --wv-border-strong: #344356;
  --wv-text: #d8dee9;
  --wv-text-strong: #e8edf3;
  --wv-text-muted: #8895a5;
  --wv-accent: #5d96ff;
  --wv-accent-strong: #2764d8;
  --wv-positive: #32d583;
  --wv-negative: #f04438;
  --wv-danger: #ff5b68;
  --wv-radius-sm: 6px;
  --wv-radius-md: 8px;
  --wv-radius-lg: 12px;
  --wv-control-h: 34px;
  --wv-control-h-compact: 30px;
  --wv-focus-ring: 0 0 0 2px rgba(93,150,255,.22);
  --wv-shadow-float: 0 18px 48px rgba(0,0,0,.48);
  --market-ticker-row: 28px;
  --wrekt-viewport-width: 100vw;
  --wrekt-viewport-height: 100dvh;
  --wrekt-viewport-left: 0px;
  --wrekt-viewport-top: 0px;
  --wrekt-keyboard-inset: 0px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--wv-text);
  background: var(--wv-bg);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; width: 100%; height: 100%; overflow: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, input, textarea, select { font: inherit; }
button { min-width: 0; max-width: 100%; cursor: pointer; overflow: hidden; text-align: center; overflow-wrap: anywhere; }
.hidden { display: none !important; }

/* Canonical interaction primitives. Component CSS can size these, but not invent a new visual language. */
button, input, textarea, select { transition: border-color .12s ease, background-color .12s ease, color .12s ease, box-shadow .12s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--wv-focus-ring); }
::selection { background: rgba(93,150,255,.28); color: #fff; }

.app-shell { display: grid; grid-template-rows: 48px var(--market-ticker-row) minmax(0, 1fr); background: var(--wv-bg); }
.topbar { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; min-height: 48px; align-items: center; gap: 12px; padding: 0 10px; border-bottom: 1px solid var(--wv-border-subtle); background: var(--wv-chrome); }
.market-ticker { min-width:0; height:var(--market-ticker-row); overflow:hidden; border-bottom:1px solid var(--wv-border-subtle); background:var(--wv-input); }
.market-ticker-track { height:100%; display:flex; align-items:stretch; justify-content:safe center; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
.market-ticker-track::-webkit-scrollbar { display:none; }
.market-ticker-item { flex:0 0 auto; min-width:150px; height:100%; display:grid; grid-template-columns:auto auto auto; align-items:center; justify-content:center; gap:6px; padding:0 12px; border:0; border-right:1px solid #202a35; border-radius:0; background:transparent; color:#dbe4ed; font-size:10px; line-height:1; white-space:nowrap; font-variant-numeric:tabular-nums; transition:background-color .35s ease, box-shadow .35s ease; }
.market-ticker-item:first-child { border-left:1px solid #202a35; }
.market-ticker-item strong { color:#f2f6fa; font-size:10px; letter-spacing:.25px; }
.market-ticker-price { min-width:52px; text-align:right; font-weight:800; color:#dbe4ed; }
.market-ticker-change { min-width:46px; text-align:right; font-weight:800; color:#8290a0; }
.market-ticker-change.positive { color:var(--wv-positive); }
.market-ticker-change.negative { color:#f04438; }
.market-ticker-item.active { background:#141d27; box-shadow:inset 0 -2px 0 var(--wv-accent); }
.market-ticker-item.tick-flash-up { animation:wrekt-tick-up .48s ease-out; }
.market-ticker-item.tick-flash-down { animation:wrekt-tick-down .48s ease-out; }
@keyframes wrekt-tick-up { 0%{background:rgba(50,213,131,.58);box-shadow:inset 0 0 18px rgba(50,213,131,.38)} 100%{background:transparent;box-shadow:none} }
@keyframes wrekt-tick-down { 0%{background:rgba(240,68,56,.58);box-shadow:inset 0 0 18px rgba(240,68,56,.38)} 100%{background:transparent;box-shadow:none} }
@media (prefers-reduced-motion: reduce) { .market-ticker-item.tick-flash-up,.market-ticker-item.tick-flash-down { animation:none; } }

.brand-cluster { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wrekt-build-badge { font:900 8px/1 ui-monospace,monospace; color:#72d6ef; opacity:.8; white-space:nowrap; }
.brand { display: flex; align-items: center; min-width: 0; overflow: visible; font-weight: 800; letter-spacing: .2px; }
.brand-logo { display: block; width: 60px; height: auto; max-width: 100%; object-fit: contain; object-position: left center; }
@media (max-width: 760px) { .brand-logo { width: 54px; height: auto; } }
.address-wrap { display: grid; grid-template-columns: 34px 34px 1fr 44px 34px; gap: 5px; }
.address-wrap input, .composer textarea { background: var(--wv-input); color: var(--wv-text-strong); border: 1px solid var(--wv-border); border-radius: 7px; outline: none; }
.address-wrap input { height: 32px; padding: 0 10px; }
.address-wrap button, .account-area button, .chat-panel button { background: var(--wv-control); color: #e7edf3; border: 1px solid var(--wv-border); border-radius: 6px; }
.address-wrap button:hover, .account-area button:hover, .chat-panel button:hover { background: var(--wv-control-hover); }
.account-area { position:relative; display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.wrekt-voice-button{display:none!important}
.wrekt-voice-button>span{font-size:14px;line-height:1}.wrekt-voice-button>small{font:inherit}.wrekt-voice-button.active{border-color:#4f9ec4!important;color:#e9fbff!important;box-shadow:inset 0 0 0 1px rgba(87,184,222,.18),0 0 13px rgba(54,173,216,.12)}
.wrekt-voice-panel{position:fixed;left:50%;top:50%;right:auto;z-index:2147482500;width:min(420px,calc(100vw - 20px));max-height:min(720px,calc(100dvh - 20px));transform:translate(-50%,-50%);display:grid;gap:0;border:1px solid #33495c;border-radius:11px;background:rgba(8,16,23,.985);box-shadow:0 18px 54px rgba(0,0,0,.58);overflow:auto;color:#dbe8f3;white-space:normal}
.wrekt-voice-panel[hidden]{display:none!important}.wrekt-voice-panel header{min-height:48px;display:flex;align-items:center;justify-content:space-between;padding:7px 9px;border-bottom:1px solid #293a48;background:linear-gradient(90deg,rgba(36,111,137,.72),rgba(17,43,58,.72))}
.wrekt-voice-panel header span{display:grid;gap:1px}.wrekt-voice-panel header small{font:850 7px/1 system-ui,sans-serif;letter-spacing:.16em;color:#8ecadd}.wrekt-voice-panel header strong{font:900 14px/1 system-ui,sans-serif;letter-spacing:.05em}.wrekt-voice-panel header button{width:30px;height:30px;padding:0;font-size:18px}
.wrekt-voice-status{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:center;padding:8px 10px;border-bottom:1px solid #22313d;background:#0c151d}.wrekt-voice-status strong{color:#718494;font:900 9px/1 system-ui,sans-serif}.wrekt-voice-status strong[data-state="on"]{color:#72e5bf}.wrekt-voice-status span{overflow:hidden;text-overflow:ellipsis;color:#9fb0bf;font:750 9px/1.2 system-ui,sans-serif}
.wrekt-voice-panel>label{min-height:46px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:7px 10px;border-bottom:1px solid #1f2d37}.wrekt-voice-panel>label>span{display:grid;gap:2px}.wrekt-voice-panel label strong{font:850 9px/1 system-ui,sans-serif;letter-spacing:.03em}.wrekt-voice-panel label small{color:#758797;font:650 8px/1.2 system-ui,sans-serif}.wrekt-voice-panel input[type="checkbox"]{width:18px;height:18px;accent-color:#42b8d5}
.wrekt-voice-panel select{width:132px;height:30px;padding:0 26px 0 8px;border:1px solid #35556a;border-radius:6px;background:#0e1d27;color:#dff7ff;font:800 9px/1 system-ui,sans-serif;outline:none}.wrekt-voice-panel select:focus{border-color:#54a9cc;box-shadow:0 0 0 1px rgba(84,169,204,.2)}.wrekt-voice-panel[data-engine="system"] .wrekt-voice-ai-choice{display:none}
.wrekt-voice-panel .wrekt-voice-volume{grid-template-columns:minmax(0,1fr) 124px}.wrekt-voice-volume output{margin-left:6px;color:#9cddef}.wrekt-voice-volume input{width:124px;accent-color:#42b8d5}.wrekt-voice-test{margin:9px;min-height:36px;border-color:#335b70!important;background:linear-gradient(180deg,#163649,#102634)!important;color:#dff7ff!important;font:900 9px/1 system-ui,sans-serif;letter-spacing:.04em}
body[data-layout-mode^="phone-"] .wrekt-voice-panel{left:50%;top:50%;right:auto;width:min(360px,calc(var(--wrekt-viewport-width,100vw) - 14px));max-height:calc(var(--wrekt-viewport-height,100dvh) - 14px);transform:translate(-50%,-50%)}
body[data-layout-mode="phone-landscape"] .wrekt-voice-panel{top:max(6px,env(safe-area-inset-top));bottom:max(6px,env(safe-area-inset-bottom));left:50%;width:min(620px,calc(var(--wrekt-viewport-width,100vw) - 24px));max-height:none;transform:translateX(-50%);grid-template-columns:1fr;overflow:auto}

.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #6f7782; }
.connection-dot.online { background: var(--wv-positive); box-shadow: 0 0 8px rgba(50,213,131,.6); }
#login-btn { padding: 7px 10px; }
.profile-btn { width: 32px; height: 32px; border-radius: 50% !important; background-size: cover !important; background-position: center !important; }
.wrekt-account-pnl {
  height:40px;
  min-width:430px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  overflow:hidden;
  border:1px solid #355064;
  border-radius:8px;
  background:linear-gradient(180deg,rgba(20,36,47,.98),rgba(8,17,23,.98));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 4px 14px rgba(0,0,0,.2);
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.wrekt-account-pnl > span {
  min-width:0;
  display:grid;
  grid-template-columns:40px minmax(0,1fr);
  align-items:center;
  column-gap:8px;
  padding:4px 10px;
  overflow:hidden;
  border-right:1px solid rgba(65,91,108,.78);
}
.wrekt-account-pnl > span:last-child { border-right:0; }
.wrekt-account-pnl small {
  display:block;
  width:40px;
  color:#a6bac7;
  font-size:6px;
  font-weight:900;
  line-height:1.05;
  letter-spacing:.08em;
  white-space:normal;
}
.wrekt-account-pnl strong {
  min-width:0;
  overflow:hidden;
  color:#eaf5fb;
  font-size:16px;
  font-weight:950;
  line-height:1;
  letter-spacing:-.045em;
  text-align:right;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
#wrekt-account-pnl-value.positive { color:#48dfa6; text-shadow:0 0 10px rgba(72,223,166,.24); }
#wrekt-account-pnl-value.negative { color:#ff687b; text-shadow:0 0 10px rgba(255,104,123,.22); }
.wrekt-account-pnl.hidden { display:none!important; }

@media (max-width:1200px) and (min-width:851px) {
  .wrekt-account-pnl { min-width:330px; }
  .wrekt-account-pnl > span { grid-template-columns:36px minmax(0,1fr); column-gap:6px; padding-inline:8px; }
  .wrekt-account-pnl small { width:36px; }
  .wrekt-account-pnl strong { font-size:13px; }
}

.workspace { position: relative; min-height: 0; display: grid; grid-template-columns: minmax(640px, 1fr) 8px minmax(280px, 400px); }
.browser-pane { position: relative; min-width: 0; background: #080b10; overflow: hidden; }
.browser-hint { position: absolute; left: 12px; top: 12px; z-index: 2; max-width: 640px; padding: 7px 10px; border-radius: 6px; background: rgba(12,17,24,.88); color: #9da9b7; font-size: 11px; pointer-events: none; }
#browser-frame { width: 100%; height: 100%; border: 0; background: #e8e8e8; }
.research-workspace { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-rows: minmax(0, 1fr); background: var(--wv-bg); }
.research-markets { min-width: 0; display: flex; justify-content: center; gap: 5px; overflow: hidden; }
.market-chip, #research-open-external { height: 26px; padding: 0 8px; border: 1px solid var(--wv-border); border-radius: 6px; background: #171f29; color: #dce5ef; font-size: 10px; }
.market-chip:hover, #research-open-external:hover { background: #243140; }
#research-open-external { white-space: nowrap; }
.research-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #758394; font-size: 12px; background: linear-gradient(180deg, #0c1118, #090d12); }

.chat-panel { position:relative; min-width: 0; border-left: 1px solid var(--wv-border-subtle); background: var(--wv-panel); display: grid; grid-template-rows: 36px 52px max-content minmax(0,1fr) auto; overflow: hidden; }
.workspace-resize-handle { position: relative; z-index: 6; width: 8px; min-width: 8px; height: 100%; padding: 0; border: 0; border-radius: 0; background: #151c24; cursor: col-resize; touch-action: none; overflow: visible; }
.workspace-resize-handle::before { content: ""; position: absolute; inset: 0 -4px; }
.workspace-resize-handle span { position: absolute; left: 50%; top: 50%; width: 3px; height: 54px; transform: translate(-50%, -50%); border-radius: 999px; background: #435365; opacity: .72; transition: height .14s ease, background-color .14s ease, opacity .14s ease; }
.workspace-resize-handle:hover span, .workspace-resize-handle:focus-visible span, body.workspace-resizing .workspace-resize-handle span { height: 82px; background: #78aef0; opacity: 1; }
.workspace-resize-handle:focus-visible { outline: 2px solid #78aef0; outline-offset: -2px; }
body.workspace-resizing, body.workspace-resizing * { cursor: col-resize !important; user-select: none !important; }
.workspace.desktop-chart-max .chart-pane > * { visibility: visible; }
.workspace.desktop-chat-max .chart-pane { overflow: hidden; }

.chat-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--wv-border-subtle); }
.chat-tabs .tab { border: 0; border-radius: 0; background: transparent; color: #8f9baa; }
.chat-tabs .tab.active { color: #fff; border-bottom: 2px solid var(--wv-accent); }
.room-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border-bottom: 1px solid var(--wv-border-subtle); }
.room-name { font-weight: 800; font-size: 14px; }
.room-subtitle { font-size: 10px; color: #8895a5; margin-top: 2px; }
#chat-signout { min-width: 64px; height: 28px; padding: 0 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.room-list { max-height: 100px; overflow-y: auto; border-bottom: 1px solid var(--wv-border-subtle); padding: 5px; }
.room-chip { width: 100%; text-align: left; padding: 6px 8px; border: 0 !important; background: transparent !important; color: #aab6c5 !important; }
.room-chip.active { background: #192330 !important; color: #fff !important; }
.message-stage { position:relative; min-height:0; overflow:hidden; }
.message-list { width:100%; height:100%; min-height:0; overflow-y:auto; padding:8px 9px 18px; box-sizing:border-box; scroll-behavior:auto; overflow-anchor:auto; }
.empty-state { color: #768393; font-size: 12px; text-align: center; padding: 30px 12px; }
.message { position: relative; padding: 8px 7px; border: 1px solid #222c38; border-radius: 7px; background: #0f151c; margin-bottom: 5px; }
.message:hover { background: #121a23; border-color: #2a3644; }
.message.selected { background: #141d27; border-color: #415267; box-shadow: 0 5px 18px rgba(0,0,0,.28); }
.message-head { display: flex; align-items: center; gap: 7px; min-height: 22px; }
.message-author { font-weight: 700; font-size: 12px; color: #eef3f8; }
.message-time, .message-edited { font-size: 9px; color: #6e7a89; }
.message-tools { display: flex; gap: 4px; }
.message-action-tray { position: absolute; z-index: 6; top: 5px; right: 7px; align-items: center; max-width: min(430px, calc(100% - 52px)); padding: 4px 5px; border: 1px solid #344252; border-radius: 8px; background: rgba(11,16,22,.96); box-shadow: 0 8px 22px rgba(0,0,0,.38); overflow-x: auto; scrollbar-width: none; }
.message-action-tray::-webkit-scrollbar { display: none; }
.message:not(.selected) .message-action-tray { display: none; }
.message-action-tray button { flex: 0 0 auto; min-width: 28px; height: 28px; padding: 0 5px; border-color: #28323f; background: #111821; font-size: 11px; }
.message-action-tray .role-plate { flex: 0 0 auto; margin-right: 2px; }
.message-body { margin-top: 3px; font-size: 13px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; }
.cashtag { color: #61a6ff; font-weight: 700; }
.reply-preview { width: 100%; display: flex; align-items: stretch; gap: 7px; margin: 4px 0 3px; padding: 4px 6px !important; border: 0 !important; background: transparent !important; color: #92a0b0 !important; text-align: left; font-size: 10px; }
.reply-preview strong { display: block; color: #b8c5d4; font-size: 10px; }
.reply-preview span span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.reply-rule { width: 3px; min-width: 3px; border-radius: 3px; background: #486fa8; }
.reply-jump:hover { background: #131b24 !important; }
.reaction-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction-pill { display: inline-flex; align-items: center; gap: 4px; height: 25px; padding: 0 7px !important; border-radius: 12px !important; font-size: 11px; background: #151e29 !important; border-color: #2a3542 !important; }
.reaction-pill.reacted { background: #17365f !important; border-color: #3b75ba !important; color: #dcecff !important; }
.message-media-link { display: block; margin-top: 7px; }
.message-media { display: block; width: 100%; max-height: 260px; object-fit: contain; border: 1px solid #283441; border-radius: 7px; background: #090d12; }
.symbol-strip { padding: 6px 9px; border-top: 1px solid var(--wv-border-subtle); font-size: 11px; color: #97a7ba; }
.symbol-pill { display: inline-block; margin-right: 5px; padding: 3px 6px; border-radius: 12px; background: #182331; color: #69aaff; }
.composer { border-top: 1px solid var(--wv-border-subtle); padding: 8px; background: #0f141b; }
.composer textarea { width: 100%; height: 62px; resize: none; padding: 8px; }
.composer-actions { --composer-control-size: 36px; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.composer-left { min-width: 0; display: flex; align-items: center; gap: 7px; }
body:not([data-layout-mode^="phone-"]) .composer-left .icon-control,
body:not([data-layout-mode^="phone-"]) #send-btn { width: var(--composer-control-size); min-width: var(--composer-control-size); height: var(--composer-control-size); min-height: var(--composer-control-size); box-sizing: border-box; padding: 0; }
#attach-btn .wv-ui-icon, #paste-snapshot-btn .wv-ui-icon, #send-btn .wv-ui-icon { display: none; }
#attach-btn::before, #paste-snapshot-btn::before, #send-btn::before { content: ""; display: block; width: 20px; height: 20px; background-position: center; background-repeat: no-repeat; background-size: 20px 20px; image-rendering: auto; }
#attach-btn::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef3f8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 11.5 12 20a5 5 0 0 1-7-7l9-9a3.5 3.5 0 0 1 5 5l-9 9a2 2 0 0 1-3-3l8.5-8.5'/%3E%3C/svg%3E"); }
#paste-snapshot-btn::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef3f8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='5' width='12' height='16' rx='2'/%3E%3Cpath d='M9 5.5V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1.5M9 9h6M9 13h6M9 17h4'/%3E%3C/svg%3E"); }
#send-btn::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7v4a4 4 0 0 1-4 4H6'/%3E%3Cpath d='m10 11-4 4 4 4'/%3E%3C/svg%3E"); }
#wrekt-emoji-btn .wv-ui-icon { width: 20px; height: 20px; min-width: 20px; min-height: 20px; object-fit: contain; image-rendering: auto; }
#attach-btn:disabled, #send-btn:disabled { opacity: .45; cursor: default; }
#send-btn { background: var(--wv-accent-strong); border-color: var(--wv-accent-strong); }
.reply-bar, .media-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 6px 7px; border: 1px solid #283442; border-radius: 7px; background: #131a23; font-size: 10px; color: #aebac8; }
.reply-bar span, .media-preview span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar button, .media-preview button { width: 24px; height: 24px; padding: 0; }
.media-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid #303b49; }

@media (max-width: 850px) {
  .topbar { grid-template-columns: 1fr auto; }
  .brand { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .browser-pane { display: none; }
  .chat-panel { border-left: 0; }
}

/* WrektView chart-first workspace */
.mobile-pane-switch { display: none; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.topbar-center { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
#market-quickbar { display: none !important; }
.chart-pane { min-height: 0; }
.research-workspace { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-rows: minmax(0, 1fr); background: var(--wv-bg); }

/* TV-style chat identity */
.message { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 8px; }
.message-avatar { width: 34px; height: 34px; margin-top: 2px; display: grid; place-items: center; overflow: hidden; border-radius: 50% !important; border: 1px solid #2b3948 !important; background: #1a2737 !important; color: #dce8f5 !important; font-size: 11px; font-weight: 800; padding: 0 !important; }
.message-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.message-content { min-width: 0; }
.message-head { flex-wrap: wrap; gap: 6px; }
.message-context { color: #6fa9ff; font-size: 9px; font-weight: 700; white-space: nowrap; }
.message-body:empty { display: none; }
.profile-btn { overflow: hidden; display: grid; place-items: center; padding: 0; font-weight: 800; }
.profile-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
#paste-snapshot-btn { padding: 5px 8px; font-size: 10px; white-space: nowrap; }
#paste-snapshot-btn:disabled { opacity: .45; cursor: default; }

/* Mobile experience v9: explicit navigation, safe header, dedicated landscape density. */
body[data-layout-mode^="phone-"] {
  overflow:hidden;
  max-width:100%;
  overscroll-behavior:none;
}
body[data-layout-mode^="phone-"] .app-shell {
  position: fixed;
  left: var(--wrekt-viewport-left, 0px);
  top: var(--wrekt-viewport-top, 0px);
  right: auto;
  bottom: auto;
  width: var(--wrekt-viewport-width, 100vw);
  max-width: var(--wrekt-viewport-width, 100vw);
  height: var(--wrekt-viewport-height, 100dvh);
  min-width: 0;
  min-height: 0;
  box-sizing:border-box;
  grid-template-rows: calc(42px + env(safe-area-inset-top)) var(--market-ticker-row) minmax(0, 1fr);
  overflow: hidden;
}
body[data-layout-mode="phone-landscape"] .app-shell {
  --market-ticker-row:0px;
  grid-template-rows:calc(36px + env(safe-area-inset-top)) 0 minmax(0,1fr);
}
body[data-layout-mode="phone-landscape"] .topbar { grid-row:1; }
body[data-layout-mode="phone-landscape"] .market-ticker {
  display:block !important;
  grid-row:2;
  height:0 !important;
  min-height:0 !important;
  visibility:hidden;
  pointer-events:none;
  overflow:hidden;
  border:0 !important;
}
body[data-layout-mode="phone-landscape"] .workspace {
  grid-row:3;
  min-height:0;
  height:100%;
}
body[data-layout-mode^="phone-"] .market-quickbar { display: none; }
body[data-layout-mode^="phone-"] .market-ticker-track { justify-content:flex-start; }
body[data-layout-mode^="phone-"] .market-ticker-item { min-width:122px; padding:0 8px; gap:4px; font-size:9px; }
body[data-layout-mode^="phone-"] .market-ticker-item strong { font-size:9px; }
body[data-layout-mode="phone-landscape"] .market-ticker-item { min-width:108px; font-size:8px; }
body[data-layout-mode="phone-landscape"] .market-ticker-item strong { font-size:8px; }
body[data-layout-mode^="phone-"] .topbar {
  position: relative;
  z-index: 900;
  min-width:0;
  max-width:100%;
  min-height: 0;
  height: 100%;
  box-sizing:border-box;
  grid-template-columns: 62px minmax(108px, 1fr) auto;
  align-items: end;
  gap: 4px;
  padding: env(safe-area-inset-top) max(5px, env(safe-area-inset-right)) 4px max(5px, env(safe-area-inset-left));
  overflow:hidden;
}
body[data-layout-mode="phone-landscape"] .topbar {
  grid-template-columns: 66px minmax(120px, 1fr) auto;
  gap: 4px;
  padding-bottom: 3px;
}
body[data-layout-mode^="phone-"] .brand-cluster { display:flex; align-items:center; gap:4px; min-width:0; overflow:hidden; }
body[data-layout-mode^="phone-"] .brand { display:none !important; }
body[data-layout-mode^="phone-"] .brand-cluster .connection-dot { flex:0 0 8px; }
body[data-layout-mode^="phone-"] .wrekt-build-badge { min-width:0; overflow:hidden; text-overflow:clip; white-space:nowrap; }
body[data-layout-mode^="phone-"] .topbar-center { min-width:0; overflow:hidden; display:grid; place-items:end center; }
body[data-layout-mode^="phone-"] .account-area { min-width:0; max-width:218px; gap:4px; justify-self:end; overflow:hidden; }

/* Portrait topbar: physical left / true center / physical right. */
body[data-layout-mode="phone-portrait"] .topbar {
  display:block;
  padding:env(safe-area-inset-top) 0 4px;
}
body[data-layout-mode="phone-portrait"] .brand-cluster {
  position:absolute;
  left:max(5px,env(safe-area-inset-left));
  bottom:4px;
  height:34px;
  max-width:84px;
  gap:3px;
  overflow:visible;
}
body[data-layout-mode="phone-portrait"] .brand {
  display:flex !important;
  order:0;
  width:28px;
  min-width:28px;
  max-width:28px;
  overflow:visible;
}
body[data-layout-mode="phone-portrait"] .brand-logo {
  width:28px;
  max-width:28px;
  max-height:30px;
}
body[data-layout-mode="phone-portrait"] .brand-cluster .connection-dot {
  order:1;
  width:6px;
  height:6px;
  flex:0 0 6px;
}
body[data-layout-mode="phone-portrait"] .wrekt-build-badge {
  order:2;
  font-size:6px;
  line-height:1;
  letter-spacing:-.02em;
  opacity:.72;
}
body[data-layout-mode="phone-portrait"] .topbar-center {
  position:absolute;
  left:50%;
  bottom:4px;
  width:116px;
  max-width:116px;
  height:34px;
  transform:translateX(-50%);
  display:grid;
  place-items:end center;
  overflow:visible;
}
body[data-layout-mode="phone-portrait"] .mobile-pane-switch {
  width:116px;
  max-width:116px;
  margin:0;
}
body[data-layout-mode="phone-portrait"] .account-area {
  position:absolute;
  right:max(5px,env(safe-area-inset-right));
  bottom:4px;
  width:32px;
  min-width:32px;
  max-width:32px;
  height:32px;
  display:grid;
  place-items:center;
  gap:0;
  overflow:visible;
}
body[data-layout-mode="phone-portrait"] .wrekt-account-pnl {
  display:none !important;
}
body[data-layout-mode="phone-portrait"] .profile-btn:not(.hidden),
body[data-layout-mode="phone-portrait"] #login-btn:not(.hidden) {
  display:grid !important;
}
body[data-layout-mode="phone-portrait"] .profile-btn.hidden,
body[data-layout-mode="phone-portrait"] #login-btn.hidden {
  display:none !important;
}
body[data-layout-mode^="phone-"] .wrekt-account-pnl {
  height:29px;
  width:146px;
  min-width:0;
  max-width:146px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
body[data-layout-mode^="phone-"] .wrekt-account-pnl > span {
  min-width:0;
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:auto auto;
  align-content:center;
  gap:1px;
  padding:2px 5px;
  border-right:1px solid rgba(65,91,108,.58);
}
body[data-layout-mode^="phone-"] .wrekt-account-pnl > span:last-child { display:grid; border-right:0; }
body[data-layout-mode^="phone-"] .wrekt-account-pnl small {
  width:auto;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#8198a8;
  font-size:5px !important;
  line-height:1 !important;
  letter-spacing:.04em;
}
body[data-layout-mode^="phone-"] .wrekt-account-pnl strong {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
  font-size:8px !important;
  line-height:1 !important;
  letter-spacing:-.03em;
}
body[data-layout-mode="phone-landscape"] .wrekt-account-pnl { width:178px; max-width:178px; }
body[data-layout-mode="phone-landscape"] .wrekt-account-pnl strong { font-size:9px !important; }
body[data-layout-mode^="phone-"] .account-area .icon-control,
body[data-layout-mode^="phone-"] .profile-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; }
body[data-layout-mode="phone-landscape"] .account-area .icon-control,
body[data-layout-mode="phone-landscape"] .profile-btn { width: 29px; min-width: 29px; height: 29px; min-height: 29px; font-size: 14px; }

body[data-layout-mode^="phone-"] .mobile-pane-switch {
  display:grid;
  position:static;
  justify-self:center;
  align-self:end;
  width:min(116px,100%);
  max-width:100%;
  height:34px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 2px;
  border: 1px solid #2b3745;
  border-radius: 999px;
  background: #101720;
  transform: none;
}
body[data-layout-mode="phone-landscape"] .mobile-pane-switch { width:min(144px,100%); height:30px; }
body[data-layout-mode^="phone-"] .mobile-pane-switch button {
  min-width: 0;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8f9bab;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
body[data-layout-mode="phone-landscape"] .mobile-pane-switch button { min-height: 24px; height: 24px; font-size: 12px; }
body[data-layout-mode^="phone-"] .mobile-pane-switch button.active {
  background: #193d6d;
  color: #fff;
  box-shadow: inset 0 0 0 1px #4387e6;
}

body[data-layout-mode^="phone-"] .workspace-resize-handle { display: none; }
body[data-layout-mode^="phone-"] .workspace {
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:0;
  height:100%;
  box-sizing:border-box;
  position:relative;
  overflow:hidden;
  overscroll-behavior: none;
  background: var(--wv-bg);
}
body[data-layout-mode^="phone-"] .chart-pane,
body[data-layout-mode^="phone-"] .chat-panel {
  position:absolute;
  inset:0;
  width:100%;
  max-width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  box-sizing:border-box;
  overflow-x:hidden;
}
body[data-layout-mode^="phone-"][data-mobile-pane="chart"] .chart-pane { display: block; z-index: 2; }
body[data-layout-mode^="phone-"][data-mobile-pane="chart"] .chat-panel { display: none; }
body[data-layout-mode^="phone-"][data-mobile-pane="chat"] .chart-pane { display: none; }
body[data-layout-mode^="phone-"][data-mobile-pane="chat"] .chat-panel { display: grid; z-index: 2; border-left: 0; }

/* Phone chat structure: explicit rows keep the scroll area stable when DM navigation appears/disappears. */
.room-header-actions { display: flex; align-items: center; gap: 6px; }
#rooms-drawer-toggle { display: none; }
.rooms-drawer, .rooms-drawer-scrim, .dm-drawer, .dm-drawer-scrim { display: none; }
body[data-layout-mode^="phone-"] .chat-panel {
  overflow:hidden;
  width:100%;
  max-width:100%;
  height:calc(100% - var(--wrekt-keyboard-inset, 0px));
  box-sizing:border-box;
  grid-template-rows:38px 46px minmax(0,1fr) auto;
  grid-template-areas: "tabs" "header" "messages" "composer";
  background: #0f151c;
}
body[data-layout-mode^="phone-"] .chat-tabs { grid-area: tabs; }
body[data-layout-mode^="phone-"] .room-header { grid-area: header; min-height: 0; padding: 5px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
body[data-layout-mode^="phone-"] .room-header-copy { min-width: 0; overflow: hidden; }
body[data-layout-mode^="phone-"] .room-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-layout-mode^="phone-"] .room-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-layout-mode^="phone-"] .room-header-actions { flex-wrap: nowrap; flex-shrink: 0; min-width: max-content; }
body[data-layout-mode^="phone-"] #room-list { display: none; }
body[data-layout-mode^="phone-"] .message-stage { grid-area:messages; width:100%; max-width:100%; min-width:0; min-height:0; overflow:hidden; }
body[data-layout-mode^="phone-"] .message-list { width:100%; max-width:100%; min-width:0; min-height:0; box-sizing:border-box; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding:6px 7px 10px; }
body[data-layout-mode^="phone-"] .composer { grid-area:composer; position:relative; z-index:8; width:100%; max-width:100%; min-width:0; box-sizing:border-box; overflow:hidden; padding:6px 7px calc(6px + env(safe-area-inset-bottom)); background:rgba(15,20,27,.98); }
body[data-layout-mode^="phone-"] .composer-compose-row { width:100%; max-width:100%; min-width:0; box-sizing:border-box; }
body[data-layout-mode^="phone-"] .composer textarea { width:100%; max-width:100%; box-sizing:border-box; min-height:52px; height:52px; max-height:104px; }
body[data-layout-mode^="phone-"] .composer-actions { width:100%; max-width:100%; min-width:0; box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:6px; align-items:stretch; }
body[data-layout-mode^="phone-"] .composer-left { min-width:0; display:grid; grid-template-columns:repeat(3,44px); justify-content:start; gap:5px; overflow:hidden; }
body[data-layout-mode^="phone-"] .composer-left button { width:44px; min-width:44px; max-width:44px; padding-inline:5px; white-space:nowrap; line-height:1; }
body[data-layout-mode^="phone-"] input,
body[data-layout-mode^="phone-"] textarea,
body[data-layout-mode^="phone-"] select,
body[data-layout-mode^="phone-"] [contenteditable="true"] { font-size: 16px !important; }
body[data-layout-mode^="phone-"] #send-btn { width:44px; min-width:44px; max-width:44px; padding-inline:0; }
body[data-layout-mode^="phone-"] #rooms-drawer-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; }

/* Message cards stay inside the viewport and metadata degrades gracefully on narrow phones. */
body[data-layout-mode^="phone-"] .message {
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  align-content:start;
  padding:7px 6px;
}
body[data-layout-mode^="phone-"] .message-content { min-width:0; max-width:100%; overflow:hidden; }
body[data-layout-mode^="phone-"] .message-head {
  min-width:0;
  max-width:100%;
  align-items:flex-start;
  gap:4px 6px;
  overflow:hidden;
}
body[data-layout-mode^="phone-"] .message-author {
  min-width:0;
  max-width:min(46%,180px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body[data-layout-mode^="phone-"] .message-rep {
  max-width:92px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body[data-layout-mode^="phone-"] .message-context {
  max-width:86px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body[data-layout-mode="phone-portrait"] .message-time { flex-basis:100%; margin-top:-1px; }
body[data-layout-mode="phone-portrait"] .message-live-presence { font-size:0; gap:0; }
body[data-layout-mode="phone-portrait"] .message-live-dot { width:7px; height:7px; min-width:7px; }

body[data-layout-mode^="phone-"] .message-action-tray {
  top: 4px;
  right: 5px;
  width: auto;
  max-width: calc(100% - 46px);
  margin-left: 0;
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
body[data-layout-mode^="phone-"] .message-action-tray::-webkit-scrollbar { display: none; }
body[data-layout-mode^="phone-"] .message-action-tray button { flex: 0 0 auto; }

/* Phone room and DM drawers: navigation never owns permanent chat height. */
body[data-layout-mode^="phone-"] .rooms-drawer-scrim,
body[data-layout-mode^="phone-"] .dm-drawer-scrim { display: block; position: absolute; inset: 0; z-index: 78; border: 0; border-radius: 0; background: rgba(2,6,10,.55); opacity: 0; pointer-events: none; transition: opacity .16s ease; }
body[data-layout-mode^="phone-"] .rooms-drawer,
body[data-layout-mode^="phone-"] .dm-drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); position: absolute; inset: 0 auto 0 0; z-index: 79; width: min(82vw, 330px); border-right: 1px solid #2d3947; background: rgba(13,19,26,.985); box-shadow: 18px 0 44px rgba(0,0,0,.42); transform: translateX(-102%); transition: transform .18s ease; }
body[data-layout-mode^="phone-"][data-rooms-drawer="open"] .rooms-drawer,
body[data-layout-mode^="phone-"][data-dm-drawer="open"] .dm-drawer { transform: translateX(0); }
body[data-layout-mode^="phone-"][data-rooms-drawer="open"] .rooms-drawer-scrim,
body[data-layout-mode^="phone-"][data-dm-drawer="open"] .dm-drawer-scrim { opacity: 1; pointer-events: auto; }
.rooms-drawer-head, .dm-drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 10px; border-bottom: 1px solid #27323e; }
.rooms-drawer-head strong, .dm-drawer-head strong { color: #edf4fb; font-size: 15px; }
.rooms-drawer-head button, .dm-drawer-head button { width: 34px; height: 34px; padding: 0; }
.rooms-drawer-list, .dm-drawer-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px; -webkit-overflow-scrolling: touch; }
.rooms-drawer-list .room-chip, .dm-drawer-list .room-chip { width: 100%; min-height: 44px; border-radius: 8px !important; font-size: 14px; }
.dm-drawer-list .dm-chip { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; }
body[data-layout-mode="phone-landscape"] .rooms-drawer,
body[data-layout-mode="phone-landscape"] .dm-drawer { width: min(52vw, 360px); }

body[data-layout-mode^="phone-"] #chat-signout { display: none; }

/* Landscape is not a squeezed portrait: chat chrome and composer collapse into compact rows. */
body[data-layout-mode="phone-landscape"][data-mobile-pane="chat"] .chat-panel {
  display:grid !important;
  position:absolute !important;
  inset:0 !important;
  left:0 !important;
  right:0 !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  transform:none !important;
  grid-template-rows:34px minmax(0,1fr) auto;
  grid-template-areas:"header" "messages" "composer";
  overflow:hidden !important;
}
body[data-layout-mode="phone-landscape"][data-mobile-pane="chat"] .chart-pane { display:none !important; }
body[data-layout-mode="phone-landscape"] .chat-tabs {
  position: absolute;
  top: 2px;
  left: max(6px, env(safe-area-inset-left));
  z-index: 12;
  width: 118px;
  height: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #283544;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15,21,28,.96);
}
body[data-layout-mode="phone-landscape"] .chat-tabs .tab { min-height: 28px; font-size: 13px; }
body[data-layout-mode="phone-landscape"] .room-header { padding: 2px max(6px, env(safe-area-inset-right)) 2px max(132px, calc(env(safe-area-inset-left) + 132px)); min-height: 34px; }
body[data-layout-mode="phone-landscape"] .room-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-layout-mode="phone-landscape"] .room-subtitle { display: none; }
body[data-layout-mode="phone-landscape"] .room-header-actions { flex-wrap: nowrap; gap: 4px; }
body[data-layout-mode="phone-landscape"] .room-header-actions .icon-control { width: 29px; min-width: 29px; height: 29px; min-height: 29px; padding: 0; }
body[data-layout-mode="phone-landscape"] .message-stage,
body[data-layout-mode="phone-landscape"] .message-list {
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  transform:none;
}
body[data-layout-mode="phone-landscape"] .message-list { padding:4px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left)); }
body[data-layout-mode="phone-landscape"] .message { width:100%; max-width:100%; box-sizing:border-box; margin:0; padding-block:4px; grid-template-columns:32px minmax(0,1fr); gap:6px; }
body[data-layout-mode="phone-landscape"] .message-avatar { width: 29px; height: 29px; }
body[data-layout-mode="phone-landscape"] .message-action-tray { max-width: min(360px, 72vw); }
body[data-layout-mode="phone-landscape"] .message-action-tray button { height: 27px; min-width: 28px; padding-inline: 5px; }
body[data-layout-mode="phone-landscape"] .composer {
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  transform:none;
  padding:4px max(8px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
}
body[data-layout-mode="phone-landscape"] .composer-compose-row {
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:5px;
  align-items:stretch;
}
body[data-layout-mode="phone-landscape"] .composer textarea { min-height: 36px; height: 36px; max-height: 60px; padding: 6px 8px; }
body[data-layout-mode="phone-landscape"] .composer-actions { display: flex; grid-template-columns: none; gap: 4px; margin-top: 0; align-items: stretch; }
body[data-layout-mode="phone-landscape"] .composer-left { display: flex; grid-template-columns: none; gap: 4px; }
body[data-layout-mode="phone-landscape"] .composer-left button,
body[data-layout-mode="phone-landscape"] #send-btn { width: 36px; min-width: 36px; min-height: 36px; height: 36px; padding: 0; font-size: 15px; }
body[data-layout-mode="phone-landscape"] #send-btn { font-size: 18px; }
body[data-layout-mode="phone-landscape"] .reply-bar,
body[data-layout-mode="phone-landscape"] .media-preview { margin-bottom: 4px; padding-block: 4px; }

@media (prefers-reduced-motion: reduce) {
  body[data-layout-mode^="phone-"] .rooms-drawer,
  body[data-layout-mode^="phone-"] .rooms-drawer-scrim,
  body[data-layout-mode^="phone-"] .dm-drawer,
  body[data-layout-mode^="phone-"] .dm-drawer-scrim { transition: none; }
}

.chat-size-control { position: relative; min-width: 0; }
#chat-size-toggle { min-height: 28px; padding: 5px 8px; white-space: normal; line-height: 1.1; }
.chat-size-popover { position: fixed; z-index: 500; width: min(300px, calc(100vw - 16px)); padding: 12px; border: 1px solid #52657c; border-radius: 10px; background: #0a0f15; box-shadow: 0 20px 60px rgba(0,0,0,.72); }
.chat-size-popover label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: #cbd7e4; font-size: 11px; }
.chat-size-popover input { width: 100%; min-height: 34px; touch-action: pan-x; }
.chat-size-marks { display: flex; justify-content: space-between; gap: 6px; color: #718096; font-size: 9px; }

.chat-panel { --message-font-size: 13px; }
.chat-panel .room-header-actions { position: static; min-width: 0; justify-content: flex-end; }
.chat-panel .message-body,
.chat-panel .message-author,
.chat-panel .message-time,
.chat-panel .message-edited,
.chat-panel .message-context,
.chat-panel .reply-preview,
.chat-panel .reply-preview strong,
.chat-panel .reaction-pill { font-size: var(--message-font-size); }

/* Mobile chat is intentionally fixed-scale: no Aa resizing or browser text inflation. */
body[data-layout-mode^="phone-"] .chat-size-control { display:none !important; }
body[data-layout-mode^="phone-"] .chat-panel {
  --message-font-size:13px !important;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body[data-layout-mode^="phone-"] .message-list {
  scroll-behavior:auto;
  overflow-anchor:auto;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
}

.dm-unread-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: auto; padding: 0 5px; border-radius: 999px; background: #2f78d6; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; }
.chat-tabs .dm-unread-badge { margin-left: 4px; vertical-align: middle; }


/* Compact, accessible icon-first controls across desktop and mobile. */
.icon-control { min-width: 36px; min-height: 36px; display: inline-grid; place-items: center; padding: 5px 8px; line-height: 1; font-size: 17px; }
.chat-tabs .icon-control { min-width: 44px; }
#chat-size-toggle.icon-control { font-size: 13px; font-weight: 800; letter-spacing: -.02em; }
body[data-layout-mode^="phone-"] .icon-control { min-width: 34px; min-height: 34px; padding: 4px 6px; font-size: 16px; }
body[data-layout-mode^="phone-"] .mobile-pane-switch .icon-control { min-width: 0; min-height: 32px; padding-inline: 5px; font-size: 12px; }
body[data-layout-mode^="phone-"] #rooms-drawer-toggle { min-width: 36px; }
body[data-layout-mode^="phone-"] #send-btn.icon-control { min-width: 44px; padding-inline: 8px; font-size: 19px; }
body[data-layout-mode^="phone-"] .composer-left button.icon-control { white-space: nowrap; }

/* Final landscape specificity guard: keep the compact row after generic icon rules. */
body[data-layout-mode="phone-landscape"] .mobile-pane-switch .icon-control { min-height: 24px; height: 24px; padding: 0 5px; font-size: 12px; }
body[data-layout-mode="phone-landscape"] .composer-left button.icon-control,
body[data-layout-mode="phone-landscape"] #send-btn.icon-control { width: 36px; min-width: 36px; min-height: 36px; height: 36px; padding: 0; }
body[data-layout-mode="phone-landscape"] #send-btn.icon-control { font-size: 18px; }

/* Wrekt Calls remain independent chart controls, not a reserved layout bar. */
.research-workspace { position:absolute; inset:0; grid-template-rows:minmax(0,1fr); }
.wrekt-call-overlay { position:absolute; inset:0; z-index:24; pointer-events:none; }
.wrekt-call-overlay.hidden { display:none; }
.wrekt-people-toggle,.wrekt-make-call { position:absolute; bottom:5px; min-height:26px; padding:3px 8px; border:1px solid #303b49; border-radius:999px; background:#141c25; color:#e6edf5; font-size:10px; font-weight:800; pointer-events:auto; box-shadow:0 3px 12px rgba(0,0,0,.32); }
.wrekt-people-toggle { left:7px; }
.wrekt-make-call { right:7px; }
body[data-layout-mode^="phone-"] .wrekt-call-overlay { inset:0; }
body[data-layout-mode^="phone-"] .wrekt-people-toggle,body[data-layout-mode^="phone-"] .wrekt-make-call { bottom:max(5px,env(safe-area-inset-bottom)); min-height:24px; font-size:9px; padding:2px 7px; }
body[data-layout-mode^="phone-"] .wrekt-people-toggle { left:max(6px,env(safe-area-inset-left)); }
body[data-layout-mode^="phone-"] .wrekt-make-call { right:max(6px,env(safe-area-inset-right)); }
.wrekt-call-dialog { width:min(520px,calc(100vw - 24px)); max-height:min(92vh,760px); overflow:auto; border:1px solid #334052; border-radius:17px; padding:0; background:#0d141b; color:#eef3f7; box-shadow:0 24px 80px rgba(0,0,0,.58); }
.wrekt-call-dialog::backdrop { background:rgba(0,0,0,.72); backdrop-filter:blur(2px); }
.wrekt-call-visual-layer { position:absolute; inset:0; overflow:hidden; border-radius:inherit; pointer-events:none; }
.wrekt-call-shader { position:absolute; inset:0; width:100%; height:100%; opacity:.82; }
.wrekt-call-brand-ghost { position:absolute; left:50%; top:54%; width:72%; max-width:350px; transform:translate(-50%,-50%) rotate(-7deg); opacity:.09; filter:saturate(.35) contrast(1.15); }
.wrekt-call-visual-veil { position:absolute; inset:0; background:linear-gradient(180deg,rgba(5,8,12,.14),rgba(5,8,12,.58) 44%,rgba(5,8,12,.95)); }
.wrekt-call-dialog form { position:relative; z-index:1; display:grid; gap:9px; padding:14px; }
.wrekt-call-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:10px; border-bottom:1px solid rgba(108,124,142,.24); }
.wrekt-call-head > div { min-width:0; display:grid; gap:2px; }
.wrekt-call-kicker { color:#a5b1bd; font-size:9px; font-weight:950; letter-spacing:1.25px; }
.wrekt-call-dialog header button { width:34px; height:34px; border:1px solid #334052; border-radius:8px; background:rgba(23,31,41,.88); color:#fff; }
.wrekt-call-market { color:#eef4f8; font-size:14px; font-weight:950; }
.wrekt-call-market-row { display:flex; align-items:end; justify-content:space-between; gap:12px; }
.wrekt-call-reference-label,.wrekt-call-wallet span { display:block; color:#7f8d9c; font-size:7px; font-weight:900; letter-spacing:.8px; }
.wrekt-call-reference-price { display:block; margin-top:3px; color:#f2f6f9; font-size:28px; line-height:1; font-weight:950; letter-spacing:-.7px; font-variant-numeric:tabular-nums; }
.wrekt-call-wallet { min-width:98px; border:1px solid #3b4653; border-radius:10px; background:rgba(10,16,23,.74); padding:8px 10px; text-align:right; }
.wrekt-call-wallet strong { display:block; margin-top:2px; color:#f0d695; font-size:16px; font-weight:950; font-variant-numeric:tabular-nums; }
.wrekt-call-direction { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.wrekt-call-direction button { min-height:80px; display:grid; grid-template-columns:64px minmax(0,1fr); align-items:center; gap:4px; padding:6px 9px; border:1px solid #344153; border-radius:11px; background:rgba(15,22,30,.84); color:#a8b4bf; text-align:left; overflow:hidden; }
.wrekt-call-direction button img { width:58px; height:58px; object-fit:contain; }
.wrekt-call-direction button strong { display:block; color:inherit; font-size:12px; font-weight:950; letter-spacing:.35px; }
.wrekt-call-direction button small { display:block; margin-top:2px; color:#8795a4; font-size:8px; }
.wrekt-call-direction button.active[data-wrekt-direction="long"] { border-color:rgba(36,212,159,.78); background:rgba(14,59,46,.74); color:#effff9; }
.wrekt-call-direction button.active[data-wrekt-direction="short"] { border-color:rgba(255,79,95,.8); background:rgba(72,23,31,.76); color:#fff3f5; }
.wrekt-call-slider { display:grid; gap:5px; border:1px solid #303c49; border-radius:10px; background:rgba(8,13,19,.8); padding:9px 10px; }
.wrekt-call-slider-head,.wrekt-call-slider-foot { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.wrekt-call-slider label { color:#93a0ae; font-size:9px; font-weight:950; letter-spacing:.55px; }
.wrekt-call-slider-head strong { font-size:16px; font-weight:950; }
.wrekt-call-slider--tp .wrekt-call-slider-head strong { color:#a9ffe4; }
.wrekt-call-slider--sl .wrekt-call-slider-head strong { color:#ffbdc4; }
.wrekt-call-slider--risk .wrekt-call-slider-head strong { color:#f0d695; }
.wrekt-call-slider input[type="range"] { width:100%; min-height:22px; margin:0; accent-color:var(--wv-accent); }
.wrekt-call-slider-foot { color:#7d8b99; font-size:8px; }
.wrekt-call-slider-foot strong { color:#dfe7ee; font-size:10px; font-variant-numeric:tabular-nums; }
.wrekt-call-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.wrekt-call-metrics > div { min-width:0; border:1px solid #2c3743; border-radius:8px; background:rgba(14,21,29,.72); padding:7px; }
.wrekt-call-metrics span { display:block; color:#748292; font-size:7px; font-weight:900; letter-spacing:.45px; }
.wrekt-call-metrics strong { display:block; margin-top:3px; color:#edf3f8; font-size:10px; font-weight:900; font-variant-numeric:tabular-nums; overflow:hidden; text-overflow:ellipsis; }
.wrekt-call-status { min-height:16px; color:#9aabba; font-size:9px; }
.wrekt-call-submit { min-height:48px; border:1px solid #536a82; border-radius:10px; background:linear-gradient(180deg,#22374e,#17283b); color:#fff; font-size:11px; font-weight:950; letter-spacing:.65px; }
.wrekt-call-fineprint { margin:0; color:#697786; font-size:7px; line-height:1.45; text-align:center; }
@media (max-width:560px){
  .wrekt-call-dialog{width:min(96vw,520px);max-height:92vh;border-radius:14px}
  .wrekt-call-dialog form{padding:11px;gap:8px}
  .wrekt-call-reference-price{font-size:24px}
  .wrekt-call-direction{gap:6px}
  .wrekt-call-direction button{min-height:70px;grid-template-columns:50px minmax(0,1fr);padding:5px 7px}
  .wrekt-call-direction button img{width:46px;height:46px}
  .wrekt-call-direction button strong{font-size:10px}
}
.wrekt-people-dialog { width:min(420px,calc(100vw - 24px)); border:1px solid #334052; border-radius:12px; padding:0; background:#0f151d; color:#e8eef5; }
.wrekt-people-dialog::backdrop { background:rgba(0,0,0,.64); }
.wrekt-people-dialog section { display:grid; gap:8px; padding:12px; }
.wrekt-people-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.wrekt-people-dialog header div { display:grid; gap:2px; }
.wrekt-people-dialog header span { color:#8496aa; font-size:10px; }
.wrekt-people-dialog header button { width:32px; height:32px; border:1px solid #334052; border-radius:7px; background:#171f29; color:#fff; }
.wrekt-people-list { display:grid; gap:6px; max-height:min(55vh,430px); overflow:auto; }
.wrekt-people-row { min-height:44px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:8px; padding:7px 8px; border:1px solid #26313e; border-radius:8px; background:#111821; }
.wrekt-people-row .profile-link { text-align:left; font-weight:800; }
.wrekt-people-row-meta { color:#8fa2b8; font-size:10px; white-space:nowrap; }
.wrekt-people-empty { padding:18px 8px; color:#8496aa; text-align:center; font-size:11px; }
@media (max-width:850px){ .wrekt-people-list{max-height:60vh} }

/* People-on-the-Chart: separate price-ranked social rail beside the native chart. */
.wrekt-chart-stage{min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;overflow:hidden}
.wrekt-people-rail{width:112px;min-width:0;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:5px;padding:6px 5px;border-left:1px solid #26313e;background:#0d131a;pointer-events:none}
.wrekt-people-rail.hidden{display:none}
.wrekt-entry-marker{pointer-events:auto;min-height:36px;width:100%;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:4px;padding:4px 5px;border:1px solid #2e3947;border-radius:7px;background:#141c25;color:#e7eef6;text-align:left}
.wrekt-entry-marker-price{grid-column:1/-1;color:#7f91a5;font-size:8px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wrekt-entry-marker-main{font-size:9px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wrekt-entry-marker-count{font-size:9px;font-weight:900}
@media (max-width:850px){.wrekt-people-rail{width:48px;padding:4px 3px;gap:4px}.wrekt-entry-marker{min-height:34px;display:flex;flex-direction:column;justify-content:center;padding:3px 2px}.wrekt-entry-marker-price{font-size:7px;max-width:42px}.wrekt-entry-marker-main{font-size:0}.wrekt-entry-marker-count{font-size:9px}}

/* Rep Deck: one deliberate utility drawer replaces floating Call/People controls. */
.wrekt-utility-toggle img{width:24px;height:24px;object-fit:contain;filter:drop-shadow(0 0 8px rgba(93,150,255,.28))}
.wrekt-utility-scrim{position:absolute;inset:0;z-index:88;border:0;border-radius:0;background:rgba(2,6,10,.62);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .18s ease}
.wrekt-utility-drawer{position:absolute;top:0;right:0;bottom:0;z-index:89;width:min(420px,92vw);display:grid;grid-template-rows:auto auto minmax(0,1fr);border-left:1px solid rgba(83,106,130,.58);background:linear-gradient(180deg,rgba(13,20,29,.995),rgba(8,13,20,.995));box-shadow:-24px 0 70px rgba(0,0,0,.56);transform:translateX(102%);transition:transform .2s cubic-bezier(.2,.72,.2,1);overflow:hidden}
body[data-wrekt-utility-drawer="open"] .wrekt-utility-drawer{transform:translateX(0)}
body[data-wrekt-utility-drawer="open"] .wrekt-utility-scrim{opacity:1;pointer-events:auto}
.wrekt-utility-head{min-height:58px;padding:8px 10px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(83,106,130,.28);background:linear-gradient(90deg,rgba(24,47,72,.42),rgba(10,16,23,.25))}
.wrekt-utility-head>div{display:flex;align-items:center;gap:9px;min-width:0}.wrekt-utility-head img{width:34px;height:34px;object-fit:contain}.wrekt-utility-head span{display:grid;line-height:1.05}.wrekt-utility-head small{font-size:8px;letter-spacing:1.6px;color:#71869b;font-weight:900}.wrekt-utility-head strong{font-size:16px;letter-spacing:.8px;color:#eef5fb}.wrekt-utility-head button{width:38px;height:38px;border:1px solid #344456;border-radius:9px;background:#141e29;color:#fff;font-size:22px}
.wrekt-utility-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:7px;border-bottom:1px solid rgba(83,106,130,.25);background:#0b1118}.wrekt-utility-tabs button{min-width:0;min-height:42px;border:1px solid #2b3847;border-radius:9px;background:#111923;color:#7f91a5;font-size:12px;font-weight:950;letter-spacing:.45px}.wrekt-utility-tabs button.active{border-color:#507eb4;background:linear-gradient(180deg,#1b3858,#14283d);color:#f4f8fc;box-shadow:inset 0 0 0 1px rgba(100,164,230,.22)}.wrekt-utility-tabs button span{margin-left:4px}
.wrekt-utility-body{position:relative;min-height:0;overflow:hidden;background:radial-gradient(circle at 50% -10%,rgba(43,91,140,.16),transparent 42%)}.wrekt-utility-panel{height:100%;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.wrekt-utility-panel[hidden]{display:none!important}
.wrekt-wallet-panel{padding:14px;display:grid;align-content:start;gap:12px}.wrekt-wallet-hero{position:relative;min-height:150px;display:grid;place-items:center;overflow:hidden;padding:18px;border:1px solid #34465a;border-radius:14px;background:linear-gradient(145deg,rgba(28,47,66,.9),rgba(12,20,29,.9));box-shadow:inset 0 0 30px rgba(61,120,177,.08)}.wrekt-wallet-hero img{position:absolute;left:50%;top:50%;width:min(78%,300px);height:118px;object-fit:contain;transform:translate(-50%,-50%);opacity:.18;filter:drop-shadow(0 0 18px rgba(65,149,235,.34));pointer-events:none}.wrekt-wallet-hero>div{position:relative;z-index:2;min-width:0;width:100%;display:grid;place-items:center;text-align:center}.wrekt-wallet-hero>div>span{font-size:10px;letter-spacing:1.8px;color:#8da0b3;font-weight:950}.wrekt-wallet-hero strong{display:block;width:100%;font-size:clamp(42px,11vw,72px);line-height:.96;color:#f1d99c;font-weight:1000;font-variant-numeric:tabular-nums;text-align:center;letter-spacing:-2px;text-shadow:0 3px 20px rgba(0,0,0,.72),0 0 22px rgba(240,214,149,.14)}#wrekt-drawer-wallet-balance{font-size:inherit;color:inherit;letter-spacing:inherit;font-weight:inherit}.wrekt-wallet-hero small{margin-top:6px;font-size:9px;color:#7f90a1;text-align:center}.wrekt-wallet-rule{display:grid;gap:3px;padding:12px;border-left:3px solid #4f82bb;background:rgba(19,31,44,.74)}.wrekt-wallet-rule strong{font-size:12px;color:#f1f6fa;letter-spacing:.4px}.wrekt-wallet-rule span{font-size:11px;color:#8fb7df;font-weight:900}.wrekt-wallet-active-call{min-height:48px;padding:11px;border:1px solid #2d3b4a;border-radius:10px;background:#0f171f;color:#a7b5c3;font-size:11px;font-weight:800}.wrekt-wallet-panel p{margin:0;color:#6f8091;font-size:9px;line-height:1.5}
/* Call slip and People now live inside the deck rather than modal chrome. */
.wrekt-utility-drawer .wrekt-call-dialog{width:auto;max-height:none;height:100%;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:auto}.wrekt-utility-drawer .wrekt-call-dialog form{min-height:100%;padding:12px}.wrekt-utility-drawer .wrekt-call-visual-layer{border-radius:0}.wrekt-utility-drawer .wrekt-people-dialog{width:auto;height:100%;border:0;border-radius:0;background:transparent}.wrekt-utility-drawer .wrekt-people-dialog section{padding:12px}.wrekt-utility-drawer .wrekt-people-list{max-height:none}
@media(max-width:850px){.wrekt-utility-drawer{width:min(90vw,380px)}body[data-layout-mode="phone-landscape"] .wrekt-utility-drawer{width:min(56vw,430px)}.wrekt-utility-tabs button{min-height:40px;font-size:10px}.wrekt-wallet-hero{min-height:132px;padding:14px}.wrekt-wallet-hero img{width:min(84%,260px);height:102px}.wrekt-wallet-hero strong{font-size:clamp(38px,12vw,58px)}}
@media(prefers-reduced-motion:reduce){.wrekt-utility-drawer,.wrekt-utility-scrim{transition:none}}



/* REP Deck visual restore + stable mobile Call overlay (2026-08-29). */
.wrekt-utility-drawer {
  isolation:isolate;
  width:min(920px,88vw);
  top:14px;
  right:14px;
  bottom:14px;
  border:1px solid rgba(86,137,171,.62);
  border-radius:22px;
  background:
    radial-gradient(circle at 78% 12%,rgba(42,190,196,.16),transparent 30%),
    radial-gradient(circle at 12% 88%,rgba(48,104,172,.18),transparent 34%),
    linear-gradient(145deg,rgba(10,28,35,.985),rgba(7,15,24,.992) 58%,rgba(6,12,19,.995));
  box-shadow:-30px 0 90px rgba(0,0,0,.62),inset 0 0 70px rgba(61,177,189,.06);
}
.wrekt-utility-drawer::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:.24;
  background:
    repeating-linear-gradient(118deg,transparent 0 24px,rgba(98,203,213,.035) 25px 27px,transparent 28px 54px),
    linear-gradient(90deg,rgba(31,145,153,.09),transparent 38%,rgba(51,99,150,.08));
  mix-blend-mode:screen;
}
.wrekt-utility-fx {
  position:absolute;
  inset:74px 20px 18px;
  z-index:-1;
  overflow:hidden;
  pointer-events:none;
  opacity:.2;
}
.wrekt-utility-fx::before {
  content:"WC";
  position:absolute;
  left:3%;
  bottom:-8%;
  font-family:Impact,Haettenschweiler,"Arial Narrow Bold","Arial Narrow",sans-serif;
  font-size:clamp(180px,30vw,420px);
  font-weight:1000;
  line-height:.78;
  letter-spacing:-.08em;
  color:rgba(179,217,229,.14);
  text-shadow:0 0 38px rgba(62,166,187,.18);
  transform:skewX(-6deg);
}
.wrekt-utility-fx img {
  position:absolute;
  right:-4%;
  bottom:5%;
  width:min(42%,360px);
  max-height:52%;
  object-fit:contain;
  opacity:.24;
  filter:drop-shadow(0 0 26px rgba(45,169,186,.32));
}
.wrekt-utility-head {
  position:relative;
  z-index:2;
  min-height:78px;
  padding:10px 14px;
  border-bottom:1px solid rgba(126,221,225,.32);
  background:linear-gradient(90deg,rgba(52,159,169,.92),rgba(45,151,161,.82) 55%,rgba(46,151,158,.68));
  backdrop-filter:blur(10px);
}
.wrekt-utility-head small { color:rgba(220,245,247,.5);font-weight:1000;letter-spacing:3px; }
.wrekt-utility-head strong {
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:21px;
  font-weight:750;
  letter-spacing:.08em;
  color:#f4fbfc;
  text-shadow:0 1px 10px rgba(0,0,0,.28);
}
.wrekt-utility-head>div>img { width:48px;height:48px;filter:drop-shadow(0 0 8px rgba(0,0,0,.3)); }
.wrekt-utility-head>button { width:46px;height:46px;border-radius:13px;background:rgba(9,20,30,.88); }
.wrekt-utility-tabs {
  position:relative;
  z-index:2;
  gap:8px;
  padding:10px 12px;
  background:rgba(5,12,20,.88);
  backdrop-filter:blur(10px);
}
.wrekt-utility-tabs button {
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:11px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:13px;
  font-weight:750;
  letter-spacing:.08em;
}
.wrekt-utility-tabs .wv-tab-icon { width:23px;height:23px;object-fit:contain;filter:drop-shadow(0 0 8px rgba(92,177,255,.24)); }
.wrekt-utility-tabs button.active { background:linear-gradient(180deg,rgba(31,74,118,.94),rgba(20,45,73,.96));box-shadow:inset 0 0 0 1px rgba(113,183,249,.32),0 0 20px rgba(52,129,203,.12); }
.wrekt-utility-body { z-index:1;background:linear-gradient(180deg,rgba(5,19,25,.38),rgba(5,14,21,.7)); }
.wrekt-wallet-panel { position:relative;z-index:1;grid-template-columns:minmax(0,1.2fr) minmax(240px,.8fr);grid-template-areas:"hero rule" "hero call" "history history" "note note";align-items:stretch;padding:18px;gap:12px; }
.wrekt-wallet-hero { grid-area:hero;min-height:260px;border-color:rgba(84,153,188,.55);background:linear-gradient(155deg,rgba(19,47,65,.72),rgba(7,20,30,.72));box-shadow:inset 0 0 50px rgba(62,167,189,.08),0 16px 40px rgba(0,0,0,.18); }
.wrekt-wallet-hero::after { content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(100deg,transparent,rgba(111,207,217,.06),transparent 58%); }
.wrekt-wallet-hero img { width:min(66%,360px);height:74%;opacity:.2;filter:drop-shadow(0 0 28px rgba(67,182,207,.42)); }
.wrekt-wallet-hero>div>span { font-family:Impact,Haettenschweiler,"Arial Narrow Bold","Arial Narrow",sans-serif;font-size:17px;letter-spacing:4px;color:#91a8b6; }
.wrekt-wallet-hero strong { font-family:Impact,Haettenschweiler,"Arial Narrow Bold","Arial Narrow",sans-serif;font-size:clamp(58px,8vw,110px);letter-spacing:-2px;color:#f3e0a9;text-shadow:0 5px 28px rgba(0,0,0,.82),0 0 28px rgba(246,218,150,.16); }
.wrekt-wallet-hero small { font-size:13px;letter-spacing:.35px;color:#728494; }
.wrekt-wallet-rule { grid-area:rule;align-self:start;min-height:96px;align-content:center;border-left:5px solid #4f9de8;background:linear-gradient(100deg,rgba(22,45,63,.9),rgba(14,29,41,.72)); }
.wrekt-wallet-rule strong,.wrekt-wallet-rule span { font-family:Impact,Haettenschweiler,"Arial Narrow Bold","Arial Narrow",sans-serif;letter-spacing:1.1px; }
.wrekt-wallet-rule strong { font-size:20px; }.wrekt-wallet-rule span { font-size:18px; }
.wrekt-wallet-active-call { grid-area:call;align-self:start;min-height:64px;font-size:14px;background:rgba(10,20,29,.78); }
.wrekt-wallet-panel>p { grid-area:note;align-self:start;font-size:11px; }
.wrekt-call-history{grid-area:history;min-width:0;padding:12px;border:1px solid rgba(91,130,165,.42);border-radius:13px;background:linear-gradient(180deg,rgba(7,17,25,.76),rgba(5,12,18,.88));box-shadow:inset 0 0 24px rgba(84,158,218,.045)}
.wrekt-call-history-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:9px}.wrekt-call-history-head span{font-size:11px;font-weight:800;letter-spacing:.12em;color:#d9e7f2}.wrekt-call-history-head small{font-size:9px;color:#72869a}
.wrekt-call-history-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.wrekt-call-history-card{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"main result" "meta meta";gap:5px 8px;padding:8px 9px;border:1px solid rgba(80,105,130,.38);border-radius:10px;background:rgba(13,24,34,.66);backdrop-filter:blur(7px)}.wrekt-call-history-card.win{border-color:rgba(49,177,117,.4)}.wrekt-call-history-card.loss{border-color:rgba(226,86,96,.4)}.wrekt-call-history-main{grid-area:main;min-width:0;display:grid;grid-template-columns:24px auto 1fr;align-items:center;gap:6px}.wrekt-call-history-main img{width:24px;height:24px;object-fit:contain}.wrekt-call-history-main strong{font-size:12px;color:#edf4f9}.wrekt-call-history-main span{font-size:8px;color:#8195a8}.wrekt-call-history-result{grid-area:result;display:grid;justify-items:end;align-content:center}.wrekt-call-history-result strong{font-size:12px}.wrekt-call-history-card.win .wrekt-call-history-result strong{color:#62dfa4}.wrekt-call-history-card.loss .wrekt-call-history-result strong{color:#ff7e88}.wrekt-call-history-result span{font-size:8px;color:#8fa0b0}.wrekt-call-history-meta{grid-area:meta;display:flex;justify-content:space-between;border-top:1px solid rgba(102,126,151,.16);padding-top:5px;color:#6f8397;font-size:8px;letter-spacing:.04em}.wrekt-call-history-empty{grid-column:1/-1;padding:14px;border:1px dashed rgba(95,122,149,.3);border-radius:9px;text-align:center;color:#718497;font-size:10px}

.wrekt-call-close { display:none;align-items:center;justify-content:center;width:44px;height:44px;padding:8px;border:1px solid rgba(110,143,171,.55);border-radius:12px;background:rgba(11,20,29,.86); }
.wrekt-call-close img { width:100%;height:100%;object-fit:contain; }

/* Content-independent mobile shell geometry. */
body[data-layout-mode^="phone-"] .workspace {
  height:100%;
  min-height:0;
  min-width:0;
  position:relative;
  overflow:hidden;
  contain:layout size;
}
body[data-layout-mode^="phone-"] .chart-pane,
body[data-layout-mode^="phone-"] .chat-panel {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
  min-width:0;
  max-width:100%;
  max-height:100%;
  overflow:hidden;
}
body[data-layout-mode^="phone-"] .research-workspace {
  position:absolute;
  inset:0;
  min-width:0;
  min-height:0;
  width:100%;
  height:100%;
  overflow:hidden;
  contain:layout size;
}
body[data-layout-mode^="phone-"] .wrekt-chart-stage { min-width:0;min-height:0;max-width:100%;max-height:100%;overflow:hidden; }
body[data-layout-mode^="phone-"] .message-list { min-height:0;overflow-y:auto;overscroll-behavior:contain; }
body[data-layout-mode^="phone-"] .chat-panel { grid-auto-rows:minmax(0,auto); }
body[data-layout-mode^="phone-"] .workspace.desktop-chart-max,
body[data-layout-mode^="phone-"] .workspace.desktop-chat-max {
  display:block;
  position:relative;
  inset:auto;
  width:100%;
  max-width:100%;
  height:100%;
  min-width:0;
  grid-template-columns:1fr !important;
  overflow:hidden;
}

/* Mobile Call Ticket is a true viewport overlay in portrait and landscape. */
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-utility-drawer {
  position:absolute;
  left:0;
  top:0;
  right:auto;
  bottom:auto;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  border:0;
  border-radius:0;
  transform:translateX(102%);
  grid-template-rows:minmax(0,1fr);
  background:linear-gradient(150deg,rgba(7,17,25,.998),rgba(4,11,17,.998));
}
body[data-layout-mode^="phone-"][data-wrekt-utility-drawer="open"][data-wrekt-utility-panel="call"] .wrekt-utility-drawer { transform:translateX(0); }
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-utility-head,
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-utility-tabs,
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-utility-fx { display:none; }
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-utility-body,
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-call-dialog { width:100%;height:100%;min-width:0;min-height:0;overflow:hidden; }
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form { width:100%;height:100%;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;padding:calc(10px + env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-call-close { display:inline-flex; }
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-call-head { position:sticky;top:0;z-index:4;min-height:50px;background:linear-gradient(180deg,rgba(7,17,25,.98),rgba(7,17,25,.76));backdrop-filter:blur(8px); }
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-call-visual-layer { position:absolute;inset:0; }

body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form {
  display:grid;
  grid-template-rows:auto auto auto repeat(3,minmax(72px,1fr)) auto auto auto auto;
  align-content:stretch;
  gap:8px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-market-row { min-height:72px; }
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction { min-height:104px; }
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction button { min-height:96px; }
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-slider { min-height:72px;align-content:center; }

body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form {
  display:grid;
  grid-template-columns:minmax(180px,.9fr) minmax(220px,1.2fr) minmax(190px,.9fr);
  grid-template-rows:auto auto auto minmax(0,1fr);
  grid-template-areas:
    "head head head"
    "market sliders metrics"
    "direction sliders submit"
    "direction sliders fine";
  align-items:stretch;
  gap:6px 8px;
  overflow:auto;
  padding:calc(5px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-head { grid-area:head;min-height:38px; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-market-row { grid-area:market;display:grid;grid-template-columns:1fr;gap:4px;padding:7px;min-height:0; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-reference-price { font-size:20px; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-direction { grid-area:direction;grid-column:1;display:grid;grid-template-columns:1fr 1fr;gap:5px;align-self:stretch; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-direction button { min-height:58px;grid-template-columns:42px minmax(0,1fr);padding:4px 6px; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-direction button img { width:38px;height:38px; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-slider { grid-column:2;min-height:0;padding:5px 7px; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-slider--tp { grid-row:2; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-slider--sl { grid-row:3; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-slider--risk { grid-row:4;align-self:start; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-metrics { grid-area:metrics;align-self:start; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-status { grid-column:3;grid-row:2;align-self:end;margin-top:42px; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-submit { grid-area:submit;min-height:48px;align-self:end; }
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-fineprint { grid-area:fine;align-self:start; }

@media (max-width:850px) {
  body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-drawer { width:min(94vw,520px);top:0;right:0;bottom:0;border-radius:0; }
  body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-panel { grid-template-columns:1fr;grid-template-areas:"hero" "rule" "call" "history" "note";padding:10px; }
  body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero { min-height:220px; }
}

/* LOCKED REP DECK ART RESTORE — visual layer only. Functional geometry/state stays current. */
.wrekt-utility-drawer{isolation:isolate}
.wrekt-utility-drawer::before{display:none}
.wrekt-deck-shader{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;opacity:.92}
.wrekt-deck-shader.is-fallback{background:radial-gradient(circle at 48% 18%,rgba(62,151,232,.16),transparent 38%),linear-gradient(135deg,rgba(255,255,255,.018),transparent 50%)}
.wrekt-utility-head,.wrekt-utility-tabs,.wrekt-utility-body{position:relative;z-index:2}
.wrekt-utility-head{border-bottom:1px solid rgba(83,106,130,.28);background:linear-gradient(90deg,rgba(24,47,72,.82),rgba(10,16,23,.72));backdrop-filter:blur(8px)}
.wrekt-utility-head small{color:#71869b;font-weight:900;letter-spacing:1.6px}
.wrekt-utility-head strong{color:#eef5fb;text-shadow:0 1px 10px rgba(62,151,232,.18)}
.wrekt-utility-body{background:linear-gradient(180deg,rgba(4,9,15,.74),rgba(5,10,17,.90))}
.wrekt-utility-body::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.28;background:linear-gradient(rgba(143,211,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(143,211,255,.025) 1px,transparent 1px),radial-gradient(circle at 50% 0,rgba(52,139,224,.16),transparent 42%);background-size:100% 5px,42px 100%,100% 100%;mask-image:linear-gradient(to bottom,#000,rgba(0,0,0,.7) 72%,transparent)}
.wrekt-utility-panel{position:relative;z-index:1}
.wrekt-utility-tabs{background:rgba(7,14,22,.88)}
.wrekt-utility-tabs button{position:relative;isolation:isolate;overflow:hidden;text-align:center;justify-content:center;gap:7px;background:rgba(13,23,33,.66);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease,background .18s ease}
.wrekt-utility-tabs button::before{content:"";position:absolute;inset:-22%;z-index:-1;background-position:center;background-repeat:no-repeat;background-size:112% auto;opacity:.085;filter:grayscale(1) saturate(.2) brightness(1.35);transition:opacity .18s ease,filter .18s ease,transform .18s ease}
.wrekt-utility-tabs button[data-wrekt-utility-tab="wallet"]::before{background-image:url('/assets/emoji/wv_wrekt.png')}
.wrekt-utility-tabs button[data-wrekt-utility-tab="call"]::before{background-image:url('/assets/emoji/wv_target.png')}
.wrekt-utility-tabs button[data-wrekt-utility-tab="people"]::before{background-image:url('/assets/emoji/wv_eyes.png')}
.wrekt-utility-tabs button.active{border-color:rgba(104,177,255,.76);background:linear-gradient(180deg,rgba(37,83,130,.74),rgba(18,45,72,.76));box-shadow:inset 0 0 20px rgba(87,177,255,.12),0 0 12px rgba(72,157,238,.18)}
.wrekt-utility-tabs button.active::before{opacity:.22;filter:grayscale(.2) saturate(.85) brightness(1.15) drop-shadow(0 0 10px rgba(110,198,255,.45));transform:scale(1.05)}
.wrekt-utility-tabs .wv-tab-icon{position:relative;z-index:2}

.wrekt-wallet-panel{position:relative}
.wrekt-wallet-panel::before{content:"";position:absolute;inset:10px;pointer-events:none;opacity:.12;background:url('/assets/brand/full-logo.png') center 78%/min(72%,440px) auto no-repeat;filter:grayscale(1) brightness(1.5) drop-shadow(0 0 28px rgba(93,150,255,.24))}
.wrekt-wallet-panel>*{position:relative;z-index:1}
.wrekt-wallet-hero{position:relative;display:block;min-width:0;overflow:hidden;background:linear-gradient(145deg,rgba(16,34,51,.96),rgba(5,12,20,.96));box-shadow:inset 0 0 44px rgba(61,140,220,.10),0 0 0 1px rgba(143,211,255,.04)}
.wrekt-wallet-hero::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.22;background:repeating-linear-gradient(180deg,transparent 0 3px,rgba(143,211,255,.055) 4px)}
.wrekt-wallet-score-stage{position:relative;z-index:2;display:grid!important;place-items:center;align-content:center;text-align:center;min-height:150px;overflow:hidden;padding:12px 16px;width:100%}
.wrekt-wallet-wc-watermark{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-49%) scaleX(1.08)!important;z-index:-1;font-family:Impact,"Arial Black",sans-serif;font-size:clamp(110px,17vw,210px)!important;line-height:.76;letter-spacing:-.055em!important;color:transparent!important;background:linear-gradient(180deg,rgba(255,255,255,.31),rgba(143,211,255,.19) 55%,rgba(69,185,255,.11));-webkit-background-clip:text;background-clip:text;-webkit-text-stroke:1px rgba(163,220,255,.08);filter:blur(.15px) drop-shadow(0 0 24px rgba(82,174,255,.16));opacity:.62;pointer-events:none}
.wrekt-wallet-kicker{position:relative!important;z-index:2;margin-bottom:2px;font-size:10px!important;letter-spacing:1.8px!important;color:#8da0b3!important;font-weight:950}
.wrekt-wallet-score-value{position:relative;z-index:3;display:block!important;width:100%;font-family:Impact,"Arial Black","Courier New",ui-monospace,monospace!important;font-size:clamp(72px,9.2vw,126px)!important;font-style:italic;line-height:.82!important;letter-spacing:.015em!important;text-align:center;white-space:nowrap;color:#f8fcff!important;font-weight:1000;font-variant-numeric:tabular-nums;-webkit-text-stroke:2px rgba(4,18,30,.92)!important;text-shadow:5px 5px 0 rgba(18,74,125,.75),-2px -2px 0 rgba(255,255,255,.28),0 0 12px rgba(144,218,255,.85),0 0 34px rgba(43,142,231,.42)!important}
.wrekt-wallet-score-stage small{position:relative;z-index:3;margin-top:7px;font-size:9px;color:#7f90a1;text-align:center}
.wrekt-wallet-art{position:absolute!important;left:auto!important;top:auto!important;right:3%!important;bottom:-7%!important;z-index:1!important;width:clamp(72px,15vw,132px)!important;height:clamp(72px,15vw,132px)!important;object-fit:contain;opacity:.17!important;filter:grayscale(.45) saturate(.72) brightness(.86) drop-shadow(0 0 14px rgba(85,173,255,.18))!important;transform:rotate(7deg)!important;pointer-events:none}

.wrekt-call-direction button{position:relative;isolation:isolate;display:grid;grid-template-columns:1fr;place-items:center;align-content:center;text-align:center;min-width:0;overflow:hidden;background:rgba(9,17,25,.72);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease,background .18s ease}
.wrekt-call-direction button img{position:absolute;left:50%;top:50%;z-index:0;width:104%;height:128%;transform:translate(-50%,-50%) scale(1);object-fit:contain;opacity:.14;filter:grayscale(.72) saturate(.45) brightness(.75);pointer-events:none;transition:opacity .2s ease,filter .2s ease,transform .2s ease}
.wrekt-call-direction button span{position:relative;z-index:2;display:grid;place-items:center;text-align:center;text-shadow:0 1px 7px rgba(0,0,0,.92)}
.wrekt-call-direction button strong{font-size:clamp(11px,2.8vw,15px);letter-spacing:.075em}
.wrekt-call-direction button small{font-size:clamp(7px,1.9vw,10px);max-width:16ch;text-align:center}
.wrekt-call-direction button.active[data-wrekt-direction="long"]{border-color:rgba(42,231,168,.88);background:radial-gradient(circle at 50% 50%,rgba(11,94,68,.48),rgba(7,27,23,.78));box-shadow:inset 0 0 34px rgba(30,221,154,.13),0 0 17px rgba(25,226,158,.25)}
.wrekt-call-direction button.active[data-wrekt-direction="short"]{border-color:rgba(255,85,101,.9);background:radial-gradient(circle at 50% 50%,rgba(105,27,38,.50),rgba(30,10,17,.8));box-shadow:inset 0 0 34px rgba(255,72,92,.13),0 0 17px rgba(255,70,92,.23)}
.wrekt-call-direction button.active img{opacity:.31;transform:translate(-50%,-50%) scale(1.08);filter:grayscale(.08) saturate(1.15) brightness(.98)}
.wrekt-call-direction button.active[data-wrekt-direction="long"] img{filter:grayscale(.04) saturate(1.16) brightness(1.02) drop-shadow(0 0 13px rgba(34,239,166,.52))}
.wrekt-call-direction button.active[data-wrekt-direction="short"] img{filter:grayscale(.04) saturate(1.16) brightness(1.02) drop-shadow(0 0 13px rgba(255,75,94,.48))}

@media(hover:hover) and (pointer:fine){.wrekt-call-direction button:hover,.wrekt-utility-tabs button:hover{transform:translateY(-1px)}}
@media(max-width:850px){body[data-layout-mode^="phone-"] .wrekt-call-direction button{grid-template-columns:1fr;padding:7px 8px}body[data-layout-mode^="phone-"] .wrekt-call-direction button img{width:108%;height:136%}}
@media(max-width:850px) and (orientation:portrait){body[data-layout-mode="phone-portrait"] .wrekt-wallet-score-stage{min-height:clamp(118px,22vh,168px);padding:6px 8px}body[data-layout-mode="phone-portrait"] .wrekt-wallet-wc-watermark{font-size:clamp(104px,31vw,154px)!important}body[data-layout-mode="phone-portrait"] .wrekt-wallet-score-value{font-size:clamp(68px,21vw,104px)!important;line-height:.78!important}body[data-layout-mode="phone-portrait"] .wrekt-wallet-art{width:clamp(68px,21vw,96px)!important;height:clamp(68px,21vw,96px)!important;right:1%!important;bottom:-12%!important}}
@media(max-width:850px) and (orientation:landscape){body[data-layout-mode="phone-landscape"] .wrekt-wallet-score-stage{min-height:clamp(108px,38vh,156px)}body[data-layout-mode="phone-landscape"] .wrekt-wallet-wc-watermark{font-size:clamp(98px,18vw,160px)!important}body[data-layout-mode="phone-landscape"] .wrekt-wallet-score-value{font-size:clamp(64px,11vw,104px)!important}body[data-layout-mode="phone-landscape"] .wrekt-call-direction button img{width:106%;height:138%}}
@media(prefers-reduced-motion:reduce){.wrekt-deck-shader{opacity:.45}.wrekt-call-direction button,.wrekt-call-direction button img,.wrekt-utility-tabs button,.wrekt-utility-tabs button::before{transition:none}}

/* Chat accessibility: user-owned scroll state. No forced smooth snapping. */
.chat-scroll-controls { position:absolute; z-index:12; right:10px; bottom:10px; max-width:min(92%,460px); min-height:34px; padding:5px 7px 5px 10px; border:1px solid #344558; border-radius:999px; background:rgba(10,17,24,.94); box-shadow:0 8px 24px rgba(0,0,0,.38); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:flex-end; gap:8px; pointer-events:auto; }
.chat-scroll-controls.hidden { display: none !important; }
.chat-scroll-controls span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9ba9b8; font-size: 11px; }
#chat-jump-latest { min-height: 28px; padding: 4px 10px; font-weight: 800; border-color: #45688f; background: #172538; }
#chat-jump-latest:focus-visible { outline: 2px solid #78aef0; outline-offset: 2px; }
body[data-layout-mode^="phone-"] .chat-scroll-controls { right:8px; bottom:8px; min-height:38px; padding:5px 6px 5px 9px; max-width:calc(100% - 16px); }
body[data-layout-mode^="phone-"] #chat-jump-latest { min-height: 32px; }

@media(max-width:700px){.wrekt-call-history-list{grid-template-columns:1fr}.wrekt-call-history-head{align-items:flex-start;flex-direction:column;gap:2px}}

/* Runtime freshness / stale-client fail-safe */
.wrekt-runtime-upgrade{position:fixed;inset:0;z-index:2147483646;display:grid;place-items:center;background:rgba(2,5,10,.86);padding:20px}
.wrekt-runtime-upgrade.hidden{display:none}
.wrekt-runtime-upgrade-card{width:min(520px,92vw);display:grid;gap:12px;padding:22px;border:1px solid rgba(130,210,255,.45);border-radius:16px;background:#080d14;box-shadow:0 18px 70px rgba(0,0,0,.55);text-align:center}
.wrekt-runtime-upgrade-card strong{font-size:18px;letter-spacing:.12em}
.wrekt-runtime-upgrade-card span{font-size:14px;line-height:1.45;color:#d8e7f2}
.wrekt-runtime-upgrade-card small{font-size:11px;line-height:1.4;color:#7f97a8}
.wrekt-runtime-upgrade-card button{justify-self:center;border:1px solid rgba(160,220,255,.65);border-radius:10px;background:#101b27;color:#fff;padding:10px 16px;font:inherit;font-weight:800;cursor:pointer}
.wrekt-runtime-upgrade-card button:disabled{opacity:.62;cursor:wait}
html[data-wrekt-upgrade-required="true"] #wrekt-call-overlay{pointer-events:none}

/* v168 toxic acceptance: chat mentions + REP */
.composer{position:relative}.chat-mention-menu{position:absolute;left:8px;right:8px;bottom:100%;z-index:30;max-height:220px;overflow:auto;padding:6px;background:rgba(9,14,20,.98);border:1px solid #344250;border-radius:8px;box-shadow:0 12px 30px rgba(0,0,0,.4)}.chat-mention-menu.hidden{display:none}.chat-mention-menu button{display:block;width:100%;text-align:left;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:var(--wv-text-strong)}.chat-mention-menu button:hover,.chat-mention-menu button.active{background:#1a2733}.chat-mention{display:inline;padding:0;border:0;background:transparent;color:#8fd8ff;font:inherit;font-weight:700;cursor:pointer}.message-rep{font-size:10px;font-weight:800;letter-spacing:.04em;color:#8fd8ff;opacity:.9;white-space:nowrap}

/* UI convergence guardrails: keep repeated shell controls visually related across features. */
.icon-control,
.market-chip,
#research-open-external { border-radius: var(--wv-radius-md); }

.topbar,
.market-ticker,
.chat-panel,
.composer { border-color: var(--wv-border-subtle); }

/* REP Deck V2: canonical call/workspace styling. */
.wrekt-rep-v2-enabled{position:relative;isolation:isolate;overflow:hidden}
.wrekt-rep-v2-enabled::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:.16;background:linear-gradient(135deg,transparent 0 48%,rgba(91,130,170,.38) 48.25% 48.5%,transparent 48.75%),repeating-linear-gradient(0deg,transparent 0 23px,rgba(91,130,170,.14) 24px),repeating-linear-gradient(90deg,transparent 0 35px,rgba(91,130,170,.12) 36px)}
.wrekt-rep-v2-flow{position:relative;display:grid;grid-template-areas:"direction direction" "risk outcome";grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:14px;padding:14px;min-width:0}
.wrekt-rep-v2-direction{grid-area:direction;min-width:0}.wrekt-rep-v2-risk{grid-area:risk;min-width:0}.wrekt-rep-v2-outcome{grid-area:outcome;min-width:0}
.wrekt-rep-v2-sources{display:none!important}
.wrekt-rep-v2-cap{display:flex;align-items:center;gap:7px;margin-bottom:8px;color:#dce6f0;font-size:9px;font-weight:900;letter-spacing:.06em}
.wrekt-rep-v2-cap>span{display:flex;width:21px;height:21px;align-items:center;justify-content:center;border:1px solid #344454;border-radius:999px;background:rgba(7,12,18,.72);font-size:8px}
.wrekt-rep-v2-enabled .wrekt-call-head{margin:0 0 8px;padding:0}.wrekt-rep-v2-enabled .wrekt-call-market-row{margin:0 0 10px}.wrekt-rep-v2-enabled .wrekt-call-direction{margin:0;gap:8px}
.wrekt-rep-v2-enabled .wrekt-call-direction button{min-height:54px}
.wrekt-rep-v2-rr{display:flex;align-items:center;gap:8px;margin-top:10px}.wrekt-rep-v2-rr>span{font-size:8px;font-weight:900;color:#7f8d9d}.wrekt-rep-v2-rr>div{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;flex:1}
.wrekt-rep-v2-rr button{min-height:34px;border:1px solid #2d3946;border-radius:6px;background:rgba(9,15,21,.82);color:#788797;font:900 8px/1 inherit}.wrekt-rep-v2-rr button.active{border-color:#4f779f;background:rgba(25,46,65,.94);color:#eef7ff}
.wrekt-rep-v2-position{margin-top:8px;padding:7px 9px;border:1px solid #2d3946;border-radius:7px;background:rgba(7,12,18,.66)}.wrekt-rep-v2-position small{display:block;color:#6f8091;font-size:7px;font-weight:900}.wrekt-rep-v2-position strong{font-size:10px}.wrekt-rep-v2-position span{float:right;color:#7f8d9d;font-size:8px;font-weight:800}
.wrekt-rep-v2-risk-box,.wrekt-rep-v2-shape-box{padding:12px;border:1px solid #2d3946;border-radius:9px;background:rgba(7,12,18,.70);backdrop-filter:blur(5px)}.wrekt-rep-v2-shape-box{margin-top:10px}
.wrekt-rep-v2-control-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start}.wrekt-rep-v2-control-head small{display:block;color:#7f8d9d;font-size:7px;font-weight:900;letter-spacing:.08em}.wrekt-rep-v2-control-head strong{display:block;margin-top:2px;color:#dce6f0;font-size:10px}.wrekt-rep-v2-control-head em{display:block;margin-top:2px;color:#708091;font-size:7px;font-style:normal}.wrekt-rep-v2-control-head output{color:#dce6f0;font-size:9px;font-weight:900;white-space:nowrap}
.wrekt-rep-v2-risk-number output{display:block;padding:4px 6px;border:1px solid currentColor;border-radius:6px;font-size:20px;font-weight:950;line-height:1;text-align:center}.wrekt-rep-v2-risk-number strong{margin-top:3px;text-align:right;font-size:8px}
.wrekt-rep-v2-risk-box input,.wrekt-rep-v2-shape-box input{width:100%;margin-top:9px}
.wrekt-rep-v2-risk-scale{display:grid;grid-template-columns:1fr 1fr .7fr .25fr .25fr;margin-top:3px;color:#6f8091;font-size:6px;font-weight:900}.wrekt-rep-v2-risk-scale span{text-align:right}.wrekt-rep-v2-risk-scale span:first-child{text-align:left}
.wrekt-rep-v2-risk-gradient{display:grid;grid-template-columns:1fr 1fr .7fr .25fr .25fr;height:4px;margin-top:3px;overflow:hidden;border-radius:999px}.wrekt-rep-v2-risk-gradient i:nth-child(1){background:#20d6a2}.wrekt-rep-v2-risk-gradient i:nth-child(2){background:#a8c25d}.wrekt-rep-v2-risk-gradient i:nth-child(3){background:#f7c65b}.wrekt-rep-v2-risk-gradient i:nth-child(4){background:#ff9b55}.wrekt-rep-v2-risk-gradient i:nth-child(5){background:#ff5b68}
.wrekt-rep-v2-shape-scale{display:flex;justify-content:space-between;margin-top:3px;color:#6f8091;font-size:6px;font-weight:900}
.wrekt-rep-v2-warning{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding:7px 9px;border:1px solid #2d3946;border-radius:7px;background:rgba(7,12,18,.65);font-size:7px}.wrekt-rep-v2-warning strong{font-size:8px}.wrekt-rep-v2-warning span{text-align:right;color:#94a3b2}
.wrekt-rep-v2-hero{display:grid;grid-template-columns:1fr 1fr;gap:8px}.wrekt-rep-v2-hero>div{padding:10px;border:1px solid #2d3946;border-radius:8px;background:rgba(7,12,18,.72)}.wrekt-rep-v2-hero small,.wrekt-rep-v2-trade-map small,.wrekt-rep-v2-math small{display:block;color:#758596;font-size:7px;font-weight:900}.wrekt-rep-v2-hero strong{display:block;margin-top:2px;font-size:19px;line-height:1.05}.wrekt-rep-v2-hero span{display:block;margin-top:3px;color:#758596;font-size:7px}.wrekt-rep-v2-gain strong{color:#20d6a2}
.wrekt-rep-v2-trade-map{margin-top:9px;overflow:hidden;border:1px solid #2d3946;border-radius:8px;background:rgba(7,12,18,.72)}.wrekt-rep-v2-trade-row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border:0;border-radius:0;background:transparent;color:#dce6f0;text-align:left}.wrekt-rep-v2-target{background:rgba(32,214,162,.09)}.wrekt-rep-v2-trade-row>span:last-child{text-align:right}.wrekt-rep-v2-trade-row strong{font-size:10px}.wrekt-rep-v2-trade-row small{font-size:7px}.wrekt-rep-v2-trade-row em{display:inline-block;margin-left:4px;padding:1px 4px;border:1px solid currentColor;border-radius:999px;font-size:5px;font-style:normal;letter-spacing:.08em}
.wrekt-rep-v2-entry{display:grid;grid-template-columns:auto 1fr auto 1fr;gap:6px;padding:5px 10px;border-top:1px solid #26333f;border-bottom:1px solid #26333f;color:#758596;font-size:7px}.wrekt-rep-v2-entry strong{text-align:right;color:#cdd8e2;font-size:8px}
.wrekt-rep-v2-editor{display:grid;grid-template-columns:82px minmax(0,1fr) auto auto;gap:5px;padding:7px;border-top:1px solid #26333f;background:#0c141d}.wrekt-rep-v2-editor[hidden]{display:none!important}.wrekt-rep-v2-editor select,.wrekt-rep-v2-editor input{min-width:0;min-height:34px;border:1px solid #304050;border-radius:5px;background:#0d151e;color:#eef6ff;padding:5px 6px;font:800 11px/1 inherit}.wrekt-rep-v2-editor button{min-height:34px;border:1px solid #304050;border-radius:5px;background:#101923;color:#aebdca;padding:5px 7px;font:900 7px/1 inherit}.wrekt-rep-v2-editor [data-wrekt-editor-error]{grid-column:1/-1;color:#ff9ba4;font-size:7px}
.wrekt-rep-v2-math{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:8px}.wrekt-rep-v2-math>div{padding:4px 6px;border-left:2px solid #344454;background:rgba(7,12,18,.54)}.wrekt-rep-v2-math strong{display:block;font-size:9px}
.wrekt-rep-v2-enabled .wrekt-call-status{min-height:18px;margin:7px 0 0;font-size:8px}.wrekt-rep-v2-enabled .wrekt-call-submit{width:100%;min-height:42px;margin-top:7px}
.wrekt-rep-v2-enabled .risk-watch{border-color:#f7c65b!important;background:rgba(247,198,91,.08)!important}.wrekt-rep-v2-enabled .risk-watch strong,.wrekt-rep-v2-enabled .risk-watch output{color:#f7c65b}.wrekt-rep-v2-enabled .risk-high{border-color:#ff9b55!important;background:rgba(255,155,85,.10)!important}.wrekt-rep-v2-enabled .risk-high strong,.wrekt-rep-v2-enabled .risk-high output{color:#ff9b55}.wrekt-rep-v2-enabled .risk-critical{border-color:#ff5b68!important;background:rgba(255,91,104,.13)!important}.wrekt-rep-v2-enabled .risk-critical strong,.wrekt-rep-v2-enabled .risk-critical output{color:#ff7b86}.wrekt-rep-v2-enabled .risk-total{border-color:#ff5b68!important;background:rgba(255,91,104,.22)!important;box-shadow:inset 0 0 0 2px rgba(255,91,104,.42)}.wrekt-rep-v2-enabled .risk-total strong,.wrekt-rep-v2-enabled .risk-total output{color:#ff6976}

body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow{grid-template-areas:"direction" "risk" "outcome";grid-template-columns:1fr;gap:13px;padding:14px 12px 18px}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction button{min-height:58px}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor{grid-template-columns:1fr 1fr}body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor button{min-height:42px}

body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-utility-body{overflow:hidden}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] form.wrekt-rep-v2-enabled{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:calc(5px + env(safe-area-inset-top)) max(7px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left))}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow{grid-template-areas:"direction risk outcome";grid-template-columns:minmax(0,.82fr) minmax(0,1fr) minmax(0,1.08fr);gap:7px;padding:0;align-items:start;min-width:0;width:100%}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-direction{padding-right:7px;border-right:1px solid rgba(65,82,99,.55)}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-outcome{padding-left:7px;border-left:1px solid rgba(65,82,99,.55)}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-cap{margin-bottom:4px;font-size:7px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-cap>span{width:16px;height:16px;font-size:6px}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-head{margin-bottom:4px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-market-row{margin-bottom:4px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction button{min-height:38px;padding:4px 6px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction img{width:24px;height:24px}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr{display:block;margin-top:5px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr>span{display:block;margin-bottom:3px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr button{min-height:27px}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-position{margin-top:5px;padding:4px 6px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-box,body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-box{padding:7px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-box{margin-top:5px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-number output{font-size:15px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-box input,body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-box input{margin-top:5px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-warning{margin-top:5px;padding:4px 6px}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero{gap:4px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero>div{padding:6px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero strong{font-size:13px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-trade-map{margin-top:4px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-trade-row{padding:5px 7px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-entry{padding:3px 7px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-math{margin-top:4px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-status{margin-top:3px;min-height:12px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-submit{min-height:34px;margin-top:3px;padding:5px;font-size:8px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor{grid-template-columns:68px minmax(0,1fr) auto auto;padding:5px}body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor select,body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor input,body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor button{min-height:28px}


/* MOBILE_REP_DECK_FIT_V1
   The deck is an app surface on phones: chrome stays fixed and only data lists scroll. */
body[data-layout-mode="phone-portrait"] .wrekt-utility-drawer,
body[data-layout-mode="phone-landscape"] .wrekt-utility-drawer {
  position:absolute;
  left:0;
  top:0;
  right:auto;
  bottom:auto;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  border:0;
  border-radius:0;
}

body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-drawer {
  grid-template-rows:auto auto minmax(0,1fr);
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-head {
  min-height:52px;
  padding:6px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left));
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-head>div>img {
  width:36px;
  height:36px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-head strong {
  font-size:16px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-head>button {
  width:40px;
  height:40px;
  border-radius:10px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-tabs {
  gap:5px;
  padding:5px 7px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-tabs button {
  min-height:40px;
  gap:5px;
  font-size:11px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-tabs .wv-tab-icon {
  width:20px;
  height:20px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-body {
  min-height:0;
  overflow:hidden;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-utility-panel {
  min-height:0;
  height:100%;
  overflow:hidden;
}

body[data-layout-mode="phone-portrait"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-panel {
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:auto auto minmax(0,1fr);
  grid-template-areas:"hero" "call" "history";
  align-content:stretch;
  gap:7px;
  padding:8px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-rule,
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-panel>p {
  display:none;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero {
  min-height:96px;
  max-height:118px;
  padding:8px;
  border-radius:11px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero img {
  width:min(56%,220px);
  height:82px;
  opacity:.14;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero>div>span {
  font-size:11px;
  letter-spacing:2px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero strong {
  font-size:clamp(34px,11vw,52px);
  line-height:.92;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero small {
  margin-top:2px;
  font-size:8px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-active-call {
  min-height:42px;
  padding:8px 9px;
  font-size:11px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-call-history {
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:8px;
  border-radius:10px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-call-history-head {
  flex:0 0 auto;
  margin-bottom:6px;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-call-history-head small {
  display:none;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-call-history-list {
  min-height:0;
  flex:1 1 auto;
  grid-template-columns:1fr;
  gap:5px;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-call-history-card {
  padding:7px 8px;
}

body[data-layout-mode="phone-landscape"] .wrekt-wallet-panel {
  min-height:0;
  display:grid;
  grid-template-columns:minmax(180px,.72fr) minmax(0,1.28fr);
  grid-template-rows:auto minmax(0,1fr);
  grid-template-areas:"hero history" "call history";
  align-content:stretch;
  gap:7px;
  padding:7px max(8px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
}
body[data-layout-mode="phone-landscape"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero {
  min-height:86px;
  max-height:112px;
}
body[data-layout-mode="phone-landscape"]:not([data-wrekt-utility-panel="call"]) .wrekt-wallet-hero strong {
  font-size:clamp(32px,7vw,48px);
}

/* People owns the scroll region; the deck itself does not. */
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-people-dialog,
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-people-dialog>section {
  width:100%;
  height:100%;
  min-height:0;
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-people-dialog>section {
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
  padding:8px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
}
body[data-layout-mode^="phone-"]:not([data-wrekt-utility-panel="call"]) .wrekt-people-list {
  min-height:0;
  max-height:none;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

/* REP ticket: compact controls fit the portrait viewport; landscape keeps its 3-column workbench. */
body[data-layout-mode^="phone-"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form {
  overflow:hidden;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form {
  grid-template-rows:auto auto auto repeat(3,minmax(50px,1fr)) auto auto auto auto;
  gap:5px;
  padding:calc(6px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-head {
  min-height:42px;
  padding-bottom:5px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-market-row {
  min-height:48px;
  align-items:center;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-reference-price {
  font-size:22px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-wallet {
  padding:5px 8px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-wallet strong {
  font-size:13px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction {
  min-height:64px;
  gap:5px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction button {
  min-height:62px;
  grid-template-columns:40px minmax(0,1fr);
  gap:3px;
  padding:4px 6px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction button img {
  width:36px;
  height:36px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction button strong {
  font-size:10px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction button small {
  display:none;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-slider {
  min-height:0;
  gap:2px;
  padding:5px 8px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-slider-head strong {
  font-size:13px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-slider-foot {
  font-size:8px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-metrics {
  min-height:40px;
  padding:5px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-status {
  min-height:12px;
  font-size:8px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-submit {
  min-height:42px;
  font-size:10px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-fineprint {
  font-size:6px;
  line-height:1.25;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form {
  overflow:hidden;
}

@media (max-height:620px) and (orientation:portrait) {
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-dialog form {
    grid-template-rows:auto auto auto repeat(3,minmax(44px,1fr)) auto auto auto;
  }
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-fineprint {
    display:none;
  }
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction {
    min-height:56px;
  }
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-call-direction button {
    min-height:54px;
  }
}


/* PORTRAIT_PANE_SWITCH_ICONS_V1
   Portrait switch is icon-first: chart + speech bubble, no redundant words. */
body[data-layout-mode="phone-portrait"] .mobile-pane-switch {
  width:104px;
  height:40px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:3px;
}
body[data-layout-mode="phone-portrait"] .mobile-pane-switch button {
  min-width:0;
  width:100%;
  min-height:32px;
  height:32px;
  padding:0;
}
body[data-layout-mode="phone-portrait"] .mobile-pane-switch .mobile-pane-label {
  display:none;
}
body[data-layout-mode="phone-portrait"] .mobile-pane-switch .wv-ui-icon {
  width:24px;
  height:24px;
  object-fit:contain;
}
body[data-layout-mode="phone-portrait"] .mobile-pane-switch button[data-mobile-pane="chart"] .wv-ui-icon {
  filter:drop-shadow(0 0 6px rgba(74,137,255,.28));
}
body[data-layout-mode="phone-portrait"] .mobile-pane-switch button[data-mobile-pane="chat"] .wv-ui-icon {
  width:22px;
  height:22px;
}


/* PORTRAIT_REP_DECK_CLOSED_STATE_V1
   Portrait only: closed REP Deck is removed from layout/paint entirely. */
body[data-layout-mode="phone-portrait"]:not([data-wrekt-utility-drawer="open"]) .wrekt-utility-drawer {
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transform:none !important;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-drawer="open"] .wrekt-utility-drawer {
  display:grid !important;
  visibility:visible !important;
  pointer-events:auto !important;
  transform:none !important;
}
body[data-layout-mode="phone-portrait"]:not([data-wrekt-utility-drawer="open"]) .wrekt-utility-scrim {
  display:none !important;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-drawer="open"] .wrekt-utility-scrim {
  display:block !important;
}


/* PORTRAIT_REP_TICKET_PAGER_V1
   Portrait REP creation is a three-card ticket: Direction, Risk, Outcome. */
.wrekt-rep-v2-pager { display:none; }

body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] form.wrekt-rep-v2-enabled {
  display:flex !important;
  flex-direction:column;
  width:100%;
  height:100%;
  min-height:0;
  max-height:none;
  padding:calc(6px + env(safe-area-inset-top)) 0 0 !important;
  gap:0;
  overflow:hidden !important;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] form.wrekt-rep-v2-enabled > .wrekt-call-market-picker {
  flex:0 0 auto;
  margin:0;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] form.wrekt-rep-v2-enabled > .wrekt-call-fineprint {
  display:none !important;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow {
  position:relative;
  flex:1 1 auto;
  display:block;
  min-height:0;
  width:100%;
  padding:0;
  overflow:hidden;
  isolation:isolate;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow::before,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow::after {
  position:absolute;
  z-index:9;
  top:46%;
  width:30px;
  height:64px;
  display:grid;
  place-items:center;
  border:1px solid rgba(103,177,255,.34);
  background:linear-gradient(180deg,rgba(20,48,75,.92),rgba(9,20,31,.94));
  color:#8bc6ff;
  font:1000 27px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  opacity:0;
  pointer-events:none;
  transform:translateY(-50%);
  text-shadow:0 0 10px rgba(91,177,255,.68);
  box-shadow:0 0 20px rgba(56,142,235,.18),inset 0 0 18px rgba(77,166,255,.09);
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow::before {
  content:"‹";
  left:-5px;
  border-radius:0 12px 12px 0;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow::after {
  content:"›";
  right:-5px;
  border-radius:12px 0 0 12px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow.can-prev::before,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow.can-next::after {
  opacity:.92;
  animation:wrekt-rep-pager-edge-pulse 1.7s ease-in-out infinite;
}

body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-direction,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-outcome {
  position:absolute;
  z-index:2;
  inset:8px 10px 66px;
  min-width:0;
  min-height:0;
  margin:0;
  padding:12px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
  border:1px solid rgba(82,111,140,.68);
  border-radius:16px;
  background:
    radial-gradient(circle at 86% 5%,rgba(62,132,203,.11),transparent 33%),
    linear-gradient(155deg,rgba(9,19,28,.985),rgba(5,11,17,.99));
  box-shadow:inset 0 0 36px rgba(54,121,181,.05),0 14px 32px rgba(0,0,0,.32);
  opacity:.28;
  pointer-events:none;
  transition:transform .2s cubic-bezier(.2,.72,.2,1),opacity .16s ease;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-direction { transform:translateX(-108%); }
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk { transform:translateX(108%); }
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-outcome { transform:translateX(108%); }

body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="1"] .wrekt-rep-v2-direction,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="2"] .wrekt-rep-v2-risk,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="3"] .wrekt-rep-v2-outcome {
  transform:translateX(0);
  opacity:1;
  pointer-events:auto;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="1"] .wrekt-rep-v2-risk,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="1"] .wrekt-rep-v2-outcome,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="2"] .wrekt-rep-v2-outcome {
  transform:translateX(108%);
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="2"] .wrekt-rep-v2-direction,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="3"] .wrekt-rep-v2-direction,
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow[data-rep-step="3"] .wrekt-rep-v2-risk {
  transform:translateX(-108%);
}

body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager {
  position:absolute;
  z-index:12;
  left:10px;
  right:10px;
  bottom:max(8px,env(safe-area-inset-bottom));
  height:50px;
  display:grid;
  grid-template-columns:48px minmax(0,1fr) 48px;
  align-items:center;
  gap:8px;
  padding:4px;
  border:1px solid rgba(76,108,139,.72);
  border-radius:15px;
  background:rgba(7,14,21,.965);
  box-shadow:0 -10px 28px rgba(0,0,0,.35),inset 0 0 18px rgba(69,139,208,.05);
  backdrop-filter:blur(10px);
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-arrow {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #4276a6;
  border-radius:11px;
  background:linear-gradient(180deg,#173653,#10253a);
  color:#c9e7ff;
  font:1000 28px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  text-shadow:0 0 9px rgba(96,185,255,.72);
  box-shadow:inset 0 0 16px rgba(67,155,237,.12),0 0 12px rgba(61,143,219,.15);
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-arrow:disabled {
  opacity:.22;
  filter:saturate(.35);
  box-shadow:none;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-center {
  min-width:0;
  display:grid;
  justify-items:center;
  gap:2px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-dots {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-dots button {
  width:28px;
  height:28px;
  min-width:28px;
  min-height:28px;
  padding:0;
  border:1px solid #344c63;
  border-radius:999px;
  background:#0e1a25;
  color:#7890a6;
  font:950 10px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-dots button.active {
  border-color:#62b5ff;
  background:radial-gradient(circle at 50% 40%,#346fa7,#173653);
  color:#fff;
  box-shadow:0 0 0 2px rgba(74,159,239,.12),0 0 14px rgba(67,157,241,.28);
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-pager-hint {
  color:#667b90;
  font:900 6px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.12em;
}
body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-cap {
  position:sticky;
  top:0;
  z-index:3;
  margin:-2px -2px 10px;
  padding:5px 2px 7px;
  background:linear-gradient(180deg,rgba(9,19,28,.99),rgba(9,19,28,.88) 72%,transparent);
}

@keyframes wrekt-rep-pager-edge-pulse {
  0%,100% { opacity:.42; filter:brightness(.9); }
  50% { opacity:1; filter:brightness(1.25); }
}
@media (prefers-reduced-motion:reduce) {
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-direction,
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk,
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-outcome {
    transition:none;
  }
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow::before,
  body[data-layout-mode="phone-portrait"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow::after {
    animation:none !important;
  }
}


/* LANDSCAPE_REP_DECK_COMPRESSION_V1
   Landscape only: preserve the 3-column REP layout, compress chrome/card internals to fit one screen. */
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] form.wrekt-rep-v2-enabled {
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  overflow:hidden !important;
  padding:max(3px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)) !important;
  gap:0;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] form.wrekt-rep-v2-enabled > .wrekt-call-market-picker {
  flex:0 0 auto;
  margin:0 0 2px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-flow {
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-areas:"direction risk outcome";
  grid-template-columns:minmax(0,.86fr) minmax(0,1fr) minmax(0,1.08fr);
  align-items:stretch;
  gap:5px;
  padding:0;
  width:100%;
  overflow:hidden;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-direction,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-outcome {
  min-width:0;
  min-height:0;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  padding-top:1px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-direction {
  padding-right:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-outcome {
  padding-left:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-cap {
  min-height:18px;
  margin-bottom:2px;
  gap:5px;
  font-size:6px;
  letter-spacing:.04em;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-cap>span {
  width:15px;
  height:15px;
  font-size:5px;
}

body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-head {
  margin-bottom:2px;
  padding:0;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-kicker {
  font-size:6px;
  letter-spacing:.14em;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-market {
  font-size:15px;
  line-height:1.05;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-close {
  width:30px;
  height:30px;
  min-width:30px;
  border-radius:8px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-market-row {
  min-height:0;
  margin-bottom:3px;
  padding:4px 6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-reference-label,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-wallet>span {
  font-size:6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-reference-price {
  font-size:19px;
  line-height:1;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-wallet {
  padding:4px 6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-wallet strong {
  font-size:10px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction button {
  min-height:34px;
  padding:3px 5px;
  border-radius:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-direction img {
  width:21px;
  height:21px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-direction button strong {
  font-size:7px;
  line-height:1.05;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-call-direction button small {
  display:none;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr {
  display:flex;
  align-items:center;
  gap:4px;
  margin-top:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr>span {
  margin:0;
  font-size:6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr>div {
  gap:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-rr button {
  min-height:24px;
  border-radius:5px;
  font-size:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-position {
  margin-top:3px;
  padding:3px 5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-position small {
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-position strong {
  font-size:8px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-position span {
  font-size:6px;
}

body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-box,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-box {
  padding:5px 6px;
  border-radius:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-box {
  margin-top:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-control-head {
  gap:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-control-head small {
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-control-head strong {
  margin-top:1px;
  font-size:8px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-control-head em {
  margin-top:1px;
  font-size:5px;
  line-height:1.15;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-control-head output {
  font-size:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-number output {
  padding:3px 5px;
  font-size:14px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-number strong {
  margin-top:1px;
  font-size:6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-box input,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-box input {
  margin-top:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-risk-scale,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-shape-scale {
  margin-top:2px;
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-warning {
  margin-top:3px;
  padding:3px 5px;
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-warning strong {
  font-size:6px;
}

body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero {
  gap:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero>div {
  min-height:52px;
  padding:4px 6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero small {
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero strong {
  font-size:12px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-hero span {
  font-size:6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-trade-map {
  margin-top:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-trade-row {
  min-height:38px;
  padding:4px 6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-trade-row small,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-entry span {
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-trade-row strong {
  font-size:9px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-entry {
  min-height:25px;
  padding:2px 6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-entry strong {
  font-size:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-math {
  gap:3px;
  margin-top:3px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-math>div {
  padding:3px 4px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-math small {
  font-size:5px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-math strong {
  font-size:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-status {
  min-height:9px;
  margin-top:2px;
  font-size:6px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-enabled .wrekt-call-submit {
  min-height:30px;
  margin-top:2px;
  padding:4px 6px;
  font-size:7px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor {
  grid-template-columns:60px minmax(0,1fr) auto auto;
  gap:3px;
  padding:4px;
}
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor select,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor input,
body[data-layout-mode="phone-landscape"][data-wrekt-utility-panel="call"] .wrekt-rep-v2-editor button {
  min-height:25px;
  font-size:7px;
}


/* Wrekt notification attention states */
.chat-tabs .tab[data-view="dms"] { position: relative; overflow: visible; }
.dm-tab-alert {
  position: absolute;
  top: 3px;
  right: calc(50% - 19px);
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid #091017;
  border-radius: 999px;
  background: #ff5b68;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,91,104,.35), 0 2px 7px rgba(0,0,0,.45);
  font: 900 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}
.dm-tab-alert[hidden] { display: none !important; }
.chat-tabs .tab[data-view="dms"].has-unread { color: #fff; }
.dm-chip.has-unread {
  border-color: rgba(93,150,255,.62) !important;
  background: linear-gradient(90deg, rgba(47,120,214,.20), rgba(15,21,28,.96)) !important;
  box-shadow: inset 3px 0 0 #5d96ff;
  color: #f3f8ff;
  font-weight: 800;
}
.message.message--unread {
  border-color: rgba(93,150,255,.66);
  background: linear-gradient(90deg, rgba(47,120,214,.16), #101820 36%);
  box-shadow: inset 3px 0 0 #5d96ff, 0 4px 14px rgba(0,0,0,.20);
}
.message.message--unread::after {
  content: 'NEW';
  position: absolute;
  top: 6px;
  right: 7px;
  color: #8bb8ff;
  font: 900 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .08em;
  pointer-events: none;
}


/* CHAT_ATTENTION_V1: in-conversation mentions + public room activity/unread */
#message-stage { position:relative; }
.chat-attention-tray {
  position:absolute;
  z-index:18;
  top:6px;
  left:8px;
  right:8px;
  max-height:min(270px,45%);
  overflow:hidden;
  border:1px solid rgba(92,162,224,.58);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(9,20,29,.985),rgba(6,13,20,.97));
  box-shadow:0 14px 34px rgba(0,0,0,.48),inset 0 0 22px rgba(74,151,218,.06);
  opacity:0;
  pointer-events:none;
  transform:translateY(-115%);
  transition:transform .22s cubic-bezier(.18,.76,.2,1),opacity .16s ease;
  backdrop-filter:blur(10px);
}
.chat-attention-tray.open {
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}
.chat-attention-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:28px;
  padding:6px 9px;
  border-bottom:1px solid rgba(80,123,158,.34);
  color:#b9dcf5;
  font:900 8px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.12em;
}
.chat-attention-head span {
  min-width:18px;
  padding:3px 5px;
  border-radius:999px;
  background:#17354a;
  color:#d9f1ff;
  text-align:center;
}
.chat-attention-list {
  max-height:230px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.chat-attention-item {
  display:grid;
  grid-template-columns:minmax(0,1fr) 28px;
  align-items:stretch;
  border-bottom:1px solid rgba(58,89,112,.28);
}
.chat-attention-item:last-child { border-bottom:0; }
.chat-attention-open {
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  padding:8px 9px;
  border:0;
  background:transparent;
  color:#dceaf3;
  text-align:left;
  cursor:pointer;
}
.chat-attention-open:hover { background:rgba(69,139,196,.12); }
.chat-attention-copy { min-width:0; display:grid; gap:3px; }
.chat-attention-copy strong {
  overflow:hidden;
  color:#9bd5ff;
  font:900 9px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.chat-attention-copy > span {
  overflow:hidden;
  color:#b7c5cf;
  font:700 10px/1.25 ui-monospace,SFMono-Regular,Consolas,monospace;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.chat-attention-open time {
  color:#678092;
  font:800 7px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.chat-attention-dismiss {
  width:28px;
  border:0;
  border-left:1px solid rgba(58,89,112,.28);
  background:transparent;
  color:#708b9e;
  font:900 17px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  cursor:pointer;
}
.chat-attention-dismiss:hover { color:#fff; background:rgba(255,255,255,.05); }

.message.message--mention {
  border-color:rgba(73,183,255,.74);
  background:linear-gradient(90deg,rgba(31,124,187,.19),#101820 42%);
  box-shadow:inset 3px 0 0 #53b8ff,0 4px 16px rgba(0,0,0,.2);
}
.message.message--mention-focus {
  animation:wrekt-mention-focus 1.05s ease-in-out 3;
}
@keyframes wrekt-mention-focus {
  0%,100% { box-shadow:inset 3px 0 0 #53b8ff,0 4px 16px rgba(0,0,0,.2); }
  50% { box-shadow:inset 4px 0 0 #8bd7ff,0 0 0 1px rgba(92,199,255,.55),0 0 24px rgba(53,166,232,.26); }
}

.public-room-chip {
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}
.room-chip-label {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.room-chip-meta {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
}
.room-active-count {
  color:#688498;
  font:800 7px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  white-space:nowrap;
}
.room-unread-badge {
  padding:3px 5px;
  border:1px solid rgba(83,184,255,.58);
  border-radius:999px;
  background:rgba(39,124,185,.18);
  color:#8dd8ff;
  font:950 7px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.04em;
  white-space:nowrap;
}
.public-room-chip.has-unread {
  border-color:rgba(83,184,255,.44) !important;
  box-shadow:inset 2px 0 0 rgba(83,184,255,.82);
}

body[data-layout-mode^="phone-"] .chat-attention-tray {
  top:4px;
  left:5px;
  right:5px;
  max-height:min(220px,42%);
  border-radius:8px;
}
body[data-layout-mode^="phone-"] .chat-attention-copy strong { font-size:8px; }
body[data-layout-mode^="phone-"] .chat-attention-copy > span { font-size:9px; }

@media (prefers-reduced-motion:reduce) {
  .chat-attention-tray { transition:none; }
  .message.message--mention-focus { animation:none; }
}


/* CHAT_ROOM_LIVENESS_V1 */
.public-room-chip { position:relative; overflow:visible !important; }
.public-room-chip.is-active .room-active-count {
  color:#45f39a;
  text-shadow:0 0 8px rgba(69,243,154,.5);
  font-weight:1000;
  letter-spacing:.055em;
}
.public-room-chip.is-active .room-active-count::before {
  content:'';
  display:inline-block;
  width:6px;
  height:6px;
  margin-right:5px;
  border-radius:50%;
  background:#38ee8a;
  box-shadow:0 0 8px rgba(56,238,138,.9);
  vertical-align:1px;
  animation:wrekt-room-live-dot 1.65s ease-in-out infinite;
}
.public-room-chip.is-inactive .room-active-count {
  color:#ff6572;
  text-shadow:0 0 7px rgba(255,73,91,.28);
  font-weight:950;
  letter-spacing:.05em;
}
.room-unread-badge {
  min-width:42px;
  padding:4px 6px;
  border-color:rgba(96,202,255,.72);
  background:linear-gradient(180deg,rgba(39,143,205,.3),rgba(26,91,136,.22));
  color:#c8efff;
  box-shadow:0 0 9px rgba(66,178,239,.18);
  font-size:8px;
}
.room-hover-preview {
  position:absolute;
  z-index:40;
  left:8px;
  right:8px;
  top:calc(100% + 6px);
  display:grid;
  gap:5px;
  padding:9px 10px;
  border:1px solid rgba(94,176,230,.62);
  border-radius:9px;
  background:linear-gradient(180deg,rgba(8,19,28,.99),rgba(5,12,18,.99));
  box-shadow:0 14px 30px rgba(0,0,0,.52),inset 0 0 18px rgba(69,150,205,.06);
  color:#d9e7ef;
  text-align:left;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(-4px);
  transition:opacity .12s ease,transform .12s ease,visibility .12s linear;
}
.room-hover-preview strong {
  color:#77d5ff;
  font:1000 8px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.1em;
}
.room-hover-preview > span {
  display:-webkit-box;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  color:#d7e3ea;
  font:750 11px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace;
  white-space:normal;
}
.public-room-chip.has-unread:hover .room-hover-preview,
.public-room-chip.has-unread:focus-visible .room-hover-preview {
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}
@keyframes wrekt-room-live-dot {
  0%,100% { opacity:.45; transform:scale(.82); }
  50% { opacity:1; transform:scale(1.12); }
}
body[data-layout-mode^="phone-"] .room-hover-preview { display:none; }
@media (prefers-reduced-motion:reduce) {
  .public-room-chip.is-active .room-active-count::before { animation:none; }
  .room-hover-preview { transition:none; }
}

/* Desktop chat frame containment: overlays never consume grid tracks. */
body:not([data-layout-mode^="phone-"]) #chat-panel {
  grid-template-rows:36px 52px max-content minmax(0,1fr) auto;
  min-height:0;
}
body:not([data-layout-mode^="phone-"]) #chat-panel > #room-list { grid-row:3; min-height:0; }
body:not([data-layout-mode^="phone-"]) #chat-panel > #message-stage {
  grid-row:4;
  min-height:0;
  min-width:0;
  overflow:hidden;
}
body:not([data-layout-mode^="phone-"]) #chat-panel > #message-stage > #message-list {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
}
body:not([data-layout-mode^="phone-"]) #chat-panel > #composer {
  grid-row:5;
  min-height:0;
  position:relative;
  z-index:3;
}

/* Keep the active phone chat visible above decorative layers and inside the visual viewport. */
body[data-layout-mode^="phone-"][data-mobile-pane="chat"] #chat-panel{
  display:grid!important;
  visibility:visible!important;
  opacity:1!important;
  z-index:2;
  height:calc(100% - var(--wrekt-keyboard-inset,0px))!important;
  max-height:100%;
  min-height:0;
  overflow:hidden;
}
body[data-layout-mode^="phone-"][data-mobile-pane="chat"] #message-stage{
  display:block;
  grid-area:messages;
  min-height:0;
  height:100%;
  isolation:isolate;
  overflow:hidden;
}
body[data-layout-mode^="phone-"][data-mobile-pane="chat"] #message-list{
  position:relative;
  z-index:2;
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}
body[data-layout-mode^="phone-"] #wrekt-session-flags{display:none!important}
