:root {
  --bg: #0a0d13;
  --bg-2: #0f1420;
  --panel: #111826;
  --panel-2: #151e2e;
  --panel-3: #1a2436;
  --border: #1f2a3c;
  --border-soft: #182233;
  --text: #e8edf6;
  --muted: #8390a8;
  --faint: #5c6880;
  --red: #ff5c5c;
  --green: #35d07f;
  --yellow: #ffd166;
  --blue: #4f8cff;
  --cyan: #45c8dc;
  --orange: #ff9f43;
  --radius: 12px;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

* { box-sizing: border-box; }

.news-list, .help-body, .modal-body, .log-list {
  user-select: text;
  -webkit-user-select: text;
}

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

body {
  user-select: none;
  -webkit-user-select: none;
  background:
    radial-gradient(1000px 520px at 18% -10%, rgba(39, 72, 130, 0.30), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(88, 54, 130, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #243148; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #31415e; }

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */
.topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 14, 21, 0.82);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}
.logo span { color: var(--yellow); }
.tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--yellow);
  border: 1px solid rgba(255, 209, 102, 0.45);
  border-radius: 4px;
  padding: 2px 5px;
  transform: translateY(-1px);
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  min-width: 250px;
}
.clock-date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.clock-time { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: 1px; }
.clock-status {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  color: var(--green);
  background: rgba(53, 208, 127, 0.10);
  border: 1px solid rgba(53, 208, 127, 0.22);
}

.slots-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.slots-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.slots { display: flex; gap: 5px; }
.slot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid #33425c;
  background: transparent;
  transition: 0.18s ease;
}
.slot.used {
  background: var(--yellow);
  border-color: var(--yellow);
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.45);
}
.slots-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.account { display: flex; gap: 18px; margin-left: auto; }
.account-item { display: flex; flex-direction: column; gap: 2px; }
.account-item span { font-size: 10px; color: var(--muted); }
.account-item b { font-family: var(--mono); font-size: 15px; color: var(--text); }
.account-item b.up { color: var(--red); }
.account-item b.down { color: var(--green); }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transition: 0.18s ease;
}
.icon-btn:hover { color: var(--text); border-color: #33425c; background: var(--panel-2); }

/* ---------- notice ---------- */
.notice {
  flex: 0 0 30px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 11px;
  color: #8d9ab0;
  background: rgba(16, 22, 33, 0.75);
  border-bottom: 1px solid var(--border-soft);
}
.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.55);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(255, 209, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
}
.link-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  padding: 2px 4px;
}
.link-btn:hover { color: #8db3ff; text-decoration: underline; }

/* ---------- layout ---------- */
.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 330px;
  gap: 8px;
  padding: 8px;
}

.panel {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 28, 43, 0.94), rgba(12, 17, 27, 0.96));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  flex: 0 0 auto;
}
.panel-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #a9b5c9;
}
.muted { color: var(--faint); font-size: 10px; }

