:root {
  --bg: #050c19;
  --surface: #0c1727;
  --surface-2: #111e2e;
  --surface-3: #0a1423;
  --line: #20344a;
  --line-soft: rgba(116, 151, 185, 0.16);
  --text: #edf4fb;
  --muted: #8092a7;
  --cyan: #34d3dc;
  --green: #2dd4a5;
  --red: #ff6073;
  --orange: #ffad24;
  --blue: #347df1;
  --gold: #d9b836;
}
html.auth-pending .app-shell { visibility: hidden; }

* { box-sizing: border-box; }

html, body { min-width: 330px; min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 50% -20%, #122744 0%, var(--bg) 42rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
body.theme-peer { --bg: #0d071b; --surface: #19102b; --surface-2: #21143a; --surface-3: #150d28; --line: #513b72; --cyan: #d08cff; --blue: #8d5cf6; background: radial-gradient(circle at 50% -15%, #43236b 0%, #0d071b 45rem); }
body.theme-teacher { --bg: #031416; --surface: #082326; --surface-2: #0b3032; --surface-3: #071e22; --line: #285c5c; --cyan: #6ee7d8; --blue: #d69b36; background: radial-gradient(circle at 50% -15%, #16494a 0%, #031416 45rem); }
body.theme-peer .topbar, body.theme-peer .toolbar, body.theme-peer .quote-strip, body.theme-peer .chart-footer { background-color: rgba(28,14,49,.95); }
body.theme-teacher .topbar, body.theme-teacher .toolbar, body.theme-teacher .quote-strip, body.theme-teacher .chart-footer { background-color: rgba(5,35,38,.95); }
body.theme-peer .chart-stage, body.theme-teacher .chart-stage { background: #000; }
body:not(.auth-gate) { background-image: linear-gradient(rgba(3, 7, 18, .52), rgba(3, 7, 18, .78)), url("assets/login-background.png"); background-position: center; background-size: cover; background-attachment: fixed; }

button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; padding: 14px; }

.topbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px 16px 0 0;
  background: rgba(10, 22, 39, 0.93);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; overflow: hidden; border: 1px solid #57406f; border-radius: 11px; color: transparent; background: #09070d url("assets/dragonking-logo.png") center / 145% no-repeat; font-weight: 900; }
.brand p { margin: 0 0 3px; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: 0.16em; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.top-actions { display: flex; align-items: center; gap: 9px; }

.blind-badge, .status-pill, .position-pill, .winrate-pill, .market-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(52, 211, 220, 0.38);
  border-radius: 999px;
  color: #72dce3;
  background: rgba(52, 211, 220, 0.07);
  white-space: nowrap;
}

.blind-badge { padding: 7px 11px; font-size: 10px; }
.blind-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.selected-drawing-delete { position: absolute; z-index: 7; top: 10px; left: 10px; right: auto; padding: 7px 10px; border: 1px solid rgba(255,96,115,.72); border-radius: 7px; color: #ffd9de; background: rgba(80,20,34,.94); box-shadow: 0 6px 18px rgba(0,0,0,.28); cursor: pointer; font-size: 9px; font-weight: 800; transition: left 90ms ease, top 90ms ease; }
.selected-drawing-delete:hover { color: #fff; background: #a52e43; }
.selected-drawing-delete.white-frame-delete { color: #fff; border-color: #ff8192; background: #c9364f; box-shadow: 0 7px 22px rgba(201,54,79,.38); }
.selected-drawing-delete.white-frame-delete:hover { background: #e34760; }
.selected-drawing-delete[hidden] { display: none; }
.secondary-button, .primary-small, .toolbar button, .size-presets button { border: 1px solid var(--line); border-radius: 8px; background: #101c2c; cursor: pointer; }
.secondary-button, .primary-small { padding: 9px 13px; font-size: 11px; }
.primary-small { border-color: #347df1; background: #2769d1; }
.review-button { border-color: rgba(217,184,54,.48); color: #e1cb72; background: rgba(217,184,54,.06); }
.review-button:hover, body.review-focus .review-button { border-color: #d9b836; color: #fff1a8; background: rgba(217,184,54,.16); }
.review-dock-button { position: fixed; z-index: 40; top: 50%; right: 10px; padding: 12px 8px; border: 1px solid rgba(217,184,54,.75); border-radius: 9px 0 0 9px; color: #fff1a8; background: #18283b; box-shadow: 0 8px 22px rgba(0,0,0,.35); cursor: pointer; font-size: 11px; font-weight: 800; writing-mode: vertical-rl; letter-spacing: .08em; }
.review-dock-button:hover { color: #fff; background: #705c20; }
body.review-focus .review-dock-button { display: none; }
.player-button { display: inline-flex; align-items: center; gap: 7px; }
.player-avatar { display: inline-grid; width: 24px; height: 24px; place-items: center; border: 1px solid #35516c; border-radius: 50%; color: #bfd0df; background: #15283a; font-size: 10px; font-weight: 900; }
.player-avatar.admin-avatar { border-color: rgba(52,211,220,.65); color: #062a2b; background: linear-gradient(135deg, #79e5e8, #35c8d0); box-shadow: 0 0 0 3px rgba(52,211,220,.08); }

.toolbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 18px;
  border: 1px solid var(--line-soft);
  border-top: 0;
  background: rgba(8, 18, 32, 0.96);
}

.timeframe-group, .chart-tools, .drawing-tools, .drawing-tools-panel { display: flex; align-items: center; gap: 7px; }
.chart-tools { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.drawing-tools { padding-right: 7px; border-right: 1px solid var(--line); }
.drawing-tools-panel { overflow: hidden; max-width: 720px; opacity: 1; transition: max-width .22s ease, opacity .16s ease; }
.drawing-tools.collapsed .drawing-tools-panel { max-width: 0; opacity: 0; pointer-events: none; }
.drawing-tools-toggle { color: #d3dce5 !important; font-size: 17px !important; }
.notes-quick-actions { grid-template-columns: minmax(0, 1fr) !important; }
.drawing-tools:not(.collapsed) .drawing-tools-toggle { border-color: #3a83ed; color: #fff !important; background: #286ad2; }
#drawingTools,
#undoDrawingButton,
#resetScaleButton,
#returnCurrentButton,
#historyBackButton { display: none !important; }
.timeframe-group > span:first-child { color: #b7c6d6; font-size: 11px; font-weight: 800; }
.symbol-button { border: 0 !important; color: #d8dee8 !important; background: transparent !important; font-size: 12px !important; font-weight: 800; }
.quote-badge { padding: 4px 7px; border-radius: 4px; font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.quote-badge, .quote-separator, .chart-spread { display: none !important; }
.quote-badge.bid { color: #11c990; background: rgba(14,203,129,.14); }
.quote-badge.ask { color: #f35c70; background: rgba(246,70,93,.14); }
.quote-separator, .chart-spread { color: #7e8998; font-size: 10px; }
.toolbar button { padding: 5px 12px; color: #96a8bb; font-size: 10px; }
.drawing-tools button { min-width: 27px; height: 27px; padding: 0 6px; color: #d3dce5; font-size: 15px; line-height: 1; }
.drawing-tools button.fib-tool { min-width: 36px; font-size: 10px; font-weight: 800; }
.drawing-tools button[data-tool="position"] { font-size: 8px; font-weight: 800; }
.toolbar button.active, .toolbar button.tool-active { border-color: #3a83ed; color: white; background: #286ad2; }
.dataset-select { height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: #b7c6d6; background: #101c2c; font-size: 10px; }
.extend-select { height: 28px; min-width: 104px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: #9fb2c4; background: #101c2c; font-size: 9px; }
.toolbar-note { color: #617286; font-size: 9px; }
.terminal-menu { position: relative; flex: 0 0 auto; }
.terminal-menu > button { display: inline-flex; align-items: center; gap: 4px; }
.terminal-menu b { min-width: 14px; padding: 0 4px; border-radius: 999px; color: #071917; background: #14caa8; font-size: 9px; line-height: 15px; }
.terminal-popover { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 180px; padding: 5px; border: 1px solid #303845; border-radius: 7px; background: #141920; box-shadow: 0 12px 28px rgba(0,0,0,.46); }
.terminal-popover[hidden] { display: none; }
.terminal-popover button { display: flex; width: 100%; align-items: center; gap: 7px; padding: 7px 8px; border: 0; border-radius: 4px; color: #b9c2ce; background: transparent; text-align: left; font-size: 11px; }
.terminal-popover button:hover, .terminal-popover button.active { color: #fff; background: #242b35; }
.indicator-popover i { width: 8px; height: 8px; border-radius: 999px; }
.chart-color-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 7px; margin-top: 5px; padding: 8px; border-top: 1px solid #2a3542; color: #aebdca; font-size: 9px; }
.chart-color-settings strong { grid-column: 1 / -1; color: #e4edf4; font-size: 9px; }
.chart-color-settings label { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.chart-color-settings input[type="color"] { width: 28px; height: 20px; padding: 1px; border: 1px solid #526273; border-radius: 5px; background: #0c1724; cursor: pointer; }
.chart-color-settings button { grid-column: 1 / -1; justify-content: center; padding: 5px 6px; border: 1px solid #2b485d; color: #91b9c7; font-size: 8px; }
.indicator-manager { display: grid; gap: 4px; margin-top: 5px; padding-top: 7px; border-top: 1px solid #2a3542; }
.indicator-manager-title { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 3px 2px; color: #dce9f2; font-size: 9px; font-weight: 800; }
.indicator-manager-title small { color: #7890a4; font-size: 7px; font-weight: 500; }
.indicator-manager > p { margin: 3px; color: #71879a; font-size: 8px; }
.indicator-manager-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) 22px 22px 22px; align-items: center; gap: 5px; min-height: 25px; padding: 2px 3px; border: 1px solid #223b51; border-radius: 6px; background: #0a1929; }
.indicator-manager-row.is-locked { border-color: rgba(110,231,216,.42); background: rgba(52,211,220,.08); }
.indicator-manager-row > i { width: 8px; height: 8px; border-radius: 999px; box-shadow: 0 0 7px currentColor; }
.indicator-manager-row > span { overflow: hidden; color: #cbd9e4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.indicator-manager-row > span small { margin-left: 3px; color: #71879a; font-size: 7px; }
.indicator-manager-row > button { width: 22px; height: 21px; padding: 0; border: 1px solid #2b4a60; border-radius: 5px; color: #9db4c4; background: #0b1d2e; cursor: pointer; font-size: 11px; line-height: 19px; }
.indicator-manager-row > button:hover { border-color: #6ee7d8; color: #eafffb; }
.indicator-manager-row > button:last-child { color: #ff91a0; }
.indicator-manager-row > button:disabled { cursor: not-allowed; opacity: .35; }
.indicator-chip { padding: 5px 9px; border-radius: 7px; color: #ccb958; background: rgba(217,184,54,0.07); font-size: 9px; }

.trainer-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: calc(100vh - 142px); min-height: 620px; border: 1px solid var(--line-soft); border-top: 0; border-radius: 0 0 16px 16px; overflow: hidden; background: #070f1e; transition: none; }
.trainer-grid.side-panel-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.side-panel-toggle { position: absolute; z-index: 16; top: 50%; right: 299px; display: grid; width: 20px; height: 48px; place-items: center; padding: 0; border: 1px solid rgba(110,231,216,.42); border-right: 0; border-radius: 8px 0 0 8px; color: #9ff4e7; background: rgba(8,30,43,.94); box-shadow: 0 5px 18px rgba(0,0,0,.35); cursor: pointer; font-size: 19px; line-height: 1; transform: translateY(-50%); transition: none; }
.side-panel-toggle:hover { background: rgba(24,75,82,.98); }
.trainer-grid.side-panel-collapsed .side-panel-toggle { right: 0; border-right: 1px solid rgba(110,231,216,.42); border-radius: 8px 0 0 8px; }
.trainer-grid.side-panel-collapsed .side-panel { min-width: 0; opacity: 0; overflow: hidden; pointer-events: none; visibility: hidden; }
.trainer-grid.side-panel-collapsed .side-panel {
  opacity: 1;
  overflow: visible;
  pointer-events: none;
  visibility: visible;
  position: relative;
  z-index: 100;
}
.trainer-grid.side-panel-collapsed #sidePanel > #orderCard { display: none; }
.trainer-grid.side-panel-collapsed .side-scroll {
  display: block;
  width: 0;
  height: 0;
  padding: 0;
  overflow: visible;
}
.trainer-grid.side-panel-collapsed .side-scroll > :not(.account-card) { display: none; }
.trainer-grid.side-panel-collapsed .side-scroll > .account-card {
  position: fixed;
  z-index: 1000;
  top: 42px;
  right: 14px;
  left: auto;
  display: block;
  width: min(270px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  pointer-events: auto;
  box-shadow: 0 12px 30px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(14px);
}
.chart-column { display: grid; width: 100%; height: 100%; min-width: 0; min-height: 0; grid-template-rows: 39px minmax(0, 1fr) 29px; border-right: 1px solid var(--line); }
.quote-strip, .chart-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 13px; color: var(--muted); background: #081321; font-size: 10px; }
.quote-strip { border-bottom: 1px solid var(--line); }
.quote-strip strong { color: #cbd7e3; }
.quote-strip span:last-child { color: #617286; }
.chart-footer { border-top: 1px solid var(--line); font-size: 9px; }

.chart-stage { --price-axis-width: 72px; position: relative; min-height: 0; overflow: hidden; background: #000; }
.chart-stage::after { content: ""; position: absolute; z-index: 2; top: 0; right: var(--price-axis-width); bottom: 0; width: 1px; background: #2b3b4d; pointer-events: none; }
#positionBackgroundOverlay { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
#landesBandFillOverlay { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
#lightweightChart { position: absolute; z-index: 1; inset: 0; background: transparent; touch-action: none; user-select: none; cursor: grab; }
#chartStage.rectangle-tool,
#chartStage.rectangle-tool #lightweightChart,
#chartStage.rectangle-tool #replayChart {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M2 2h10v10H2z' fill='%23020817' fill-opacity='.8' stroke='%2342dbe2' stroke-width='1.8'/%3E%3Cpath d='M12 12l5 5' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") 2 2, crosshair !important;
}
#positionOverlay { position: absolute; z-index: 8; inset: 0; overflow: hidden; pointer-events: none; }
#positionScaleOverlay { position: absolute; z-index: 7; inset: 0; overflow: hidden; pointer-events: none; }
.position-risk-scale-tick { position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 3px; min-width: 50px; padding: 1px 3px; border: 1px solid; border-radius: 3px; color: #fff; font: 800 8px/10px ui-sans-serif, system-ui; white-space: nowrap; transform: translateY(-50%); box-shadow: 0 2px 8px rgba(0,0,0,.25); pointer-events: none; }
.position-risk-scale-tick::before { content: ""; width: 9px; border-top: 1px solid currentColor; opacity: .85; }
.position-risk-scale-tick::after { content: ""; position: absolute; z-index: 0; top: 50%; right: calc(100% - 1px); width: var(--risk-line-width, 14px); height: 1px; background: linear-gradient(to left, currentColor 0 30%, transparent 78%), repeating-linear-gradient(to left, currentColor 0 5px, transparent 5px 10px); opacity: .68; -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 52%, #000 100%); mask-image: linear-gradient(to left, transparent 0%, #000 52%, #000 100%); }
.position-risk-scale-tick.loss { border-color: rgba(255,127,143,.7); background: rgba(135,28,48,.92); }
.position-risk-scale-tick.profit { border-color: rgba(111,255,205,.62); background: rgba(7,111,91,.92); }
.position-risk-zone { position: absolute; box-sizing: border-box; border: 1px solid; border-radius: 3px; overflow: visible; box-shadow: inset 0 0 0 1px rgba(255,255,255,.045), 0 0 18px rgba(0,0,0,.08); }
.position-risk-zone.position-label-layer { border-color: transparent !important; background: transparent !important; box-shadow: none !important; }
.position-risk-zone.position-label-layer::after { display: none; }
.position-risk-zone::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(255,255,255,.12) 8px 9px); }
.position-risk-zone.stop { border-color: rgba(255,83,105,.94); background: linear-gradient(180deg, rgba(221,46,70,.30), rgba(145,25,43,.18)); }
.position-risk-zone.take { border-color: rgba(0,226,163,.94); background: linear-gradient(180deg, rgba(0,178,132,.24), rgba(0,106,83,.16)); }
.position-risk-zone span { position: absolute; z-index: 1; top: -22px; right: -1px; padding: 4px 8px; border: 1px solid; border-radius: 5px 5px 2px 2px; color: #f7fffb; font: 800 10px/12px ui-sans-serif, system-ui; letter-spacing: .01em; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.position-risk-zone span.position-stop-label { display: inline-flex; align-items: center; gap: 5px; padding-right: 5px; }
.position-stop-lock { width: 17px; height: 17px; padding: 0; border: 0; border-radius: 4px; color: #fff; background: transparent; cursor: pointer; font: 13px/17px ui-sans-serif, system-ui; pointer-events: auto; }
.position-stop-lock:hover { background: rgba(255,255,255,.16); }
.position-stop-lock.unlocked { color: #ffe2e6; }
.position-stop-lock.locked { color: #d8fff3; box-shadow: 0 0 0 1px rgba(145,255,218,.2); }
@keyframes stop-lock-pulse { 0%, 100% { opacity: .48; } 50% { opacity: 1; box-shadow: 0 0 10px rgba(255,83,105,.58); } }
.position-risk-zone.stop span { border-color: rgba(255,127,143,.72); background: linear-gradient(135deg, #dc3b55, #a91f3b); }
.position-risk-zone.take span { border-color: rgba(111,255,205,.58); background: linear-gradient(135deg, #119c7b, #08715f); }
.position-risk-zone.closed-loss-green { background: linear-gradient(180deg, rgba(0,178,132,.50), rgba(0,106,83,.38)); }
.position-risk-zone.closed-profit-red { background: linear-gradient(180deg, rgba(221,46,70,.50), rgba(145,25,43,.38)); }
.position-entry-line { position: absolute; z-index: 1; height: 0; border-top: 1px dashed rgba(244,249,252,.92); filter: drop-shadow(0 0 3px rgba(255,255,255,.18)); }
.position-entry-line.has-label::after { content: attr(data-label); position: absolute; right: -1px; top: -21px; padding: 4px 8px; border: 1px solid rgba(255,214,108,.72); border-radius: 5px 5px 2px 2px; color: #fff8da; background: linear-gradient(135deg, #8d6d20, #5d4818); box-shadow: 0 4px 12px rgba(0,0,0,.24); font: 800 10px/12px ui-sans-serif, system-ui; white-space: nowrap; }
.position-entry-line.long { border-color: #24d5a0; }
.position-entry-line.short { border-color: #ffad24; }
.position-exit-line { z-index: 2; border-top-style: solid; border-top-width: 1.5px; }
.position-exit-line.profit { border-color: #00e2a3; }
.position-exit-line.loss { border-color: #ff5369; }
.position-exit-line::after { top: -22px; }
.position-exit-line.profit::after { border-color: rgba(111,255,205,.58); color: #f7fffb; background: linear-gradient(135deg, #119c7b, #08715f); }
.position-exit-line.loss::after { border-color: rgba(255,127,143,.72); color: #fff5f6; background: linear-gradient(135deg, #dc3b55, #a91f3b); }
.price-scale-header { position: absolute; z-index: 3; top: 12px; right: 8px; display: flex; align-items: center; justify-content: space-between; width: 88px; height: 38px; box-sizing: border-box; padding: 0 10px; border: 1px solid #3b4b5e; border-radius: 7px; color: #d0d7df; background: #070707; box-shadow: 0 2px 8px rgba(0,0,0,.32); font-size: 15px; letter-spacing: .02em; pointer-events: none; }
.price-scale-header b { color: #aeb9c7; font-size: 16px; font-weight: 400; line-height: 1; transform: translateY(-2px); }
#replayChart { position: absolute; z-index: 3; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; cursor: grab; touch-action: none; }
.chart-context-menu { position: fixed; z-index: 60; min-width: 232px; padding: 4px 0; border: 1px solid #303640; border-radius: 7px; background: rgba(20,24,31,.98); box-shadow: 0 16px 32px rgba(0,0,0,.5); }
.chart-context-menu[hidden] { display: none; }
.chart-context-menu button { display: block; width: 100%; padding: 8px 14px; border: 0; color: #d6dce5; background: transparent; text-align: left; font-size: 12px; cursor: pointer; }
.chart-context-menu button:hover { background: #262d37; }
.chart-context-menu button[data-chart-context="drawings"], .chart-context-menu button[data-chart-context="indicators"] { color: #ff6976; }
.chart-context-menu hr { margin: 4px 0; border: 0; border-top: 1px solid #2a3039; }
.chart-stage.panning #replayChart { cursor: grabbing; }
.chart-stage.panning #lightweightChart { cursor: grabbing; }
.chart-stage.dragging-stop #replayChart { cursor: ns-resize; }
.chart-stage.scaling-price #replayChart { cursor: ns-resize; }
.chart-stage.scaling-price #lightweightChart { cursor: ns-resize; }
.chart-stage.shift-price-ready #replayChart { cursor: ns-resize; }
.chart-stage.shift-price-ready #lightweightChart { cursor: ns-resize; }
.chart-stage.blocking-position-take #replayChart { cursor: not-allowed; }
.chart-stage.blocking-position-take #lightweightChart { cursor: not-allowed; }
.chart-stage.drawing #replayChart { cursor: cell; }

.chart-legend { position: absolute; z-index: 2; top: 10px; left: 12px; display: flex; gap: 12px; padding: 6px 8px; border-radius: 6px; color: #7e91a6; background: rgba(3,10,24,0.7); font-size: 9px; pointer-events: none; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { display: inline-block; width: 14px; height: 2px; }
.active-indicator-legend { position: absolute; z-index: 3; top: 43px; left: 50px; display: flex; max-width: min(280px, calc(100% - 168px)); flex-direction: column; gap: 2px; padding: 5px 8px; border-radius: 6px; color: #aebdca; background: rgba(3,10,24,.64); font-size: 10px; line-height: 15px; pointer-events: auto; }
.active-indicator-legend[hidden] { display: none; }
.active-indicator-legend .indicator-legend-row { display: flex; min-width: 0; align-items: center; gap: 2px; padding: 1px 3px; border: 0; border-radius: 4px; color: inherit; background: transparent; font: inherit; text-align: left; white-space: nowrap; }
.active-indicator-legend .indicator-legend-main { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 7px; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; text-align: left; white-space: nowrap; }
.active-indicator-legend .indicator-legend-row:hover { background: rgba(255,255,255,.1); }
.active-indicator-legend .indicator-legend-row.is-hidden { opacity: .45; }
.active-indicator-legend .indicator-legend-main:hover { color: #fff; }
.active-indicator-legend i { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 999px; box-shadow: 0 0 6px currentColor; }
.active-indicator-legend b { overflow: hidden; color: #dce7ee; font-weight: 700; text-overflow: ellipsis; }
.active-indicator-legend .indicator-legend-eye { margin-left: auto; color: #8fa8b5; font-size: 9px; }
.active-indicator-legend .indicator-legend-settings { flex: 0 0 auto; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 4px; color: #8fa8b5; background: transparent; cursor: pointer; font-size: 11px; line-height: 17px; }
.active-indicator-legend .indicator-legend-settings:hover { color: #fff; background: rgba(255,255,255,.12); }
.landes-water-panel { position: absolute; z-index: 4; right: calc(var(--price-axis-width) + 8px); bottom: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 250px; padding: 10px 12px; border: 1px solid rgba(60,65,80,.95); border-radius: 6px; color: #fff; background: rgba(18,22,33,.88); box-shadow: 0 5px 16px rgba(0,0,0,.3); font-size: 13px; pointer-events: none; }
.landes-water-panel[hidden] { display: none; }
.landes-water-panel div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.landes-water-panel span { color: #d5d9e2; }
.landes-water-panel strong { color: #fff; font-size: 16px; font-weight: 700; }
.landes-water-panel strong.is-compressed { color: #ef5350; }
.landes-water-panel strong.is-normal { color: #b4b9be; }
.shortcut-legend { position: absolute; z-index: 3; top: 43px; left: 12px; display: flex; align-items: flex-start; gap: 7px; color: #8fa3b7; font-size: 9px; }
.shortcut-legend button { width: 27px; height: 27px; padding: 0; border: 1px solid #263d55; border-radius: 7px; color: #bdd0df; background: rgba(7,19,33,.9); cursor: pointer; }
.shortcut-legend > div { display: flex; align-items: center; gap: 10px; min-height: 27px; max-width: 780px; padding: 0 9px; overflow: hidden; border: 1px solid #263d55; border-radius: 7px; white-space: nowrap; background: rgba(7,19,33,.9); transition: max-width .22s ease, opacity .16s ease, padding .22s ease; }
.shortcut-legend > div strong { color: #d3e0ea; }
.shortcut-legend.collapsed > div { max-width: 0; padding-inline: 0; border-width: 0; opacity: 0; }
.avatar-face { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: hsl(var(--avatar-hue) 62% 36%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.leaderboard-avatar { display: inline-grid; width: 34px; height: 34px; margin: 0 9px; place-items: center; border-radius: 50%; font-size: 20px; vertical-align: middle; }
.leaderboard-presence { margin-left: 8px; color: #718397; font-size: 9px; font-style: normal; }
.leaderboard-presence::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #526273; }
.leaderboard-presence.online { color: #63e7bd; }
.leaderboard-presence.online::before { background: #2dd4a5; box-shadow: 0 0 7px #2dd4a5; }
.avatar-dialog { width: min(760px, calc(100vw - 28px)); }
.avatar-search { display: grid; gap: 9px; padding: 4px 18px 10px; }
.avatar-search input { width: 100%; padding: 10px 12px; border: 1px solid #2b4a63; border-radius: 9px; color: #eaf4fb; background: #081727; }
.avatar-search > div { display: flex; gap: 7px; flex-wrap: wrap; }
.avatar-search button { padding: 5px 10px; border: 1px solid #34546c; border-radius: 999px; background: #102238; cursor: pointer; }
.auth-choice-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0; }
.auth-choice-panel[hidden] { display: none; }
.auth-choice-panel button { display: grid; gap: 5px; min-height: 92px; place-content: center; border: 1px solid #315473; border-radius: 12px; background: #0b1d31; cursor: pointer; }
.auth-choice-panel button:hover { border-color: #52dce4; background: #12304a; }
.auth-choice-panel strong { font-size: 18px; }
.auth-choice-panel span { color: #8298aa; font-size: 10px; }
.landes-identity-panel { display: grid; gap: 10px; margin: 2px 0 4px; padding: 12px; border: 1px solid rgba(52, 211, 220, .28); border-radius: 12px; background: linear-gradient(145deg, rgba(13, 38, 55, .9), rgba(7, 21, 36, .94)); }
.landes-identity-panel[hidden] { display: none; }
.landes-identity-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.landes-identity-heading strong { color: #eafcff; font-size: 13px; }
.landes-identity-heading span, .landes-identity-status { color: #8198ac; font-size: 9px; }
.landes-identity-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.landes-identity-options button { display: grid; min-width: 0; gap: 4px; padding: 10px 8px; border: 1px solid #294b64; border-radius: 9px; color: #c8d8e4; background: #0a1d30; text-align: left; cursor: pointer; transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
.landes-identity-options button:hover { border-color: #52dce4; transform: translateY(-1px); }
.landes-identity-options button.active { border-color: #6ee7d8; color: #06211e; background: linear-gradient(135deg, #6ee7d8, #38c5c6); box-shadow: 0 0 0 2px rgba(110, 231, 216, .12); }
.landes-identity-options button b { color: #6f9caf; font: 800 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.landes-identity-options button.active b { color: rgba(6, 33, 30, .62); }
.landes-identity-options button strong { font-size: 13px; }
.landes-identity-options button span { overflow: hidden; color: #7f99ab; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.landes-identity-options button.active span { color: rgba(6, 33, 30, .72); }
.landes-identity-status { min-height: 14px; margin: 0; }
#authFields { display: grid; gap: 12px; }
#authFields[hidden] { display: none; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, minmax(68px, 1fr)); gap: 10px; max-height: 62vh; padding: 10px 18px 22px; overflow-y: auto; }
.avatar-grid button { display: grid; place-items: center; min-height: 76px; padding: 5px; border: 1px solid #28435b; border-radius: 12px; background: #09182a; }
.avatar-grid button:hover, .avatar-grid button.selected { border-color: #5ce5e8; background: #12324a; }
.avatar-grid button:disabled { opacity: .28; cursor: not-allowed; filter: grayscale(1); }
.avatar-grid button small { color: #ff9aa7; font-size: 8px; }
.avatar-grid .avatar-face { width: 64px; height: 64px; font-size: 38px; }
.teacher-user-actions .delete-user { border-color: #853849; color: #ff8292; }
.training-records-dialog { width: min(900px, calc(100vw - 28px)); }
.personal-training-dialog { width: min(760px, calc(100vw - 28px)); }
.personal-training-actions button { display: grid; width: 100%; gap: 6px; padding: 18px; text-align: left; border: 1px solid #2dd4a5; border-radius: 12px; background: linear-gradient(135deg, #123952, #0b2138); cursor: pointer; }
.personal-training-actions strong { font-size: 18px; }
.personal-training-actions span { color: #91a9bc; }
.personal-training-dialog h3 { margin: 20px 0 6px; }
.training-start-options { margin: 18px 0 20px; padding: 16px; border: 1px solid rgba(73,113,145,.55); border-radius: 14px; background: linear-gradient(145deg, rgba(16,31,50,.96), rgba(7,18,31,.96)); }
.training-start-option-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.training-start-option-heading h3 { margin: 0; color: #42d7e5; font-size: 15px; }
.training-start-option-heading span, .training-start-options > small { color: #8499ad; font-size: 10px; }
.training-scale-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.training-leverage-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.training-scale-choice button { display: grid; gap: 4px; min-height: 62px; padding: 10px 12px; border: 1px solid #344b64; border-radius: 11px; color: #cbd8e5; background: #132237; text-align: left; cursor: pointer; }
.training-interval-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.training-scale-choice button strong { font-size: 14px; }
.training-scale-choice button span { color: #8398ad; font-size: 10px; }
.training-scale-choice button:hover { border-color: #39d7df; }
.training-scale-choice button.active { border-color: #39d7df; color: #fff; background: linear-gradient(135deg, #159bb9, #147bb2); box-shadow: 0 0 0 2px rgba(57,215,223,.18), 0 8px 18px rgba(18,152,193,.22); }
.training-scale-choice button.active span { color: rgba(255,255,255,.82); }
.training-record-viewer-dialog { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
.training-record-viewer-dialog .teacher-dialog-shell { min-height: 100vh; padding: 10px; }
.training-record-viewer-dialog .teacher-dialog-heading { position: absolute; z-index: 4; top: 12px; right: 16px; left: 16px; pointer-events: none; }
.training-record-viewer-dialog .teacher-dialog-heading > div { visibility: hidden; }
.training-record-viewer-dialog .teacher-dialog-heading button { pointer-events: auto; }
.training-record-viewer-dialog::backdrop, .training-records-dialog::backdrop { background: rgba(0,0,0,.58); backdrop-filter: blur(3px); }
.training-record-chart { min-height: calc(100vh - 20px); overflow-x: auto; overflow-y: hidden; border: 0; border-radius: 0; background: #000; cursor: grab; }
.training-record-chart svg { display: block; height: calc(100vh - 20px); max-width: none; }
.training-record-chart .student-mini-chart { width: auto; min-width: 100%; }
.training-replay-controls { position: absolute; z-index: 6; top: 13px; right: 74px; left: 18px; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid rgba(96,151,191,.72); border-radius: 9px; color: #d8e9f5; background: rgba(7,18,31,.94); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.training-replay-controls[hidden] { display: none; }
.training-replay-controls button, .training-replay-controls select { height: 28px; padding: 0 9px; border: 1px solid #31536e; border-radius: 6px; color: #dcecf5; background: #10263a; cursor: pointer; font-size: 10px; font-weight: 800; }
.training-replay-controls button:hover, .training-replay-controls select:hover { border-color: #58d9e0; background: #173b53; }
.training-replay-controls input[type="range"] { min-width: 120px; flex: 1 1 auto; accent-color: #35d3db; }
.training-replay-controls span { min-width: 90px; color: #8eafc2; font-size: 9px; text-align: right; white-space: nowrap; }
.training-replay-controls .training-replay-market-time { min-width: 145px; color: #6ee7d8; font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; }
.training-record-viewer-dialog #trainingRecordMeta { position: absolute; z-index: 3; right: 18px; bottom: 18px; max-width: 420px; }
.training-feedback-panel { position: absolute; z-index: 5; left: 20px; bottom: 20px; display: grid; width: min(420px, calc(100vw - 40px)); gap: 8px; padding: 12px; border: 1px solid #7256a8; border-radius: 12px; background: rgba(9,20,35,.94); }
.training-feedback-panel[hidden] { display: none; }
.training-feedback-panel label { display: grid; gap: 5px; }
.training-feedback-panel select, .training-feedback-panel textarea { padding: 8px; border: 1px solid #304b63; border-radius: 7px; color: #e9f2f8; background: #071321; }
.training-feedback-panel textarea { min-height: 72px; resize: vertical; }
.admin-review-item button { margin-left: 10px; }
.basis-line { background: #b4b9be; }
.band-line { background: #5123dc; }
.white-candle { height: 8px !important; border: 1px solid white; background: white; }
.candle-up-line { background: #0ecb81; }
.candle-down-line { background: #f6465d; }
.volume-line { background: rgba(14,203,129,.55); }

.loading-overlay { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #cbd7e3; background: rgba(3,10,24,0.94); }
.loading-overlay[hidden] { display: none; }
.loading-overlay small { color: var(--muted); font-size: 10px; }
.spinner { width: 26px; height: 26px; border: 2px solid rgba(52,211,220,0.15); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.room-entry-countdown { position: absolute; z-index: 24; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #eafcff; background: rgba(3, 8, 17, .86); backdrop-filter: blur(8px); }
.room-entry-countdown[hidden] { display: none; }
.room-entry-countdown span { color: #8de8db; font-size: 12px; letter-spacing: .16em; }
.room-entry-countdown strong { color: #fff; font-size: clamp(72px, 15vw, 148px); line-height: .9; font-variant-numeric: tabular-nums; text-shadow: 0 0 34px rgba(74, 225, 204, .5); }
.room-entry-countdown strong.room-entry-countdown-pop { animation: room-entry-countdown-pop .72s ease both; }
.room-entry-countdown small { color: #a6bac4; font-size: 12px; }
@keyframes room-entry-countdown-pop { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }

.draw-hint { position: absolute; z-index: 4; left: 50%; bottom: 16px; translate: -50% 0; padding: 7px 10px; border: 1px solid rgba(52,211,220,0.28); border-radius: 7px; color: #a4e4e7; background: rgba(10,27,39,0.94); font-size: 9px; pointer-events: none; }
.white-candle-preview-actions { position: absolute; z-index: 5; top: 10px; left: 50%; display: flex; align-items: center; gap: 8px; translate: -50% 0; padding: 6px 8px 6px 10px; border: 1px solid rgba(255,255,255,.38); border-radius: 7px; color: #f5f7fa; background: rgba(8,16,28,.94); box-shadow: 0 6px 18px rgba(0,0,0,.3); font-size: 9px; }
.white-candle-preview-actions button { padding: 5px 9px; border: 1px solid rgba(255,255,255,.55); border-radius: 5px; color: #061120; background: #fff; cursor: pointer; font-size: 9px; font-weight: 700; }
.white-candle-preview-actions button:hover { background: #dfe8ee; }
.white-candle-preview-actions[hidden] { display: none; }
.relation-target-actions { position: absolute; z-index: 5; top: 52px; left: 50%; display: flex; align-items: center; gap: 8px; translate: -50% 0; padding: 7px 9px; border: 1px solid rgba(255,207,56,.62); border-radius: 8px; color: #fff4bc; background: rgba(18,22,27,.95); box-shadow: 0 6px 18px rgba(0,0,0,.3); font-size: 9px; }
.relation-target-actions strong { color: #ffd34e; font-size: 12px; }
.relation-target-actions button { padding: 5px 9px; border: 1px solid rgba(255,207,56,.7); border-radius: 5px; color: #17130a; background: #ffcf38; cursor: pointer; font-size: 9px; font-weight: 700; }
.relation-target-actions button:disabled { cursor: not-allowed; opacity: .45; }
.relation-target-actions button:last-child { color: #d7e3ec; border-color: #476078; background: #172536; }
.relation-target-actions[hidden] { display: none; }
.reason-selection-actions { position: absolute; z-index: 6; top: 94px; left: 50%; display: flex; align-items: center; gap: 8px; translate: -50% 0; padding: 7px 9px; border: 2px solid #151515; border-radius: 9px; color: #151515; background: #fff4b8; box-shadow: 4px 5px 0 #151515, 0 8px 22px rgba(0,0,0,.34); font-size: 9px; font-weight: 800; }
.reason-selection-actions strong { color: #a64b00; font-size: 12px; }
.reason-selection-actions button { padding: 5px 9px; border: 2px solid #151515; border-radius: 6px; color: #fff; background: #151515; cursor: pointer; font-size: 9px; font-weight: 900; }
.reason-selection-actions button:last-child { color: #151515; background: #fff; }
.reason-selection-actions[hidden] { display: none; }
.chart-zoom-controls { position: absolute; z-index: 4; left: 50%; bottom: 9px; display: flex; overflow: hidden; translate: -50% 0; border: 1px solid #29445d; border-radius: 7px; background: rgba(11,23,38,.92); box-shadow: 0 6px 18px rgba(0,0,0,.28); opacity: .34; transition: opacity 140ms ease; }
.chart-stage:hover .chart-zoom-controls, .chart-zoom-controls:focus-within { opacity: 1; }
.chart-zoom-controls button { height: 27px; min-width: 31px; padding: 0 9px; border: 0; border-right: 1px solid #29445d; color: #a9b9c9; background: transparent; cursor: pointer; font-size: 12px; }
.chart-zoom-controls button:last-child { border-right: 0; }
.chart-zoom-controls button:hover { color: white; background: #18304a; }
.chart-zoom-controls #autoFitButton { font-size: 9px; }

.side-panel { display: grid; width: 100%; height: 100%; min-height: 0; max-height: 100%; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; background: #0a1423; }
.side-scroll { display: flex; min-height: 0; flex-direction: column; gap: 9px; padding: 10px; overflow-y: auto; scrollbar-color: #284059 transparent; }
.side-card, .order-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #111e2e, #0d1928); box-shadow: inset 0 1px rgba(255,255,255,0.02); }
.card-title-row, .order-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.side-card h2, .order-card h2 { margin: 0; font-size: 14px; }
.card-fold-toggle { flex: 0 0 auto; width: 25px; height: 25px; padding: 0; border: 1px solid rgba(110,231,216,.28); border-radius: 7px; color: #8db6bd; background: rgba(7,28,42,.72); cursor: pointer; font-size: 14px; line-height: 1; transition: transform 150ms ease, color 150ms ease, border-color 150ms ease; }
.card-fold-toggle:hover { border-color: #6ee7d8; color: #dffff9; }
.card-fold-toggle.is-collapsed { transform: rotate(180deg); }
.side-card.is-collapsed, .order-card.is-collapsed { min-height: 0; padding-bottom: 10px; }
.side-card.is-collapsed > :not(.card-title-row):not(.notes-workbench-heading), .notes-workbench.is-collapsed > :not(.notes-workbench-heading), .order-card.is-collapsed > :not(.order-heading), .teacher-sidebar-panel.is-collapsed > :not(.teacher-sidebar-heading) { display: none !important; }
.notes-workbench.is-collapsed { padding-bottom: 10px; }
.drawing-manager-card { padding: 11px 12px; }
.drawing-manager-title { display: flex; align-items: center; gap: 7px; }
.drawing-manager-title span { display: inline-grid; min-width: 20px; height: 20px; place-items: center; border-radius: 999px; color: #86a0b9; background: #0a1728; font-size: 9px; }
.manager-toggle { width: 27px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: #9cb0c4; background: #0a1728; cursor: pointer; transition: transform 150ms ease; }
.manager-toggle.collapsed { transform: rotate(180deg); }
.drawing-manager-body { margin-top: 10px; }
.drawing-manager-hint { margin: 6px 0 0; color: #70859a; font-size: 8px; }
.drawing-manager-body[hidden] { display: none; }
.drawing-list { display: grid; max-height: 170px; gap: 5px; overflow-y: auto; }
.drawing-list > p { margin: 9px 0; color: #63758a; font-size: 9px; text-align: center; }
.drawing-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) 25px 25px; align-items: center; gap: 5px; padding: 5px; border: 1px solid #1b324d; border-radius: 8px; background: #0a1728; }
.drawing-item.selected { border-color: rgba(52,211,220,.65); background: rgba(52,211,220,.07); }
.drawing-item.is-hidden { opacity: .52; }
.drawing-item > button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 6px; color: #91a7ba; background: transparent; cursor: pointer; }
.drawing-item > button:hover { color: #e5f0f5; background: #17283a; }
.drawing-item .drawing-delete:hover { color: #ff7181; background: rgba(255,96,115,.1); }
.drawing-item-main { min-width: 0; border: 0; color: #c6d4df; background: transparent; text-align: left; cursor: pointer; }
.drawing-item-main strong, .drawing-item-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawing-item-main strong { font-size: 10px; }
.drawing-item-main span { margin-top: 2px; color: #667d92; font-size: 8px; }
.drawing-manager-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.drawing-manager-actions button { padding: 6px; border: 1px solid var(--line); border-radius: 7px; color: #91a7ba; background: #0a1728; font-size: 9px; cursor: pointer; }
.drawing-manager-actions button:disabled { opacity: .38; cursor: not-allowed; }
.drawing-manager-actions .danger-text:not(:disabled) { color: #ff7181; }

.review-card { border-color: rgba(52,125,241,.38); }
.notes-workbench { padding: 12px; }
.notes-workbench-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.notes-eyebrow { display: block; margin-bottom: 3px; color: #74dce4; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.notes-workbench-heading h2 { font-size: 15px; }
.notes-workbench-heading p { max-width: 245px; margin: 5px 0 0; color: #7890a5; font-size: 8px; line-height: 1.45; }
.notes-quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 11px 0 8px; }
.notes-quick-actions button { display: grid; min-height: 53px; align-content: center; gap: 2px; padding: 6px 4px; border: 1px solid #284761; border-radius: 9px; color: #c9d8e5; background: #0b1b2d; cursor: pointer; text-align: left; }
.notes-quick-actions button:hover { border-color: #43dae0; background: rgba(52,211,220,.1); }
.notes-quick-actions b { color: #ffcf70; font-size: 11px; }
.notes-quick-actions span { font-size: 9px; font-weight: 800; }
.notes-quick-actions small { color: #71879a; font-size: 8px; }
.notes-capture-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 8px 9px; border: 1px solid rgba(45,212,165,.27); border-radius: 9px; background: rgba(45,212,165,.055); }
.notes-capture-bar div { display: grid; min-width: 0; gap: 2px; }
.notes-capture-bar strong { color: #8ee9ce; font-size: 9px; }
.notes-capture-bar span { overflow: hidden; color: #7b93a7; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.notes-capture-bar button { flex: 0 0 auto; padding: 6px 8px; border: 1px solid rgba(45,212,165,.45); border-radius: 7px; color: #8ee9ce; background: #0a2330; cursor: pointer; font-size: 8px; font-weight: 800; }
.notes-capture-bar #toggleNoteBubblesButton { border-color: rgba(111,168,255,.38); color: #a8c8ff; background: #101e34; }
.notes-capture-bar button:disabled { cursor: not-allowed; opacity: .4; }
.note-section { margin-top: 7px; border: 1px solid rgba(63,102,132,.48); border-radius: 9px; background: rgba(5,16,29,.35); }
.note-section[open] { border-color: rgba(73,137,175,.62); background: rgba(7,21,37,.68); }
.note-section summary { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 9px; color: #d8e6f1; cursor: pointer; list-style: none; font-size: 10px; font-weight: 800; }
.note-section summary::-webkit-details-marker { display: none; }
.note-section summary::after { color: #69839a; content: "＋"; font-size: 12px; }
.note-section[open] summary::after { content: "−"; }
.note-section summary > span { display: flex; min-width: 0; align-items: center; gap: 5px; }
.note-section summary i { display: inline-grid; width: 22px; height: 18px; place-items: center; border-radius: 5px; color: #7fdde3; background: rgba(52,211,220,.1); font-size: 8px; font-style: normal; }
.note-section summary small { overflow: hidden; color: #71879c; font-size: 8px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.note-section summary em { display: inline-grid; min-width: 17px; height: 17px; place-items: center; margin-left: 2px; border-radius: 999px; color: #ffcf70; background: rgba(255,189,74,.12); font-size: 8px; font-style: normal; }
.note-section > :not(summary) { margin-inline: 9px; }
.note-section > .review-hint { margin-top: 2px; }
.note-label { display: block; margin: 0 0 5px; color: #b8cad9; font-size: 9px; font-weight: 800; }
#sessionNoteInput { display: block; width: 100%; min-height: 68px; resize: vertical; padding: 8px; border: 1px solid #294963; border-radius: 7px; outline: none; color: #e3eff8; background: #081522; font: 10px/1.55 ui-sans-serif, system-ui; }
#sessionNoteInput:focus { border-color: #34d3dc; box-shadow: 0 0 0 2px rgba(52,211,220,.08); }
.note-field-footer { display: flex; justify-content: space-between; gap: 7px; margin: 4px 0 8px; color: #6e8599; font-size: 8px; }
.note-field-footer small { color: #9ab2c5; }
.review-selection-pill { padding: 4px 7px; border: 1px solid rgba(52,125,241,.45); border-radius: 999px; color: #9fc3ff; background: rgba(52,125,241,.1); font-size: 9px; white-space: nowrap; }
.review-hint { margin: 9px 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.review-archive-line { margin: -3px 0 8px; color: #7e9ac1; font-size: 9px; }
.review-archive-line strong { color: #e1cb72; }
.entry-note-header { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 4px; color: #d7e6f2; font-size: 10px; }
.entry-note-header strong { color: #e1cb72; font-size: 9px; }
.entry-note-editor { padding: 8px; border: 1px solid rgba(255,189,74,.35); border-radius: 9px; background: rgba(255,189,74,.06); }
.entry-note-anchor-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; color: #ffcf70; font-size: 9px; }
#entryNoteSignal { max-width: 112px; padding: 4px 6px; border: 1px solid #735d31; border-radius: 6px; color: #f4d68a; background: #1c1a12; font-size: 9px; }
#entryNoteInput { display: block; width: 100%; min-height: 54px; resize: vertical; padding: 8px; border: 1px solid #594a28; border-radius: 7px; outline: none; color: #f0eee5; background: #121713; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
#entryNoteInput:focus { border-color: #ffbd4a; }
.entry-note-list { max-height: 150px; overflow: auto; margin-top: 7px; }
.entry-note-empty { color: #71869a; font-size: 9px; }
.entry-note-item { padding: 6px 7px; border-left: 3px solid #ffbd4a; border-bottom: 1px solid rgba(55,80,105,.35); color: #b9ccdb; font-size: 9px; line-height: 1.45; }
.entry-note-item strong { color: #ffcf70; }
.entry-note-item small { display: block; color: #7890a4; font-size: 8px; }
.review-note-label { display: block; margin-bottom: 5px; color: #b8c8d8; font-size: 9px; }
.review-archive-list { display: grid; max-height: 116px; gap: 5px; margin: 6px 0 9px; overflow-y: auto; }
.review-archive-list > p { margin: 4px 0; color: #71869a; font-size: 9px; }
.review-archive-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 6px 7px; border: 1px solid rgba(52,125,241,.25); border-radius: 8px; background: rgba(52,125,241,.055); }
.review-archive-item strong, .review-archive-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-archive-item strong { color: #b9d2ff; font-size: 9px; }
.review-archive-item small { margin-top: 2px; color: #71869a; font-size: 8px; }
.review-archive-actions { display: flex; gap: 4px; }
.review-archive-item button { padding: 5px 7px; border: 1px solid rgba(111,168,255,.38); border-radius: 6px; color: #9fc3ff; background: #0a1728; cursor: pointer; font-size: 8px; }
.review-archive-item .archive-delete-button { border-color: rgba(255,96,115,.42); color: #ff91a0; }
#reviewNoteInput, .review-output { display: block; width: 100%; min-height: 62px; resize: vertical; padding: 8px; border: 1px solid #1c3550; border-radius: 8px; outline: none; color: #dce8f2; background: #081321; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
#reviewNoteInput:focus { border-color: #347df1; }
.review-output { min-height: 150px; margin-top: 8px; color: #b9d0e8; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.review-actions button { padding: 7px 6px; border: 1px solid #29445d; border-radius: 7px; color: #b7c8d9; background: #0a1728; cursor: pointer; font-size: 9px; }
.review-actions button:disabled { opacity: .38; cursor: not-allowed; }
.review-actions button:not(:disabled):hover { border-color: #347df1; color: #fff; background: rgba(52,125,241,.14); }
.review-archive-actions { grid-template-columns: 1fr 1fr; }
.archive-note-section { padding-bottom: 8px; }
.archive-note-section .review-archive-list { margin-bottom: 0; }

body.review-focus .review-card {
  position: fixed;
  z-index: 30;
  top: 92px;
  right: 22px;
  width: min(360px, calc(100vw - 44px));
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  border-color: rgba(52,125,241,.72);
  box-shadow: 0 18px 45px rgba(0,0,0,.48), 0 0 0 1px rgba(52,125,241,.12);
}

body.review-focus .review-card h2 { color: #e8f1ff; }
body.review-focus .review-card::before {
  content: "复盘笔记";
  display: block;
  margin: -2px 0 10px;
  color: #7fb0ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.admin-notes-dialog { width: min(980px, calc(100vw - 30px)); }
.admin-notes-summary { display: flex; flex-wrap: wrap; gap: 7px; }
.admin-notes-summary span { display: grid; gap: 2px; min-width: 110px; padding: 9px 10px; border: 1px solid rgba(66,219,226,.22); border-radius: 8px; color: #7892a8; background: #0a1a2b; font-size: 8px; }
.admin-notes-summary strong { color: #eaf6ff; font-size: 15px; }
.admin-notes-list { display: grid; max-height: 58vh; gap: 9px; overflow-y: auto; }
.admin-notes-empty, .admin-notes-list > p { margin: 0; padding: 18px; color: #7c93a8; text-align: center; }
.admin-note-record { padding: 11px 12px; border: 1px solid rgba(76,135,175,.35); border-radius: 10px; background: rgba(8,25,42,.86); }
.admin-note-record h3 { margin: 0 0 7px; color: #e8f4ff; font-size: 11px; }
.admin-note-record h3 span { margin-left: 6px; color: #7da0ba; font-size: 8px; font-weight: 500; }
.admin-note-block { margin-top: 7px; padding: 7px 8px; border-left: 2px solid #34d3dc; color: #b7ccdc; background: rgba(52,211,220,.05); font-size: 9px; line-height: 1.55; white-space: pre-wrap; }
.admin-note-block strong { display: block; margin-bottom: 3px; color: #78dce2; font-size: 8px; }
.admin-review-item { margin-top: 7px; padding: 7px 8px; border: 1px solid rgba(52,125,241,.25); border-radius: 7px; color: #b9d2ff; background: rgba(52,125,241,.05); font-size: 9px; }

@media (max-width: 760px) {
  body.review-focus .review-card { top: 78px; right: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 90px); }
}
.status-pill, .position-pill, .winrate-pill { padding: 5px 9px; font-size: 9px; }
.status-pill { border-color: rgba(45,212,165,.4); color: var(--green); background: rgba(45,212,165,.07); }
.position-pill.empty { border-color: #3c4c5f; color: #9baabd; background: transparent; }
.position-pill.long { border-color: rgba(45,212,165,.4); color: var(--green); }
.position-pill.short { border-color: rgba(255,173,36,.45); color: var(--orange); }

.info-list { display: grid; gap: 8px; margin: 13px 0 11px; }
.info-list div { display: flex; justify-content: space-between; }
.info-list dt { color: var(--muted); font-size: 10px; }
.info-list dd { margin: 0; font-size: 11px; font-weight: 700; }
.info-list div:last-child dd { color: #75dce4; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #293a4e; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width 180ms ease; }

.account-total { display: grid; grid-template-columns: 1fr 1fr; margin-top: 13px; }
.account-total div, .summary-grid div, .position-grid div { display: flex; flex-direction: column; gap: 4px; }
.account-total span, .summary-grid span, .position-grid span { color: var(--muted); font-size: 9px; }
.account-total strong { font-size: 16px; }
.align-right { align-items: flex-end; }
.account-floating-summary { display: grid; gap: 7px; margin-top: 10px; padding: 10px 11px; border: 1px solid rgba(65,203,176,.34); border-radius: 10px; background: linear-gradient(135deg, rgba(8, 52, 52, .7), rgba(8, 28, 43, .72)); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 5px 18px rgba(0,0,0,.16); transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease; }
.account-floating-summary.is-negative { border-color: rgba(255, 92, 112, .6); background: linear-gradient(135deg, rgba(79, 24, 39, .72), rgba(34, 25, 42, .74)); }
.account-floating-summary.is-positive { border-color: rgba(65, 220, 173, .58); }
.account-floating-head, .account-floating-value-row, .account-floating-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-floating-head span, .account-floating-meta span { color: var(--muted); font-size: 9px; }
.account-floating-head span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px currentColor; }
.account-floating-summary.is-negative .account-floating-head span::before { background: var(--red); }
.account-floating-head em { padding: 2px 6px; border: 1px solid rgba(120, 218, 208, .32); border-radius: 999px; color: #9de8dc; font-size: 9px; font-style: normal; }
.account-floating-value-row strong:first-child { font-size: 21px; letter-spacing: -.2px; }
.account-floating-value-row strong:last-child { font-size: 13px; }
.account-floating-meta { padding-top: 6px; border-top: 1px solid rgba(130, 184, 205, .14); }
.account-floating-meta strong { margin-left: 3px; color: #dbe9f4; font-size: 10px; }
.account-floating-summary.live-pulse { animation: none; }
@keyframes livePnlPulse { 0% { transform: scale(1); } 38% { transform: scale(1.012); box-shadow: 0 0 0 3px rgba(74, 220, 187, .13), 0 8px 24px rgba(0,0,0,.24); } 100% { transform: scale(1); } }
.divider { height: 1px; margin: 11px 0; background: var(--line); }
.account-card h3 { margin: 0 0 9px; font-size: 12px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.summary-grid div { padding: 9px; border: 1px solid #1c3550; border-radius: 10px; background: #0a1728; }
.summary-grid strong { font-size: 13px; }
.account-leverage-row { display: grid; gap: 7px; margin-top: 12px; }
.account-leverage-row > span { color: var(--muted); font-size: 9px; }
.account-leverage-row .leverage-presets button { min-height: 32px; padding: 6px 5px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.position-card { border-color: rgba(45,212,165,0.28); }
.position-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.position-grid strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }

.trade-stats { display: flex; justify-content: space-between; margin: 12px 0 8px; color: var(--muted); font-size: 9px; }
.trade-stats strong { color: #cbd7e3; }
.history-list { display: grid; max-height: 122px; gap: 5px; overflow-y: auto; }
.history-list > p { margin: 8px 0 0; color: #63758a; font-size: 9px; text-align: center; }
.history-item { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid #1b324d; border-radius: 8px; background: #0a1728; font-size: 9px; }
.history-item span:first-child { color: #71849a; }
.history-item em { justify-self: start; padding: 3px 7px; border-radius: 999px; font-style: normal; }
.history-item em.long { color: #75e1bd; background: rgba(45,212,165,.09); }
.history-item em.short { color: #ffc365; background: rgba(255,173,36,.09); }
.history-item em.close { color: #c4d0dc; background: rgba(143,160,180,.09); }
.history-item strong { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
.history-item .history-pnl-percent { font-size: 8px; font-weight: 800; opacity: .86; }

.order-card { position: relative; z-index: 7; margin: 0 10px 10px; border-color: #29445d; background: linear-gradient(145deg, #142335, #0c1727); box-shadow: 0 -16px 36px rgba(4,10,20,.58); }
.order-heading { justify-content: flex-start; }
.order-heading > span { color: var(--muted); font-size: 9px; }
.order-heading > span:nth-child(2) { margin-left: auto; }
.market-pill { padding: 4px 7px; font-size: 9px; }
.leverage-row { margin: 10px 0 2px; }
.leverage-row > label { display: block; margin-bottom: 6px; color: #8fa3b7; font-size: 9px; }
.leverage-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.leverage-presets button { min-height: 30px; padding: 7px 6px; border-color: #49657f; color: #8deaff !important; -webkit-text-fill-color: #8deaff; background: #14263b; font-size: 11px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.leverage-presets button:hover,
.leverage-presets button:focus-visible { border-color: #63b2ff; color: #fff; outline: none; }
.leverage-presets button.active { border-color: #69b5ff; color: #fff !important; -webkit-text-fill-color: #fff; background: #1b5890 !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.leverage-presets button:disabled { cursor: not-allowed; opacity: .42; }
.leverage-preview { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 10px; padding: 6px 8px; border: 1px solid rgba(89, 143, 187, .28); border-radius: 7px; color: #839caf; background: rgba(10, 26, 42, .72); font-size: 9px; }
.leverage-preview span { display: flex; gap: 4px; align-items: baseline; }
.leverage-preview strong { color: #d8ebf7; font-size: 10px; }
#sizeSlider { width: 100%; height: 4px; margin: 12px 0 10px; accent-color: var(--cyan); }
.size-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.size-presets button { padding: 6px; color: #a7b6c7; font-size: 9px; }
.size-presets button.active { border-color: #347df1; color: white; background: rgba(52,125,241,.18); }

.risk-row { display: flex; width: 100%; align-items: center; justify-content: space-between; margin: 8px 0; padding: 7px 9px; border: 1px solid #1e344a; border-radius: 8px; color: var(--muted); background: #0b1726; cursor: pointer; font-size: 9px; }
.risk-row[hidden] { display: none !important; }
.risk-row strong { color: #c6d1dc; }
.risk-row em { padding: 3px 6px; border: 1px solid rgba(217,184,54,.5); border-radius: 999px; color: #e1cb72; font-style: normal; }
.trade-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.trade-buttons button, .next-button, .finish-button { min-height: 35px; border: 0; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 800; }
.trade-buttons button:disabled, .next-button:disabled { cursor: not-allowed; filter: saturate(.2); opacity: .42; }
.trade-buttons .reverse-button { grid-column: 1 / -1; border: 1px solid rgba(255,190,69,.65); color: #ffd77a; background: linear-gradient(90deg, rgba(255,79,101,.2), rgba(255,187,55,.2), rgba(39,205,151,.2)); }
.extend-training-button { width: 100%; min-height: 34px; margin-top: 10px; border: 1px solid rgba(69,215,199,.42); border-radius: 8px; color: #79eadb; background: rgba(26,126,116,.13); cursor: pointer; font-weight: 800; }
.extend-training-button:disabled { cursor: not-allowed; opacity: .4; }
.long-button { color: #06231b; background: linear-gradient(135deg, #35d6b7, #1fc66e); }
.short-button { color: #291603; background: linear-gradient(135deg, #ffbd28, #ff7a1d); }
.partial-button { background: #a44650; }
.close-button { border: 1px solid #2a4056 !important; background: #111d2d; }
.next-button { width: 100%; margin-top: 6px; color: white; background: linear-gradient(135deg, #3d89f4, #276ce3); }
.next-button kbd { margin-left: 4px; color: #c8dbfb; background: transparent; font-family: inherit; }
.candle-playback-controls { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; margin-top: 6px; }
.candle-playback-controls button, .candle-playback-controls select { min-height: 32px; border: 1px solid #2d4c67; border-radius: 8px; color: #cfe1ef; background: #101e2e; font-size: 10px; font-weight: 800; }
.candle-playback-controls button { cursor: pointer; }
.candle-playback-controls button:hover, .candle-playback-controls select:hover { border-color: #42d7e5; background: #15344b; }
.candle-playback-controls button.is-playing { border-color: #42d7e5; color: #fff; background: rgba(26,150,170,.28); }
.candle-playback-controls button:disabled, .candle-playback-controls select:disabled { cursor: not-allowed; opacity: .42; }
.candle-playback-controls label { display: flex; align-items: center; gap: 5px; color: #8499ad; font-size: 9px; white-space: nowrap; }
.candle-playback-controls select { min-width: 58px; padding: 0 5px; color: #e2edf7; }
.finish-button { width: 100%; margin-top: 5px; border: 1px solid #243b51; color: #a8b7c8; background: #101b2a; }
.candle-playback-controls.is-floating {
  position: absolute;
  z-index: 17;
  top: auto !important;
  bottom: 14px !important;
  left: 50%;
  width: min(270px, calc(100% - 24px));
  margin-top: 0;
  padding: 5px;
  border: 1px solid rgba(91,135,170,.62);
  border-radius: 9px;
  background: rgba(9,18,31,.94);
  box-shadow: 0 8px 20px rgba(0,0,0,.34);
  transform: translateX(-50%);
}

.risk-dialog { width: min(390px, calc(100vw - 30px)); padding: 0; border: 1px solid #2b465e; border-radius: 15px; color: var(--text); background: #101d2d; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.risk-dialog::backdrop { background: rgba(2,7,14,.72); backdrop-filter: blur(3px); }
.auth-gate .app-shell > :not(#authDialog) { visibility: hidden; }
.auth-gate #authCloseButton { display: none; }
.risk-dialog form { display: grid; gap: 13px; padding: 20px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-heading p { margin: 0 0 4px; color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.dialog-heading h2 { margin: 0; }
.dialog-heading button { border: 0; color: #8fa0b3; background: transparent; cursor: pointer; font-size: 22px; }
.risk-dialog label { display: grid; gap: 6px; color: #9aaabd; font-size: 10px; }
.risk-dialog input { height: 40px; padding: 0 10px; border: 1px solid #294159; border-radius: 8px; outline: none; color: white; background: #0a1524; }
.auto-risk-output { display: flex; align-items: center; justify-content: space-between; padding: 11px; border: 1px solid rgba(45,212,165,.28); border-radius: 8px; color: #8ea1b4; background: rgba(45,212,165,.045); font-size: 10px; }
.auto-risk-output strong { color: #61dcb8; }
.risk-dialog p { margin: 0; color: #718399; font-size: 9px; line-height: 1.55; }
.dialog-save { height: 39px; border: 0; border-radius: 8px; color: #06211c; background: var(--green); cursor: pointer; font-weight: 800; }
.game-over-dialog { width: min(430px, calc(100vw - 30px)); overflow: hidden; border-color: rgba(255, 67, 96, .78); background: radial-gradient(circle at 50% 0, rgba(255, 55, 88, .22), transparent 48%), #160d16; box-shadow: 0 0 0 1px rgba(255, 67, 96, .16), 0 30px 100px rgba(255, 35, 78, .22), 0 30px 90px rgba(0,0,0,.72); }
.game-over-dialog::backdrop { background: rgba(10, 2, 8, .82); backdrop-filter: blur(5px); }
.game-over-dialog form { gap: 15px; padding: 28px 26px 25px; text-align: center; }
.game-over-kicker { color: #ff8095; font-size: 9px; font-weight: 900; letter-spacing: .28em; }
.game-over-title { color: #ff405f; font-size: clamp(34px, 9vw, 54px); font-weight: 950; letter-spacing: .08em; line-height: 1; text-shadow: 0 0 22px rgba(255, 45, 86, .5); }
.game-over-message { color: #d8aeb7 !important; font-size: 12px !important; }
.game-over-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.game-over-stats div { display: grid; gap: 5px; padding: 11px 8px; border: 1px solid rgba(255, 104, 127, .26); border-radius: 9px; background: rgba(255, 61, 91, .07); }
.game-over-stats span { color: #a97883; font-size: 9px; }
.game-over-stats strong { color: #ff7186; font-size: 15px; }
.game-over-button { color: #fff; background: linear-gradient(135deg, #e72e50, #9f1739); box-shadow: 0 8px 22px rgba(219, 35, 70, .25); }
.dialog-error { min-height: 14px; color: var(--red) !important; }
.username-availability { display: block; min-height: 18px; margin-top: 6px; color: var(--muted); }
.username-availability.available { color: var(--green); }
.username-availability.unavailable { color: var(--red); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-actions button, .logout-button { height: 39px; border: 1px solid #2d4a65; border-radius: 8px; background: #14243a; cursor: pointer; font-weight: 800; }
.dialog-actions button:last-child { border-color: #298a75; color: #06231d; background: var(--green); }
.teacher-room-resume-dialog .dialog-actions { gap: 12px; margin-top: 18px; }
.teacher-room-resume-dialog .dialog-actions button {
  min-height: 54px;
  border-radius: 12px;
  font-size: 15px;
}
.teacher-room-resume-dialog .teacher-destroy-room-button {
  border-color: rgba(255, 96, 115, .72);
  color: #fff;
  background: linear-gradient(135deg, #8e2639, #c83f55);
  box-shadow: 0 8px 20px rgba(200, 63, 85, .2);
}
.room-announcement-dialog { border-color: rgba(110, 231, 216, .48); box-shadow: 0 24px 80px rgba(21, 181, 171, .18), 0 30px 90px rgba(0,0,0,.6); }
.room-announcement-dialog h2 { color: #e4fffb; }
.room-announcement-dialog #roomAnnouncementMessage { color: #9bcac7; }
.auth-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
.auth-dialog #loginButton { width: min(340px, 100%); margin-inline: auto; }
.logout-button { color: #ff9ca8; background: rgba(255,96,115,.08); }
.leaderboard-dialog { width: min(600px, calc(100vw - 30px)); }
.leaderboard-head, .leaderboard-row { display: grid; grid-template-columns: minmax(140px, 1fr) 90px 70px 58px; align-items: center; gap: 8px; }
.leaderboard-head { padding: 0 9px; color: #718399; font-size: 9px; }
.leaderboard-list { display: grid; max-height: 440px; gap: 5px; overflow-y: auto; }
.leaderboard-list > p { padding: 20px; color: #718399; text-align: center; }
.leaderboard-row { padding: 9px; border: 1px solid #1f374f; border-radius: 8px; background: #0a1728; font-size: 10px; }
.leaderboard-row.me { border-color: rgba(52,211,220,.48); background: rgba(52,211,220,.06); }
.leaderboard-row.top-rank { position: relative; overflow: hidden; border-width: 1.5px; box-shadow: 0 10px 28px rgba(0,0,0,.22); }
.leaderboard-row.top-rank::before { position: absolute; inset: 0 auto 0 0; width: 5px; content: ""; background: var(--rank-color); box-shadow: 0 0 18px var(--rank-color); }
.leaderboard-row.rank-1 { --rank-color: #ffd84d; border-color: rgba(255,216,77,.62); background: linear-gradient(90deg, rgba(255,216,77,.16), #0a1728 38%); }
.leaderboard-row.rank-2 { --rank-color: #cbd8e6; border-color: rgba(203,216,230,.5); background: linear-gradient(90deg, rgba(203,216,230,.13), #0a1728 38%); }
.leaderboard-row.rank-3 { --rank-color: #d99258; border-color: rgba(217,146,88,.54); background: linear-gradient(90deg, rgba(217,146,88,.14), #0a1728 38%); }
.leaderboard-row.rank-1 em { color: #171100; background: #ffd84d; }
.leaderboard-row.rank-2 em { color: #17202b; background: #cbd8e6; }
.leaderboard-row.rank-3 em { color: #25150b; background: #d99258; }
.pk-invite-button { margin-left: 10px; padding: 4px 8px; border: 1px solid #9d62e8; border-radius: 7px; color: #eadbff; background: rgba(126,70,198,.22); cursor: pointer; font-size: 9px; }
.pk-invite-button:hover { background: rgba(157,98,232,.42); }
.leaderboard-row strong { color: #b8ebee; }
#leaderboardBreakdownTooltip { display: none !important; }
.leaderboard-row em { display: inline-grid; min-width: 26px; height: 22px; margin-right: 8px; place-items: center; border-radius: 999px; color: #e8cd70; background: rgba(217,184,54,.09); font-style: normal; }
.member-admin-button { border-color: rgba(45,212,165,.45) !important; color: #74e3c3 !important; }
.teacher-button { border-color: rgba(52,211,220,.45) !important; color: #79e2e7 !important; }
.room-button { border-color: rgba(232,205,112,.4) !important; color: #e8cd70 !important; }
.teacher-dialog { width: min(1120px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid #2b465e; border-radius: 15px; color: var(--text); background: #091421; box-shadow: 0 30px 100px rgba(0,0,0,.72); }
.teacher-dialog::backdrop { background: rgba(2,7,14,.78); backdrop-filter: blur(3px); }
.teacher-dialog-shell { display: grid; gap: 14px; padding: 20px; }
.admin-panel-note { margin: 0; padding: 10px 12px; border: 1px solid rgba(45,212,165,.25); border-radius: 8px; color: #8fcdbb; background: rgba(45,212,165,.045); font-size: 9px; }
.member-create-panel { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .8fr) minmax(150px, .8fr) auto; align-items: center; gap: 8px; padding: 12px; border: 1px solid #26445c; border-radius: 10px; background: #0b1928; }
.member-create-panel > div { display: grid; gap: 3px; }
.member-create-panel > div span { color: #74889b; font-size: 8px; }
.member-create-panel input, .member-create-panel button { height: 36px; border: 1px solid #2a465e; border-radius: 7px; color: #b9c8d5; background: #0a1726; font-size: 9px; }
.member-create-panel input { padding: 0 10px; outline: 0; }
.member-create-panel button { padding: 0 14px; border-color: #238d78; color: #06281f; background: var(--green); cursor: pointer; font-weight: 800; }
.member-create-panel .dialog-error { grid-column: 2 / -1; min-height: 0; }
.teacher-dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.teacher-dialog-heading p { margin: 0 0 4px; color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.teacher-dialog-heading h2 { margin: 0; font-size: 20px; }
.teacher-dialog-heading > div:last-child { display: flex; align-items: center; gap: 8px; }
.teacher-dialog-heading button { height: 34px; padding: 0 12px; border: 1px solid #2a4258; border-radius: 8px; color: #9eb1c4; background: #101d2d; cursor: pointer; }
.teacher-topline { display: flex; min-width: 0; align-items: center; gap: 18px; }
.teacher-topline .teacher-dialog-heading { min-width: 178px; flex: 0 0 auto; }
.teacher-topline .teacher-summary-grid { min-width: 0; flex: 1 1 auto; }
.teacher-top-student-ribbon { display: none; min-width: 0; }
#closeTeacherButton, #closeMemberAdminButton { min-width: 34px; padding: 0 10px; border: 0; background: transparent; font-size: 13px; }
.competition-control { display: grid; gap: 11px; padding: 14px; border: 1px solid #26425a; border-radius: 12px; background: linear-gradient(135deg, #0e1d2d, #0a1725); }
.competition-title { display: flex; align-items: center; justify-content: space-between; }
.competition-title > div { display: flex; align-items: center; gap: 10px; }
.competition-title span { color: #8093a7; font-size: 10px; }
.competition-title b, .competition-title i { color: #9eb1c3; font-style: normal; font-weight: 600; }
.competition-title strong { padding: 5px 9px; border: 1px solid rgba(52,211,220,.35); border-radius: 999px; color: #7ee2e7; font-size: 9px; }
.teacher-room-fold { display: block; min-width: 0; border: 1px solid rgba(95, 146, 157, .3); border-radius: 14px; background: rgba(5, 20, 32, .76); }
.teacher-room-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; color: #d9eef0; cursor: pointer; list-style: none; }
.teacher-room-fold > summary::-webkit-details-marker { display: none; }
.teacher-room-fold > summary > span { display: grid; gap: 3px; }
.teacher-room-fold > summary strong { color: #e2f2f4; font-size: 11px; }
.teacher-room-fold > summary small { color: #7897a3; font-size: 8px; }
.teacher-room-fold > summary > b { display: inline-grid; width: 24px; height: 24px; place-items: center; border: 1px solid rgba(110, 231, 216, .32); border-radius: 50%; color: #8df4e6; font-size: 15px; transition: transform .18s ease; }
.teacher-room-fold[open] > summary > b { transform: rotate(180deg); }
.teacher-room-fold[open] > .room-builder { margin-top: 0; border: 0; border-top: 1px solid rgba(95, 146, 157, .2); border-radius: 0 0 14px 14px; }
.room-builder { display: grid; gap: 9px; padding: 12px; border: 1px solid #223d54; border-radius: 10px; background: #0a1726; }
.room-builder-step { display: flex; align-items: center; gap: 9px; }
.room-step-number { display: inline-grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgba(52,211,220,.4); border-radius: 50%; color: #8ce4e8; background: rgba(52,211,220,.08); font-size: 9px; font-weight: 800; }
.room-builder-step div { display: grid; gap: 2px; }
.room-builder-step strong { color: #d5e3ed; font-size: 10px; }
.room-builder-step small { color: #71869a; font-size: 8px; }
.room-presets { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 31px; }
.room-presets button { height: 29px; padding: 0 13px; border: 1px solid #29465d; border-radius: 7px; color: #9fb4c6; background: #0d1b2b; cursor: pointer; font-size: 9px; }
.room-presets button:hover, .room-presets button.active { border-color: #39c8ce; color: #e5fbfc; background: rgba(52,211,220,.12); }
.room-create-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; padding-left: 31px; }
.room-create-actions label { display: grid; gap: 5px; color: #8194a7; font-size: 8px; }
.room-create-actions input { width: 100%; height: 36px; border: 1px solid #2a465e; border-radius: 7px; color: #b9c8d5; background: #0d1b2b; font-size: 9px; }
.room-create-actions input { padding: 0 9px; }
.room-builder-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 31px; }
.room-builder-footer #createRoomButton { min-height: 36px; padding: 0 15px; border: 1px solid #238d78; border-radius: 7px; color: #06281f; background: var(--green); cursor: pointer; font-size: 9px; font-weight: 800; }
.room-builder-footer #createRoomButton:hover { filter: brightness(1.08); }
.room-range-value { color: #7890a5; font-size: 9px; }
.room-management { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid #223d54; border-radius: 10px; background: #091625; }
.room-management-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-management-heading strong { color: #d5e3ed; font-size: 10px; }
.room-management-heading span { color: #71869a; font-size: 8px; }
.teacher-room-list { display: grid; max-height: 180px; gap: 6px; overflow-y: auto; }
.teacher-room-list > p { margin: 0; padding: 14px; color: #71869a; text-align: center; font-size: 9px; }
.teacher-room-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #213b52; border-radius: 8px; background: #0c1a2a; }
.teacher-room-item.current { border-color: rgba(52,211,220,.48); background: rgba(52,211,220,.06); }
.teacher-room-meta { display: grid; min-width: 0; gap: 3px; }
.teacher-room-meta strong { color: #d9e5ed; font-size: 10px; }
.teacher-room-meta span { overflow: hidden; color: #748a9e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-room-actions, .room-invite-row { display: flex; align-items: center; gap: 6px; }
.teacher-room-actions button, .room-invite-row select, .room-invite-row button { height: 31px; border: 1px solid #2b4b63; border-radius: 7px; color: #a9c3d4; background: #0c1a2a; font-size: 8px; }
.teacher-room-actions button, .room-invite-row button { padding: 0 10px; cursor: pointer; }
.teacher-room-actions button:disabled, .room-invite-row button:disabled, .room-invite-row select:disabled { cursor: not-allowed; opacity: .45; }
.teacher-room-actions .danger, #deleteRoomButton { border-color: rgba(255,96,115,.45); color: #ff8996; }
.room-invite-row select { min-width: 0; flex: 1; padding: 0 9px; }
.competition-actions { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(5, auto); gap: 7px; }
.competition-actions input, .competition-actions button { height: 34px; border: 1px solid #29445c; border-radius: 7px; color: #b8c7d5; background: #0a1726; font-size: 9px; }
.competition-actions input { padding: 0 10px; }
.competition-actions button { padding: 0 10px; cursor: pointer; }
.competition-actions button[data-room-action="start"] { border-color: #238d78; color: #07271f; background: var(--green); font-weight: 800; }
.teacher-playback-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; padding-top: 2px; }
.teacher-playback-actions button, .teacher-playback-actions select { height: 32px; border: 1px solid #2b5870; border-radius: 7px; color: #d7edf2; background: #0b2031; font-size: 9px; }
.teacher-playback-actions button { min-width: 118px; padding: 0 11px; cursor: pointer; }
.teacher-playback-actions button:first-child { border-color: rgba(65, 203, 176, .7); color: #071e1b; background: linear-gradient(135deg, #8df4e6, #41cbb0); font-weight: 800; }
.teacher-playback-actions select { min-width: 76px; padding: 0 8px; }
.teacher-playback-actions button:disabled, .teacher-playback-actions select:disabled { cursor: not-allowed; opacity: .45; }
.teacher-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.teacher-summary-grid div { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid #1f374d; border-radius: 9px; background: #0c1928; }
.teacher-summary-grid span { color: #7f91a4; font-size: 9px; }
.teacher-summary-grid strong { font-size: 16px; }
.teacher-summary-grid { gap: 0; padding: 3px 6px; border: 1px solid rgba(62,109,142,.34); border-radius: 9px; background: rgba(8,24,41,.72); }
.teacher-summary-grid div { min-height: 28px; padding: 4px 12px; border: 0; border-right: 1px solid rgba(62,109,142,.28); border-radius: 0; background: transparent; }
.teacher-summary-grid div:last-child { border-right: 0; }
.teacher-summary-grid strong { font-size: 14px; }
.teacher-table-head, .teacher-user-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(260px, 1.4fr); align-items: center; gap: 10px; }
.member-table-head, .member-table-head + .teacher-user-list .teacher-user-row { grid-template-columns: minmax(180px, 1.25fr) minmax(130px, .8fr) minmax(115px, .7fr) minmax(120px, .7fr) minmax(230px, 1.35fr); }
.teacher-table-head { padding: 0 12px; color: #75879a; font-size: 9px; }
.teacher-user-list { display: grid; max-height: 440px; gap: 6px; overflow-y: auto; }
.teacher-user-list > p { padding: 28px; color: #74869a; text-align: center; }
.teacher-user-row { padding: 10px 12px; border: 1px solid #1e364b; border-radius: 9px; background: #0b1827; }
.teacher-user-row.pending { border-color: rgba(255,186,54,.42); background: rgba(255,186,54,.045); }
.admin-user-notes { display: grid; gap: 2px; min-width: 0; }
.admin-user-notes strong { color: #8ee9ce; font-size: 10px; }
.admin-user-notes span { overflow: hidden; color: #718ca1; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-notes button { justify-self: start; padding: 4px 6px; border: 1px solid rgba(52,211,220,.36); border-radius: 6px; color: #8ce2e5; background: rgba(52,211,220,.06); cursor: pointer; font-size: 8px; }
.teacher-player { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.member-list-avatar { display: inline-grid; width: 52px; height: 52px; flex: 0 0 52px; place-items: center; overflow: hidden; border: 2px solid #34516b; border-radius: 50%; color: #c3d1dd; background: #14283b; font-size: 29px; line-height: 1; font-weight: 900; }
.teacher-player .member-list-avatar { display: inline-grid; margin-top: 0; place-items: center; font-size: 29px; line-height: 1; }
.teacher-user-row .teacher-player { min-height: 56px; align-items: center; }
.member-list-avatar.admin-avatar { border-color: rgba(52,211,220,.6); color: #062a2b; background: #53d7dc; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #46596b; box-shadow: 0 0 0 3px rgba(70,89,107,.12); }
.online-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(45,212,165,.12); }
.teacher-player strong, .teacher-live strong, .teacher-equity strong { display: block; font-size: 10px; }
.teacher-player span, .teacher-live span, .teacher-equity span { display: block; margin-top: 3px; color: #74879a; font-size: 8px; }
.teacher-live-progress { height: 4px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: #26394c; }
.teacher-live-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.teacher-user-actions { display: flex; align-items: center; gap: 5px; }
.teacher-user-actions select, .teacher-user-actions button { height: 29px; border: 1px solid #2c465e; border-radius: 6px; color: #a9bac9; background: #101e2e; font-size: 8px; }
.teacher-user-actions select { min-width: 76px; padding: 0 5px; }
.teacher-user-actions button { padding: 0 8px; cursor: pointer; }
.member-role-label { padding: 5px 8px; border: 1px solid #2c465e; border-radius: 999px; color: #8fa5b8; background: #0c1928; font-size: 8px; }
.teacher-user-actions .approve-user { border-color: #278a75; color: #62dfba; }
.teacher-user-actions .block-user { border-color: rgba(255,96,115,.38); color: #ff8996; }

/* Member admin readability: keep the dense table usable without tiny text. */
#memberAdminDialog .admin-panel-note { color: #a7d7ca; font-size: 11px; line-height: 1.5; }
#memberAdminDialog .member-create-panel > div span { color: #9aafbf; font-size: 11px; }
#memberAdminDialog .member-create-panel input,
#memberAdminDialog .member-create-panel button { font-size: 12px; }
#memberAdminDialog .teacher-summary-grid span { color: #9aabba; font-size: 11px; }
#memberAdminDialog .teacher-table-head { color: #a8b8c7; font-size: 11px; }
#memberAdminDialog .teacher-user-row { padding-block: 12px; }
#memberAdminDialog .teacher-player strong,
#memberAdminDialog .teacher-live strong,
#memberAdminDialog .teacher-equity strong { font-size: 12px; }
#memberAdminDialog .teacher-player span,
#memberAdminDialog .teacher-live span,
#memberAdminDialog .teacher-equity span { color: #9aabba; font-size: 10px; }
#memberAdminDialog .admin-user-notes strong { font-size: 12px; }
#memberAdminDialog .admin-user-notes span { color: #9aabba; font-size: 10px; }
#memberAdminDialog .admin-user-notes button { padding: 5px 8px; color: #a9edef; font-size: 10px; }
#memberAdminDialog .teacher-user-actions { flex-wrap: wrap; row-gap: 7px; }
#memberAdminDialog .teacher-user-actions select,
#memberAdminDialog .teacher-user-actions button { height: 32px; color: #d4e0ea; font-size: 11px; }
#memberAdminDialog .teacher-user-actions select { min-width: 86px; padding-inline: 7px; }
#memberAdminDialog .teacher-user-actions button { padding-inline: 9px; }
#memberAdminDialog .member-role-label { padding: 6px 9px; color: #c4d2df; font-size: 11px; }
.teacher-monitor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 3px 0; }
.teacher-monitor-heading > div:first-child { display: grid; gap: 3px; }
.teacher-monitor-heading strong { color: #dbe8f3; font-size: 12px; }
.teacher-monitor-heading span { color: #71869a; font-size: 9px; }
.teacher-monitor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; max-height: 500px; overflow-y: auto; padding: 1px; }
.teacher-monitor-grid > p { grid-column: 1 / -1; padding: 28px; color: #74869a; text-align: center; }
.teacher-monitor-card { min-width: 0; padding: 9px; border: 1px solid #1e3a51; border-radius: 11px; background: linear-gradient(145deg, #0e1d2d, #0a1625); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.teacher-monitor-card.is-online { border-color: rgba(45,212,165,.35); }
.teacher-monitor-card.is-offline { opacity: .72; }
.teacher-monitor-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.teacher-monitor-card-head .teacher-player { min-width: 0; }
.teacher-monitor-card-head .teacher-player strong, .teacher-monitor-card-head .teacher-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-status { padding: 3px 6px; border: 1px solid #29455b; border-radius: 999px; color: #9db1c0; font-size: 8px; }
.teacher-mini-frame { height: 126px; margin: 8px 0; overflow: hidden; border: 1px solid #1c3850; border-radius: 7px; background: #061120; }
.student-mini-chart { display: block; width: 100%; height: 100%; }
.student-mini-empty { display: grid; height: 100%; place-items: center; color: #647b90; font-size: 9px; }
.teacher-monitor-meta, .teacher-monitor-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #7890a4; font-size: 8px; }
.teacher-monitor-meta b { color: #d5e0e9; font-weight: 700; }
.teacher-monitor-meta .position-long { color: #2dd4a5; }
.teacher-monitor-meta .position-short { color: #ff6073; }
.teacher-monitor-position { margin-top: 5px; overflow: hidden; color: #9db1c0; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-monitor-foot { margin-top: 6px; color: #5f7488; }
.teacher-monitor-card .teacher-live-progress { margin-top: 7px; }
.student-records-button { width: 100%; height: 28px; margin-top: 8px; padding: 0 8px; border: 1px solid #2c536a; border-radius: 7px; color: #a9dce1; background: #0b1b2b; cursor: pointer; font-size: 8px; }

.student-picker { display: grid; gap: 9px; padding: 10px; border: 1px solid rgba(73,122,156,.28); border-radius: 10px; background: rgba(4,15,27,.48); }
.student-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.student-picker-head > div { display: flex; align-items: center; gap: 8px; }
.student-picker-head strong { font-size: 10px; }
.student-picker-head span { color: #7f95a9; font-size: 8px; }
.student-picker-head button { height: 26px; padding: 0 9px; border: 1px solid #294a62; border-radius: 7px; color: #9db5c7; background: #0b1a2a; cursor: pointer; font-size: 8px; }
.student-picker-head button:disabled { opacity: .4; cursor: not-allowed; }
.student-picker-list { display: grid; max-height: 150px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; overflow-y: auto; }
.student-picker-list > p { grid-column: 1 / -1; margin: 0; padding: 16px; color: #71869a; text-align: center; font-size: 9px; }
.student-choice { display: grid; min-width: 0; grid-template-columns: auto auto 1fr; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid #213d54; border-radius: 9px; color: #c4d3df; background: #0a1828; cursor: pointer; transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
.student-choice:hover { border-color: #35637c; transform: translateY(-1px); }
.student-choice:has(input:checked) { border-color: rgba(52,211,220,.58); background: rgba(52,211,220,.08); }
.student-choice input { width: 14px; height: 14px; margin: 0; accent-color: var(--cyan); }
.student-choice-avatar { display: inline-grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: #05262a; background: linear-gradient(135deg, #70e1e6, #2fb9c7); font-size: 9px; font-weight: 900; }
.student-choice > span:last-child { display: grid; min-width: 0; gap: 2px; }
.student-choice strong, .student-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-choice strong { font-size: 9px; }
.student-choice small { color: #71879a; font-size: 7px; }
.room-invite-row .invite-primary { margin-left: auto; border-color: #24937f; color: #06281f; background: linear-gradient(135deg, #39d8b6, #23bd8a); font-weight: 800; }

/* 2026 interface refresh */
:root {
  --bg: #020817;
  --surface: #0a1626;
  --surface-2: #0f1d30;
  --line: #203a52;
  --text: #eef6ff;
  --muted: #7f93a9;
  --cyan: #42dbe2;
  --green: #34d8a5;
  --blue: #4b8cff;
}
body { background: radial-gradient(circle at 12% -10%, rgba(32,112,173,.28), transparent 34rem), radial-gradient(circle at 85% 0%, rgba(40,173,158,.12), transparent 28rem), #020817; }
.app-shell { display: flex; height: 100dvh; min-height: 650px; flex-direction: column; padding: 10px; overflow: hidden; }
.topbar { min-height: 68px; flex: 0 0 auto; padding: 9px 14px; border-color: rgba(90,137,174,.24); border-radius: 18px 18px 0 0; background: rgba(7,19,35,.82); box-shadow: 0 14px 44px rgba(0,0,0,.2); backdrop-filter: blur(18px) saturate(1.25); }
.topbar .brand { flex: 0 0 auto; }
.top-actions { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: space-between; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.top-actions::-webkit-scrollbar { display: none; }
.top-nav-primary, .top-nav-context { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.top-nav-primary { margin-left: auto; padding: 4px; border: 1px solid rgba(74,126,166,.2); border-radius: 13px; background: rgba(4,14,27,.48); }
.top-nav-context { padding-left: 12px; border-left: 1px solid rgba(93,135,168,.22); }
.top-nav-primary .secondary-button { min-height: 35px; border-color: transparent; background: transparent; }
.top-nav-primary .secondary-button:hover { background: rgba(36,69,99,.72); }
.top-nav-primary .secondary-button > span { margin-right: 3px; color: #76dfe5; font-weight: 900; }
.top-nav-primary .main-menu-button { border-color: rgba(66,219,226,.42); color: #c9fbff; background: rgba(34,121,137,.19); }
.top-nav-primary .main-menu-button:hover { border-color: rgba(66,219,226,.72); background: rgba(34,121,137,.34); }
.secondary-button, .primary-small { min-height: 39px; padding: 0 13px; border-color: rgba(83,125,158,.34); border-radius: 11px; background: rgba(17,34,53,.76); white-space: nowrap; transition: translate 140ms ease, border-color 140ms ease, background 140ms ease; }
.secondary-button:hover, .primary-small:hover { translate: 0 -1px; border-color: rgba(79,174,203,.58); background: #142a42; }
.primary-small { border-color: rgba(75,140,255,.8); background: linear-gradient(135deg, #4b8cff, #2967dc); box-shadow: 0 8px 22px rgba(45,105,220,.24); }
.player-button { padding-left: 8px; }
.line-button.active { border-color: rgba(130,90,255,.72); color: #c0adff; background: rgba(130,90,255,.16); }
.player-avatar { width: 28px; height: 28px; }
.toolbar { min-height: 48px; flex: 0 0 auto; padding: 7px 14px; border-color: rgba(90,137,174,.2); background: rgba(5,15,29,.9); }
.toolbar button, .dataset-select, .extend-select { border-radius: 9px; background: rgba(14,30,48,.86); }
.drawing-tools button { width: 30px; height: 30px; }
.trainer-grid { height: auto; min-height: 0; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) 300px; border-color: rgba(90,137,174,.2); border-radius: 0 0 18px 18px; background: rgba(4,13,26,.9); }
.chart-column { border-color: rgba(79,119,151,.26); }
.quote-strip, .chart-footer { background: rgba(6,17,31,.92); }
.chart-stage { background: #000; }
.side-panel { background: linear-gradient(180deg, #091526, #07111f); }
.side-scroll { gap: 10px; padding: 11px; }
.side-card, .order-card { border-color: rgba(76,122,156,.3); border-radius: 13px; background: linear-gradient(145deg, rgba(17,34,53,.94), rgba(9,22,38,.96)); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 10px 30px rgba(0,0,0,.12); }
.order-card { border-color: rgba(72,130,170,.42); box-shadow: 0 -18px 45px rgba(0,0,0,.38); }
.trainer-grid { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); }
.chart-column { border-right: 1px solid rgba(79,119,151,.26); border-bottom: 0; }
.side-panel { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; border-top: 0; }
.side-scroll { flex-direction: column; overflow-x: hidden; overflow-y: auto; }
.side-scroll .side-card, .side-scroll .account-card, .side-scroll .history-card { min-width: 0; height: auto; }
.order-card { display: block; min-width: 0; margin: 0 10px 10px; padding: 14px; overflow: visible; box-shadow: 0 -18px 45px rgba(0,0,0,.38); }
.teacher-dialog { width: min(1380px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-color: rgba(78,134,171,.38); border-radius: 18px; background: #071321; }
.teacher-dialog-shell { max-height: calc(100dvh - 26px); gap: 13px; padding: 18px; overflow-y: auto; }
.competition-control { border-color: rgba(77,126,161,.33); background: linear-gradient(135deg, rgba(14,31,50,.98), rgba(7,21,37,.98)); }
.room-builder, .room-management { border-color: rgba(67,112,145,.34); background: rgba(6,19,34,.74); }
.room-management { grid-template-columns: minmax(320px,.9fr) minmax(420px,1.3fr); align-items: start; }
.room-management-heading { grid-column: 1 / -1; }
.teacher-room-list { max-height: 230px; }
.student-picker { min-height: 100%; }
.teacher-summary-grid div, .teacher-user-row, .teacher-monitor-card { border-color: rgba(62,109,142,.34); background: rgba(8,24,41,.88); }
.teacher-monitor-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.teacher-panorama-card { grid-column: 1 / -1; min-width: 0; padding: 12px; border: 1px solid rgba(45,212,165,.35); border-radius: 11px; background: linear-gradient(145deg, #0e1d2d, #0a1625); }
.teacher-panorama-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: #dbe8f3; font-size: 11px; }
.teacher-panorama-head > div:first-child { display: grid; gap: 3px; }
.teacher-panorama-head span { color: #7890a4; font-size: 8px; }
.teacher-panorama-filters { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.teacher-panorama-filters > span { overflow: hidden; color: #7890a4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-panorama-filters label { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; color: #8fa6b5; font-size: 8px; white-space: nowrap; }
.teacher-panorama-filters select { min-height: 26px; padding: 0 6px; border: 1px solid #31516a; border-radius: 5px; color: #d9f6f3; background: #0a1b2c; font-size: 9px; }
.teacher-panorama-filters button { padding: 4px 8px; border: 1px solid #31516a; border-radius: 5px; color: #9bb1c1; background: #0a1b2c; cursor: pointer; font-size: 8px; }
.teacher-panorama-frame { position: relative; height: 320px; overflow: hidden; border: 1px solid #1c3850; border-radius: 7px; background: #000; }
.teacher-panorama-frame .student-mini-chart { width: 100%; height: 100%; }
.teacher-panorama-frame:has(.teacher-clear-candle-chart) { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.teacher-panorama-frame .teacher-clear-candle-chart { width: auto !important; min-width: 100%; height: 100%; }
.teacher-native-panorama-chart { position: relative; width: 100%; height: 100%; min-height: 0; background: #000; }
.teacher-native-panorama-chart canvas { display: block; }
.teacher-panorama-action-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.teacher-panorama-action-marker { position: absolute; display: inline-flex; align-items: center; gap: 3px; transform: translate(-50%, -50%); padding: 2px 4px; border: 1px solid currentColor; border-radius: 4px; color: #2dd4a5; background: rgba(3, 13, 21, .82); box-shadow: 0 2px 7px rgba(0, 0, 0, .42); font: 700 9px/1 ui-sans-serif, system-ui; white-space: nowrap; }
.teacher-panorama-action-marker i { max-width: 72px; overflow: hidden; color: #d8e8ef; font-size: 8px; font-style: normal; text-overflow: ellipsis; }
.teacher-panorama-action-marker b { color: currentColor; font-size: 10px; }
.teacher-panorama-action-marker.is-short { color: #ff6073; }
.teacher-panorama-action-marker.is-long { color: #2dd4a5; }
.teacher-panorama-action-dot { position: absolute; width: 6px; height: 6px; transform: translate(-50%, -50%); border: 1px solid #fff; border-radius: 50%; background: #2dd4a5; box-shadow: 0 0 0 3px rgba(45, 212, 165, .16); }
.teacher-panorama-action-dot.is-short { background: #ff6073; box-shadow: 0 0 0 3px rgba(255, 96, 115, .16); }
.teacher-native-panorama-modal { min-width: 0; min-height: 0; }
.teacher-panorama-frame[data-open-teacher-panorama] { cursor: grab; touch-action: none; user-select: none; }
.teacher-panorama-frame[data-open-teacher-panorama].is-panning { cursor: grabbing; }
.teacher-overview-positions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.teacher-overview-position { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #29455b; border-radius: 7px; color: #9db1c0; background: #0b1b2b; font-size: 8px; }
.teacher-overview-position.muted { opacity: .48; }
.teacher-overview-position b { color: #e4edf4; }
.teacher-overview-position em { font-style: normal; font-weight: 800; }
.teacher-overview-position small { color: #7890a4; font-size: 8px; }
.teacher-overview-position .position-long { color: #2dd4a5; }
.teacher-overview-position .position-short { color: #ff6073; }
.teacher-overview-eye { width: 18px; height: 18px; padding: 0; border: 1px solid #355772; border-radius: 50%; color: #7de9d0; background: #0b2232; cursor: pointer; font-size: 9px; line-height: 16px; }
.teacher-overview-position.muted .teacher-overview-eye { color: #7890a4; }
.teacher-panorama-scrubber { flex: 0 0 auto; display: grid; gap: 5px; margin-top: 7px; padding: 7px 10px 6px; border: 1px solid rgba(70, 126, 149, .38); border-radius: 9px; background: linear-gradient(180deg, rgba(8, 31, 45, .94), rgba(6, 20, 33, .94)); }
.teacher-panorama-scrubber-head { display: flex; min-width: 0; align-items: center; gap: 10px; }
.teacher-panorama-scrubber-head > div:first-child { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.teacher-panorama-scrubber-head strong { color: #d9f6f3; font-size: 9px; white-space: nowrap; }
.teacher-panorama-scrubber-head span { overflow: hidden; color: #7897a3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-panorama-scrubber-head > b { margin-left: auto; color: #8df4e6; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.teacher-panorama-scrubber-actions { display: flex; gap: 4px; }
.teacher-panorama-scrubber-actions button { min-width: 34px; height: 22px; padding: 0 7px; border: 1px solid rgba(88, 145, 157, .45); border-radius: 6px; color: #9cb7c0; background: rgba(12, 34, 47, .9); cursor: pointer; font-size: 8px; }
.teacher-panorama-scrubber-actions button:hover { border-color: #6ee7d8; color: #eafffb; background: rgba(110, 231, 216, .12); }
.teacher-panorama-overview { position: relative; height: 48px; overflow: hidden; border: 1px solid rgba(70, 126, 149, .48); border-radius: 7px; background: #061622; cursor: ew-resize; touch-action: none; user-select: none; }
.teacher-panorama-overview-chart { display: block; width: 100%; height: 100%; }
.teacher-panorama-overview-window { position: absolute; top: 2px; bottom: 2px; min-width: 14px; border: 1px solid #9ff4e7; border-radius: 5px; background: rgba(110, 231, 216, .15); box-shadow: 0 0 0 1px rgba(110, 231, 216, .12), 0 0 14px rgba(110, 231, 216, .2); cursor: grab; }
.teacher-panorama-overview-window:active { cursor: grabbing; }
.teacher-panorama-overview-window i { position: absolute; top: 50%; width: 3px; height: 22px; border-radius: 99px; background: #b6fff5; box-shadow: 0 0 7px rgba(110, 231, 216, .7); transform: translateY(-50%); }
.teacher-panorama-overview-window i:first-child { left: 4px; }
.teacher-panorama-overview-window i:last-child { right: 4px; }
.teacher-panorama-overlay { position: absolute; z-index: 8; right: 8px; bottom: 8px; left: 8px; display: grid; gap: 5px; max-height: calc(100% - 16px); pointer-events: none; }
.teacher-panorama-overlay > * { margin-top: 0; pointer-events: auto; border-color: rgba(110, 231, 216, .35); background: rgba(5, 22, 35, .52); box-shadow: 0 8px 22px rgba(0, 0, 0, .22); backdrop-filter: blur(10px); }
.teacher-panorama-overlay .teacher-panorama-scrubber { padding: 6px 8px 5px; }
.teacher-panorama-overlay .teacher-panorama-overview { height: 40px; }
.teacher-panorama-overlay .teacher-panorama-scrubber-scale { display: none; }
.teacher-panorama-overlay .teacher-panorama-trade-strip-head span { display: none; }
.teacher-panorama-trade-strip { display: grid; gap: 5px; margin-top: 7px; padding: 6px 8px; border: 1px solid rgba(70,126,149,.34); border-radius: 8px; background: rgba(5,22,35,.74); }
.teacher-panorama-trade-strip-head { display: flex; align-items: baseline; gap: 8px; }
.teacher-panorama-trade-strip-head strong { color: #cfeeea; font-size: 8px; }
.teacher-panorama-trade-strip-head span { color: #708b9a; font-size: 7px; }
.teacher-panorama-trade-list { display: flex; min-width: 0; gap: 5px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.teacher-panorama-trade-item { display: grid; flex: 0 0 auto; grid-template-columns: auto auto auto; align-items: center; gap: 6px; min-height: 25px; padding: 3px 6px; border: 1px solid #29485e; border-radius: 6px; color: #a9bdc9; background: #091b2b; cursor: pointer; font-size: 7px; white-space: nowrap; }
.teacher-panorama-trade-item:hover { border-color: #6ee7d8; background: rgba(110,231,216,.1); }
.teacher-panorama-trade-item strong { color: #dbeef1; font-size: 8px; }
.teacher-panorama-trade-item span { color: #8199a8; }
.teacher-panorama-trade-item em { font-style: normal; font-weight: 800; }
.teacher-panorama-trade-item.profit em { color: #54e1b2; }
.teacher-panorama-trade-item.loss em { color: #ff7181; }
.teacher-panorama-trade-item.flat em, .teacher-panorama-trade-item.open em { color: #e5c86f; }
.teacher-panorama-trade-empty { padding: 4px 2px; color: #718797; font-size: 8px; }
.teacher-panorama-scrubber input[type="range"] { width: 100%; height: 22px; margin: 0; accent-color: #6ee7d8; cursor: ew-resize; touch-action: pan-x; }
.teacher-panorama-scrubber input[type="range"] { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); opacity: 0; pointer-events: none; }
.teacher-panorama-scrubber input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #22566a, #6ee7d8 52%, #22566a); }
.teacher-panorama-scrubber input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; border: 2px solid #dffff9; border-radius: 50%; background: #34cdb7; box-shadow: 0 0 0 4px rgba(110, 231, 216, .14), 0 3px 10px rgba(0, 0, 0, .4); -webkit-appearance: none; }
.teacher-panorama-scrubber input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #22566a, #6ee7d8 52%, #22566a); }
.teacher-panorama-scrubber input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 2px solid #dffff9; border-radius: 50%; background: #34cdb7; box-shadow: 0 0 0 4px rgba(110, 231, 216, .14), 0 3px 10px rgba(0, 0, 0, .4); }
.teacher-panorama-scrubber-scale { display: flex; justify-content: space-between; color: #567284; font-size: 7px; }
.teacher-panorama-dialog { width: min(1600px, calc(100vw - 24px)); height: min(850px, calc(100dvh - 24px)); padding: 0; border: 1px solid rgba(78,134,171,.46); border-radius: 18px; color: #dbe8f3; background: #071321; box-shadow: 0 30px 100px rgba(0,0,0,.72); }
.teacher-panorama-dialog-shell { display: grid; height: 100%; grid-template-rows: auto auto 1fr; gap: 10px; padding: 18px; box-sizing: border-box; }
.teacher-panorama-readonly-note { margin: 0; color: #7890a4; font-size: 10px; }
.teacher-panorama-viewport { position: relative; min-height: 0; overflow: hidden; border: 1px solid #1c3850; border-radius: 9px; background: #000; cursor: grab; touch-action: none; }
.teacher-panorama-viewport:active { cursor: grabbing; }
.teacher-panorama-zoom-layer { width: 100%; height: 100%; transform-origin: 0 0; will-change: transform; }
.teacher-panorama-zoom-layer .student-mini-chart { display: block; width: 100%; height: 100%; }
.teacher-panorama-zoom-layer .teacher-clear-candle-chart { width: auto !important; min-width: 0; height: 100%; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid rgba(66,219,226,.72); outline-offset: 2px; }

/* PlayStation-style launcher */
.home-dashboard { display: none; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 18px; padding: clamp(22px, 5vh, 58px) clamp(24px, 7vw, 110px) 20px; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(126,59,178,.22), transparent 33rem), linear-gradient(145deg, rgba(4,7,18,.78), rgba(2,3,10,.84)); }
body.home-active .app-shell > .topbar,
body.home-active .app-shell > .toolbar,
body.home-active .app-shell > .trainer-grid { display: none; }
body.home-active .home-dashboard { display: flex; }
body.home-active .review-dock-button { display: none; }
.home-dashboard-header, .home-dashboard-copy, .home-dashboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-brand-lockup { display: flex; align-items: center; gap: 15px; }
.home-brand-mark { display: grid; width: 48px; height: 48px; place-items: center; overflow: hidden; border: 1px solid rgba(191,117,255,.7); border-radius: 14px; color: transparent; background: #09070d url("assets/dragonking-logo.png") center / 145% no-repeat; box-shadow: 0 0 32px rgba(180,77,255,.26); font-size: 20px; font-weight: 900; }
.home-brand-lockup p { margin: 0 0 4px; color: var(--cyan); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.home-brand-lockup h1 { margin: 0; color: #f3f8ff; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.04em; }
.home-brand-lockup span { display: block; margin-top: 5px; color: #7891ab; font-size: 11px; }
.home-profile { display: flex; align-items: center; gap: 10px; min-width: 180px; padding: 8px 10px 8px 8px; border: 1px solid rgba(92,137,179,.34); border-radius: 14px; background: rgba(12,31,53,.75); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.home-profile-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(66,219,226,.72); border-radius: 50%; color: #062a2b; background: linear-gradient(135deg, #79e5e8, #35c8d0); font-weight: 900; }
.home-profile > div { display: grid; min-width: 0; gap: 3px; flex: 1; }
.home-profile strong { overflow: hidden; color: #f0f7ff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-profile span:not(.home-profile-avatar) { color: #7b91a8; font-size: 9px; }
.home-profile button { width: 31px; height: 31px; border: 1px solid #31516d; border-radius: 9px; color: #9cb5ca; background: rgba(16,39,63,.84); cursor: pointer; }
.home-profile button:hover { color: white; border-color: var(--cyan); background: rgba(38,96,125,.55); }
.home-dashboard-copy { padding: 0 4px; }
.home-kicker { display: inline-flex; align-items: center; gap: 7px; color: #81e5d0; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.home-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.home-dashboard-copy p { margin: 0; color: #6e859d; font-size: 10px; }
.home-carousel-shell { display: flex; min-height: 0; flex: 1 1 auto; align-items: center; gap: 14px; }
.home-tiles { display: flex; min-width: 0; height: 100%; flex: 1; align-items: center; gap: clamp(12px, 2vw, 26px); padding: 20px max(3vw, 12px) 28px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
.home-tiles::-webkit-scrollbar { display: none; }
.home-tile { position: relative; display: flex; flex: 0 0 clamp(205px, 19vw, 286px); aspect-ratio: .86; flex-direction: column; align-items: flex-start; justify-content: flex-end; padding: clamp(19px, 2.2vw, 30px); overflow: hidden; border: 1px solid rgba(86,133,173,.36); border-radius: 22px; color: #edf6ff; background: linear-gradient(155deg, rgba(19,49,79,.98), rgba(6,19,35,.98)); box-shadow: 0 20px 42px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.06); cursor: pointer; scroll-snap-align: center; text-align: left; transform: translateY(0) scale(.96); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, filter 180ms ease; }
.home-tile::before { position: absolute; top: -22%; right: -18%; width: 72%; height: 48%; border-radius: 50%; background: rgba(66,219,226,.14); content: ""; filter: blur(2px); transform: rotate(-25deg); }
.home-tile::after { position: absolute; right: -22%; bottom: -18%; width: 78%; height: 52%; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; content: ""; transform: rotate(-28deg); }
.home-tile:hover, .home-tile:focus-visible { border-color: rgba(111,219,238,.78); box-shadow: 0 26px 55px rgba(0,0,0,.42), 0 0 0 3px rgba(66,219,226,.09), inset 0 1px rgba(255,255,255,.09); filter: brightness(1.08); outline: none; transform: translateY(-8px) scale(1); }
.home-tile-training { background: linear-gradient(155deg, #1b65a1, #102f58 50%, #071729); }
.home-tile-room { background: linear-gradient(155deg, #176f71, #123e58 48%, #071a2b); }
.home-tile-review { background: linear-gradient(155deg, #5c438d, #30285c 48%, #10152d); }
.home-tile-ranking { background: linear-gradient(155deg, #8b6326, #4d3820 48%, #201a18); }
.home-tile-settings { background: linear-gradient(155deg, #465872, #26364c 48%, #111b2b); }
.home-tile-index { position: absolute; top: 19px; left: 24px; color: rgba(230,244,255,.55); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.home-tile-icon { position: absolute; top: 22px; right: 24px; display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 15px; color: #fff; background: rgba(0,0,0,.16); box-shadow: inset 0 1px rgba(255,255,255,.13); font-size: 24px; }
.home-tile-title, .home-tile-subtitle, .home-tile-cta { position: relative; z-index: 1; }
.home-tile-title { margin-top: auto; font-size: clamp(19px, 2vw, 26px); font-weight: 900; letter-spacing: -.04em; }
.home-tile-subtitle { min-height: 30px; margin-top: 7px; color: rgba(231,243,253,.72); font-size: 9px; line-height: 1.55; }
.home-tile-cta { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.16); color: #fff; font-size: 10px; font-weight: 800; }
.home-tile-cta b { font-size: 17px; font-weight: 400; }
.home-carousel-arrow { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(86,135,176,.42); border-radius: 50%; color: #b6d0e6; background: rgba(15,37,61,.86); cursor: pointer; font-size: 28px; line-height: 1; }
.home-carousel-arrow:hover { border-color: var(--cyan); color: #fff; background: rgba(28,78,108,.9); }
.home-dashboard-footer { padding: 0 4px; color: #5f7891; font-size: 9px; }
.home-dashboard-footer kbd { display: inline-grid; min-width: 18px; height: 18px; margin: 0 2px; place-items: center; border: 1px solid #2b4762; border-radius: 4px; color: #a9c1d5; background: #0b1d31; font-family: inherit; font-size: 9px; }

@media (max-width: 720px) {
  .home-dashboard { gap: 12px; padding: 22px 12px 14px; }
  .home-dashboard-header { align-items: flex-start; flex-direction: column; }
  .home-profile { align-self: stretch; }
  .home-dashboard-copy p { display: none; }
  .home-carousel-shell { gap: 5px; }
  .home-carousel-arrow { flex-basis: 32px; width: 32px; height: 32px; font-size: 22px; }
  .home-tiles { gap: 12px; padding-inline: 4px; }
  .home-tile { flex-basis: min(78vw, 285px); }
}

@media (max-width: 1180px) {
  .brand p { display: none; }
  .brand h1 { font-size: 17px; }
  .blind-badge { display: none; }
  .teacher-monitor-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .student-picker-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .top-nav-primary { margin-left: 0; }
  .toolbar { align-items: flex-start; flex-direction: column; overflow: hidden; }
  .timeframe-group, .chart-tools { width: 100%; overflow-x: auto; }
  .trainer-grid { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; min-height: 0; overflow: visible; }
  .chart-column { height: 70dvh; min-height: 520px; border-right: 0; }
  .side-panel { height: auto; max-height: none; grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .side-scroll { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .side-scroll .side-card, .side-scroll .account-card, .side-scroll .history-card { min-width: 0; }
  .order-card { display: block; position: static; margin: 0 10px 10px; overflow: visible; }
  .room-management { grid-template-columns: 1fr; }
  .room-management-heading { grid-column: auto; }
  .teacher-monitor-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Teacher room: compact game-style control deck. */
body.teacher-dashboard-active #teacherDialog .teacher-topline {
  grid-template-columns: 172px minmax(0, 1fr) !important;
  gap: 12px;
  align-items: stretch;
}
body.teacher-dashboard-active #teacherDialog .teacher-topline .teacher-summary-grid { display: none !important; }
body.teacher-dashboard-active #teacherDialog .teacher-dialog-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body.teacher-dashboard-active #teacherDialog .teacher-dialog-heading p { display: none; }
body.teacher-dashboard-active #teacherDialog .teacher-dialog-heading h2 { font-size: 18px; }
body.teacher-dashboard-active #teacherDialog .teacher-dialog-heading > div:last-child { display: grid; gap: 5px; }
body.teacher-dashboard-active #teacherDialog #closeTeacherButton { min-width: 116px; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  max-height: 78px;
  overflow: visible;
}
.teacher-student-slot-panel {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(110,231,216,.2);
  border-radius: 12px;
  background: rgba(7,25,38,.74);
}
.teacher-student-slot-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.teacher-student-slot-head strong { color: #eafffb; font-size: 10px; }
.teacher-student-slot-head span { color: #6ee7d8; font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.teacher-student-slot-head .teacher-student-all { margin-left: auto; min-width: 34px; height: 21px; padding: 0 6px; font-size: 8px; }
.teacher-student-slot-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.teacher-student-slot {
  display: grid;
  min-width: 0;
  min-height: 42px;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 2px 4px;
  padding: 3px 4px;
  border: 1px solid rgba(79,126,145,.28);
  border-radius: 8px;
  color: #cfe3e7;
  background: rgba(6,20,31,.76);
  cursor: pointer;
  text-align: left;
}
.teacher-student-slot > b { grid-row: 1 / -1; color: #6b8995; font: 700 8px ui-monospace, SFMono-Regular, Menlo, monospace; }
.teacher-student-slot > span:last-child { min-width: 0; overflow: hidden; color: #eafffb; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-student-slot.is-selected, .teacher-student-slot:hover { border-color: #6ee7d8; background: rgba(110,231,216,.16); }
.teacher-student-slot.is-muted { opacity: .45; }
.teacher-student-slot.is-empty { cursor: default; opacity: .55; }
.teacher-student-slot.is-empty span { color: #708894; }
.teacher-student-slot-avatar { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid #327a8a; border-radius: 5px; color: #06211e; background: #55d8d0; font-size: 8px; font-weight: 800; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon .teacher-panorama-filters { display: grid; align-content: center; min-width: 58px; max-width: 72px; }
.teacher-panorama-filters label { color: #8fa6b5; font-size: 8px; }
.teacher-panorama-filters select { width: 100%; min-height: 28px; }

body.teacher-dashboard-active #teacherDialog .competition-control {
  gap: 7px;
  padding: 0 0 0 10px;
  overflow-x: hidden;
  overflow-y: auto;
}
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-title { min-height: 46px; padding: 8px 11px; }
body.teacher-dashboard-active #teacherDialog .competition-title strong { font-size: 15px; }
body.teacher-dashboard-active #teacherDialog .competition-title span:last-child { font-size: 9px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active,
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-empty { gap: 7px; padding: 9px 10px; border-radius: 12px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active { grid-template-columns: 1fr; }
body.teacher-dashboard-active #teacherDialog .room-lobby-main strong { font-size: 21px; letter-spacing: .08em; }
body.teacher-dashboard-active #teacherDialog .room-lobby-code { grid-template-columns: auto 1fr auto; }
body.teacher-dashboard-active #teacherDialog .room-lobby-metrics { justify-content: space-between; font-size: 9px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-fold { flex: 0 0 auto; border-radius: 12px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-fold-summary { min-height: 42px; padding: 7px 10px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-fold-summary strong { font-size: 11px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-fold-summary small { font-size: 8px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-fold[open] { padding-bottom: 7px; }
body.teacher-dashboard-active #teacherDialog .room-builder,
body.teacher-dashboard-active #teacherDialog .room-management,
body.teacher-dashboard-active #teacherDialog .competition-actions { min-width: 0; width: auto; box-sizing: border-box; }
body.teacher-dashboard-active #teacherDialog .room-builder { display: grid; grid-template-columns: 1fr !important; gap: 7px; padding: 9px; }
body.teacher-dashboard-active #teacherDialog .room-builder-step { display: none; }
body.teacher-dashboard-active #teacherDialog .room-presets { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 4px; padding: 0; }
body.teacher-dashboard-active #teacherDialog .room-presets button { min-width: 0; padding: 0 4px; font-size: 9px; }
body.teacher-dashboard-active #teacherDialog .room-create-actions { display: grid; grid-template-columns: 1fr 1fr !important; gap: 6px; padding: 0; }
body.teacher-dashboard-active #teacherDialog .room-create-actions label { gap: 3px; color: #8fa6b5; font-size: 8px; }
body.teacher-dashboard-active #teacherDialog .room-create-actions input { height: 30px; min-height: 30px; font-size: 9px; }
.room-settings { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.room-settings label { display: grid; gap: 3px; color: #8fa6b5; font-size: 8px; }
.room-settings select { min-width: 0; min-height: 30px; padding: 0 6px; border: 1px solid #31516a; border-radius: 6px; color: #d9f6f3; background: #0a1b2c; font-size: 9px; }

/* Floating account card stays above the chart with a translucent glass surface. */
body.theme-peer .trainer-grid.side-panel-collapsed .side-scroll > .account-card,
body.theme-teacher .trainer-grid.side-panel-collapsed .side-scroll > .account-card,
.trainer-grid.side-panel-collapsed .side-scroll > .account-card {
  z-index: 1000 !important;
  border-color: rgba(255,255,255,.16) !important;
  background: rgba(28,28,30,.64) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.14) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.25) !important;
  backdrop-filter: blur(20px) saturate(1.25) !important;
}

/* 个人训练设置保持居中窄面板，避免在宽屏上横跨整页。 */
.personal-training-dialog {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(760px, 72vw) !important;
  max-width: calc(100vw - 40px) !important;
  height: auto !important;
  max-height: min(88dvh, 820px) !important;
  margin: auto !important;
  border: 1px solid #38383a !important;
  border-radius: 20px !important;
  background: #1c1c1e !important;
  box-shadow: 0 30px 100px rgba(0,0,0,.7) !important;
}
.personal-training-dialog::backdrop {
  background: rgba(0,0,0,.68) !important;
  backdrop-filter: blur(6px) !important;
}
.personal-training-dialog .teacher-dialog-shell {
  max-height: min(88dvh, 820px) !important;
  padding: 24px !important;
  overflow-y: auto !important;
}
@media (max-width: 600px) {
  .personal-training-dialog {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
  }
  .personal-training-dialog .teacher-dialog-shell { max-height: calc(100dvh - 20px) !important; padding: 16px !important; }
}

/* Chart canvas: TradingView-like neutral black. */
body.theme-peer .chart-stage,
body.theme-teacher .chart-stage,
.chart-stage,
.training-record-chart,
.teacher-panorama-frame,
.teacher-native-panorama-chart,
.teacher-panorama-viewport { background: #101010; }

/* Room exit controls stay visible on the active-room card. */
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-quick-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: grid;
  gap: 5px;
  align-content: center;
}
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-quick-actions .room-lobby-quick {
  grid-column: auto;
  grid-row: auto;
  min-width: 54px;
  min-height: 54px;
  border-color: #6ee7d8;
  color: #06211e;
  background: #6ee7d8;
  font-size: 11px;
  font-weight: 800;
}
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-delete {
  min-width: 54px;
  min-height: 26px;
  border: 1px solid rgba(255,96,115,.65);
  border-radius: 7px;
  color: #ff9aa7;
  background: rgba(255,96,115,.08);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-title { display: none; }
body.teacher-dashboard-active #teacherDialog .teacher-dialog-heading h2 { white-space: nowrap; }
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active { position: relative; grid-template-columns: 1fr auto; }
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-main,
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-code,
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-metrics { grid-column: 1; }
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active .room-lobby-quick { grid-column: 2; grid-row: 1 / span 3; min-width: 54px; min-height: 54px; border-color: #6ee7d8; color: #06211e; background: #6ee7d8; font-size: 11px; font-weight: 800; }
.training-interval-choice { grid-template-columns: repeat(6,minmax(0,1fr)) !important; gap: 6px; }
.training-interval-choice button { min-height: 48px; padding: 7px 8px; }
body.teacher-dashboard-active #teacherDialog .room-builder-footer { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; padding: 0; }
body.teacher-dashboard-active #teacherDialog .room-range-value { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
body.teacher-dashboard-active #teacherDialog .room-builder-footer #createRoomButton { min-width: 68px; height: 32px; padding: 0 12px; }
body.teacher-dashboard-active #teacherDialog .room-management { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 8px; }
body.teacher-dashboard-active #teacherDialog .room-management-heading { display: flex; justify-content: space-between; }
body.teacher-dashboard-active #teacherDialog .room-management-heading strong { font-size: 10px; }
body.teacher-dashboard-active #teacherDialog .room-management-heading span { font-size: 8px; }
body.teacher-dashboard-active #teacherDialog .room-roster-grid { grid-template-columns: repeat(2, minmax(0,1fr)); max-height: 120px; overflow-y: auto; }
body.teacher-dashboard-active #teacherDialog .room-roster-card { padding: 5px; }
body.teacher-dashboard-active #teacherDialog .room-roster-card em { display: none; }
body.teacher-dashboard-active #teacherDialog .competition-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; padding: 8px; }
body.teacher-dashboard-active #teacherDialog .competition-actions input { grid-column: 1 / -1; min-height: 30px; }
body.teacher-dashboard-active #teacherDialog .competition-actions button { min-width: 0; padding: 0 4px; font-size: 9px; }
body.teacher-dashboard-active #teacherDialog .competition-actions button[data-room-action="start"] { grid-column: auto; }
body.teacher-dashboard-active #teacherDialog .teacher-playback-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 72px 50px; gap: 5px; }
body.teacher-dashboard-active #teacherDialog .teacher-playback-actions select { min-width: 0; }
body.teacher-dashboard-active #teacherDialog #teacherLiveList { min-height: 0; }
body.teacher-dashboard-active #teacherDialog .teacher-panorama-head { display: none; }
body.teacher-dashboard-active #teacherDialog .teacher-overview-positions { display: none !important; }
.teacher-panorama-playback-hint { position: absolute; z-index: 12; left: 50%; bottom: 51px; padding: 3px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #f2f4f7; background: rgba(17,20,25,.86); box-shadow: 0 3px 12px rgba(0,0,0,.38); pointer-events: none; transform: translateX(-50%); font-size: 10px; font-weight: 700; white-space: nowrap; }
.teacher-panorama-playback-toggle { position: absolute; z-index: 12; left: 50%; bottom: 12px; display: grid; width: 58px; height: 34px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.82); border-radius: 999px; color: #16191d; background: linear-gradient(135deg, #f7f8fa, #aeb5bd); box-shadow: 0 5px 18px rgba(0,0,0,.52); cursor: pointer; pointer-events: auto; transform: translateX(-50%); font-size: 16px; font-weight: 900; line-height: 1; }
.teacher-panorama-playback-toggle:hover:not(:disabled) { filter: brightness(1.08); }
.teacher-panorama-playback-toggle:disabled { cursor: not-allowed; opacity: .45; }
.teacher-panorama-tools { position: absolute; z-index: 8; right: 10px; bottom: 10px; width: min(390px, 45%); border: 1px solid rgba(110,231,216,.28); border-radius: 10px; color: #d9f6f3; background: rgba(5,18,28,.72); box-shadow: 0 8px 22px rgba(0,0,0,.28); backdrop-filter: blur(10px); }
.teacher-panorama-tools > summary { padding: 5px 9px; color: #91b8c1; cursor: move; font-size: 9px; list-style: none; user-select: none; }
.teacher-panorama-tools > summary::-webkit-details-marker { display: none; }
.teacher-panorama-tools[open] > summary { border-bottom: 1px solid rgba(110,231,216,.16); color: #6ee7d8; }
.teacher-panorama-tools .teacher-panorama-overlay { padding: 6px; }
.teacher-panorama-tools .teacher-panorama-scrubber { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.teacher-panorama-tools .teacher-panorama-scrubber-head > div:first-child span,
.teacher-panorama-tools .teacher-panorama-scrubber-scale { display: none; }
.teacher-panorama-tools .teacher-panorama-scrubber-head { min-height: 24px; }
.teacher-panorama-tools .teacher-panorama-scrubber-head b { font-size: 8px; }
.teacher-panorama-tools .teacher-panorama-scrubber-actions button { height: 24px; padding: 0 7px; font-size: 8px; }
@media (max-width: 600px) {
  .app-shell { padding: 0; }
  .topbar { border-radius: 0; }
  .trainer-grid { border-radius: 0; }
  .side-scroll { grid-template-columns: 1fr; }
  .student-picker-list, .teacher-monitor-grid { grid-template-columns: 1fr; }
  .teacher-dialog { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .teacher-dialog-shell { max-height: 100dvh; padding: 12px; }
}

@media (max-width: 850px) {
  .competition-actions { grid-template-columns: 1fr 1fr; }
  .competition-actions input { grid-column: 1 / -1; }
  .room-create-actions { grid-template-columns: 1fr 1fr; }
  .room-create-actions { padding-left: 0; }
  .room-builder-footer { padding-left: 0; }
  .room-builder-footer #createRoomButton { flex: 1; }
  .room-invite-row { flex-wrap: wrap; }
  .room-invite-row select { flex-basis: 100%; }
  .teacher-table-head { display: none; }
  .teacher-user-row { grid-template-columns: 1fr 1fr; }
  .member-table-head + .teacher-user-list .teacher-user-row { grid-template-columns: 1fr 1fr; }
  .teacher-user-actions { grid-column: 1 / -1; }
  .member-create-panel { grid-template-columns: 1fr 1fr; }
  .member-create-panel > div, .member-create-panel .dialog-error { grid-column: 1 / -1; }
  .teacher-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .teacher-room-item { align-items: flex-start; flex-direction: column; }
  .teacher-room-actions { width: 100%; }
  .teacher-room-actions button { flex: 1; }
  .teacher-monitor-grid { grid-template-columns: 1fr; }
  .teacher-monitor-heading { align-items: flex-start; flex-direction: column; }
}

/* Compact teacher room lobby: two-row setup and two-row player grid. */
@media (min-width: 851px) {
  .teacher-room-workspace .room-builder {
    grid-template-columns: minmax(150px, .78fr) minmax(220px, 1.2fr) minmax(150px, .78fr) minmax(300px, 1.55fr);
    grid-template-areas:
      "step-one presets step-two dates"
      "range range range create";
    align-items: center;
    column-gap: 12px;
    row-gap: 7px;
    padding: 10px 12px;
  }
  .teacher-room-workspace .room-builder-step:nth-child(1) { grid-area: step-one; }
  .teacher-room-workspace .room-presets { grid-area: presets; padding-left: 0; }
  .teacher-room-workspace .room-builder-step:nth-child(3) { grid-area: step-two; }
  .teacher-room-workspace .room-create-actions { grid-area: dates; padding-left: 0; }
  .teacher-room-workspace .room-builder-footer { display: contents; }
  .teacher-room-workspace .room-range-value { grid-area: range; padding-left: 31px; }
  .teacher-room-workspace .room-builder-footer #createRoomButton { grid-area: create; justify-self: end; }
  .teacher-room-workspace .student-picker-list,
  .teacher-room-workspace .room-roster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .teacher-room-workspace .student-picker-list { max-height: 102px; }
}

@media (min-width: 851px) and (max-width: 1180px) {
  .teacher-room-workspace .student-picker-list,
  .teacher-room-workspace .room-roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Hide the sample/OHLC strip without changing chart or training logic. */
.quote-strip { display: none !important; }
.chart-column { grid-template-rows: minmax(0, 1fr) 29px; }

/* Merge the market/timeframe bar into the top header. */
.topbar > .toolbar {
  min-width: 0;
  min-height: 0;
  flex: 0 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.topbar > .toolbar .timeframe-group { min-width: max-content; gap: 5px; flex-wrap: nowrap; }
.topbar > .toolbar .chart-tools { display: none; }

@media (max-width: 900px) {
  .topbar { align-items: center; flex-wrap: wrap; gap: 7px 10px; }
  .topbar > .toolbar { width: 100%; order: -1; }
  .topbar > .toolbar .timeframe-group { width: 100%; overflow-x: auto; padding-bottom: 1px; }
}
.room-leaderboard-dialog { width: min(650px, calc(100vw - 30px)); }
.room-ranking-meta { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid #234057; border-radius: 8px; background: #0a1727; }
.room-ranking-meta span { color: #6edce2; font-size: 10px; }
.room-ranking-meta strong { color: #91a3b5; font-size: 9px; }
.room-ranking-head, .room-ranking-row { display: grid; grid-template-columns: minmax(180px, 1fr) 100px 75px 70px; align-items: center; gap: 8px; }
.room-ranking-head { padding: 0 10px; color: #718399; font-size: 9px; }
.room-ranking-list { display: grid; max-height: 440px; gap: 5px; overflow-y: auto; }
.room-ranking-list > p { padding: 25px; color: #718399; text-align: center; }
.room-ranking-row { padding: 10px; border: 1px solid #1f374f; border-radius: 8px; background: #0a1728; font-size: 10px; }
.room-ranking-row.me { border-color: rgba(52,211,220,.5); background: rgba(52,211,220,.06); }
.room-ranking-row em { display: inline-grid; min-width: 27px; height: 23px; margin-right: 8px; place-items: center; border-radius: 999px; color: #e8cd70; background: rgba(217,184,54,.09); font-style: normal; }
.room-ranking-row strong { color: #b9e9df; }
.room-invite-dialog form { text-align: center; }
.room-invite-dialog #roomInviteCountdown { display: block; margin: 14px 0; color: #6edce2; font-size: 20px; }
.live-ranking-float { position: fixed; z-index: 40; top: 50%; width: 170px; padding: 12px; border: 1px solid rgba(71,218,225,.38); border-radius: 14px; color: #dcecf3; background: rgba(4,18,32,.9); box-shadow: 0 18px 48px rgba(0,0,0,.4); backdrop-filter: blur(14px); transform: translateY(-50%); }
.live-ranking-float.left { left: 12px; }
.live-ranking-float.right { right: 12px; }
.live-ranking-float > strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #6edce2; font-size: 10px; letter-spacing: .08em; user-select: none; }
.live-ranking-float > strong > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.live-ranking-drag-handle { display: inline-grid; width: 17px; height: 17px; place-items: center; border: 1px solid rgba(110, 231, 216, .38); border-radius: 5px; color: #8df4e6; cursor: grab; font-size: 13px; font-style: normal; line-height: 1; letter-spacing: -.12em; }
.live-ranking-float.is-dragging .live-ranking-drag-handle { cursor: grabbing; }
.live-ranking-float div div { display: grid; grid-template-columns: 24px 1fr auto; gap: 6px; padding: 6px 0; border-top: 1px solid rgba(83,125,158,.2); font-size: 9px; }
.live-ranking-float div div.me { color: #7ff2c9; }
.room-archive-entry { padding: 11px; border: 1px solid #1f374f; border-radius: 8px; background: #0a1728; }
.room-archive-entry strong, .room-archive-entry span { display: block; }
.room-archive-entry span { margin-top: 4px; color: #8399aa; font-size: 9px; }
@media (max-width: 1100px) { .live-ranking-float { top: auto; bottom: 12px; width: 145px; transform: none; } }

.rectangle-settings-dialog { width: min(540px, calc(100vw - 28px)); padding: 0; border: 1px solid #38434e; border-radius: 13px; color: #e8edf1; background: #1e2227; box-shadow: 0 30px 100px rgba(0,0,0,.72); }
.rectangle-settings-dialog::backdrop { background: rgba(0,0,0,.67); backdrop-filter: none; }
.rectangle-settings-dialog form { display: grid; min-height: 520px; grid-template-rows: auto auto 1fr auto; }
.rectangle-dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 25px 10px; }
.rectangle-dialog-heading > div { display: flex; align-items: center; gap: 11px; }
.rectangle-dialog-heading h2 { margin: 0; font-size: 23px; }
.rectangle-icon { font-size: 27px; rotate: -12deg; }
.rectangle-dialog-heading button { border: 0; color: #dbe1e6; background: transparent; cursor: pointer; font-size: 36px; font-weight: 200; line-height: 1; }
.rectangle-tabs { display: flex; gap: 29px; margin: 0 25px; border-bottom: 1px solid #4b5056; }
.rectangle-tabs button { position: relative; padding: 13px 0 12px; border: 0; color: #aeb5bd; background: transparent; cursor: pointer; font-size: 14px; font-weight: 700; }
.rectangle-tabs button.active { color: white; }
.rectangle-tabs button.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; border-radius: 99px; background: #e8edf0; content: ""; }
.rectangle-tab-panel { display: grid; align-content: start; gap: 22px; min-height: 330px; padding: 28px 30px; }
.rectangle-tab-panel[hidden] { display: none; }
.settings-row { display: grid; grid-template-columns: 115px minmax(0, 1fr); align-items: center; gap: 20px; color: #e1e6ea; font-size: 14px; }
.settings-row > select, .style-control-group select, .coordinate-panel input, .stacked-setting textarea { border: 1px solid #4b525a; border-radius: 8px; outline: 0; color: #e9eef2; background: #262b30; }
.settings-row > select { height: 43px; padding: 0 13px; }
.style-control-group { display: flex; min-width: 0; align-items: center; gap: 8px; }
.style-control-group select { height: 38px; min-width: 82px; padding: 0 8px; }
.rectangle-color-picker { position: relative; flex: 0 0 auto; width: 51px; height: 38px; }
.rectangle-native-color-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rectangle-color-swatch { box-sizing: border-box; width: 51px; height: 38px; padding: 4px; border: 1px solid #515860; border-radius: 8px; background: #292e33; cursor: pointer; }
.rectangle-color-swatch::after { display: block; width: 100%; height: 100%; border-radius: 4px; content: ""; background: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); }
.rectangle-color-picker.is-open { z-index: 30; }
.rectangle-color-popover { position: absolute; z-index: 31; top: calc(100% + 8px); left: 0; display: none; width: 248px; padding: 10px; border: 1px solid #424b55; border-radius: 8px; background: #1b2025; box-shadow: 0 15px 35px rgba(0,0,0,.55); }
.rectangle-color-picker.is-open .rectangle-color-popover { display: block; }
.rectangle-color-popover-title { margin-bottom: 8px; color: #cbd2d9; font-size: 11px; font-weight: 700; }
.rectangle-color-grid { display: grid; grid-template-columns: repeat(9, 20px); gap: 5px; }
.rectangle-color-grid button { width: 20px; height: 20px; padding: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.rectangle-color-grid button:hover, .rectangle-color-grid button.selected { border-color: #fff; box-shadow: 0 0 0 1px #fff, inset 0 0 0 1px rgba(0,0,0,.18); }
.rectangle-custom-color-button { width: 100%; margin-top: 10px; padding: 7px 8px; border: 1px solid #4b555f; border-radius: 5px; color: #dbe2e8; background: #262c32; cursor: pointer; font-size: 11px; }
.rectangle-custom-color-button:hover { border-color: #8d9aa6; background: #303840; }
.check-label { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check-label input, .visibility-option input { width: 18px; height: 18px; accent-color: #edf1f4; }
.opacity-control { display: flex; flex: 1; align-items: center; gap: 8px; }
.opacity-control input { min-width: 90px; flex: 1; accent-color: #dfe5e8; }
.opacity-control output { min-width: 32px; color: #aeb7bf; font-size: 11px; }
.stacked-setting { display: grid; gap: 10px; color: #dfe5e9; font-size: 14px; }
.stacked-setting textarea { min-height: 120px; resize: vertical; padding: 12px; font: inherit; }
.coordinate-panel { grid-template-columns: 1fr 1fr; gap: 18px; }
.coordinate-panel label { display: grid; gap: 8px; color: #bfc8cf; font-size: 12px; }
.coordinate-panel input { height: 42px; padding: 0 11px; }
.visibility-option { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #444d55; border-radius: 9px; cursor: pointer; }
.visibility-option span { display: grid; gap: 4px; }
.visibility-option small { color: #8d99a4; }
.visibility-timeframe { display: flex; align-items: center; justify-content: space-between; padding: 13px; border-top: 1px solid #454c53; color: #aab4bc; }
.visibility-timeframe strong { padding: 5px 10px; border-radius: 6px; color: white; background: #343b42; }
.rectangle-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 25px; border-top: 1px solid #484e54; }
.rectangle-dialog-footer select { height: 40px; min-width: 125px; padding: 0 11px; border: 1px solid #525961; border-radius: 8px; color: #d9e0e5; background: #262b30; }
.rectangle-dialog-footer > div { display: flex; gap: 10px; }
.rectangle-dialog-footer button { min-width: 88px; height: 40px; border: 1px solid #d8dde0; border-radius: 8px; color: #e7ecef; background: transparent; cursor: pointer; font-size: 14px; }
.rectangle-dialog-footer .confirm-rectangle-settings { border-color: #f1f3f4; color: #171a1d; background: #f1f3f4; }

.relation-note-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; overflow: visible; border: 3px solid #151515; border-radius: 18px; color: #151515; background: #fffdf4; box-shadow: 9px 10px 0 #151515, 0 35px 100px rgba(0,0,0,.65); }
.relation-note-dialog::backdrop { background: rgba(3,8,15,.72); backdrop-filter: blur(3px); }
.relation-note-dialog form { position: relative; display: grid; gap: 14px; padding: 25px; }
.manga-burst { position: absolute; top: -24px; right: 20px; padding: 8px 11px; border: 3px solid #151515; color: #151515; background: #ffdf4d; box-shadow: 4px 4px 0 #151515; font: 900 13px/1 ui-sans-serif, system-ui; rotate: 4deg; }
.relation-note-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.relation-note-heading small { font-weight: 900; letter-spacing: .12em; }
.relation-note-heading h2 { margin: 3px 0 0; font-size: 23px; }
.relation-note-heading button { border: 0; color: #151515; background: transparent; cursor: pointer; font-size: 31px; line-height: 1; }
.relation-note-summary { margin: 0; padding: 10px 12px; border: 2px dashed #151515; border-radius: 10px; background: #fff4b8; font-size: 12px; font-weight: 800; line-height: 1.5; }
.relation-note-dialog label { font-size: 12px; font-weight: 900; }
.relation-note-dialog textarea { min-height: 132px; padding: 12px; resize: vertical; border: 2px solid #151515; border-radius: 12px; outline: none; color: #151515; background: white; font: 13px/1.6 ui-sans-serif, system-ui; }
.relation-note-dialog textarea:focus { box-shadow: 4px 4px 0 #ffcf38; }
.relation-note-actions { display: flex; justify-content: flex-end; gap: 9px; }
.reason-preset-row { display: flex; align-items: center; gap: 8px; margin-top: -3px; color: #6f5a2b; font-size: 10px; font-weight: 700; }
.reason-preset-row button { padding: 6px 10px; border: 1px solid #d9a62a; border-radius: 6px; color: #5a3a00; background: #fff3c7; cursor: pointer; font-size: 10px; font-weight: 800; }
.reason-preset-row button:hover { border-color: #b77b00; color: #2f2100; background: #ffe59a; }
.relation-note-actions button { min-width: 92px; min-height: 39px; border: 2px solid #151515; border-radius: 9px; color: #151515; background: white; cursor: pointer; font-weight: 900; }
.relation-note-actions .relation-note-save { color: white; background: #151515; box-shadow: 3px 3px 0 #ffcf38; }
.order-reason-dialog { width: min(620px, calc(100vw - 28px)); }
.order-reason-dialog textarea { height: 72px; min-height: 72px; resize: none; }
.order-reason-actions { flex-wrap: wrap; }
.order-reason-actions button { flex: 1 1 150px; }
.order-reason-actions #skipOrderReasonButton { background: #fff4b8; }


@media (max-width: 600px) {
  .rectangle-tabs { gap: 18px; }
  .rectangle-tabs button { font-size: 12px; }
  .settings-row { grid-template-columns: 90px minmax(0, 1fr); }
  .coordinate-panel { grid-template-columns: 1fr; }
}

.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: 300px; padding: 10px 13px; border: 1px solid #2d4b63; border-radius: 9px; color: #cbd8e4; background: #112234; box-shadow: 0 15px 40px rgba(0,0,0,.45); font-size: 10px; opacity: 0; translate: 0 8px; pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; translate: 0 0; }

/* Compact chart workspace: keep the training controls in the right rail. */
.opens-toggle,
.candle-visibility-controls,
.toolbar-note,
.indicator-chip,
#entryNoteButton,
.notes-workbench {
  display: none !important;
}

@media (max-width: 720px) {
  .trainer-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }
  .chart-column {
    height: 100%;
    min-height: 450px;
    border-right: 1px solid rgba(79,119,151,.26);
    border-bottom: 0;
  }
  .side-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    max-height: 100%;
    padding: 0;
    overflow: hidden;
  }
  .side-scroll {
    overflow-y: auto;
    padding: 10px;
  }
  .order-card {
    order: initial;
    margin: 0 10px 10px;
  }
}

@media (max-width: 1100px) {
  .blind-badge, .toolbar-note, .indicator-chip { display: none; }
}

@media (max-width: 720px) {
  .app-shell { padding: 0; }
  .topbar { border-radius: 0; }
  .trainer-grid { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); height: auto; min-height: 0; border-radius: 0; overflow: hidden; }
  .chart-column { height: 100%; min-height: 450px; border-right: 1px solid var(--line); border-bottom: 0; }
  .side-panel { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: 100%; max-height: 100%; padding: 0; overflow: hidden; }
  .side-scroll { overflow-y: auto; overflow-x: hidden; padding: 10px; }
  .order-card { order: initial; margin: 0 10px 10px; }
}

@media (max-width: 560px) {
  .app-shell { padding: 0; }
  .topbar { padding: 0 10px; }
  .brand p, .secondary-button { display: none; }
  #playerButton, #leaderboardButton { display: inline-block; padding: 7px; font-size: 9px; }
  .brand h1 { font-size: 16px; }
  .primary-small { padding: 7px 9px; }
  .toolbar { padding: 5px 10px; }
  .chart-tools button { padding: 5px 8px; }
  .quote-strip span:last-child { display: none; }
  .chart-column { height: 58vh; min-height: 390px; }
}

/* Bitget-inspired palette: neutral dark surfaces with green profit and red risk. */
:root {
  --bg: #0b0e13;
  --surface: #151922;
  --surface-2: #1d222c;
  --surface-3: #10141b;
  --line: #2b313c;
  --line-soft: rgba(128, 140, 157, .24);
  --text: #f1f3f5;
  --muted: #8b93a1;
  --cyan: #29c7b5;
  --green: #16c784;
  --red: #f6465d;
  --orange: #ffab2e;
  --blue: #4d82ff;
  --gold: #f0b90b;
}

body { background: radial-gradient(circle at 50% -20%, rgba(31, 38, 52, .45), transparent 45%), var(--bg); }
.topbar { background: rgba(18, 21, 28, .96); border-color: var(--line); }
.toolbar { background: #10141b; border-color: var(--line); }
.trainer-grid, .chart-column, .side-panel { border-color: var(--line); }
.trainer-grid { background: #0e1218; }
.chart-stage { background: #000; }
.side-panel { background: linear-gradient(180deg, #11151d, #0d1016); }
.side-card, .order-card { background: linear-gradient(145deg, #171c24, #11151c); border-color: var(--line); }
.quote-strip, .chart-footer { background: #10141b; border-color: var(--line); }
.long-button { color: #061b14; background: linear-gradient(135deg, #17c98a, #0ea978); }
.short-button { color: #fff; background: linear-gradient(135deg, #f6465d, #c9364c); }
.order-card {
  padding: 0 10px 11px;
  border: 0;
  border-radius: 0;
  background: #101216;
  box-shadow: none;
}
.order-heading {
  min-height: 42px;
  margin: 0 -10px 10px;
  padding: 0 10px;
  border-bottom: 1px solid #252a33;
}
.order-heading h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #aab3c0; }
.order-heading .market-pill { margin-left: auto; padding: 0; border: 0; border-radius: 0; color: #dce2eb; background: transparent; font-size: 12px; font-weight: 700; }
.trade-side-buttons { margin-bottom: 10px; }
.trade-side-buttons button { min-height: 34px; font-size: 12px; }
.order-type-row, .order-quantity { margin-bottom: 10px; }
.order-type-row > label, .order-quantity > label { display: block; margin-bottom: 5px; color: #7f8a99; font-size: 10px; }
.order-type-row > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.order-type-row button, .size-presets button {
  min-height: 24px;
  border: 1px solid #29303a;
  border-radius: 4px;
  color: #b7c0cc;
  background: #11151b;
  font-size: 10px;
}
.order-type-row button.active { border-color: #13cfae; color: #061f1a; background: #18d7b4; }
.order-type-row button:disabled { opacity: .62; cursor: default; }
.quantity-control { display: grid; grid-template-columns: 28px 1fr 28px; gap: 5px; }
.quantity-control button, .quantity-control output, .quantity-control input {
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 1px solid #29303a;
  border-radius: 5px;
  color: #dce2eb;
  background: #1a1f27;
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.quantity-control input { width: 100%; padding: 0 6px; text-align: center; outline: none; }
.quantity-control input:focus { border-color: #18d7b4; box-shadow: 0 0 0 1px rgba(24,215,180,.25); }
.quantity-control button { cursor: pointer; color: #aab4c1; background: #202630; font-size: 17px; }
.quantity-control button:hover { background: #29313d; }
.order-card #sizeSlider { width: 100%; height: 3px; margin: 7px 0; accent-color: #18d7b4; }
.order-card #closeSizeSlider { width: 100%; height: 3px; margin: 7px 0; accent-color: #e05268; }
.size-presets { gap: 5px; }
.size-presets button { padding: 4px; }
.close-size-presets { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.size-presets button.active { border-color: #36404d; color: #fff; background: #202630; }
.risk-row { margin: 10px 0; border-color: #29303a; border-radius: 5px; background: #171c24; }
.risk-row em { border-color: #3c4653; color: #aeb8c4; }
.trade-buttons button, .next-button, .finish-button { border-radius: 5px; }
.partial-button, .close-button { min-height: 30px !important; font-size: 10px !important; }
.partial-button { background: linear-gradient(135deg, #c44b5b, #9f3041); }
.next-button, .primary-small { background: linear-gradient(135deg, #4d82ff, #3463d1); }
.finish-button, .close-button { color: #c8d0dc; background: #171d26; border-color: var(--line) !important; }
.toolbar button.active, .toolbar button.tool-active { border-color: var(--cyan); background: #145e57; }
.opens-toggle { min-height: 28px; padding: 0 10px; border: 1px solid #384352; border-radius: 8px; color: #b7c2d0; background: #151b24; cursor: pointer; font-size: 10px; font-weight: 800; }
.opens-toggle.active { border-color: var(--cyan); color: #e8fffb; background: rgba(41, 199, 181, .18); }
.candle-visibility-controls { display: flex; align-items: center; gap: 4px; }
.candle-visibility-button { min-height: 28px; padding: 0 8px; border: 1px solid #384352; border-radius: 7px; color: #aebaca; background: #151b24; cursor: pointer; font-size: 9px; white-space: nowrap; }
.candle-visibility-button:hover, .candle-visibility-button.active { border-color: var(--cyan); color: #e8fffb; background: rgba(41, 199, 181, .18); }
.indicator-chip { color: var(--gold); background: rgba(240, 185, 11, .08); }
.risk-row em { border-color: rgba(240, 185, 11, .5); color: #f0c74e; }
.student-choice:has(input:checked) { border-color: rgba(41, 199, 181, .65); background: rgba(41, 199, 181, .09); }
.toast { border-color: var(--line); color: #d9e1eb; background: #171d26; }

/* The record viewer must use the same viewport as the personal trainer. */
.training-record-viewer-dialog {
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.training-record-viewer-dialog .teacher-dialog-shell {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.training-record-chart {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  overflow: hidden !important;
}
.training-record-replay-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #000;
}
.training-record-replay-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.training-record-replay-stage canvas.is-panning { cursor: grabbing; }


/* Keep the rail beside the chart when the browser is narrowed. */
@media (max-width: 900px) {
  .app-shell {
    height: 100dvh;
    overflow: hidden;
  }
  .trainer-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr);
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
  .chart-column {
    height: 100%;
    min-height: 450px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .side-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    max-height: 100%;
    padding: 0;
    overflow: hidden;
  }
  .side-scroll {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
  }
  .order-card {
    display: block;
    order: initial;
    margin: 0 10px 10px;
    overflow: visible;
  }
}


/* Dense desktop chrome: more vertical room for the main chart. */
@media (min-width: 901px) {
  .app-shell {
    padding: 6px;
  }
  .topbar {
    min-height: 54px;
    gap: 10px;
    padding: 6px 10px;
  }
  .brand {
    gap: 8px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .brand p {
    margin-bottom: 1px;
    font-size: 7px;
  }
  .brand h1 {
    font-size: 16px;
  }
  .top-nav-primary .secondary-button {
    min-height: 30px;
    padding: 0 9px;
  }
  .secondary-button,
  .primary-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }
  .player-avatar {
    width: 22px;
    height: 22px;
  }
  .toolbar {
    min-height: 38px;
    gap: 8px;
    padding: 4px 10px;
  }
  .toolbar button {
    padding: 4px 9px;
  }
  .drawing-tools button {
    width: 26px;
    height: 26px;
  }
  .chart-column {
    grid-template-rows: 30px minmax(0, 1fr) 22px;
  }
  .quote-strip,
  .chart-footer {
    padding: 0 9px;
    font-size: 9px;
  }
  .side-scroll {
    gap: 7px;
    padding: 7px;
  }
  .side-card,
  .order-card {
    padding: 10px;
  }
  .drawing-manager-card {
    padding: 8px 9px;
  }
  .order-card {
    margin: 0 7px 7px;
  }
}


/* Remove secondary cards from the compact right rail. */
.drawing-manager-card,
.training-card {
  display: none !important;
}


/* Keep the compact workspace focused on the chart and trading controls. */
.chart-column {
  position: relative;
  display: block !important;
  height: calc(100dvh - 106px) !important;
  min-height: 0 !important;
}

.chart-column .chart-stage {
  position: absolute;
  inset: 30px 0 22px;
  height: auto !important;
}

.chart-column .quote-strip {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  display: flex;
  height: 30px;
}

.chart-column .chart-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 22px;
}

/* Room + PK workspace refresh: lighter hierarchy, stronger primary actions. */
.teacher-room-workspace {
  gap: 16px;
  padding: 22px;
}

.teacher-dialog:has(.teacher-room-workspace) {
  width: min(1220px, calc(100vw - 24px));
  border-color: rgba(110, 231, 216, .28);
  border-radius: 24px;
  background: linear-gradient(145deg, #081622 0%, #07111e 56%, #0b1221 100%);
  box-shadow: 0 34px 120px rgba(0, 0, 0, .78), 0 0 0 1px rgba(110, 231, 216, .04);
}

.teacher-dialog:has(.teacher-room-workspace)::backdrop {
  background: rgba(1, 7, 15, .84);
  backdrop-filter: blur(12px) saturate(1.12);
}

.teacher-room-workspace .teacher-dialog-heading {
  padding: 2px 2px 4px;
}

.teacher-room-workspace .teacher-dialog-heading p {
  margin-bottom: 6px;
  color: #6ee7d8;
  font-size: 9px;
  letter-spacing: .2em;
}

.teacher-room-workspace .teacher-dialog-heading h2 {
  color: #f3fbff;
  font-size: 25px;
  letter-spacing: -.03em;
}

.teacher-room-workspace .teacher-dialog-heading button:not(#closeTeacherButton) {
  border-color: rgba(110, 231, 216, .22);
  color: #a8c4cf;
  background: rgba(20, 40, 52, .7);
}

.teacher-room-workspace .competition-control {
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.teacher-room-workspace .teacher-room-lobby { min-height: 74px; }
.teacher-room-workspace .teacher-room-lobby-active,
.teacher-room-workspace .teacher-room-lobby-empty { display: grid; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid rgba(110,231,216,.34); border-radius: 16px; background: linear-gradient(115deg, rgba(13,53,59,.96), rgba(8,28,43,.96)); box-shadow: inset 0 1px rgba(255,255,255,.05), 0 12px 28px rgba(0,0,0,.12); }
.teacher-room-workspace .teacher-room-lobby-active { grid-template-columns: minmax(230px,1fr) auto auto; }
.teacher-room-workspace .teacher-room-lobby-empty { grid-template-columns: auto 1fr auto; border-style: dashed; border-color: rgba(88,133,151,.42); background: rgba(7,24,38,.7); }
.room-lobby-main { display: grid; gap: 3px; }
.room-lobby-kicker { color: #70e4d3; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.room-lobby-main strong { color: #efffff; font-size: 19px; letter-spacing: -.03em; }
.room-lobby-main small, .teacher-room-lobby-empty small { color: #86a9b3; font-size: 9px; }
.room-lobby-code { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid rgba(110,231,216,.22); border-radius: 10px; background: rgba(0,0,0,.14); }
.room-lobby-code span { color: #86a9b3; font-size: 8px; }
.room-lobby-code b { color: #eafffb; font-size: 15px; letter-spacing: .12em; }
.room-lobby-code button { height: 25px; padding: 0 8px; border: 1px solid rgba(110,231,216,.35); border-radius: 7px; color: #9ff4e7; background: rgba(110,231,216,.08); cursor: pointer; font-size: 8px; }
.room-lobby-metrics { display: flex; gap: 12px; color: #82a1ad; font-size: 8px; }
.room-lobby-metrics b { display: block; margin-bottom: 2px; color: #dffbf7; font-size: 14px; }
.room-lobby-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(110,231,216,.42); border-radius: 11px; color: #8df4e6; background: rgba(110,231,216,.08); font-size: 24px; }
.teacher-room-lobby-empty div { display: grid; gap: 4px; }
.teacher-room-lobby-empty strong { color: #dff3f4; font-size: 12px; }
.teacher-room-lobby-empty em { color: #6e9ba4; font-size: 8px; font-style: normal; letter-spacing: .15em; }
.teacher-room-workspace .room-management { grid-template-columns: minmax(270px,.72fr) minmax(480px,1.28fr); }
.teacher-room-workspace .room-roster-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-bottom: 8px; }
.room-roster-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 8px 9px; border: 1px solid rgba(79,126,145,.3); border-radius: 10px; background: rgba(8,30,43,.78); }
.room-roster-player { display: flex; align-items: center; gap: 7px; min-width: 0; }
.room-roster-avatar { width: 24px; height: 24px; flex: 0 0 24px; font-size: 13px; }
.room-roster-player span { display: grid; min-width: 0; gap: 2px; }
.room-roster-player strong { overflow: hidden; color: #dff3f4; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.room-roster-player small { color: #7897a3; font-size: 7px; }
.room-roster-card em { font-size: 8px; font-style: normal; white-space: nowrap; }
.room-roster-card em.online { color: #73e6c5; }
.room-roster-card em.offline { color: #6e8492; }
.room-invite-caption { grid-column: 1 / -1; margin: 2px 0 -1px; color: #7897a3; font-size: 8px; }
.room-list-empty { padding: 18px 8px; color: #7897a3; font-size: 9px; text-align: center; }

.teacher-room-workspace .competition-title {
  position: relative;
  min-height: 78px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid rgba(110, 231, 216, .2);
  border-radius: 18px;
  background: radial-gradient(circle at 82% 0%, rgba(110, 231, 216, .14), transparent 34%), linear-gradient(135deg, rgba(16, 48, 55, .9), rgba(8, 24, 36, .92));
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.teacher-room-workspace .competition-title::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  width: 120px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, #6ee7d8);
  opacity: .7;
}

.teacher-room-workspace .competition-title span {
  color: #8ba8b4;
  font-size: 10px;
}

.teacher-room-workspace .competition-title b,
.teacher-room-workspace .competition-title i {
  color: #d5e8ee;
}

.teacher-room-workspace .competition-title strong {
  border-color: rgba(110, 231, 216, .52);
  color: #8df4e6;
  background: rgba(110, 231, 216, .08);
}

.teacher-room-workspace .room-builder {
  display: grid;
  grid-template-columns: minmax(220px, .78fr) minmax(360px, 1.22fr);
  gap: 14px 18px;
  padding: 18px;
  border-color: rgba(95, 146, 157, .3);
  border-radius: 18px;
  background: rgba(5, 20, 32, .76);
}

.teacher-room-workspace .room-builder-step:nth-child(1) { grid-column: 1; grid-row: 1; }
.teacher-room-workspace .room-presets { grid-column: 1; grid-row: 2; }
.teacher-room-workspace .room-builder-step:nth-child(3) { grid-column: 2; grid-row: 1; }
.teacher-room-workspace .room-create-actions { grid-column: 2; grid-row: 2; }
.teacher-room-workspace .room-builder-footer { grid-column: 1 / -1; }

.teacher-room-workspace .room-builder-step {
  align-items: flex-start;
  gap: 10px;
}

.teacher-room-workspace .room-step-number {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 0;
  color: #052523;
  background: linear-gradient(135deg, #8df4e6, #52c7ca);
  box-shadow: 0 6px 18px rgba(82, 199, 202, .22);
  font-size: 10px;
}

.teacher-room-workspace .room-builder-step strong {
  color: #e2f2f4;
  font-size: 12px;
}

.teacher-room-workspace .room-builder-step small {
  color: #7897a3;
  font-size: 9px;
}

.teacher-room-workspace .room-presets,
.teacher-room-workspace .room-create-actions,
.teacher-room-workspace .room-builder-footer {
  padding-left: 36px;
}

.teacher-room-workspace .room-presets button {
  height: 36px;
  padding: 0 15px;
  border-color: rgba(88, 133, 151, .42);
  border-radius: 10px;
  color: #9cb7c0;
  background: rgba(12, 34, 47, .86);
  font-size: 10px;
}

.teacher-room-workspace .room-presets button:hover,
.teacher-room-workspace .room-presets button.active {
  border-color: #6ee7d8;
  color: #eafffb;
  background: rgba(110, 231, 216, .13);
  box-shadow: 0 0 0 3px rgba(110, 231, 216, .06);
}

.teacher-room-workspace .room-create-actions label {
  gap: 6px;
  color: #7897a3;
  font-size: 9px;
}

.teacher-room-workspace .room-create-actions input {
  height: 42px;
  border-color: rgba(88, 133, 151, .42);
  border-radius: 10px;
  color: #e8f7f8;
  background: #091c2b;
  font-size: 11px;
}

.teacher-room-workspace .room-builder-footer {
  align-items: center;
  gap: 14px;
  margin-top: 2px;
}

.teacher-room-workspace .room-range-value {
  color: #86a5ae;
  font-size: 10px;
}

.teacher-room-workspace .room-builder-footer #createRoomButton {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  color: #04231f;
  background: linear-gradient(135deg, #8df4e6, #41cbb0);
  box-shadow: 0 10px 26px rgba(65, 203, 176, .2);
  font-size: 11px;
}

.teacher-room-workspace .room-management {
  grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.18fr);
  gap: 14px 18px;
  padding: 16px;
  border-color: rgba(95, 146, 157, .28);
  border-radius: 18px;
  background: rgba(5, 19, 31, .72);
}

.teacher-room-workspace .room-management-heading strong,
.teacher-room-workspace .student-picker-head strong {
  color: #e3f2f4;
  font-size: 12px;
}

.teacher-room-workspace .room-management-heading span,
.teacher-room-workspace .student-picker-head span {
  color: #7897a3;
  font-size: 9px;
}

.teacher-room-workspace .teacher-room-list {
  max-height: 196px;
}

.teacher-room-workspace .teacher-room-item {
  padding: 11px 12px;
  border-color: rgba(79, 126, 145, .28);
  border-radius: 12px;
  background: rgba(10, 31, 45, .78);
}

.teacher-room-workspace .teacher-room-item.current {
  border-color: rgba(110, 231, 216, .58);
  background: rgba(110, 231, 216, .08);
  box-shadow: inset 3px 0 #6ee7d8;
}

.teacher-room-workspace .teacher-room-meta strong {
  color: #dff3f4;
  font-size: 11px;
}

.teacher-room-workspace .teacher-room-actions button,
.teacher-room-workspace .student-picker-head button {
  height: 32px;
  border-color: rgba(88, 133, 151, .42);
  border-radius: 9px;
  background: rgba(11, 35, 49, .9);
  font-size: 9px;
}

.teacher-room-workspace .student-picker {
  gap: 10px;
  padding: 13px;
  border-color: rgba(110, 231, 216, .2);
  border-radius: 14px;
  background: rgba(7, 27, 39, .74);
}

.teacher-room-workspace .student-picker-list {
  max-height: 176px;
  gap: 7px;
}

.teacher-room-workspace .student-choice {
  padding: 9px;
  border-color: rgba(79, 126, 145, .3);
  border-radius: 11px;
  background: rgba(8, 30, 43, .8);
}

.teacher-room-workspace .student-choice:has(input:checked) {
  border-color: rgba(110, 231, 216, .68);
  background: rgba(110, 231, 216, .1);
  box-shadow: 0 0 0 3px rgba(110, 231, 216, .05);
}

.teacher-room-workspace .room-invite-row .invite-primary {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #8df4e6, #41cbb0);
  box-shadow: 0 8px 20px rgba(65, 203, 176, .16);
}

.teacher-room-workspace .competition-actions {
  grid-template-columns: minmax(230px, 1fr) repeat(6, minmax(74px, auto));
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(95, 146, 157, .24);
  border-radius: 16px;
  background: rgba(5, 18, 30, .66);
}

.teacher-room-workspace .competition-actions input,
.teacher-room-workspace .competition-actions button {
  height: 38px;
  border-color: rgba(88, 133, 151, .36);
  border-radius: 10px;
  font-size: 9px;
}

.teacher-room-workspace .competition-actions input {
  color: #e6f5f6;
  background: rgba(10, 32, 45, .86);
}

.teacher-room-workspace .competition-actions button[data-room-action="start"] {
  border: 0;
  background: linear-gradient(135deg, #8df4e6, #41cbb0);
}

.teacher-room-workspace .teacher-summary-grid div {
  padding: 13px 15px;
  border-color: rgba(79, 126, 145, .26);
  border-radius: 13px;
  background: rgba(9, 28, 42, .76);
}

.teacher-room-workspace .teacher-summary-grid strong {
  color: #e4f7f5;
  font-size: 18px;
}

.teacher-room-workspace .teacher-monitor-heading {
  padding: 4px 3px 0;
}

.teacher-room-workspace .teacher-monitor-heading strong {
  color: #e3f2f4;
  font-size: 14px;
}

.teacher-room-workspace .teacher-monitor-grid {
  gap: 11px;
}

.teacher-room-workspace .teacher-monitor-card {
  padding: 11px;
  border-color: rgba(79, 126, 145, .28);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(13, 37, 51, .92), rgba(7, 22, 35, .9));
}

.pk-invite-button {
  border: 0;
  border-radius: 999px;
  color: #fff3ff;
  background: linear-gradient(135deg, #a76cff, #e26dcb);
  box-shadow: 0 5px 14px rgba(178, 96, 226, .2);
  font-weight: 800;
}

.pk-invite-button:hover {
  background: linear-gradient(135deg, #bb86ff, #f27bd8);
  transform: translateY(-1px);
}

.room-invite-dialog {
  width: min(430px, calc(100vw - 28px));
  overflow: hidden;
  border-color: rgba(226, 109, 203, .38);
  border-radius: 26px;
  background: radial-gradient(circle at 15% 0%, rgba(167, 108, 255, .25), transparent 35%), linear-gradient(145deg, #17102b, #0f1528 72%);
  box-shadow: 0 34px 110px rgba(0, 0, 0, .75), 0 0 45px rgba(167, 108, 255, .12);
}

.room-invite-dialog::backdrop {
  background: rgba(8, 3, 22, .82);
  backdrop-filter: blur(14px) saturate(1.2);
}

.room-invite-dialog form {
  position: relative;
  gap: 14px;
  padding: 28px;
  text-align: center;
}

.room-invite-visual {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 2px;
  place-items: center;
  border: 1px solid rgba(226, 109, 203, .5);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #a76cff, #e26dcb);
  box-shadow: 0 14px 34px rgba(178, 96, 226, .28);
  font-size: 21px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: -.08em;
  rotate: -5deg;
}

.room-invite-visual span { rotate: 5deg; }
.room-invite-visual i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ffd86b; box-shadow: 30px -25px 0 #6ee7d8, -35px 20px 0 #f18bdb; }
.room-invite-dialog .dialog-heading { justify-content: center; }
.room-invite-dialog .dialog-heading p { color: #e29bff; letter-spacing: .18em; }
.room-invite-dialog .dialog-heading h2 { color: #fff7ff; font-size: 23px; letter-spacing: -.03em; }
.room-invite-dialog #roomInviteMessage { margin: 0; padding: 13px 15px; border: 1px solid rgba(226, 109, 203, .2); border-radius: 13px; color: #d8cbe4; background: rgba(255, 255, 255, .045); font-size: 11px; }
.room-invite-dialog #roomInviteCountdown { margin: 0; color: #ffd86b; font-size: 12px; font-weight: 700; }
.room-invite-dialog .dialog-actions { gap: 9px; margin-top: 4px; }
.room-invite-dialog .dialog-actions button { height: 43px; border-radius: 12px; border-color: rgba(183, 151, 219, .32); color: #cdbedb; background: rgba(255, 255, 255, .06); }
.room-invite-dialog .dialog-actions button:last-child { border: 0; color: #24102c; background: linear-gradient(135deg, #ffd86b, #ff9ecf); box-shadow: 0 10px 24px rgba(255, 158, 207, .18); }
.room-invite-dialog.is-peer-invite .room-invite-visual { border-color: rgba(110, 231, 216, .52); background: linear-gradient(145deg, #6ee7d8, #6e8cff); box-shadow: 0 14px 34px rgba(110, 160, 255, .25); }
.room-invite-dialog.is-peer-invite .dialog-heading p { color: #8eeaff; }

@media (max-width: 900px) {
  .teacher-room-workspace .room-builder,
  .teacher-room-workspace .room-management { grid-template-columns: 1fr; }
  .teacher-room-workspace .teacher-room-lobby-active,
  .teacher-room-workspace .teacher-room-lobby-empty { grid-template-columns: 1fr; }
  .teacher-room-workspace .room-builder-step:nth-child(1),
  .teacher-room-workspace .room-presets,
  .teacher-room-workspace .room-builder-step:nth-child(3),
  .teacher-room-workspace .room-create-actions,
  .teacher-room-workspace .room-builder-footer { grid-column: 1; grid-row: auto; }
  .teacher-room-workspace .room-presets,
  .teacher-room-workspace .room-create-actions,
  .teacher-room-workspace .room-builder-footer { padding-left: 0; }
  .teacher-room-workspace .competition-actions { grid-template-columns: 1fr 1fr; }
  .teacher-room-workspace .competition-actions input { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .teacher-room-workspace { padding: 14px; }
  .teacher-room-workspace .room-roster-grid { grid-template-columns: 1fr; }
  .teacher-room-workspace .competition-title { align-items: flex-start; flex-direction: column; gap: 10px; }
  .teacher-room-workspace .room-create-actions { grid-template-columns: 1fr; }
  .teacher-room-workspace .room-builder-footer { align-items: stretch; flex-direction: column; }
  .teacher-room-workspace .room-builder-footer #createRoomButton { width: 100%; }
  .teacher-room-workspace .competition-actions { grid-template-columns: 1fr; }
  .teacher-room-workspace .competition-actions input { grid-column: auto; }
  .room-invite-dialog form { padding: 24px 18px; }
}

/* Fold low-frequency teacher controls without taking away the quick actions. */
.teacher-room-fold[open] > .competition-actions { padding: 10px; border-top: 1px solid rgba(95, 146, 157, .2); border-radius: 0 0 14px 14px; }
.teacher-subfold { display: block; min-width: 0; }
.teacher-subfold > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid rgba(95, 146, 157, .28); border-radius: 10px; color: #d9eef0; background: rgba(6, 25, 38, .72); cursor: pointer; list-style: none; }
.teacher-subfold > summary::-webkit-details-marker { display: none; }
.teacher-subfold > summary > span { display: grid; min-width: 0; gap: 2px; }
.teacher-subfold > summary strong { color: #e3f2f4; font-size: 10px; }
.teacher-subfold > summary small { overflow: hidden; color: #7897a3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-subfold > summary > b { color: #8df4e6; font-size: 14px; transition: transform .18s ease; }
.teacher-subfold[open] > summary > b { transform: rotate(180deg); }
.teacher-room-workspace .teacher-subfold { grid-column: 2; }
.teacher-subfold[open] > .student-picker { margin-top: 8px; }
@media (min-width: 901px) {
  .teacher-room-workspace > .competition-control > .teacher-room-fold { min-width: 220px; flex: 0 0 auto; align-self: stretch; }
  .teacher-room-workspace > .competition-control > .teacher-room-fold[open] { flex: 0 0 auto; }
  .teacher-room-workspace > .competition-control > #teacherRoomBuilderFold[open] { flex-basis: 860px; }
  .teacher-room-workspace > .competition-control > #teacherRoomManagementFold[open] { flex-basis: 590px; }
  .teacher-room-workspace > .competition-control > #teacherRoomActionsFold[open] { flex-basis: 470px; }
  .teacher-room-workspace > .competition-control > .teacher-room-fold > .room-builder { min-width: 0; width: 100%; box-sizing: border-box; }
  .teacher-room-workspace > .competition-control > .teacher-room-fold > .room-management { min-width: 0; width: 100%; box-sizing: border-box; }
  .teacher-room-workspace > .competition-control > .teacher-room-fold > .competition-actions { min-width: 0; width: 100%; box-sizing: border-box; }
}
@media (max-width: 900px) {
  .teacher-room-workspace > .competition-control > .teacher-room-fold { min-width: 100%; flex: 1 1 100%; }
  .teacher-room-workspace > .competition-control > .teacher-room-fold > .room-builder,
  .teacher-room-workspace > .competition-control > .teacher-room-fold > .room-management,
  .teacher-room-workspace > .competition-control > .teacher-room-fold > .competition-actions { min-width: 0; width: 100%; box-sizing: border-box; }
  .teacher-room-workspace .teacher-subfold { grid-column: 1; }
}

/* Keep the brand lockup at the far left of the merged header. */
.topbar > .brand { order: -1; }
.topbar > .toolbar { order: 0; }
.topbar > .top-actions { order: 1; }
@media (max-width: 900px) {
  .topbar > .brand { order: 0; }
  .topbar > .toolbar { order: -1; }
  .topbar > .top-actions { order: 1; }
}

/* Fullscreen teacher command deck: compact controls above a dominant panorama. */
.teacher-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.teacher-dialog-shell.teacher-room-workspace {
  display: grid;
  height: 100%;
  max-height: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px 14px;
  box-sizing: border-box;
  overflow: hidden;
}
.teacher-room-workspace > .teacher-dialog-heading { min-height: 34px; }
.teacher-room-workspace > .teacher-dialog-heading h2 { font-size: 18px; }
.teacher-room-workspace > .competition-control {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.teacher-room-workspace > .competition-control > .competition-title {
  display: grid;
  min-width: 160px;
  flex: 0 0 160px;
  align-content: center;
  gap: 5px;
  padding: 0 5px;
}
.teacher-room-workspace > .competition-control > .competition-title > div { gap: 6px; }
.teacher-room-workspace > .competition-control > .teacher-room-lobby {
  min-width: 360px;
  flex: 1 0 360px;
}
.teacher-room-workspace > .competition-control > .teacher-room-lobby-active,
.teacher-room-workspace > .competition-control > .teacher-room-lobby-empty {
  height: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
}
.teacher-room-workspace > .competition-control > .room-builder {
  min-width: 520px;
  flex: 0 0 520px;
  box-sizing: border-box;
  padding: 7px 9px;
}
.teacher-room-workspace > .competition-control > .room-management {
  min-width: 590px;
  flex: 0 0 590px;
  grid-template-columns: 165px minmax(390px, 1fr);
  box-sizing: border-box;
  padding: 7px 9px;
}
.teacher-room-workspace > .competition-control > .room-management-heading { grid-column: 1 / -1; }
.teacher-room-workspace > .competition-control .teacher-room-list { max-height: 92px; }
.teacher-room-workspace > .competition-control .student-picker { gap: 5px; padding: 6px; }
.teacher-room-workspace > .competition-control .student-picker-list,
.teacher-room-workspace > .competition-control .room-roster-grid { max-height: 58px; gap: 4px; }
.teacher-room-workspace > .competition-control .student-choice,
.teacher-room-workspace > .competition-control .room-roster-card { padding: 4px 6px; }
.teacher-room-workspace > .competition-control .student-choice-avatar,
.teacher-room-workspace > .competition-control .room-roster-avatar { width: 20px; height: 20px; }
.teacher-room-workspace > .competition-control .room-invite-row { gap: 4px; }
.teacher-room-workspace > .competition-control > .competition-actions {
  min-width: 470px;
  flex: 0 0 470px;
  align-content: center;
}
.teacher-room-workspace > .teacher-summary-grid,
.teacher-room-workspace > .teacher-monitor-heading,
.teacher-room-workspace > .teacher-room-list { display: none; }
.teacher-room-workspace > #teacherLiveList {
  display: flex;
  min-height: 0;
  max-height: none;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.teacher-room-workspace > #teacherLiveList > .teacher-panorama-card {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 10px;
}
.teacher-room-workspace > #teacherLiveList .teacher-panorama-head { margin-bottom: 6px; }
.teacher-room-workspace > #teacherLiveList .teacher-panorama-frame {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
}
.teacher-room-workspace > #teacherLiveList .teacher-overview-positions {
  max-height: 42px;
  margin-top: 6px;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .teacher-dialog-shell.teacher-room-workspace { overflow-y: auto; }
  .teacher-room-workspace > .competition-control { flex-wrap: wrap; overflow: visible; }
  .teacher-room-workspace > .competition-control > .competition-title,
  .teacher-room-workspace > .competition-control > .teacher-room-lobby,
  .teacher-room-workspace > .competition-control > .room-builder,
  .teacher-room-workspace > .competition-control > .room-management,
  .teacher-room-workspace > .competition-control > .competition-actions { min-width: 100%; flex-basis: 100%; }
  .teacher-room-workspace > #teacherLiveList { min-height: 60dvh; }
}

/* Narrow browsers must fit the right edge; never leave the room controls wider than the viewport. */
.teacher-room-workspace .room-create-actions { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) {
  .teacher-room-workspace > .competition-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    overflow: visible;
  }
  .teacher-room-workspace > .competition-control > *,
  .teacher-room-workspace > .competition-control > .competition-title,
  .teacher-room-workspace > .competition-control > .teacher-room-lobby,
  .teacher-room-workspace > .competition-control > .room-builder,
  .teacher-room-workspace > .competition-control > .room-management,
  .teacher-room-workspace > .competition-control > .competition-actions {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    flex: none !important;
    box-sizing: border-box;
  }
  .teacher-room-workspace > .competition-control > .room-builder,
  .teacher-room-workspace > .competition-control > .room-management {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .teacher-room-workspace .room-builder-step:nth-child(1),
  .teacher-room-workspace .room-presets,
  .teacher-room-workspace .room-builder-step:nth-child(3),
  .teacher-room-workspace .room-create-actions,
  .teacher-room-workspace .room-builder-footer {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

/* Prevent the horizontal command deck cards from colliding at narrow widths. */
.teacher-room-workspace > .competition-control > .competition-title {
  min-width: 195px;
  flex: 0 0 195px;
}
.teacher-room-workspace > .competition-control > .teacher-room-lobby {
  min-width: 440px;
  flex: 0 0 440px;
}
.teacher-room-workspace > .competition-control > .teacher-room-lobby-active {
  grid-template-columns: minmax(210px, 1fr) auto auto;
}
.teacher-room-workspace > .competition-control > .room-builder {
  min-width: 860px;
  flex: 0 0 860px;
  grid-template-areas: "step-one presets step-two dates create";
  grid-template-columns: 150px 220px 150px 300px 1fr;
  grid-template-rows: 1fr;
  align-items: center;
}
.teacher-room-workspace > .competition-control .room-builder-footer { display: contents; }
.teacher-room-workspace > .competition-control .room-range-value { display: none; }
.teacher-room-workspace > .competition-control .room-builder-footer #createRoomButton {
  grid-area: create;
  justify-self: stretch;
  min-width: 160px;
}
.teacher-room-workspace > .competition-control > .room-management {
  min-width: 650px;
  flex: 0 0 650px;
  grid-template-columns: 180px minmax(430px, 1fr);
}
.teacher-room-workspace > .competition-control > .competition-actions {
  min-width: 500px;
  flex: 0 0 500px;
}

/* Teacher backend is a page view, not a floating overlay. */
body.teacher-dashboard-active .app-shell { display: none; }
body.teacher-dashboard-active #teacherDialog {
  position: static;
  display: block;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
body.teacher-dashboard-active #teacherDialog::backdrop { display: none; }

/* Teacher accounts use the right rail as a supervision console instead of an order ticket. */
.teacher-sidebar-panel[hidden] { display: none !important; }
.side-panel.teacher-sidebar-mode {
  display: block;
  min-width: 0;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.side-panel.teacher-sidebar-mode .side-scroll,
.side-panel.teacher-sidebar-mode .order-card { display: none !important; }
.teacher-sidebar-panel {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 10px;
  color: #dce8f1;
}
.teacher-sidebar-heading,
.teacher-sidebar-section-title,
.teacher-sidebar-room,
.teacher-sidebar-student,
.teacher-sidebar-action-grid,
.teacher-sidebar-dates {
  display: flex;
  align-items: center;
}
.teacher-sidebar-heading {
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 5px;
  border-bottom: 1px solid rgba(94, 137, 162, .28);
}
.teacher-sidebar-heading span,
.teacher-sidebar-heading > div > span {
  display: block;
  color: #6ee7d8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
}
.teacher-sidebar-heading h2 { margin: 3px 0 0; font-size: 16px; }
.teacher-sidebar-heading em,
.teacher-sidebar-status {
  padding: 4px 7px;
  border: 1px solid #31536a;
  border-radius: 999px;
  color: #9fb5c5;
  background: #0b1b29;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.teacher-sidebar-status.is-running { color: #6ee7d8; border-color: #1e9d93; }
.teacher-sidebar-status.is-paused { color: #ffc857; border-color: #92732a; }
.teacher-sidebar-status.is-open { color: #8bb8ff; border-color: #315c9a; }
.teacher-sidebar-room,
.teacher-sidebar-builder,
.teacher-sidebar-actions {
  padding: 10px;
  border: 1px solid #21445b;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(10, 39, 54, .9), rgba(8, 23, 36, .92));
}
.teacher-sidebar-room { flex-wrap: wrap; gap: 4px 8px; }
.teacher-sidebar-room > div { min-width: 0; flex: 1 1 auto; }
.teacher-sidebar-room small,
.teacher-sidebar-section-title small,
.teacher-sidebar-student small { display: block; color: #8199aa; font-size: 9px; }
.teacher-sidebar-room strong { display: block; margin-top: 2px; color: #f3fbff; font: 700 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.teacher-sidebar-room button,
.teacher-sidebar-presets button,
.teacher-sidebar-action-grid button,
.teacher-sidebar-panorama {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #28516b;
  border-radius: 7px;
  color: #b5cbd8;
  background: #0b2030;
  font-size: 10px;
  cursor: pointer;
}
.teacher-sidebar-room button:disabled { opacity: .4; cursor: default; }
.teacher-sidebar-room p { flex: 0 0 100%; margin: 3px 0 0; color: #8199aa; font-size: 9px; }
.teacher-sidebar-section-title { justify-content: space-between; gap: 8px; }
.teacher-sidebar-section-title strong { color: #eaf6fc; font-size: 11px; }
.teacher-sidebar-builder { display: grid; gap: 8px; }
.teacher-sidebar-dates { gap: 6px; }
.teacher-sidebar-dates label { min-width: 0; flex: 1; color: #8098aa; font-size: 9px; }
.teacher-sidebar-dates input { display: block; width: 100%; min-width: 0; margin-top: 4px; padding: 6px 5px; border: 1px solid #24485e; border-radius: 6px; color: #d9e8f0; background: #081b2a; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.teacher-sidebar-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.teacher-sidebar-presets button.active { border-color: #48d8ca; color: #eafffc; background: rgba(37, 190, 176, .2); }
.teacher-sidebar-primary { min-height: 32px; border: 0; border-radius: 7px; color: #06211e; background: linear-gradient(135deg, #78eadb, #39c7b8); font-size: 11px; font-weight: 800; cursor: pointer; }
.teacher-sidebar-primary:disabled { opacity: .48; cursor: default; }
.teacher-sidebar-students { display: grid; gap: 6px; max-height: 250px; overflow-y: auto; }
.teacher-sidebar-students > p { margin: 4px 2px; color: #8199aa; font-size: 10px; text-align: center; }
.teacher-sidebar-student { justify-content: space-between; gap: 6px; padding: 7px; border: 1px solid #1f3b50; border-radius: 8px; background: rgba(7, 27, 42, .82); }
.teacher-sidebar-student.is-offline { opacity: .62; }
.teacher-sidebar-student-main { display: flex; min-width: 0; align-items: center; gap: 6px; }
.teacher-sidebar-student-main > span:last-child { min-width: 0; }
.teacher-sidebar-student-main strong { display: block; max-width: 105px; overflow: hidden; color: #dcecf3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-sidebar-avatar { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border: 1px solid #327a8a; border-radius: 7px; color: #06211e; background: #55d8d0; font-size: 10px; font-weight: 800; }
.teacher-sidebar-student-stats { display: flex; align-items: center; gap: 5px; }
.teacher-sidebar-student-stats b { min-width: 43px; color: #b8c9d3; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.teacher-sidebar-student-stats small { min-width: 39px; text-align: right; }
.teacher-sidebar-student-stats button { width: 22px; height: 22px; padding: 0; border: 1px solid #2a6172; border-radius: 50%; color: #6ee7d8; background: #092535; cursor: pointer; }
.teacher-sidebar-actions { display: grid; gap: 7px; margin-top: auto; }
.teacher-sidebar-actions input { width: 100%; box-sizing: border-box; padding: 7px 8px; border: 1px solid #24485e; border-radius: 6px; color: #d9e8f0; background: #081b2a; font-size: 10px; }
.teacher-sidebar-action-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.teacher-sidebar-action-grid button { min-width: 0; padding: 0 3px; font-size: 9px; }
.teacher-sidebar-action-grid button:disabled { opacity: .4; cursor: default; }
.teacher-sidebar-panorama { width: 100%; min-height: 32px; color: #eafffc; border-color: #188b86; background: rgba(27, 160, 150, .22); }
.teacher-sidebar-panorama:disabled { opacity: .45; cursor: default; }

@media (max-width: 900px) {
  .side-panel.teacher-sidebar-mode { padding: 8px; }
  .teacher-sidebar-students { max-height: none; }
}

/* Teacher dashboard: keep the panorama on the left and dock every control on the right. */
body.teacher-dashboard-active #teacherDialog .teacher-room-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "topline operations"
    "panorama operations"
    "archive-heading archive-heading"
    "archive-list archive-list";
  width: 100%;
  height: 100dvh;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: none;
}
body.teacher-dashboard-active #teacherDialog .teacher-room-workspace.teacher-operations-collapsed {
  grid-template-columns: minmax(0, 1fr) 0;
}
body.teacher-dashboard-active #teacherDialog .teacher-room-workspace.teacher-operations-collapsed .competition-control {
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
.teacher-operations-toggle { display: none; }
body.teacher-dashboard-active #teacherDialog #teacherOperationsToggle {
  position: absolute;
  z-index: 2200;
  top: 50%;
  right: 390px;
  display: grid;
  width: 42px;
  height: 72px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(110,231,216,.48);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: #a9fff4;
  background: rgba(7, 30, 43, .96);
  box-shadow: 0 7px 22px rgba(0,0,0,.38);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-50%);
  transition: none;
}
body.teacher-dashboard-active #teacherDialog #teacherOperationsToggle:hover { background: rgba(24,75,82,.98); }
body.teacher-dashboard-active #teacherDialog .teacher-room-workspace.teacher-operations-collapsed #teacherOperationsToggle {
  position: fixed;
  right: 0;
  border-right: 1px solid rgba(110,231,216,.48);
  border-radius: 8px 0 0 8px;
}
body.teacher-dashboard-active #teacherDialog #teacherOperationsToggle {
  pointer-events: auto !important;
}
body.teacher-dashboard-active #teacherDialog .teacher-topline { grid-area: topline; min-width: 0; }
body.teacher-dashboard-active #teacherDialog .teacher-topline {
  display: grid;
  grid-template-columns: minmax(145px, .55fr) minmax(280px, .9fr) minmax(260px, 1.3fr);
  align-items: center;
  gap: 10px;
}
body.teacher-dashboard-active #teacherDialog .teacher-topline .teacher-dialog-heading { min-height: 34px; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon { display: flex; min-width: 0; max-height: 48px; overflow: hidden; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon .teacher-student-strip { width: 100%; min-width: 0; margin: 0; padding: 5px 7px; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon .teacher-student-strip-list { max-height: 34px; overflow: hidden; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon .teacher-panorama-filters { display: flex; flex: 0 0 auto; max-width: 260px; }
body.teacher-dashboard-active #teacherDialog .teacher-panorama-head { display: none; }
body.teacher-dashboard-active #teacherDialog .competition-control {
  grid-area: operations;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0 0 0 12px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid rgba(110, 231, 216, .22);
  border-radius: 0;
  background: transparent;
}
body.teacher-dashboard-active #teacherDialog .teacher-topline .teacher-summary-grid {
  display: grid !important;
  min-width: 0;
  align-self: start;
}
body.teacher-dashboard-active #teacherDialog > .teacher-monitor-heading:not(:has(+ #teacherRoomArchiveList)) { display: none !important; }
body.teacher-dashboard-active #teacherDialog #teacherLiveList {
  grid-area: panorama;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}
body.teacher-dashboard-active #teacherDialog .teacher-monitor-heading:has(+ #teacherRoomArchiveList) {
  grid-area: archive-heading;
  align-self: end;
}
body.teacher-dashboard-active #teacherDialog #teacherRoomArchiveList {
  display: grid !important;
  grid-area: archive-list;
  min-width: 0;
  max-height: 74px;
  overflow-y: auto;
}
body.teacher-dashboard-active #teacherDialog .teacher-monitor-heading[hidden],
body.teacher-dashboard-active #teacherDialog #teacherRoomArchiveList[hidden] {
  display: none !important;
}
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-title,
body.teacher-dashboard-active #teacherDialog .competition-control > .teacher-room-lobby,
body.teacher-dashboard-active #teacherDialog .competition-control > .room-builder,
body.teacher-dashboard-active #teacherDialog .competition-control > .room-management,
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-actions {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
}
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-title {
  min-height: 58px;
  padding: 12px 14px;
}
body.teacher-dashboard-active #teacherDialog .competition-control > .teacher-room-lobby {
  min-height: 0;
}
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active,
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-empty {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 11px 12px;
}
body.teacher-dashboard-active #teacherDialog .room-lobby-code {
  grid-template-columns: auto 1fr auto;
}
body.teacher-dashboard-active #teacherDialog .room-lobby-metrics { justify-content: space-between; }
body.teacher-dashboard-active #teacherDialog .competition-control > .room-builder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 11px;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step:nth-child(1),
body.teacher-dashboard-active #teacherDialog .room-presets,
body.teacher-dashboard-active #teacherDialog .room-builder-step:nth-child(3),
body.teacher-dashboard-active #teacherDialog .room-create-actions,
body.teacher-dashboard-active #teacherDialog .room-builder-footer {
  grid-column: auto;
  grid-row: auto;
  padding-left: 0;
}
body.teacher-dashboard-active #teacherDialog .room-presets { gap: 5px; }
body.teacher-dashboard-active #teacherDialog .room-presets button { flex: 1 1 0; padding: 0 7px; }
body.teacher-dashboard-active #teacherDialog .room-create-actions { grid-template-columns: 1fr; }
body.teacher-dashboard-active #teacherDialog .room-create-actions input { height: 34px; }
body.teacher-dashboard-active #teacherDialog .room-builder-footer { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
body.teacher-dashboard-active #teacherDialog .room-builder-footer #createRoomButton { width: 100%; min-width: 0; }
body.teacher-dashboard-active #teacherDialog .competition-control > .room-management {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}
body.teacher-dashboard-active #teacherDialog .teacher-room-list { max-height: 88px; }
body.teacher-dashboard-active #teacherDialog .student-picker { padding: 8px; }
body.teacher-dashboard-active #teacherDialog .student-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 138px; }
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 2px;
}
body.teacher-dashboard-active #teacherDialog .competition-actions input { grid-column: 1 / -1; min-width: 0; }
body.teacher-dashboard-active #teacherDialog .competition-actions button { min-width: 0; padding: 0 6px; }
body.teacher-dashboard-active #teacherDialog .competition-actions button[data-room-action="start"] { grid-column: 1 / -1; }
body.teacher-dashboard-active #teacherDialog .teacher-summary-grid {
  gap: 0;
  padding: 3px 6px;
  border: 1px solid rgba(62,109,142,.34);
  border-radius: 9px;
  background: rgba(8,24,41,.72);
}
body.teacher-dashboard-active #teacherDialog .teacher-summary-grid div {
  min-height: 28px;
  padding: 4px 12px;
  border: 0;
  border-right: 1px solid rgba(62,109,142,.28);
  border-radius: 0;
  background: transparent;
}
body.teacher-dashboard-active #teacherDialog .teacher-summary-grid div:last-child { border-right: 0; }
body.teacher-dashboard-active #teacherDialog .teacher-summary-grid strong { font-size: 14px; }

/* Keep the trading side cards readable at the compact desktop width. */
.side-card h2, .order-card h2 { font-size: 16px; }
.account-total span, .summary-grid span, .position-grid span { font-size: 10px; }
.account-total strong { font-size: 18px; }
.account-card h3 { font-size: 13px; }
.summary-grid { gap: 10px; }
.summary-grid div { padding: 11px; }
.summary-grid strong { font-size: 15px; }
.position-grid { gap: 10px; margin-top: 14px; }
.position-grid strong { font-size: 13px; }
body.teacher-dashboard-active .live-ranking-float {
  display: none !important;
  right: 410px;
  left: auto;
  width: 170px;
}
body.teacher-dashboard-active .live-ranking-float.left { top: 86px; }
body.teacher-dashboard-active .live-ranking-float.right { top: 174px; }

@media (max-width: 1100px) {
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 34vw);
  }
body.teacher-dashboard-active .live-ranking-float { display: none; }
}

@media (max-width: 820px) {
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(520px, 1fr) auto auto;
    grid-template-areas:
      "topline"
      "operations"
      "panorama"
      "archive-heading"
      "archive-list";
    overflow-y: auto;
  }
  body.teacher-dashboard-active #teacherDialog .teacher-topline { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon { max-height: none; }
  body.teacher-dashboard-active #teacherDialog .teacher-topline .teacher-dialog-heading { min-width: 0; }
  body.teacher-dashboard-active #teacherDialog .competition-control {
    padding: 0;
    border-left: 0;
  }
}

/* Compact live student strip beside the teacher panorama. */
.teacher-panorama-head-right {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.teacher-panorama-layout {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 30%);
  gap: 10px;
}
.teacher-panorama-layout .teacher-panorama-frame {
  min-width: 0;
  height: auto;
}
.teacher-student-strip {
  display: grid;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border: 1px solid rgba(110, 231, 216, .24);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(8, 34, 43, .92), rgba(6, 22, 34, .96));
}
.teacher-student-strip-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}
.teacher-student-strip-head > div { display: grid; min-width: 0; gap: 3px; }
.teacher-student-strip-head strong { color: #eafffb; font-size: 11px; }
.teacher-student-strip-head span { overflow: hidden; color: #7897a3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-student-all {
  min-width: 42px;
  height: 27px;
  padding: 0 8px;
  border: 1px solid rgba(110, 231, 216, .36);
  border-radius: 7px;
  color: #a8d8d1;
  background: rgba(110, 231, 216, .07);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.teacher-student-all:hover, .teacher-student-all.active { border-color: #6ee7d8; color: #06211e; background: #6ee7d8; }
.teacher-student-strip-list {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  align-items: stretch;
  grid-template-columns: repeat(var(--student-count), minmax(0, 1fr));
  gap: 5px;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
}
.teacher-student-chip {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 6px;
  padding: 4px 5px;
  border: 1px solid rgba(79, 126, 145, .28);
  border-radius: 7px;
  color: #cfe3e7;
  background: rgba(7, 27, 42, .78);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.teacher-student-chip:hover { border-color: rgba(110, 231, 216, .7); transform: translateY(-1px); }
.teacher-student-chip.selected { border-color: #6ee7d8; background: rgba(110, 231, 216, .16); box-shadow: 0 0 0 2px rgba(110, 231, 216, .08); }
.teacher-student-chip.muted { opacity: .45; }
.teacher-student-chip-avatar {
  display: grid;
  width: clamp(22px, 2.2vw, 30px);
  height: clamp(22px, 2.2vw, 30px);
  place-items: center;
  border: 1px solid #327a8a;
  border-radius: 9px;
  color: #06211e;
  background: #55d8d0;
  font-size: clamp(10px, 1.2vw, 14px);
  font-weight: 800;
}
.teacher-student-chip-info { display: grid; width: 100%; min-width: 0; gap: 3px; text-align: left; }
.teacher-student-chip-info strong, .teacher-student-chip-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-student-chip-info strong { color: #eafffb; font-size: 8px; }
.teacher-student-chip-info small { color: #7897a3; font-size: 7px; }
.teacher-student-empty { display: grid; min-height: 100%; place-items: center; color: #7897a3; font-size: 9px; text-align: center; }
@media (max-width: 700px) {
  .teacher-panorama-head { align-items: stretch; flex-direction: column; }
  .teacher-panorama-head-right { width: 100%; justify-content: stretch; }
  .teacher-panorama-layout { grid-template-columns: 1fr; }
  .teacher-panorama-layout .teacher-panorama-frame { min-height: 260px; }
  .teacher-student-strip { min-height: 92px; }
  .teacher-student-strip-list { max-height: 92px; }
}

/* Final teacher-room redesign: prevent the right dock from creating narrow vertical text. */
body.teacher-dashboard-active #teacherDialog .room-builder {
  grid-template-areas: none !important;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  min-width: 0;
  align-items: start;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step > div {
  min-width: 0;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step strong,
body.teacher-dashboard-active #teacherDialog .room-builder-step small {
  display: block;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}
body.teacher-dashboard-active #teacherDialog .room-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding-left: 0;
}
body.teacher-dashboard-active #teacherDialog .room-presets button {
  width: 100%;
  min-width: 0;
}
body.teacher-dashboard-active #teacherDialog .room-create-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding-left: 0;
}
body.teacher-dashboard-active #teacherDialog .room-create-actions label,
body.teacher-dashboard-active #teacherDialog .room-create-actions input {
  min-width: 0;
}
body.teacher-dashboard-active #teacherDialog .room-builder-footer {
  min-width: 0;
  padding-left: 0;
}
body.teacher-dashboard-active #teacherDialog .room-builder-footer #createRoomButton {
  min-width: 0;
  white-space: normal;
}

@media (max-width: 820px) {
  body.teacher-dashboard-active #teacherDialog .room-create-actions {
    grid-template-columns: 1fr;
  }
  body.teacher-dashboard-active #teacherDialog .room-builder-step strong {
    font-size: 11px;
  }
}

/* Final room-builder layout: keep every setup field horizontal inside the right dock. */
body.teacher-dashboard-active #teacherDialog .competition-control > .room-builder {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  grid-template-areas: none !important;
  align-items: stretch !important;
  overflow: hidden;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step,
body.teacher-dashboard-active #teacherDialog .room-builder-step:nth-child(1),
body.teacher-dashboard-active #teacherDialog .room-builder-step:nth-child(3) {
  display: flex !important;
  width: 100%;
  min-width: 0;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 9px;
  grid-column: auto !important;
  grid-row: auto !important;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step > div {
  width: 0;
  min-width: 0;
  flex: 1 1 auto;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed;
}
body.teacher-dashboard-active #teacherDialog .room-builder-step strong,
body.teacher-dashboard-active #teacherDialog .room-builder-step small {
  display: block;
  width: auto;
  max-width: none;
  overflow: visible;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: normal;
  writing-mode: horizontal-tb !important;
}
body.teacher-dashboard-active #teacherDialog .room-presets,
body.teacher-dashboard-active #teacherDialog .room-create-actions,
body.teacher-dashboard-active #teacherDialog .room-builder-footer {
  width: 100%;
  min-width: 0;
  grid-column: auto !important;
  grid-row: auto !important;
  padding-left: 0 !important;
}
body.teacher-dashboard-active #teacherDialog .room-presets {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px;
}
body.teacher-dashboard-active #teacherDialog .room-presets button {
  min-width: 0;
  width: 100%;
  padding: 0 6px;
}
body.teacher-dashboard-active #teacherDialog .room-create-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px;
}
body.teacher-dashboard-active #teacherDialog .room-create-actions label,
body.teacher-dashboard-active #teacherDialog .room-create-actions input {
  min-width: 0;
  max-width: 100%;
}
body.teacher-dashboard-active #teacherDialog .room-create-actions input {
  box-sizing: border-box;
}
body.teacher-dashboard-active #teacherDialog .room-builder-footer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 7px;
}
body.teacher-dashboard-active #teacherDialog .room-range-value {
  display: block !important;
  min-width: 0;
  padding-left: 0 !important;
  line-height: 1.4;
  white-space: normal;
}
body.teacher-dashboard-active #teacherDialog .room-builder-footer #createRoomButton {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

@media (max-width: 390px) {
  body.teacher-dashboard-active #teacherDialog .room-create-actions {
    grid-template-columns: 1fr !important;
  }
  body.teacher-dashboard-active #teacherDialog .room-builder-step strong {
    font-size: 10px;
  }
}

/* TradingView-style floating drawing toolbar. */
.floating-drawing-toolbar {
  position: absolute;
  z-index: 18;
  top: 14px;
  left: 14px;
  display: flex;
  width: max-content;
  max-width: calc(100% - 28px);
  max-height: none;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(91, 135, 170, .62);
  border-radius: 10px;
  background: rgba(9, 18, 31, .94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .42), inset 0 1px rgba(255,255,255,.06);
  cursor: move;
  backdrop-filter: blur(12px) saturate(1.15);
  user-select: none;
}
.floating-drawing-toolbar button,
.floating-drawing-toolbar select {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #aebfd0;
  background: transparent;
  font-size: 16px;
  line-height: 26px;
  text-align: center;
}
.floating-drawing-toolbar button { cursor: pointer; }
.chart-type-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-right: 1px solid rgba(130, 151, 171, .26);
}
.chart-type-switch button { display: grid; place-items: center; }
.chart-type-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.chart-type-switch button.active { border-color: rgba(72, 146, 234, .86); color: #fff; background: rgba(44, 112, 203, .72); }
.floating-drawing-toolbar button.fib-tool { width: 34px; min-width: 34px; padding-inline: 3px; font-size: 10px; font-weight: 800; }
.floating-drawing-toolbar button:hover,
.floating-drawing-toolbar button.tool-active,
.floating-drawing-toolbar button.active {
  border-color: rgba(72, 146, 234, .86);
  color: #fff;
  background: rgba(44, 112, 203, .72);
}
.floating-drawing-toolbar .floating-drawing-drag-handle {
  color: #6e879e;
  cursor: grab;
  font-size: 13px;
  letter-spacing: -3px;
}
.floating-drawing-toolbar .floating-drawing-drag-handle:hover { color: #cfe5f7; background: rgba(100, 145, 183, .18); }
.floating-drawing-toolbar.is-dragging .floating-drawing-drag-handle { cursor: grabbing; }
.floating-drawing-toolbar select {
  width: 28px;
  height: 28px;
  outline: none;
  color: #b7c8d7;
  background: #101d2d;
  font-size: 0;
  cursor: pointer;
}
.floating-drawing-toolbar #floatingRectangleExtendSelect { display: none !important; }
.floating-drawing-toolbar select option { color: #d9e6f1; background: #101d2d; font-size: 11px; }
.floating-drawing-toolbar-toggle {
  position: absolute;
  z-index: 19;
  top: 14px;
  right: 62px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(91, 135, 170, .62);
  border-radius: 8px;
  color: #b7c8d7;
  background: rgba(9, 18, 31, .94);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  font-size: 16px;
  line-height: 28px;
  cursor: pointer;
  backdrop-filter: blur(12px) saturate(1.15);
}
.floating-drawing-toolbar-toggle:hover,
.floating-drawing-toolbar-toggle:focus-visible {
  border-color: rgba(72, 146, 234, .86);
  color: #fff;
  background: rgba(44, 112, 203, .72);
  outline: none;
}
.quick-trade-dock {
  position: absolute;
  z-index: 12;
  top: 0;
  right: auto;
  display: grid;
  width: 124px;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(91, 135, 170, .72);
  border-radius: 10px;
  background: rgba(9, 18, 31, .9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .38);
  backdrop-filter: blur(12px) saturate(1.15);
}
.quick-trade-dock[hidden],
.quick-trade-actions[hidden],
.quick-risk-button[hidden] { display: none; }
.quick-risk-button,
.quick-trade-actions button {
  width: 100%;
  min-height: 32px;
  padding: 6px 7px;
  border: 1px solid #385670;
  border-radius: 7px;
  color: #e4f3ff;
  background: #13263a;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.quick-risk-button { display: flex; align-items: center; justify-content: space-between; color: #b9cddd; font-size: 10px; }
.quick-risk-button strong { color: #ffe08a; font-size: 12px; }
.quick-risk-button:hover,
.quick-risk-button:focus-visible { border-color: #6ab7eb; outline: none; }
.quick-trade-actions { display: grid; gap: 6px; }
.quick-add-button { color: #e5f3ff !important; border-color: #438bc0 !important; background: #1a5276 !important; }
.quick-long-button { color: #06231b !important; background: linear-gradient(135deg, #35d6b7, #1fc66e) !important; }
.quick-short-button { color: #fff5f6 !important; background: linear-gradient(135deg, #ff6877, #df2947) !important; }
.quick-partial-button { color: #fff1f3 !important; border-color: rgba(255, 127, 143, .6) !important; background: #a44650 !important; }
.quick-close-button { color: #e8f3ff !important; border-color: #47708e !important; background: #172b40 !important; }
.quick-reverse-button { color: #ffe7a5 !important; border-color: rgba(255,190,69,.7) !important; background: linear-gradient(90deg, rgba(255,79,101,.28), rgba(255,187,55,.28), rgba(39,205,151,.28)) !important; }
.quick-trade-actions button:hover,
.quick-trade-actions button:focus-visible { filter: brightness(1.12); outline: none; }
@media (max-width: 720px) {
  .floating-drawing-toolbar { top: 8px; left: 8px; max-width: calc(100% - 16px); gap: 3px; padding: 4px; }
  .floating-drawing-toolbar button,
  .floating-drawing-toolbar select { width: 26px; min-width: 26px; height: 26px; line-height: 24px; }
  .floating-drawing-toolbar button.fib-tool { width: 32px; min-width: 32px; }
  .floating-drawing-toolbar-toggle { top: 8px; right: 8px; }
  .quick-trade-dock { right: auto; width: 108px; padding: 5px; }
}

/* Final narrow-screen guard: every teacher control stays inside the browser's right edge. */
.teacher-room-workspace > .competition-control > .room-builder .room-create-actions {
  grid-template-columns: minmax(0, 1fr) !important;
}
@media (max-width: 900px) {
  body.teacher-dashboard-active #teacherDialog,
  body.teacher-dashboard-active #teacherDialog .teacher-dialog-shell,
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace,
  body.teacher-dashboard-active #teacherDialog .competition-control {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  body.teacher-dashboard-active #teacherDialog .competition-control {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible !important;
  }
  body.teacher-dashboard-active #teacherDialog .competition-control > *,
  body.teacher-dashboard-active #teacherDialog .competition-control > .competition-title,
  body.teacher-dashboard-active #teacherDialog .competition-control > .teacher-room-lobby,
  body.teacher-dashboard-active #teacherDialog .competition-control > .room-builder,
  body.teacher-dashboard-active #teacherDialog .competition-control > .room-management,
  body.teacher-dashboard-active #teacherDialog .competition-control > .competition-actions {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    box-sizing: border-box;
  }
  body.teacher-dashboard-active #teacherDialog .competition-control > .room-builder,
  body.teacher-dashboard-active #teacherDialog .competition-control > .room-management {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
  }
  body.teacher-dashboard-active #teacherDialog .room-builder-step,
  body.teacher-dashboard-active #teacherDialog .room-presets,
  body.teacher-dashboard-active #teacherDialog .room-create-actions,
  body.teacher-dashboard-active #teacherDialog .room-builder-footer {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 0 !important;
  }
  body.teacher-dashboard-active #teacherDialog .room-create-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.teacher-dashboard-active #teacherDialog .room-create-actions input,
  body.teacher-dashboard-active #teacherDialog .room-create-actions label {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* 2026-09-25 minimal workspace — final visual layer */
:root {
  --bg: #050505;
  --surface: #0d0d0e;
  --surface-2: #151516;
  --surface-3: #09090a;
  --line: #2b2b2d;
  --line-soft: rgba(255,255,255,.09);
  --text: #f5f5f7;
  --muted: #8e8e93;
  --cyan: #f5f5f7;
  --blue: #f5f5f7;
}
body,
body.theme-peer,
body.theme-teacher,
body:not(.auth-gate) {
  color: var(--text);
  background: #050505 !important;
  background-image: none !important;
}
.app-shell { padding: 0; min-height: 600px; background: #050505; }
.topbar,
body.theme-peer .topbar,
body.theme-teacher .topbar {
  min-height: 64px;
  gap: 14px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: rgba(12,12,13,.88) !important;
  box-shadow: none;
  backdrop-filter: blur(28px) saturate(1.15);
}
.brand { gap: 9px; }
.brand-mark { width: 34px; height: 34px; border: 1px solid #303033; border-radius: 10px; filter: grayscale(1); }
.brand p { color: #8e8e93; font-size: 7px; letter-spacing: .18em; }
.brand h1 { font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.top-actions { justify-content: flex-end; }
.top-nav-primary { margin-left: 0; padding: 0; border: 0; background: transparent; }
.top-nav-context { padding-left: 8px; border-left-color: rgba(255,255,255,.1); }
.secondary-button,
.primary-small,
.top-nav-primary .main-menu-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #303033;
  border-radius: 999px;
  color: #d2d2d7;
  background: rgba(255,255,255,.035);
  box-shadow: none;
}
.secondary-button:hover,
.primary-small:hover,
.top-nav-primary .main-menu-button:hover { border-color: #68686d; color: #fff; background: rgba(255,255,255,.08); translate: none; }
.primary-small { color: #111; border-color: #f5f5f7; background: #f5f5f7; }
.player-avatar,
.player-avatar.admin-avatar { border-color: #55555a; color: #f5f5f7; background: #1c1c1e; box-shadow: none; }
.topbar > .toolbar { flex: 1 1 auto; }
.topbar > .toolbar .timeframe-group { gap: 2px; }
.toolbar button,
.toolbar .symbol-button {
  min-width: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  color: #8e8e93;
  background: transparent !important;
}
.toolbar button:hover { color: #f5f5f7; background: rgba(255,255,255,.07) !important; }
.toolbar button.active,
.toolbar button.tool-active { color: #111; background: #f5f5f7 !important; }
.toolbar-note,
.indicator-chip,
.chart-legend,
.shortcut-legend { display: none !important; }
.terminal-popover,
.chart-context-menu { border-color: #38383b; color: #f5f5f7; background: rgba(24,24,26,.96); box-shadow: 0 18px 60px rgba(0,0,0,.55); backdrop-filter: blur(24px); }
.terminal-popover button:hover,
.terminal-popover button.active,
.chart-context-menu button:hover { background: rgba(255,255,255,.08); }

.trainer-grid,
body.theme-peer .trainer-grid,
body.theme-teacher .trainer-grid {
  height: calc(100dvh - 64px);
  min-height: 0;
  grid-template-columns: minmax(0,1fr) 320px;
  border: 0;
  border-radius: 0;
  background: #000;
}
.side-panel-toggle { right: 319px; width: 18px; height: 46px; border-color: #3a3a3c; color: #d2d2d7; background: rgba(22,22,23,.9); box-shadow: none; }
.side-panel-toggle:hover { background: #252527; }
.trainer-grid.side-panel-collapsed .side-panel-toggle { border-color: #3a3a3c; }
.chart-column { display: block !important; height: 100% !important; border-right-color: rgba(255,255,255,.1); }
.chart-column .chart-stage { inset: 0 !important; height: 100% !important; }
.chart-column .quote-strip,
.chart-column .chart-footer { display: none !important; }
.chart-stage::after { background: rgba(255,255,255,.14); }
.price-scale-header { height: 30px; border-color: #303033; border-radius: 8px; color: #d2d2d7; background: rgba(10,10,10,.82); box-shadow: none; font-size: 12px; backdrop-filter: blur(14px); }
.active-indicator-legend { color: #aeaeb2; background: rgba(18,18,19,.66); backdrop-filter: blur(14px); }
.chart-zoom-controls { border-color: #303033; color: #d2d2d7; background: rgba(18,18,19,.72); box-shadow: none; backdrop-filter: blur(16px); }
.floating-drawing-toolbar { border-color: #3a3a3c !important; border-radius: 12px !important; background: rgba(24,24,26,.82) !important; box-shadow: 0 10px 36px rgba(0,0,0,.38) !important; backdrop-filter: blur(24px) saturate(1.1); }
.floating-drawing-toolbar button,
.floating-drawing-toolbar select { color: #aeaeb2 !important; border-color: transparent !important; background: transparent !important; }
.floating-drawing-toolbar button:hover,
.floating-drawing-toolbar button.tool-active { color: #fff !important; background: rgba(255,255,255,.1) !important; }
.draw-hint { color: #d2d2d7; border-color: #3a3a3c; background: rgba(22,22,23,.8); backdrop-filter: blur(18px); }
.selected-drawing-actions {
  position: absolute;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #3a3a3c;
  border-radius: 10px;
  background: rgba(24,24,26,.9);
  box-shadow: 0 10px 32px rgba(0,0,0,.42);
  backdrop-filter: blur(20px);
}
.selected-drawing-actions[hidden] { display: none !important; }
.selected-drawing-actions button,
.selected-drawing-delete,
.selected-drawing-delete.white-frame-delete {
  position: static;
  min-width: 56px;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #d2d2d7;
  background: transparent;
  box-shadow: none;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}
.selected-drawing-actions button:hover { color: #fff; background: rgba(255,255,255,.09); }
.selected-drawing-actions #selectedDrawingDeleteButton { color: #ff9f9a; }
.selected-drawing-actions #selectedDrawingLockButton.is-locked { color: #111; background: #f5f5f7; }

.side-panel,
body.theme-peer .side-panel,
body.theme-teacher .side-panel { border-left: 1px solid rgba(255,255,255,.09); background: rgba(16,16,17,.94); backdrop-filter: blur(28px); }
.side-scroll { gap: 8px; padding: 9px; }
.side-card,
.order-card { border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.025); box-shadow: none; }
.order-card { margin: 0 8px 8px; }
.card-fold-toggle,
.manager-toggle { border-color: #3a3a3c !important; color: #aeaeb2 !important; background: transparent !important; }
.drawing-item { grid-template-columns: 24px minmax(0,1fr) 24px 24px 24px; border-color: #2c2c2e; background: #141415; }
.drawing-item.selected { border-color: #8e8e93; background: #1c1c1e; }

/* 图表持续重绘时避免反复建立 backdrop-filter 合成层，保留面板颜色与层次。 */
.chart-stage .price-scale-header,
.chart-stage .active-indicator-legend,
.chart-stage .chart-zoom-controls,
.chart-stage .floating-drawing-toolbar,
.chart-stage .draw-hint,
.chart-stage .quick-trade-dock,
.chart-stage .selected-drawing-actions {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.teacher-sidebar-panel { gap: 9px; color: #f5f5f7; }
.side-panel.teacher-sidebar-mode { padding: 10px; }
.teacher-sidebar-heading { border-bottom-color: rgba(255,255,255,.1); }
.teacher-sidebar-heading span,
.teacher-sidebar-heading > div > span { color: #8e8e93; }
.teacher-sidebar-heading em,
.teacher-sidebar-status,
.teacher-sidebar-status.is-running,
.teacher-sidebar-status.is-paused,
.teacher-sidebar-status.is-open { color: #d2d2d7; border-color: #3a3a3c; background: #151516; }
.teacher-sidebar-room,
.teacher-sidebar-builder,
.teacher-sidebar-actions,
.teacher-sidebar-student { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.025); }
.teacher-sidebar-dates { display: grid; grid-template-columns: 1fr; gap: 8px; }
.teacher-sidebar-dates label { color: #8e8e93; }
.teacher-sidebar-dates input,
.teacher-sidebar-actions input { min-height: 36px; border-color: #3a3a3c; color: #f5f5f7; background: #111112; color-scheme: dark; }
.teacher-sidebar-room button,
.teacher-sidebar-presets button,
.teacher-sidebar-action-grid button,
.teacher-sidebar-panorama { border-color: #3a3a3c; color: #d2d2d7; background: #171718; }
.teacher-sidebar-presets button.active,
.teacher-sidebar-primary { color: #111; border-color: #f5f5f7; background: #f5f5f7; }
.teacher-sidebar-panorama { color: #f5f5f7; }
.teacher-sidebar-avatar { border-color: #55555a; color: #f5f5f7; background: #2c2c2e; }
.teacher-sidebar-student-stats button { border-color: #48484a; color: #f5f5f7; background: transparent; }

.home-dashboard { gap: 24px; padding: clamp(28px,6vh,72px) clamp(24px,7vw,120px); background: #050505 !important; }
.home-brand-mark { filter: grayscale(1); }
.home-brand-lockup p,
.home-kicker { color: #8e8e93; }
.home-brand-lockup h1 { color: #f5f5f7; font-size: clamp(30px,4vw,56px); font-weight: 650; letter-spacing: -.055em; }
.home-brand-lockup span,
.home-dashboard-copy p { color: #8e8e93; }
.home-carousel-arrow { display: none !important; }
.home-tiles { display: grid; height: auto; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 8px 0; overflow: visible; }
.home-tile,
.home-tile-training,
.home-tile-room,
.home-tile-review,
.home-tile-ranking,
.home-tile-settings {
  min-width: 0;
  aspect-ratio: 1.08;
  padding: clamp(18px,2vw,28px);
  border: 1px solid #2c2c2e;
  border-radius: 22px;
  color: #f5f5f7;
  background: #111112;
  box-shadow: none;
  transform: none;
}
.home-tile::before,
.home-tile::after { display: none; }
.home-tile:hover,
.home-tile:focus-visible { border-color: #636366; background: #18181a; box-shadow: none; filter: none; transform: translateY(-3px); }
.home-tile-icon { width: 42px; height: 42px; border-color: #3a3a3c; border-radius: 12px; color: #f5f5f7; background: #1c1c1e; box-shadow: none; font-size: 18px; }
.home-tile-subtitle { color: #8e8e93; }
.home-tile-cta { border-top-color: #2c2c2e; }
.home-profile { border-color: #2c2c2e; background: #111112; box-shadow: none; }

.risk-dialog,
.teacher-dialog,
.rectangle-settings-dialog { border-color: #38383b; color: #f5f5f7; background: #151516; box-shadow: 0 34px 120px rgba(0,0,0,.72); }
.risk-dialog::backdrop,
.teacher-dialog::backdrop,
.rectangle-settings-dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(12px); }
.admin-entry-button { color: #111 !important; border-color: #f5f5f7 !important; background: #f5f5f7 !important; font-weight: 700; }
.landes-identity-panel,
.member-create-panel,
.teacher-user-row,
.teacher-summary-grid,
.teacher-monitor-card { border-color: rgba(255,255,255,.1) !important; background: rgba(255,255,255,.025) !important; box-shadow: none !important; }
.landes-identity-options button { border-color: #3a3a3c !important; background: #111112 !important; }
.landes-identity-options button.active { color: #111 !important; border-color: #f5f5f7 !important; background: #f5f5f7 !important; }

body.teacher-dashboard-active #teacherDialog .teacher-room-workspace {
  grid-template-columns: minmax(0,1fr) 420px;
  padding: 12px;
  background: #080808;
}
body.teacher-dashboard-active #teacherDialog #teacherOperationsToggle { right: 420px; border-color: #3a3a3c; color: #d2d2d7; background: rgba(22,22,23,.94); }
body.teacher-dashboard-active #teacherDialog .competition-control { padding-left: 14px; border-left-color: rgba(255,255,255,.1); }
body.teacher-dashboard-active #teacherDialog .room-create-actions { display: grid; grid-template-columns: 1fr !important; gap: 9px; }
body.teacher-dashboard-active #teacherDialog .room-create-actions label { display: grid; gap: 5px; }
body.teacher-dashboard-active #teacherDialog .room-create-actions input { width: 100%; min-width: 0; height: 38px; color: #f5f5f7; border-color: #3a3a3c; background: #111112; color-scheme: dark; }
body.teacher-dashboard-active #teacherDialog .competition-title,
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active,
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-empty,
body.teacher-dashboard-active #teacherDialog .room-builder,
body.teacher-dashboard-active #teacherDialog .room-management,
body.teacher-dashboard-active #teacherDialog .competition-actions,
.teacher-room-fold { border-color: rgba(255,255,255,.1) !important; background: rgba(255,255,255,.025) !important; }
body.teacher-dashboard-active #teacherDialog .teacher-summary-grid { border-color: rgba(255,255,255,.1); background: transparent; }
body.teacher-dashboard-active #teacherDialog .teacher-summary-grid div { border-right-color: rgba(255,255,255,.1); }
.teacher-student-strip { border-color: rgba(255,255,255,.1); background: #111112; }
.teacher-student-all:hover,
.teacher-student-all.active { color: #111; border-color: #f5f5f7; background: #f5f5f7; }

@media (max-width: 1180px) {
  .brand p { display: none; }
  .brand h1 { font-size: 14px; }
  .top-nav-context { gap: 4px; }
  .secondary-button,.primary-small { padding: 0 9px; }
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace { grid-template-columns: minmax(0,1fr) 370px; }
  body.teacher-dashboard-active #teacherDialog #teacherOperationsToggle { right: 370px; }
}
@media (max-width: 900px) {
  .app-shell { overflow: auto; }
  .topbar { min-height: 104px; }
  .trainer-grid { height: calc(100dvh - 104px); grid-template-columns: minmax(0,1fr) 0; }
  .side-panel { position: absolute; z-index: 25; top: 0; right: 0; width: min(360px,92vw); transform: translateX(100%); }
  .trainer-grid:not(.side-panel-collapsed) .side-panel { transform: translateX(0); }
  .side-panel-toggle { right: 0; }
  .home-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* On narrow teacher screens, stack the full operations panel above the panorama. */
@media (max-width: 900px) {
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace {
    height: auto !important;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto minmax(520px, 1fr) auto auto !important;
    grid-template-areas:
      "topline"
      "operations"
      "panorama"
      "archive-heading"
      "archive-list";
    overflow-y: auto !important;
    overflow-x: hidden;
  }
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace.teacher-operations-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.teacher-dashboard-active #teacherDialog .teacher-room-workspace.teacher-operations-collapsed .competition-control {
    min-width: 0;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    visibility: visible;
  }
  body.teacher-dashboard-active #teacherDialog #teacherOperationsToggle { display: none !important; }
  body.teacher-dashboard-active #teacherDialog .competition-control {
    grid-area: operations;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-left: 0 !important;
    overflow: visible !important;
  }
  body.teacher-dashboard-active #teacherDialog #teacherLiveList {
    grid-area: panorama;
    min-width: 0;
    width: 100%;
  }
}

.room-ready-overlay[hidden],
.teacher-start-dock[hidden] { display: none !important; }
.trade-side-buttons[hidden] { display: none !important; }

.room-ready-overlay {
  position: absolute;
  z-index: 18;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(360px, calc(100% - 32px));
  gap: 10px;
  padding: 22px 24px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(99, 229, 201, .55);
  border-radius: 16px;
  background: rgba(5, 17, 29, .94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .08);
  text-align: center;
  backdrop-filter: blur(12px);
}
.room-ready-overlay strong { color: #e8ffff; font-size: 18px; letter-spacing: .04em; }
.room-ready-overlay span { color: #8daeb8; font-size: 12px; }
.room-ready-overlay.is-paused { border-color: rgba(255, 199, 77, .8); }
.room-ready-overlay.is-paused strong { color: #ffe3a0; }
.room-ready-button,
.teacher-unified-start-button {
  min-height: 42px;
  border: 1px solid rgba(111, 240, 215, .78);
  border-radius: 9px;
  color: #05221e;
  background: linear-gradient(135deg, #a4f7e8, #40cbb2);
  font-weight: 800;
  cursor: pointer;
}
.room-ready-button:hover,
.teacher-unified-start-button:hover { filter: brightness(1.08); }
.room-ready-button:disabled,
.teacher-unified-start-button:disabled { cursor: not-allowed; opacity: .48; filter: none; }

.teacher-room-workspace { position: relative; }
.teacher-start-dock {
  position: absolute;
  z-index: 35;
  top: 55%;
  left: 50%;
  display: grid;
  width: min(390px, calc(100% - 42px));
  gap: 8px;
  padding: 17px 18px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(99, 229, 201, .6);
  border-radius: 15px;
  background: rgba(5, 17, 29, .95);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .46), inset 0 1px rgba(255, 255, 255, .08);
  text-align: center;
  backdrop-filter: blur(12px);
}
.teacher-start-kicker { color: #6fe3ce; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.teacher-start-dock strong { color: #ebffff; font-size: 16px; }
.teacher-ready-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; min-height: 22px; }
.teacher-ready-pill { padding: 4px 8px; border: 1px solid rgba(126, 154, 169, .45); border-radius: 999px; color: #9aadb8; font-size: 10px; }
.teacher-ready-pill.is-ready { border-color: rgba(90, 229, 190, .65); color: #86f3d9; background: rgba(33, 127, 108, .22); }
.teacher-ready-pill.is-not-ready { color: #d8a1a7; background: rgba(116, 39, 53, .18); }
.teacher-unified-start-button { width: 100%; margin-top: 3px; }
.room-roster-card.is-ready { border-color: rgba(86, 224, 185, .65); }
.room-roster-card .room-ready-state { display: block; margin-top: 2px; color: #d59aa2; font-size: 10px; }
.room-roster-card.is-ready .room-ready-state { color: #7ce6cf; }

@media (max-width: 900px) {
  .teacher-start-dock { top: 52%; }
}

.room-teacher-message-dialog { width: min(430px, calc(100% - 28px)); }
.room-teacher-message-dialog #roomTeacherMessageText { margin: 18px 0; padding: 16px; border: 1px solid rgba(110, 231, 216, .34); border-radius: 10px; color: #e8ffff; background: rgba(9, 37, 48, .75); font-size: 15px; line-height: 1.7; text-align: center; }
.room-podium-dialog { width: min(720px, calc(100% - 28px)); border: 1px solid rgba(255, 214, 93, .5); border-radius: 20px; color: #eefcff; background: radial-gradient(circle at 50% 12%, rgba(103, 75, 30, .42), transparent 44%), #071421; box-shadow: 0 28px 90px rgba(0, 0, 0, .68); overflow: hidden; }
.room-podium-dialog::backdrop { background: rgba(2, 7, 13, .78); backdrop-filter: blur(6px); }
.room-podium-dialog form { position: relative; display: grid; gap: 15px; padding: 30px 28px 24px; overflow: hidden; }
.room-podium-heading { position: relative; z-index: 2; display: grid; gap: 5px; text-align: center; }
.room-podium-heading p { margin: 0; color: #f1d36c; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.room-podium-heading h2 { margin: 0; color: #fff5be; font-size: 29px; }
.room-podium-heading span { color: #99b5bd; font-size: 11px; }
.room-podium-list { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; min-height: 220px; padding: 42px 12px 0; }
.room-podium-card { display: grid; justify-items: center; gap: 7px; min-height: 132px; padding: 18px 10px 13px; border: 1px solid rgba(151, 191, 202, .3); border-radius: 14px 14px 5px 5px; background: linear-gradient(160deg, rgba(31, 65, 78, .9), rgba(9, 25, 39, .94)); text-align: center; }
.room-podium-card.rank-1 { min-height: 188px; border-color: rgba(255, 220, 99, .9); background: linear-gradient(160deg, rgba(126, 90, 27, .94), rgba(32, 35, 36, .96)); box-shadow: 0 0 34px rgba(255, 216, 92, .22); }
.room-podium-card.rank-2 { min-height: 158px; border-color: rgba(190, 214, 222, .65); }
.room-podium-card.rank-3 { min-height: 140px; border-color: rgba(203, 142, 98, .62); }
.room-podium-card .room-podium-rank { color: #fff0a5; font-size: 24px; font-weight: 900; }
.room-podium-card.rank-2 .room-podium-rank { color: #d8ecf2; }
.room-podium-card.rank-3 .room-podium-rank { color: #e7ae7d; }
.room-podium-card strong { max-width: 100%; overflow: hidden; color: #f2ffff; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.room-podium-card small { color: #9fb6bd; font-size: 10px; }
.room-podium-card b { color: #8af3d8; font-size: 15px; }
.room-podium-close { position: relative; z-index: 2; justify-self: center; min-width: 150px; min-height: 38px; border: 1px solid rgba(255, 216, 92, .68); border-radius: 8px; color: #332707; background: linear-gradient(135deg, #ffe89a, #d9a83c); font-weight: 800; cursor: pointer; }
.room-fireworks { position: absolute; z-index: 1; inset: 0; pointer-events: none; overflow: hidden; }
.room-fireworks i { position: absolute; top: 25%; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: #ffe98d; box-shadow: 0 0 10px 2px #ffe98d; animation: room-firework 1.8s ease-out infinite; animation-delay: var(--delay); transform: translate(-50%, -50%); }
.room-fireworks i:nth-child(3n) { background: #70e9d5; box-shadow: 0 0 10px 2px #70e9d5; }
.room-fireworks i:nth-child(4n) { background: #ff91b3; box-shadow: 0 0 10px 2px #ff91b3; }
@keyframes room-firework { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 16% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); } }
.teacher-ready-pill { display: inline-flex; align-items: center; gap: 5px; }
.teacher-ready-pill button { padding: 2px 5px; border: 1px solid rgba(255, 164, 174, .5); border-radius: 5px; color: #ffd6dc; background: rgba(122, 43, 55, .35); font-size: 9px; cursor: pointer; }
.teacher-ready-pill button:hover { border-color: #ff9daa; background: rgba(154, 48, 63, .55); }

@media (max-width: 600px) {
  .room-podium-dialog form { padding: 24px 12px 18px; }
  .room-podium-list { gap: 5px; padding-inline: 0; }
  .room-podium-card { padding-inline: 4px; }
  .room-podium-card strong { font-size: 11px; }
}

/* Apple-style readability pass: quieter surfaces, stronger type, fewer visual layers. */
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #151516;
  --line: #38383a;
  --line-soft: rgba(255,255,255,.12);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --cyan: #64d2ff;
  --green: #30d158;
  --red: #ff453a;
}

html { background: #000; }
body {
  color: #f5f5f7;
  background: #000;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: .005em;
}
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #64d2ff;
  outline-offset: 2px;
}

.app-shell { padding: 10px; background: #000; }
.topbar {
  min-height: 56px;
  padding: 8px 12px;
  border-color: #2c2c2e;
  border-radius: 14px;
  background: #111112 !important;
}
.brand { gap: 10px; }
.brand h1 { font-size: 17px; letter-spacing: -.025em; }
.top-actions { gap: 6px; }
.secondary-button, .primary-small, .top-nav-primary .main-menu-button {
  min-height: 38px;
  padding-inline: 13px;
  border-color: #3a3a3c;
  color: #f5f5f7;
  background: #1c1c1e;
  font-size: 13px;
}
.primary-small { color: #000; border-color: #f5f5f7; background: #f5f5f7; }
.secondary-button:hover, .primary-small:hover, .top-nav-primary .main-menu-button:hover {
  border-color: #8e8e93;
  background: #2c2c2e;
}
.primary-small:hover { background: #fff; }
.player-avatar, .player-avatar.admin-avatar { width: 34px; height: 34px; }

.trainer-grid, body.theme-peer .trainer-grid, body.theme-teacher .trainer-grid {
  background: #000;
}
.side-panel, body.theme-peer .side-panel, body.theme-teacher .side-panel {
  border-left-color: #2c2c2e;
  background: #111112;
}
.side-scroll { gap: 10px; padding: 10px; }
.side-card, .order-card {
  padding: 16px;
  border-color: #38383a;
  border-radius: 16px;
  background: #1c1c1e;
}
.side-card h2, .order-card h2 { font-size: 16px; letter-spacing: -.01em; }
.card-title-row, .order-heading { min-height: 28px; }
.card-fold-toggle, .manager-toggle { min-width: 32px; min-height: 32px; border-color: #48484a !important; }
.side-card label, .order-card label, .side-card small, .order-card small { color: #a1a1a6; font-size: 12px; }
.side-card strong, .order-card strong { font-size: 15px; }

.home-dashboard {
  gap: 28px;
  padding: clamp(28px, 7vh, 76px) clamp(18px, 7vw, 120px);
  background: #000 !important;
}
.home-dashboard-copy { max-width: 760px; }
.home-brand-lockup h1 { font-size: clamp(30px, 4vw, 54px); }
.home-dashboard-copy p { max-width: 620px; color: #a1a1a6; font-size: 15px; line-height: 1.65; }
.home-profile {
  min-width: 210px;
  min-height: 52px;
  padding: 8px 10px 8px 8px;
  border-color: #38383a;
  border-radius: 16px;
  background: #1c1c1e;
}
.home-profile-avatar { width: 38px; height: 38px; border-color: #64d2ff; color: #000; background: #64d2ff; }
.home-profile strong { font-size: 14px; }
.home-profile span:not(.home-profile-avatar) { color: #a1a1a6; font-size: 12px; }
.home-profile button { width: 36px; height: 36px; border-color: #48484a; border-radius: 10px; color: #f5f5f7; background: #2c2c2e; font-size: 16px; }
.home-profile button:hover { border-color: #8e8e93; background: #3a3a3c; }
.home-tiles { gap: 14px; }
.home-tile, .home-tile-training, .home-tile-room, .home-tile-review, .home-tile-ranking, .home-tile-settings {
  aspect-ratio: 1.08;
  padding: clamp(20px, 2.3vw, 30px);
  border-color: #38383a;
  border-radius: 20px;
  background: #1c1c1e;
}
.home-tile-training, .home-tile-room, .home-tile-review, .home-tile-ranking, .home-tile-settings { background: #1c1c1e; }
.home-tile:hover, .home-tile:focus-visible { border-color: #8e8e93; background: #2c2c2e; transform: translateY(-2px); }
.home-tile-index { color: #a1a1a6; font-size: 11px; }
.home-tile-icon { border-color: #48484a; color: #f5f5f7; background: #2c2c2e; }
.home-tile-title { font-size: clamp(19px, 2vw, 25px); }
.home-tile-subtitle { min-height: 42px; color: #a1a1a6; font-size: 13px; line-height: 1.55; }
.home-tile-cta { border-top-color: #38383a; color: #f5f5f7; font-size: 13px; }

.risk-dialog, .teacher-dialog, .rectangle-settings-dialog, .room-leaderboard-dialog, .leaderboard-dialog, .avatar-dialog {
  border-color: #48484a;
  border-radius: 18px;
  color: #f5f5f7;
  background: #1c1c1e;
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
}
.risk-dialog form, .teacher-dialog form { gap: 16px; padding: 24px; }
.dialog-heading p, .teacher-dialog-heading p { color: #64d2ff; font-size: 11px; letter-spacing: .12em; }
.dialog-heading h2, .teacher-dialog-heading h2 { font-size: 22px; letter-spacing: -.02em; }
.dialog-heading button, .teacher-dialog-heading button { color: #a1a1a6; }
.risk-dialog label, .teacher-dialog label { color: #d1d1d6; font-size: 13px; }
.risk-dialog input, .risk-dialog select, .teacher-dialog input, .teacher-dialog select, .teacher-dialog textarea {
  min-height: 42px;
  padding-inline: 12px;
  border-color: #48484a;
  border-radius: 10px;
  color: #f5f5f7;
  background: #2c2c2e;
  font-size: 15px;
}
.risk-dialog p, .teacher-dialog p { color: #a1a1a6; font-size: 13px; line-height: 1.6; }
.dialog-actions button, .auth-dialog button, .avatar-dialog button, .teacher-dialog button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
}
.auth-choice-panel { gap: 12px; padding: 8px 0; }
.auth-choice-panel button {
  min-height: 86px;
  border-color: #48484a;
  border-radius: 14px;
  color: #f5f5f7;
  background: #2c2c2e;
}
.auth-choice-panel button:hover { border-color: #64d2ff; background: #3a3a3c; }
.auth-choice-panel strong { font-size: 17px; }
.auth-choice-panel span { color: #a1a1a6; font-size: 12px; }
.member-admin-button, .admin-entry-button {
  min-height: 42px;
  font-size: 13px !important;
}
.admin-entry-button { color: #000 !important; border-color: #f5f5f7 !important; background: #f5f5f7 !important; }
.logout-button { min-height: 42px; font-size: 13px; }
.avatar-search input, .avatar-search select { min-height: 42px; font-size: 14px; }

.settings-row { grid-template-columns: 130px minmax(0, 1fr); gap: 16px; font-size: 14px; line-height: 1.45; }
.settings-row > select, .style-control-group select, .coordinate-panel input, .stacked-setting textarea {
  min-height: 42px;
  border-color: #48484a;
  border-radius: 10px;
  color: #f5f5f7;
  background: #2c2c2e;
  font-size: 14px;
}
.rectangle-dialog-heading { padding: 22px 24px 12px; }
.rectangle-dialog-heading h2 { font-size: 22px; }

.teacher-dialog-heading button, .teacher-user-actions select, .teacher-user-actions button, .member-role-label {
  min-height: 36px;
  border-color: #48484a;
  border-radius: 9px;
  color: #d1d1d6;
  background: #2c2c2e;
  font-size: 12px;
}
.teacher-table-head { color: #a1a1a6; font-size: 12px; }
.teacher-user-row { padding: 14px; border-color: #38383a; border-radius: 12px; background: #1c1c1e; }
.teacher-user-actions { gap: 7px; }
.teacher-user-actions select, .teacher-user-actions button { height: 36px; padding-inline: 10px; }
.member-role-label { padding: 7px 10px; }
#memberAdminDialog .teacher-table-head { font-size: 12px; }
#memberAdminDialog .teacher-user-actions select, #memberAdminDialog .teacher-user-actions button { height: 38px; font-size: 12px; }
#memberAdminDialog .member-role-label { font-size: 12px; }
.member-create-panel input, .member-create-panel button { min-height: 42px; font-size: 13px; }
.member-create-panel > div span, .member-role-label, .admin-user-notes { line-height: 1.45; }

.teacher-sidebar-panel, .teacher-sidebar-room, .teacher-sidebar-builder, .teacher-sidebar-actions, .teacher-sidebar-student,
.teacher-sidebar-panel .teacher-summary-grid, .teacher-sidebar-panel .teacher-monitor-card {
  border-color: #38383a;
  background: #1c1c1e;
}
.teacher-sidebar-heading span, .teacher-sidebar-heading > div > span, .teacher-sidebar-dates label { color: #a1a1a6; font-size: 12px; }
.teacher-sidebar-room button, .teacher-sidebar-presets button, .teacher-sidebar-action-grid button, .teacher-sidebar-panorama {
  min-height: 38px;
  border-color: #48484a;
  border-radius: 10px;
  color: #f5f5f7;
  background: #2c2c2e;
  font-size: 13px;
}
.teacher-sidebar-primary, .teacher-sidebar-presets button.active { color: #000; border-color: #f5f5f7; background: #f5f5f7; }

.room-ready-overlay, .teacher-start-dock { border-color: #64d2ff; border-radius: 18px; background: #1c1c1e; box-shadow: 0 24px 70px rgba(0,0,0,.64); backdrop-filter: none; }
.room-ready-overlay strong, .teacher-start-dock strong { color: #f5f5f7; font-size: 18px; }
.room-ready-overlay span { color: #a1a1a6; font-size: 13px; }
.room-ready-button, .teacher-unified-start-button { min-height: 44px; border: 0; border-radius: 11px; color: #000; background: #64d2ff; font-size: 14px; }

@media (max-width: 900px) {
  .app-shell { padding: 0; }
  .topbar { border-radius: 0 0 14px 14px; }
  .home-dashboard { padding: 28px 16px 34px; }
  .home-tiles { gap: 10px; }
  .home-tile, .home-tile-training, .home-tile-room, .home-tile-review, .home-tile-ranking, .home-tile-settings { border-radius: 16px; }
  .side-panel { width: min(380px, 94vw); }
}
@media (max-width: 600px) {
  body { font-size: 13px; }
  .topbar { min-height: 62px; padding: 8px; }
  .top-actions .secondary-button { display: none; }
  .home-dashboard { gap: 20px; }
  .home-profile { min-width: 0; }
  .home-tiles { grid-template-columns: 1fr !important; }
  .home-tile, .home-tile-training, .home-tile-room, .home-tile-review, .home-tile-ranking, .home-tile-settings { min-height: 190px; aspect-ratio: auto; }
  .auth-choice-panel { grid-template-columns: 1fr; }
  .risk-dialog, .teacher-dialog, .rectangle-settings-dialog, .room-leaderboard-dialog, .leaderboard-dialog, .avatar-dialog { width: calc(100vw - 20px); }
  .risk-dialog form, .teacher-dialog form { padding: 18px; }
  .settings-row { grid-template-columns: 1fr; gap: 7px; }
  .teacher-user-row, .member-table-head + .teacher-user-list .teacher-user-row { grid-template-columns: 1fr; }
  .teacher-user-actions { grid-column: auto; }
}

/* Room controls open on the far-right command panel. The user can still drag back left. */
.teacher-room-workspace > .competition-control {
  scroll-behavior: smooth;
  scroll-padding-inline: 14px;
}

.date-picker-control {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}
.date-picker-control input { min-width: 0; flex: 1 1 auto; }
.date-picker-trigger {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid #48484a;
  border-radius: 10px;
  color: #f5f5f7;
  background: #2c2c2e;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}
.date-picker-trigger:hover { border-color: #64d2ff; background: #3a3a3c; }
.date-picker-popover[hidden] { display: none; }
.date-picker-popover {
  position: fixed;
  z-index: 10000;
  width: 296px;
  padding: 14px;
  border: 1px solid #48484a;
  border-radius: 16px;
  color: #f5f5f7;
  background: #1c1c1e;
  box-shadow: 0 22px 70px rgba(0,0,0,.7);
}
.date-picker-header,
.date-picker-weekdays,
.date-picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.date-picker-header { grid-template-columns: 36px 1fr 36px; align-items: center; margin-bottom: 12px; }
.date-picker-title { display: flex; min-width: 0; justify-content: center; gap: 2px; white-space: nowrap; }
.date-picker-title button { width: auto; min-width: 0; height: auto; min-height: 34px; padding: 4px 5px; border: 0; border-radius: 7px; color: #f5f5f7; background: transparent; cursor: pointer; font-size: 14px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.date-picker-title button:hover { background: #2c2c2e; }
.date-picker-header > button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: #f5f5f7;
  background: transparent;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}
.date-picker-header button:hover { background: #2c2c2e; }
.date-picker-weekdays { margin-bottom: 5px; color: #a1a1a6; font-size: 11px; text-align: center; }
.date-picker-weekdays .is-weekend { color: #6e6e73; }
.date-picker-day {
  display: grid;
  min-height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #f5f5f7;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}
.date-picker-day:hover { border-color: #64d2ff; background: #2c2c2e; }
.date-picker-day.is-weekend { color: #77777c; background: #161618; }
.date-picker-day.is-other-month { color: #5a5a5f; }
.date-picker-day.is-weekend.is-other-month { color: #48484c; background: #121214; }
.date-picker-day.is-today { border-color: #64d2ff; }
.date-picker-day.is-selected { color: #000; border-color: #64d2ff; background: #64d2ff; font-weight: 700; }
.date-picker-day.is-selected.is-weekend { color: #000; background: #64d2ff; }
.date-picker-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.date-picker-choice { min-height: 42px; border: 1px solid transparent; border-radius: 10px; color: #f5f5f7; background: #242426; cursor: pointer; font-size: 13px; }
.date-picker-choice:hover { border-color: #64d2ff; background: #2c2c2e; }
.date-picker-choice.is-selected { color: #000; border-color: #64d2ff; background: #64d2ff; font-weight: 800; }
.date-picker-choice.is-outside { color: #77777c; background: #161618; }
.date-picker-year-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.date-picker-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #a1a1a6; font-size: 11px; }
.date-picker-time input { width: 112px; padding: 6px 8px; border: 1px solid #48484a; border-radius: 7px; color: #f5f5f7; background: #2c2c2e; }
.date-picker-hint { margin-top: 11px; color: #8e8e93; font-size: 11px; line-height: 1.45; text-align: center; }

@media (max-width: 600px) {
  .date-picker-popover { width: min(296px, calc(100vw - 16px)); }
  .date-picker-trigger { width: 40px; min-width: 40px; }
}

/* Shared teacher chart: one race track, with each student's current coordinate on it. */
.teacher-panorama-race-layer {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}
.teacher-panorama-axis-layer {
  position: absolute;
  right: 72px;
  bottom: 0;
  left: 0;
  height: 43px;
  pointer-events: none;
}
.teacher-panorama-axis-tick {
  position: absolute;
  bottom: 1px;
  display: grid;
  gap: 1px;
  min-width: 58px;
  transform: translateX(-50%);
  color: #9eabb9;
  font: 8px/1.05 "JetBrains Mono", "SF Mono", monospace;
  text-align: center;
  white-space: nowrap;
}
.teacher-panorama-axis-tick b { color: #c9d4df; font-size: 8px; font-weight: 700; }
.teacher-panorama-axis-tick i { color: #8fdfff; font-style: normal; }
.teacher-panorama-axis-tick em { color: #ffc857; font-size: 8px; font-style: normal; }
.teacher-panorama-race-line {
  position: absolute;
  top: 42px;
  right: 14px;
  left: 14px;
  border-top: 1px dashed rgba(100, 210, 255, .42);
  box-shadow: 0 0 12px rgba(100, 210, 255, .12);
}
.teacher-panorama-race-label {
  position: absolute;
  top: 8px;
  left: 12px;
  padding: 3px 7px;
  border: 1px solid rgba(100, 210, 255, .32);
  border-radius: 999px;
  color: #a9e8ff;
  background: rgba(9, 23, 35, .88);
  font-size: 10px;
  font-weight: 700;
}
.teacher-panorama-teacher-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px solid #ffc857;
  box-shadow: 0 0 14px rgba(255, 200, 87, .65);
  transform: translateX(-50%);
  pointer-events: none;
}
.teacher-panorama-teacher-label {
  position: absolute;
  top: 8px;
  left: 0;
  padding: 4px 8px;
  border: 1px solid rgba(255, 200, 87, .85);
  border-radius: 999px;
  color: #231700;
  background: #ffc857;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}
.teacher-panorama-all-marker {
  position: absolute;
  top: 8px;
  left: 86px;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(100, 210, 255, .38);
  border-radius: 999px;
  color: #a9e8ff;
  background: rgba(9, 23, 35, .88);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  pointer-events: auto;
}
.teacher-panorama-all-marker:hover,
.teacher-panorama-all-marker.is-active { color: #00121b; border-color: #64d2ff; background: #64d2ff; }
.teacher-panorama-student-marker {
  position: absolute;
  top: 42px;
  display: grid;
  min-width: 64px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(100, 210, 255, .48);
  border-radius: 999px;
  color: #edfaff;
  background: rgba(15, 37, 51, .94);
  box-shadow: 0 3px 12px rgba(0,0,0,.45);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}
.teacher-panorama-student-marker:hover,
.teacher-panorama-student-marker:focus-visible,
.teacher-panorama-student-marker.is-visible:hover { border-color: #64d2ff; background: #24495d; }
.teacher-panorama-student-marker.is-muted { opacity: .38; filter: grayscale(.55); }
.teacher-panorama-student-marker span:not(.teacher-panorama-student-avatar) { max-width: 62px; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
.teacher-panorama-student-marker b { grid-column: 2; color: #8fdfff; font-size: 8px; font-weight: 600; }
.teacher-panorama-student-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #64d2ff;
  border-radius: 50%;
  color: #00121b;
  background: #64d2ff;
  font-size: 12px;
  line-height: 1;
}

/* Room mode uses a stronger theme selector, so explicitly keep the personal-training fold layout. */
body.theme-teacher .trainer-grid.side-panel-collapsed,
body.theme-peer .trainer-grid.side-panel-collapsed {
  grid-template-columns: minmax(0, 1fr) 0 !important;
}
body.theme-teacher .trainer-grid.side-panel-collapsed .side-panel,
body.theme-peer .trainer-grid.side-panel-collapsed .side-panel {
  width: 0;
  min-width: 0;
}
body.theme-teacher .trainer-grid.side-panel-collapsed .side-panel-toggle,
body.theme-peer .trainer-grid.side-panel-collapsed .side-panel-toggle {
  right: 0;
}

/* Teacher monitor: show each student's live order like the personal chart. */
.teacher-panorama-position-zone {
  position: absolute;
  z-index: 1;
  min-width: 2px;
  border: 1px solid transparent;
  opacity: .26;
  pointer-events: none;
}
.teacher-panorama-position-zone.stop {
  border-color: rgba(255, 96, 115, .9);
  background: rgba(255, 62, 86, .22);
}
.teacher-panorama-position-zone.take {
  border-color: rgba(45, 212, 165, .9);
  background: rgba(45, 212, 165, .2);
}
.teacher-panorama-position-zone.short.stop { background: rgba(255, 96, 115, .25); }
.teacher-panorama-position-zone.short.take { background: rgba(45, 212, 165, .16); }
.teacher-panorama-position-line {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 4px;
  height: 0;
  border-top: 1px dashed rgba(231, 246, 251, .72);
  transform: translateY(-50%);
  pointer-events: none;
}
.teacher-panorama-position-line b,
.teacher-panorama-position-line em {
  position: relative;
  top: -13px;
  padding: 2px 4px;
  border: 1px solid rgba(126, 225, 211, .52);
  border-radius: 3px;
  color: #e9fffa;
  background: rgba(5, 22, 35, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .36);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.teacher-panorama-position-line em { color: #9eeadd; }
.teacher-panorama-position-line.long { border-color: rgba(45, 212, 165, .86); }
.teacher-panorama-position-line.short,
.teacher-panorama-position-line.stop { border-color: rgba(255, 96, 115, .86); }
.teacher-panorama-position-line.take { border-color: rgba(45, 212, 165, .86); }
.teacher-overview-positions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.teacher-monitor-position-card {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(70, 126, 149, .48);
  border-radius: 9px;
  background: #071522;
}
.teacher-monitor-position-card.muted { opacity: .45; }
.teacher-monitor-position-head,
.teacher-monitor-position-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.teacher-monitor-position-head b { color: #e5f3f4; font-size: 10px; }
.teacher-monitor-position-head em {
  margin-left: 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
.teacher-monitor-position-head .position-long { color: #2dd4a5; }
.teacher-monitor-position-head .position-short { color: #ff6073; }
.teacher-monitor-position-head .position-flat { color: #8fa3b2; }
.teacher-monitor-position-values { margin-top: 7px; }
.teacher-monitor-position-values span { display: grid; gap: 2px; min-width: 0; }
.teacher-monitor-position-values small { color: #7890a4; font-size: 8px; }
.teacher-monitor-position-values strong { overflow: hidden; color: #dceaf0; font-size: 10px; text-overflow: ellipsis; }
.teacher-monitor-position-values strong.profit { color: #2dd4a5; }
.teacher-monitor-position-values strong.loss { color: #ff6073; }
.teacher-monitor-position-level {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #8ca4b2;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Final compact teacher deck overrides. */
#teacherDialog .teacher-summary-grid { display: none !important; }
body.teacher-dashboard-active #teacherDialog .teacher-topline { grid-template-columns: 172px minmax(0,1fr) !important; gap: 12px; }
body.teacher-dashboard-active #teacherDialog .teacher-topline .teacher-summary-grid { display: none !important; }
body.teacher-dashboard-active #teacherDialog .teacher-dialog-heading p { display: none; }
body.teacher-dashboard-active #teacherDialog #teacherTopStudentRibbon { display: grid !important; grid-template-columns: minmax(0,1fr) auto; gap: 8px; max-height: 78px; overflow: visible; }
body.teacher-dashboard-active #teacherDialog .competition-control { gap: 7px; padding: 0 0 0 10px; overflow-x: hidden; overflow-y: auto; }
body.teacher-dashboard-active #teacherDialog .competition-control > .competition-title { min-height: 46px; padding: 8px 11px; }
body.teacher-dashboard-active #teacherDialog .teacher-room-lobby-active { grid-template-columns: 1fr; }
body.teacher-dashboard-active #teacherDialog .teacher-room-fold-summary { min-height: 42px; padding: 7px 10px; }
body.teacher-dashboard-active #teacherDialog .room-builder { display: grid; grid-template-columns: 1fr !important; gap: 7px; padding: 9px; }
body.teacher-dashboard-active #teacherDialog .room-builder-step { display: none; }
body.teacher-dashboard-active #teacherDialog .room-presets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 0; }
body.teacher-dashboard-active #teacherDialog .room-create-actions { display: grid; grid-template-columns: 1fr 1fr !important; gap: 6px; padding: 0; }
body.teacher-dashboard-active #teacherDialog .room-builder-footer { display: grid; grid-template-columns: 1fr auto; gap: 7px; padding: 0; }
body.teacher-dashboard-active #teacherDialog .room-management { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 8px; }
body.teacher-dashboard-active #teacherDialog .competition-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; padding: 8px; }
body.teacher-dashboard-active #teacherDialog .competition-actions input { grid-column: 1 / -1; min-height: 30px; }
body.teacher-dashboard-active #teacherDialog .competition-actions button[data-room-action="start"] { grid-column: auto; }
body.teacher-dashboard-active #teacherDialog .teacher-playback-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 72px 50px; gap: 5px; }
body.teacher-dashboard-active #teacherDialog .teacher-panorama-head { display: none; }
body.teacher-dashboard-active #teacherDialog .teacher-overview-positions { display: none !important; }
body.teacher-dashboard-active #teacherDialog #closeTeacherButton { min-width: 116px; }
.teacher-panorama-tools { position: absolute; z-index: 8; right: 10px; bottom: 10px; width: min(390px,45%); border: 1px solid rgba(110,231,216,.28); border-radius: 10px; background: rgba(5,18,28,.72); box-shadow: 0 8px 22px rgba(0,0,0,.28); backdrop-filter: blur(10px); }
.teacher-panorama-tools > summary { padding: 5px 9px; color: #91b8c1; cursor: move; font-size: 9px; list-style: none; user-select: none; }
.teacher-panorama-tools > summary::-webkit-details-marker { display: none; }
.teacher-panorama-tools[open] > summary { border-bottom: 1px solid rgba(110,231,216,.16); color: #6ee7d8; }
.teacher-panorama-tools .teacher-panorama-overlay { padding: 6px; }
.teacher-panorama-tools .teacher-panorama-scrubber { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.teacher-panorama-tools .teacher-panorama-scrubber-head > div:first-child span,
.teacher-panorama-tools .teacher-panorama-scrubber-scale { display: none; }
.room-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.room-settings label { display: grid; gap: 3px; color: #8fa6b5; font-size: 8px; }
.room-settings select { min-width: 0; min-height: 30px; padding: 0 6px; border: 1px solid #31516a; border-radius: 6px; color: #d9f6f3; background: #0a1b2c; font-size: 9px; }

/* Chart-first phone layout: keep the chart wide and move controls below it. */
.active-indicator-legend { top: 8px; left: 8px; max-width: min(250px, calc(100% - 16px)); }

@media (max-width: 720px) {
  html, body { min-width: 0; width: 100%; overflow-x: hidden; }
  .app-shell { width: 100%; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    gap: 4px 8px;
    padding: 5px 8px 0;
    border-radius: 0;
  }
  .topbar .brand { min-width: 0; grid-column: 1; grid-row: 1; gap: 6px; }
  .topbar .brand-mark { display: none; }
  .topbar .brand h1 { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { grid-column: 2; grid-row: 1; width: auto; min-width: 0; gap: 4px; }
  .topbar > .toolbar {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 0;
    overflow: hidden;
  }
  .topbar > .toolbar .timeframe-group {
    width: 100%;
    min-width: 0;
    gap: 1px;
    overflow-x: auto;
    padding: 1px 0 4px;
    scrollbar-width: none;
  }
  .topbar > .toolbar .timeframe-group::-webkit-scrollbar { display: none; }
  .topbar > .toolbar .timeframe-group > button,
  .topbar > .toolbar .symbol-button,
  .topbar > .toolbar .terminal-menu > button { flex: 0 0 auto; min-height: 28px; padding: 4px 7px; font-size: 9px !important; }
  .topbar > .toolbar .chart-tools { display: none; }
  .trainer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    width: 100%;
    height: calc(100dvh - 76px) !important;
    min-height: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0;
  }
  .chart-column {
    grid-row: 1;
    width: 100%;
    height: min(72dvh, 640px) !important;
    min-height: 360px !important;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .chart-stage { width: 100%; min-width: 0; height: 100%; touch-action: none; }
  .side-panel {
    grid-row: 2;
    display: grid;
    width: 100%;
    height: auto;
    max-height: none;
    min-width: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    border-top: 1px solid var(--line);
    border-left: 0;
    overflow: visible;
  }
  .side-scroll { display: grid; grid-template-columns: 1fr; width: 100%; max-height: none; overflow: visible; padding: 8px; }
  .side-scroll .side-card, .side-scroll .account-card, .side-scroll .history-card { width: 100%; min-width: 0; }
  .order-card { position: static; width: auto; margin: 0 8px 8px; }
  .side-panel-toggle { top: auto; right: 8px; bottom: 8px; transform: none; }
  .active-indicator-legend { top: 42px; left: 8px; max-width: min(220px, calc(100% - 16px)); padding: 3px 5px; font-size: 9px; }
  .floating-drawing-toolbar { top: 5px; left: 5px; max-width: calc(100% - 10px); gap: 2px; padding: 3px; }
  .floating-drawing-toolbar button,
  .floating-drawing-toolbar select { width: 27px; min-width: 27px; height: 27px; }
  .floating-drawing-toolbar .floating-drawing-drag-handle { width: 21px; min-width: 21px; }
  .room-ready-overlay { width: min(330px, calc(100% - 24px)); padding: 18px 16px; }
}

@media (max-width: 390px) {
  .topbar .brand h1 { font-size: 13px; }
  .chart-column { height: min(70dvh, 560px) !important; min-height: 330px !important; }
  .floating-drawing-toolbar button,
  .floating-drawing-toolbar select { width: 25px; min-width: 25px; height: 25px; }
  .chart-type-switch button { width: 25px; min-width: 25px; }
}

/* A collapsed rail must not reserve a hidden grid column. Keep the chart viewport
   identical before and after opening a position. */
.trainer-grid.side-panel-collapsed {
  grid-template-columns: minmax(0, 1fr) 0 !important;
}
.trainer-grid.side-panel-collapsed .chart-column {
  min-width: 0;
  width: 100%;
}
.trainer-grid.side-panel-collapsed .side-panel {
  width: 0;
  min-width: 0;
}

/* Keep the candle visibility control in the indicator legend. */
.active-indicator-legend .candle-visibility-row { border-top: 1px solid rgba(130, 151, 171, .16); }
.active-indicator-legend .candle-legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #2dd4a5 0 48%, #ff6073 52% 100%);
  box-shadow: 0 0 6px rgba(110, 231, 216, .55);
}

/* The full shortcut list stays directly below the indicator legend. */
.shortcut-legend {
  top: 56px;
  left: 8px;
  max-width: min(920px, calc(100% - 16px));
}
.shortcut-legend > div {
  flex-wrap: wrap;
  gap: 3px 10px;
  max-width: min(920px, calc(100vw - 58px));
  min-height: 24px;
  padding: 4px 9px;
  line-height: 13px;
}
.shortcut-legend > div span { display: inline-flex; align-items: center; gap: 3px; }
.shortcut-legend kbd {
  padding: 0 3px;
  border: 1px solid rgba(130, 151, 171, .35);
  border-radius: 3px;
  color: #d1e0ec;
  background: rgba(255,255,255,.06);
  font: 700 8px/13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 720px) {
  .shortcut-legend { top: 96px; left: 8px; max-width: calc(100% - 16px); }
  .shortcut-legend > div { max-width: calc(100vw - 58px); gap: 2px 6px; padding: 3px 6px; font-size: 8px; }
}

/* 老师指针（学生端同步显示） */
.teacher-pointer { position: absolute; z-index: 20; left: 0; top: 0; width: 0; height: 0; pointer-events: none; transform: translate(var(--tp-x, 0), var(--tp-y, 0)); transition: transform .09s linear; }
.teacher-pointer[hidden] { display: none; }
.teacher-pointer-column { position: absolute; left: calc(var(--tp-col, 6px) / -2); top: -100vh; width: var(--tp-col, 6px); height: 200vh; background: rgba(255,213,74,.16); border-left: 1px solid rgba(255,213,74,.55); border-right: 1px solid rgba(255,213,74,.55); }
.teacher-pointer-crosshair-v { position: absolute; left: 0; top: -100vh; height: 200vh; border-left: 1px dashed rgba(255,236,153,.8); }
.teacher-pointer-crosshair-h { position: absolute; left: -100vw; top: 0; width: 200vw; border-top: 1px dashed rgba(255,236,153,.8); }
.teacher-pointer-arrow { position: absolute; left: -3px; top: -2px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.7)); }
.teacher-pointer-tag { position: absolute; left: 20px; top: 16px; padding: 1px 7px; border-radius: 4px; background: #ffd54a; color: #111; font-size: 12px; white-space: nowrap; }
.teacher-student-mirror-svg { cursor: crosshair; }
.room-ready-overlay.is-starting { border-color: rgba(45, 212, 165, .9); }
.room-ready-overlay.is-starting strong { color: #2dd4a5; font-size: 28px; }

/* 老师全景：学生画图、起跑线、盈亏大字 */
.teacher-panorama-drawing-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.teacher-panorama-session-line { position: absolute; top: 0; bottom: 16%; width: 0; border-left: 1px dashed rgba(90, 176, 255, .7); pointer-events: none; }
.teacher-panorama-session-line b { position: absolute; top: 34px; left: 4px; color: #5ab0ff; font-size: 10px; font-weight: 600; white-space: nowrap; }
.teacher-panorama-future-shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .55); pointer-events: none; }
.teacher-panorama-future-shade::before { content: "学生未见"; position: absolute; top: 124px; left: 8px; color: rgba(255, 255, 255, .35); font-size: 11px; white-space: nowrap; }