.left-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.region-list {
  flex: 0 0 auto;
  padding: 0 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.region-item {
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(18, 26, 40, 0.75);
  padding: 7px 9px;
  cursor: pointer;
  transition: 0.15s ease;
}
.region-item:hover { background: #172234; border-color: #263550; }
.region-item.active {
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.14), rgba(79, 140, 255, 0.04));
  border-color: rgba(79, 140, 255, 0.45);
}
.region-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.region-name { font-size: 12px; color: #c8d3e5; }
.region-chg { font-family: var(--mono); font-size: 11px; }
.region-bottom { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; }
.region-idx { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.region-breadth { font-size: 10px; color: var(--faint); }

.search { padding: 0 10px 7px; flex: 0 0 auto; }
.search input {
  width: 100%;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: var(--text);
  padding: 0 9px;
  font-size: 11px;
  outline: none;
}
.search input:focus { border-color: #35517d; box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.10); }
.search input::placeholder { color: #4e5b72; }

.stock-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.deriv-panel {
  flex: 0 0 auto;
  margin: 0 8px 8px;
  padding: 8px 9px;
  border-radius: 7px;
  border: 1px solid #1d2b40;
  background: #0a111c;
}
.deriv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; margin-bottom: 5px; }
.deriv-head span { font-size: 10px; color: #9aa9c0; font-weight: 700; }
.deriv-head b { font-family: var(--mono); font-size: 10px; color: #d7e1f0; }
.deriv-head .muted { font-size: 9px; color: #5f6d84; font-weight: 400; }
.deriv-row { display: flex; align-items: center; gap: 5px; padding: 3px 0; border-top: 1px solid #141f30; }
.deriv-name { flex: 1 1 auto; font-size: 9px; color: #7d8ba3; }
.deriv-row b { font-family: var(--mono); font-size: 10px; color: #c8d3e5; min-width: 52px; text-align: right; }
.deriv-btn {
  width: 23px; height: 19px; border-radius: 4px; border: 1px solid #2a3952;
  background: #0d1420; color: #8fa0bb; font-size: 9px;
}
.deriv-btn:hover { border-color: #3d5a8a; color: #d7e1f0; }
.deriv-btn.sell { color: #e6a3a3; }
.deriv-note { margin-top: 4px; font-size: 8px; color: #4e5b72; line-height: 1.5; }
.deriv-pos { margin-top: 4px; font-size: 9px; color: #9aa9c0; line-height: 1.6; }
.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.12s ease;
}
.stock-item:hover { background: #162133; }
.stock-item.active { background: rgba(79, 140, 255, 0.12); border-color: rgba(79, 140, 255, 0.30); }
.stock-item-main { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.stock-item-name { font-size: 12px; color: #d5deed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-item-code { font-family: var(--mono); font-size: 9px; color: #59667e; }
.stock-item-quote { display: flex; align-items: baseline; gap: 6px; flex: 0 0 auto; }
.stock-item-quote .price { font-family: var(--mono); font-size: 12px; color: #dbe4f2; }
.stock-item-quote .chg { font-family: var(--mono); font-size: 10px; }

.up { color: var(--red) !important; }
.down { color: var(--green) !important; }
.flat { color: var(--muted) !important; }

/* ---------- center ---------- */
.center-panel { display: flex; flex-direction: column; overflow: hidden; }

.chart-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
}
.stock-head { display: flex; flex-direction: column; gap: 2px; }
.chart-head-right { display: flex; align-items: center; gap: 6px; }
.stock-title { display: flex; align-items: baseline; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: 0.5px; }
.stock-title .code { font-family: var(--mono); font-size: 11px; font-weight: 500; color: #67758e; letter-spacing: 0; }
.stock-quote { display: flex; align-items: baseline; gap: 9px; }
.stock-quote b { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.stock-quote span { font-family: var(--mono); font-size: 12px; }

.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 8px; background: #0d1420; border: 1px solid var(--border); }
.logic-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: #7f8ba3;
  font-size: 10px;
  transition: 0.15s ease;
}
.logic-btn:hover { color: var(--text); border-color: #33425c; }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  transition: 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { background: #1b2940; color: var(--text); box-shadow: inset 0 0 0 1px #2a3b58; }

.chart-wrap {
  flex: 1 1 auto;
  min-height: 250px;
  position: relative;
  margin: 0 10px;
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(11, 16, 25, 0.55), rgba(11, 16, 25, 0.20)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,0.012) 79px 80px);
  overflow: hidden;
}
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-badge {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 10px;
  color: #6e7c94;
  background: rgba(10, 15, 23, 0.72);
  border: 1px solid var(--border-soft);
  padding: 3px 7px;
  border-radius: 5px;
  pointer-events: none;
}
.chart-tooltip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  min-width: 190px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(15, 22, 34, 0.96);
  border: 1px solid #2b3a55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 10px;
  line-height: 1.5;
  color: #c8d3e5;
}
.chart-tooltip b { color: #fff; }
.chart-tooltip .tt-date { color: #7f8ba3; margin-bottom: 4px; font-family: var(--mono); }
.chart-tooltip .tt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 8px; }
.chart-tooltip .tt-row span { color: #7f8ba3; }
.chart-tooltip .tt-row b { color: #fff; font-weight: 600; }
.chart-tooltip .tt-sub { color: #95a4bd; font-size: 9px; margin-top: 4px; line-height: 1.5; }
.chart-tooltip .tt-pin {
  color: #5c6880;
  font-size: 9px;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid #1f2a3c;
}
.chart-tooltip.pinned { border-color: rgba(255, 209, 102, 0.55); }
.chart-tooltip .up { color: var(--red); }
.chart-tooltip .down { color: var(--green); }
.chart-tooltip .flat { color: #c8d3e5; }
.chart-tooltip.hidden { display: none; }

.chart-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
}
.legend { display: flex; align-items: center; gap: 12px; font-size: 10px; color: #7e8ba1; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.swatch { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.swatch.red { background: var(--red); }
.swatch.green { background: var(--green); }
.swatch.dash {
  width: 12px;
  height: 0;
  border-top: 1px dashed #ffb0b0;
  border-radius: 0;
}
.time-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.speed-btn {
  height: 28px;
  min-width: 38px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: #7f8ba3;
  font-family: var(--mono);
  font-size: 10px;
  transition: 0.15s ease;
}
.speed-btn:hover { color: #dbe4f2; border-color: #33425c; }
.speed-btn.active { color: var(--yellow); border-color: rgba(255, 209, 102, 0.55); background: rgba(255, 209, 102, 0.10); }
#pauseBtn { height: 28px; padding: 0 9px; }
.hidden { display: none !important; }

.live-compare {
  flex: 0 0 auto;
  padding: 8px 12px 7px;
  border-top: 1px solid var(--border-soft);
  background: rgba(13, 20, 32, 0.55);
}
.lc-head { display: flex; align-items: center; gap: 8px; }
.lc-head b { color: var(--yellow); font-size: 11px; }
.lc-head span { flex: 1; color: #6f7c93; font-size: 9px; }
.lc-refresh {
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: #8390a8;
  font-size: 9px;
}
.lc-refresh:hover { color: var(--text); border-color: #33425c; }
.lc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 5px;
  margin-top: 6px;
}
.lc-cell {
  background: #0d1420;
  border: 1px solid #1a2638;
  border-radius: 5px;
  padding: 4px 6px;
}
.lc-cell span { display: block; color: #6f7c93; font-size: 9px; }
.lc-cell b { color: #fff; font-size: 11px; font-family: var(--mono); }
.lc-note { margin-top: 5px; color: #5c6880; font-size: 9px; }
.lc-empty { color: #d8a15a; font-size: 10px; }
.lc-empty code { color: #ffd166; font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn {
  height: 31px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #2a3952;
  background: #172235;
  color: #cdd8ea;
  font-size: 11px;
  font-weight: 600;
  transition: 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #1e2c44; border-color: #385076; }
.btn:disabled { opacity: 0.38; }
.btn.primary {
  background: linear-gradient(180deg, #3f7cf0, #2e63cf);
  border-color: #4f8cff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.22);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #4f8cff, #3a70df); }
.btn.danger { background: rgba(120, 35, 42, 0.35); border-color: rgba(255, 92, 92, 0.40); color: #ffaaaa; }
.btn.danger:hover:not(:disabled) { background: rgba(150, 42, 50, 0.45); }
.btn.up { background: rgba(120, 35, 42, 0.30); border-color: rgba(255, 92, 92, 0.35); color: #ff9b9b; }
.btn.down { background: rgba(20, 80, 55, 0.30); border-color: rgba(53, 208, 127, 0.35); color: #8be8b8; }
.btn.wide { width: 100%; height: 35px; margin-top: 6px; }

/* ---------- log ---------- */
.log-panel {
  flex: 0 0 150px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.log-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 12px 8px;
  font-size: 10px;
  color: #8b98ad;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.log-item { display: flex; gap: 7px; align-items: baseline; }
.log-item .t { font-family: var(--mono); color: #56637a; flex: 0 0 38px; }
.log-item .m { color: #a9b5c9; }
.log-item.win .m { color: var(--red); }
.log-item.loss .m { color: var(--green); }
.log-item.sys .m { color: var(--yellow); }
.empty { color: #4e5b72; font-size: 10px; padding: 4px 0; }

/* ---------- right ---------- */
.right-panel {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.detail-card, .trade-card, .news-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 28, 43, 0.94), rgba(12, 17, 27, 0.96));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}
.detail-card { padding: 12px; }
.trade-card { padding: 0 12px 12px; }
.news-card { padding: 0 12px 10px; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.detail-name { font-size: 18px; font-weight: 800; }
.detail-meta { font-size: 10px; color: #6f7c93; margin-top: 2px; font-family: var(--mono); }
.dot-sep { margin: 0 4px; color: #3e4b61; }
.mode-badge {
  display: inline-block;
  margin-left: 7px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #9fc4ff;
  background: rgba(79, 140, 255, 0.10);
  border: 1px solid rgba(79, 140, 255, 0.25);
  font-family: var(--mono);
  vertical-align: 1px;
}
.conf-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  vertical-align: 1px;
}
.conf-badge.high { color: #8be8b8; background: rgba(53, 208, 127, 0.10); border: 1px solid rgba(53, 208, 127, 0.28); }
.conf-badge.medium { color: #ffd166; background: rgba(255, 209, 102, 0.10); border: 1px solid rgba(255, 209, 102, 0.28); }
.conf-badge.low { color: #ff9b9b; background: rgba(255, 92, 92, 0.10); border: 1px solid rgba(255, 92, 92, 0.28); }
.conf-badge.live { color: #9fc4ff; background: rgba(79, 140, 255, 0.10); border: 1px solid rgba(79, 140, 255, 0.28); }
.detail-quote { text-align: right; }
.detail-quote b { display: block; font-family: var(--mono); font-size: 21px; }
.detail-quote span { font-family: var(--mono); font-size: 11px; }

.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.w-cell {
  background: #0e1623;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.w-cell span { font-size: 10px; color: #6f7c93; }
.w-cell b { font-family: var(--mono); font-size: 12px; color: #dbe4f2; }

.wei-row { margin-top: 10px; }
.wei-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; color: #7f8ba3; }
.wei-label b { font-family: var(--mono); font-size: 15px; color: var(--yellow); }
.wei-track { height: 6px; margin-top: 4px; border-radius: 4px; background: #0d1420; overflow: hidden; border: 1px solid #1a2638; }
.wei-track i {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: 4px;
  background: linear-gradient(90deg, #3a6fd8, #45c8dc 45%, #ffd166 75%, #ff6b6b);
  transition: width 0.35s ease;
}
.wei-scale { display: flex; justify-content: space-between; font-size: 9px; color: #4e5b72; margin-top: 3px; }
.fund-row {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #1a2638;
  font-size: 9px;
  color: #7e8ca5;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.fund-row b { font-family: var(--mono); color: #c8d3e5; font-weight: 600; }
.live-row { margin-top: 8px; font-size: 10px; color: var(--cyan); min-height: 12px; }
.live-row .live-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(69, 200, 220, 0.12);
  border: 1px solid rgba(69, 200, 220, 0.30);
  margin-right: 5px;
}

.side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 8px; }
.side {
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0e1623;
  color: #7f8ba3;
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s ease;
}
.side:hover { border-color: #33425c; color: #c8d3e5; }
.side.active[data-side="long"] { background: rgba(120, 35, 42, 0.40); border-color: rgba(255, 92, 92, 0.55); color: #ffb3b3; }
.side.active[data-side="short"] { background: rgba(20, 80, 55, 0.40); border-color: rgba(53, 208, 127, 0.55); color: #9aefc2; }

.field-row { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.field > span { font-size: 10px; color: #6f7c93; }
.field input {
  width: 100%;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: var(--text);
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
}
.field input:focus { border-color: #35517d; }
.size-field { flex: 0 0 auto; min-width: 0; }
.size-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; color: #6f7c93; }
.size-head #maxShares { color: #56637a; font-family: var(--mono); }
.size-row { display: flex; gap: 3px; align-items: center; }
.size-row input {
  width: 56px;
  flex: 0 0 56px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: var(--text);
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
}
.size-row input:focus { border-color: #35517d; }
.size-quick {
  flex: 1 1 0;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: #7f8ba3;
  font-size: 9px;
  transition: 0.15s ease;
}
.size-quick:hover { color: #dbe4f2; border-color: #33425c; }
#sizeSlider { width: 100%; margin-top: 6px; accent-color: var(--blue); height: 4px; }
.leverage-field { flex: 0 0 auto; }
.risk-row { display: flex; gap: 6px; margin-top: 7px; }
.risk-field { flex: 1 1 0; display: flex; flex-direction: column; gap: 3px; }
.risk-field span { font-size: 9px; color: #6f7c93; }
.risk-field input {
  width: 100%;
  height: 27px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: var(--text);
  padding: 0 7px;
  font-family: var(--mono);
  font-size: 10px;
  outline: none;
}
.risk-field input:focus { border-color: #35517d; }
.leverage-row { display: flex; gap: 3px; }
.leverage-row button {
  flex: 1 1 0;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: #7f8ba3;
  font-family: var(--mono);
  font-size: 10px;
  transition: 0.15s ease;
}
.leverage-row button:hover { color: #dbe4f2; border-color: #33425c; }
.leverage-row button.active { background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.55); color: var(--yellow); }

.orderbook {
  margin-top: 7px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #0b111c;
  border: 1px solid #1a2638;
  font-family: var(--mono);
  font-size: 9px;
  color: #7f8ba3;
}
.ob-head, .ob-row, .ob-mid, .ob-flow, .ob-limit {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.ob-head { color: #5c6880; margin-bottom: 2px; }
.ob-row { line-height: 1.55; }
.ob-row span { width: 30px; color: #6f7c93; }
.ob-row b { flex: 1; font-weight: 600; }
.ob-row i { font-style: normal; color: #56637a; width: 38px; text-align: right; }
.ob-row.ask b { color: var(--green); }
.ob-row.bid b { color: var(--red); }
.ob-mid {
  margin: 2px 0;
  padding: 2px 0;
  border-top: 1px solid #1a2638;
  border-bottom: 1px solid #1a2638;
  color: #8390a8;
}
.ob-mid b { color: #dfe7f4; font-weight: 600; }
.ob-flow { color: #6f7c93; margin-top: 2px; flex-wrap: wrap; }
.ob-flow b { color: #c8d3e5; font-weight: 600; }
.ob-limit { color: #56637a; margin-top: 2px; }

.order-summary {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #0d1420;
  border: 1px solid var(--border-soft);
  font-size: 10px;
  color: #8290a8;
  line-height: 1.7;
}
.order-summary b { font-family: var(--mono); color: #c8d3e5; font-weight: 600; }
.order-summary .liq { color: #ff9b9b; }

.position-box {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 7px;
  border: 1px dashed #263550;
  background: rgba(13, 20, 32, 0.7);
  font-size: 10px;
  color: #8290a8;
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
}
.position-box .pos-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.position-box .pos-close {
  height: 19px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid #2a3952;
  background: #0d1420;
  color: #8fa0bb;
  font-size: 9px;
}
.position-box .pos-close:disabled { opacity: 0.45; }
.pos-item + .pos-item { margin-top: 8px; padding-top: 7px; border-top: 1px solid #1a2638; }
.pos-count {
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1a2638;
  color: #8eb6e6;
  font-size: 9px;
}
.position-box .pos-side { font-size: 11px; font-weight: 700; }
.position-box .pos-pnl { font-family: var(--mono); font-size: 12px; }
.position-box .pos-row { display: flex; justify-content: space-between; }
.position-box .pos-row b { font-family: var(--mono); color: #c8d3e5; }
.position-box .warn { color: var(--red); }

.predict-box {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border-soft);
}
.predict-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 10px; color: #7f8ba3; }
.predict-head em { font-style: normal; font-size: 9px; color: #56637a; }
.predict-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.predict-actions .btn { height: 28px; }
.predict-state { margin-top: 5px; font-size: 10px; color: var(--yellow); min-height: 12px; }

.news-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
  padding-bottom: 2px;
}
.intel-tabs { display: flex; gap: 3px; padding: 0 0 6px; }
.intel-tabs button {
  flex: 1;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: #6f7c93;
  font-size: 10px;
  transition: 0.15s ease;
}
.intel-tabs button:hover { color: var(--text); border-color: #33425c; }
.intel-tabs button.active { color: var(--text); border-color: #33425c; background: #1a2638; }
.intel-mood { font-size: 10px; padding: 0 0 6px; }
.intel-mood.up { color: var(--red); }
.intel-mood.down { color: var(--green); }
.intel-mood.flat { color: var(--muted); }
.tier-badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid #263550;
  color: #9fb0c8;
}
.tier-badge.official { color: #9fc4ff; background: rgba(79, 140, 255, 0.10); border-color: rgba(79, 140, 255, 0.25); }
.tier-badge.media { color: #b9c6da; background: #1a2638; }
.tier-badge.broker { color: #ffd166; background: rgba(255, 209, 102, 0.08); border-color: rgba(255, 209, 102, 0.22); }
.tier-badge.hot { color: #d7a8ff; background: rgba(180, 120, 255, 0.08); border-color: rgba(180, 120, 255, 0.22); }
.dir-badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid #263550;
}
.dir-badge.up { color: #ff9b9b; background: rgba(255, 92, 92, 0.08); border-color: rgba(255, 92, 92, 0.22); }
.dir-badge.down { color: #8be8b8; background: rgba(53, 208, 127, 0.08); border-color: rgba(53, 208, 127, 0.22); }
.dir-badge.flat { color: #8290a8; }
.news-body {
  font-size: 9.5px;
  color: #7f8ba3;
  line-height: 1.5;
  margin-top: 3px;
  padding-left: 40px;
}
.news-item.type-analyst { border-left-color: rgba(255, 209, 102, 0.45); }
.news-item.type-briefing { border-left-color: rgba(79, 140, 255, 0.35); }
.news-item {
  border-left: 2px solid #2a3952;
  padding: 6px 7px;
  border-radius: 0 6px 6px 0;
  background: rgba(13, 20, 32, 0.55);
}
.news-item.new { border-left-color: var(--yellow); background: rgba(255, 209, 102, 0.06); }
.news-item.future { opacity: 0.35; border-left-color: #1a2638; }
.news-item.archive { background: rgba(79, 140, 255, 0.045); border-left-color: rgba(79, 140, 255, 0.45); }
.news-item.archive .news-time { flex: 0 0 46px; white-space: nowrap; color: #7fa6ff; }
.news-item.archive .news-title { color: #b9c8e2; }
.news-item.archive .news-meta { padding-left: 52px; }
.news-top { display: flex; align-items: baseline; gap: 6px; }
.news-time { font-family: var(--mono); font-size: 9px; color: #56637a; flex: 0 0 34px; }
.news-title { font-size: 10.5px; color: #c6d1e3; line-height: 1.45; }
.news-item.future .news-title { color: #56637a; }
.news-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; padding-left: 40px; }
.news-source { font-size: 9px; color: #56637a; }
.news-tag {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  color: #9fb0c8;
  background: #1a2638;
  border: 1px solid #263550;
}
.news-tag.hot { color: #ffb3b3; background: rgba(255, 92, 92, 0.10); border-color: rgba(255, 92, 92, 0.25); }
.news-tag.rain { color: #9fc4ff; background: rgba(79, 140, 255, 0.10); border-color: rgba(79, 140, 255, 0.25); }
.news-tag.cold { color: #9fe8ea; background: rgba(69, 200, 220, 0.08); border-color: rgba(69, 200, 220, 0.22); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 11, 0.72);
  backdrop-filter: blur(5px);
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  width: min(440px, calc(100vw - 32px));
  border-radius: 14px;
  border: 1px solid #2a3a55;
  background: linear-gradient(180deg, #172134, #0e1521);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  padding: 20px;
  animation: pop 0.18s ease-out;
}
@keyframes pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-kicker { font-size: 10px; letter-spacing: 2px; color: var(--yellow); text-transform: uppercase; }
.modal-card h3 { margin: 7px 0 10px; font-size: 20px; }
.modal-body { font-size: 12px; color: #a9b5c9; line-height: 1.8; white-space: pre-wrap; max-height: 48vh; overflow-y: auto; }
.modal-body .big { font-family: var(--mono); font-size: 26px; font-weight: 700; color: #fff; }
.modal-body .good { color: var(--red); }
.modal-body .bad { color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.help-card { width: min(560px, calc(100vw - 32px)); }
.logic-card { width: min(660px, calc(100vw - 32px)); }
.logic-body { white-space: normal; max-height: 64vh; }
.logic-body h4 { color: var(--yellow); font-size: 12px; margin: 10px 0 3px; }
.logic-body p { margin: 4px 0; }
.logic-body ul { margin: 5px 0 5px 18px; padding: 0; }
.logic-body li { margin: 2px 0; }
.help-body { white-space: normal; }
.help-body p { margin: 6px 0; }
.help-body code {
  font-family: var(--mono);
  background: #0d1420;
  border: 1px solid var(--border);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--yellow);
}
.help-body .warn { color: #d8a15a; border-top: 1px solid var(--border-soft); padding-top: 8px; margin-top: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 40;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  max-width: min(560px, calc(100vw - 40px));
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #33425c;
  background: rgba(20, 29, 44, 0.97);
  color: #dbe4f2;
  font-size: 11px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- run / roles ---------- */
.role-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  color: #9fc4ff;
  background: rgba(79, 140, 255, 0.10);
  border: 1px solid rgba(79, 140, 255, 0.25);
  font-family: var(--mono);
  white-space: nowrap;
}
.run-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
  font-size: 10px;
  color: #7f8ba3;
  white-space: nowrap;
}
.run-hud #runDay { color: #c8d3e5; font-family: var(--mono); }
.run-bar {
  width: 120px;
  height: 4px;
  border-radius: 3px;
  background: #0d1420;
  border: 1px solid #1a2638;
  overflow: hidden;
}
.run-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4f8cff, #35d07f);
  transition: width 0.3s ease;
}
.run-goal { color: #56637a; }
.run-hud.final #runDay { color: var(--red); }

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 600px at 50% 20%, rgba(39, 72, 130, 0.35), transparent 60%),
    rgba(4, 7, 12, 0.92);
  backdrop-filter: blur(6px);
}
.start-screen.hidden { display: none; }
.start-card {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid #2a3a55;
  border-radius: 16px;
  background: linear-gradient(180deg, #172134, #0e1521);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.65);
  padding: 28px;
}
.start-kicker { font-size: 10px; letter-spacing: 2px; color: var(--yellow); text-transform: uppercase; }
.start-card h1 { margin: 8px 0 6px; font-size: 38px; letter-spacing: 1px; }
.start-sub { margin: 0 0 18px; color: #9aa8bd; font-size: 13px; line-height: 1.7; }
.start-sub b { color: var(--yellow); }
.start-points { display: flex; flex-direction: column; gap: 7px; margin: 6px 0 18px; }
.start-points > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 11px;
  background: #0e1623;
  border: 1px solid #1a2638;
  border-radius: 8px;
}
.start-points b { min-width: 64px; color: var(--yellow); font-size: 12px; }
.start-points span { font-size: 11px; color: #9aa8bd; line-height: 1.5; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-card {
  text-align: left;
  border: 1px solid #24334a;
  border-radius: 10px;
  background: #0e1623;
  padding: 12px;
  color: #c8d3e5;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: 0.15s ease;
}
.role-card:hover { border-color: #3b5278; background: #131f31; }
.role-card.active {
  border-color: var(--blue);
  background: rgba(79, 140, 255, 0.10);
  box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.25) inset;
}
.role-tag {
  align-self: flex-start;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #9fc4ff;
  background: rgba(79, 140, 255, 0.10);
  border: 1px solid rgba(79, 140, 255, 0.25);
}
.role-tag.hot { color: #ffb3b3; background: rgba(255, 92, 92, 0.10); border-color: rgba(255, 92, 92, 0.25); }
.role-tag.info { color: #8be8b8; background: rgba(53, 208, 127, 0.10); border-color: rgba(53, 208, 127, 0.25); }
.role-card b { font-size: 16px; }
.role-cash { font-family: var(--mono); font-size: 11px; color: var(--yellow); }
.role-perk { font-size: 10px; color: #9be8bd; line-height: 1.4; }
.role-curse { font-size: 10px; color: #d99a9a; line-height: 1.4; }
.start-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.start-note { margin: 12px 0 0; font-size: 10px; color: #56637a; text-align: center; }
.end-card { width: min(560px, calc(100vw - 40px)); text-align: center; }
.end-card h1 { font-size: 42px; }
.end-line { color: #9aa8bd; font-size: 13px; line-height: 1.8; margin: 0 0 16px; }
.end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; }
.end-stat {
  background: #0e1623;
  border: 1px solid #1a2638;
  border-radius: 7px;
  padding: 7px 9px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #7f8ba3;
}
.end-stat b { font-family: var(--mono); color: #dbe4f2; }

.margin-banner {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 92, 92, 0.55);
  background: rgba(40, 18, 22, 0.97);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: marginPulse 1.2s infinite;
}
.margin-banner.hidden { display: none; }
@keyframes marginPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0); }
  50% { box-shadow: 0 0 0 5px rgba(255, 92, 92, 0.08); }
}
.mb-left { display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: #ffb3b3; }
.mb-left b { font-size: 12px; letter-spacing: 1px; }
.mb-left #marginCountdown { font-family: var(--mono); font-size: 16px; color: #fff; }
.mb-left #marginRatio { color: #d99a9a; }
.mb-actions { display: flex; gap: 5px; }
.mb-actions .btn { height: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr) 300px; }
  .clock { min-width: 210px; }
  .account { gap: 12px; }
}
@media (max-width: 1040px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
  .topbar { flex-wrap: wrap; height: auto; flex-basis: auto; padding: 10px 12px; gap: 10px; }
  .account { margin-left: 0; }
  .layout { grid-template-columns: 1fr; }
  .left-panel { max-height: 360px; }
  .center-panel { min-height: 560px; }
  .right-panel { overflow: visible; }
  .chart-wrap { min-height: 300px; }
  .run-hud { display: none; }
  .role-grid { grid-template-columns: 1fr; }
  .start-card { padding: 20px; }
  .start-card h1 { font-size: 30px; }
}
@media (max-width: 640px) {
  .stock-title { font-size: 16px; }
  .stock-quote b { font-size: 20px; }
  .field-row { flex-direction: column; align-items: stretch; }
  .field { flex-basis: auto; }
  .news-list { max-height: 260px; }
}

/* local debug modifier */
.debug-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #3a4d6c;
  background: #111c2c;
  color: #e8b55c;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 22px rgba(0,0,0,0.45);
}
.debug-fab:hover { border-color: #e8b55c; }
.debug-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 7, 13, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.debug-card {
  width: min(560px, 96vw);
  border-radius: 12px;
  border: 1px solid #2a3b56;
  background: #0c1420;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  padding: 16px;
}
.debug-head { display: flex; align-items: baseline; gap: 8px; }
.debug-head b { font-size: 15px; color: #e7eef9; }
.debug-head span { flex: 1; font-size: 10px; color: #6f7f97; }
.debug-x { border: 0; background: transparent; color: #8fa0bb; font-size: 20px; line-height: 1; }
.debug-status {
  margin: 10px 0;
  padding: 8px 9px;
  border-radius: 6px;
  background: #0a111c;
  border: 1px solid #1b2a40;
  color: #a9b8ce;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
}
.debug-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.debug-grid button {
  height: 32px;
  border-radius: 6px;
  border: 1px solid #2a3b56;
  background: #101b2a;
  color: #c8d6ea;
  font-size: 11px;
}
.debug-grid button:hover { border-color: #4f6a94; color: #fff; }
.debug-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid #3a2c22;
  background: #1a140f;
  color: #e8b55c;
  font-size: 11px;
}
.debug-note { margin-top: 9px; color: #66758c; font-size: 9px; line-height: 1.7; }
.test-badge {
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #6b4a1f;
  background: #2a1d0e;
  color: #e8b55c;
  font-size: 9px;
  white-space: nowrap;
}
.tier-badge {
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #27415f;
  background: #0d1826;
  color: #8eb6e6;
  font-size: 9px;
  white-space: nowrap;
}
.pool-line {
  margin: 2px 0 6px;
  padding: 5px 7px;
  border-radius: 5px;
  border: 1px solid #1c2a3f;
  background: #0a111c;
  color: #7d91ad;
  font-size: 9px;
  line-height: 1.5;
}

/* event deck */
.event-modal,
.career-modal,
.roof-screen {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 13, 0.78);
}
.event-card {
  width: min(520px, 94vw);
  border-radius: 12px;
  border: 1px solid #3a4d6c;
  background: linear-gradient(145deg, #101c2c, #0b1320);
  box-shadow: 0 24px 90px rgba(0,0,0,0.7);
  padding: 18px;
  animation: eventIn 0.22s ease-out;
}
@keyframes eventIn {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.event-kicker { color: #e8b55c; font-size: 10px; letter-spacing: 0.12em; }
.event-card h3 { margin: 8px 0 6px; color: #eef4ff; font-size: 20px; line-height: 1.35; }
.event-source { font-size: 10px; color: #8eb6e6; }
.event-body { color: #c8d3e5; font-size: 13px; line-height: 1.8; margin: 12px 0; }
.event-hint { color: #7d8ba3; font-size: 10px; line-height: 1.6; border-left: 2px solid #6b4a1f; padding-left: 8px; }
.event-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.career-card {
  width: min(680px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #2a3b56;
  background: #0c1420;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65);
  padding: 16px;
}
.career-head { display: flex; align-items: baseline; gap: 8px; }
.career-head b { font-size: 15px; color: #e7eef9; }
.career-head span { flex: 1; font-size: 10px; color: #6f7f97; }
.career-card h4 { margin: 14px 0 7px; color: #c8d3e5; font-size: 12px; }
.career-card h4 .muted { font-weight: 400; font-size: 9px; color: #5f6d84; }
.career-stats {
  margin: 9px 0;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid #1b2a40;
  background: #0a111c;
  color: #a9b8ce;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
}
.achievement-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.achievement {
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid #1b2a40;
  background: #0a111c;
  color: #66758c;
  font-size: 9px;
  line-height: 1.5;
}
.achievement.unlocked { border-color: #6b4a1f; background: #1a140f; color: #e8b55c; }
.achievement b { display: block; font-size: 10px; color: #c8d3e5; margin-bottom: 1px; }
.achievement.unlocked b { color: #ffd166; }
.leaderboard { border-top: 1px solid #1a2638; }
.lb-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid #141f30;
  font-size: 10px;
  color: #8c9bb2;
}
.lb-row .rank { width: 28px; font-family: var(--mono); color: #6f7c93; }
.lb-row .name { flex: 1; }
.lb-row .eq { font-family: var(--mono); color: #c8d3e5; }
.lb-row.me { color: #e8b55c; background: #171208; }
.lb-row.me .name, .lb-row.me .eq { color: #ffd166; }
.roof-card {
  width: min(480px, 94vw);
  text-align: center;
  border-radius: 12px;
  border: 1px solid #3a2c22;
  background: linear-gradient(180deg, #101722, #160f0b);
  box-shadow: 0 24px 90px rgba(0,0,0,0.8);
  padding: 26px 20px 20px;
  animation: roofDrop 0.65s cubic-bezier(.2,.8,.2,1);
}
@keyframes roofDrop {
  from { transform: translateY(-22px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.roof-kicker { color: #e8b55c; font-size: 10px; letter-spacing: 0.14em; }
.roof-card h2 { margin: 10px 0; color: #eef4ff; font-size: 24px; }
.roof-stats { color: #a9b8ce; font-size: 11px; line-height: 1.9; margin: 8px 0 16px; white-space: pre-line; }
.roof-actions { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.roof-actions .btn { height: 32px; }
.roof-note { margin-top: 12px; color: #6f6a60; font-size: 9px; }

.mobile-city-btn {
  display: none;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #2a3b56;
  background: #0d1420;
  color: #8eb6e6;
  font-size: 11px;
}
.mobile-city-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(3, 7, 13, 0.82);
}
.mobile-city-card {
  width: min(620px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid #2a3b56;
  background: #0c1420;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  padding: 14px;
}
.mobile-city-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mobile-city-head b { color: #e7eef9; font-size: 15px; }
.mobile-city-search {
  width: 100%;
  height: 34px;
  border-radius: 7px;
  border: 1px solid #263550;
  background: #0a111c;
  color: #d7e1f0;
  padding: 0 10px;
  font-size: 12px;
  outline: none;
  margin-bottom: 8px;
}
.mobile-city-list {
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.mobile-city-region {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: #6f7c93;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.mobile-city-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid #1b2a40;
  background: #0a111c;
  color: #c8d3e5;
  font-size: 11px;
  text-align: left;
}
.mobile-city-item small {
  color: #6f7c93;
  font-family: var(--mono);
  font-size: 9px;
}
.mobile-city-item.active { border-color: #3f6ea8; background: #101d30; }
@media (max-width: 1040px) {
  .mobile-city-btn { display: inline-flex; align-items: center; }
}
@media (max-width: 640px) {
  .mobile-city-list { grid-template-columns: 1fr; }
  .mobile-city-card { max-height: 86vh; }
}
