:root {
  color-scheme: dark;
  --bg: #050d17;
  --panel: #0b1828;
  --panel-strong: #0e2034;
  --panel-soft: #0a1523;
  --line: #20364d;
  --line-strong: #2d4d68;
  --text: #ebf3fc;
  --muted: #8ea4bd;
  --cyan: #31d8cd;
  --cyan-soft: rgba(49, 216, 205, .12);
  --blue: #68a7ff;
  --green: #3cdda0;
  --red: #ff6882;
  --gold: #f8c86c;
  --shadow: 0 20px 48px rgba(0, 0, 0, .2);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scrollbar-gutter: stable; scrollbar-color: rgba(49, 216, 205, .58) rgba(5, 13, 23, .72); scrollbar-width: thin; }
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: rgba(5, 13, 23, .72); }
html::-webkit-scrollbar-thumb { border: 2px solid rgba(5, 13, 23, .72); border-radius: 999px; background: rgba(49, 216, 205, .58); }
html::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(39, 75, 105, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 75, 105, .1) 1px, transparent 1px),
    radial-gradient(ellipse at 75% 100%, rgba(19, 107, 111, .18), transparent 36%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(122deg, rgba(45, 166, 188, .09), transparent 32%);
}
.shell { position: relative; width: min(100%, 1600px); min-height: 100vh; margin: 0 auto; padding: 28px 34px; }
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.muted { color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; line-height: 1.1; letter-spacing: .02em; }
h2 { margin-bottom: 0; font-size: 19px; line-height: 1.25; }
h3 { margin-bottom: 20px; font-size: 15px; }

.auth-layout { width: min(100%, 1100px); min-height: calc(100vh - 56px); display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 430px); align-items: center; gap: clamp(48px, 8vw, 120px); margin: 0 auto; }
.brand-panel { position: relative; padding-left: 28px; animation: brand-enter .72s cubic-bezier(.2, .8, .2, 1) both; }
.brand-panel::before { position: absolute; top: 4px; bottom: 4px; left: 0; width: 2px; content: ""; background: linear-gradient(var(--cyan), transparent); }
.brand-panel::after { position: absolute; bottom: 4px; left: -4px; width: 10px; height: 10px; content: ""; border: 1px solid var(--cyan); background: var(--bg); box-shadow: 0 0 0 5px rgba(49, 216, 205, .08); animation: signal-pulse 2.4s ease-in-out infinite; }
.brand-copy { position: relative; z-index: 1; }
.brand-panel h1 { font-size: clamp(46px, 6vw, 76px); text-wrap: balance; }
.brand-panel > p:last-child { max-width: 370px; margin-top: 22px; color: var(--muted); font-size: 16px; }
.brand-copy > p:last-child { max-width: 370px; margin-top: 22px; color: var(--muted); font-size: 16px; }
.login-performance { position: relative; height: 164px; max-width: 530px; margin-top: 30px; overflow: hidden; border-top: 1px solid rgba(45, 77, 104, .7); border-bottom: 1px solid rgba(45, 77, 104, .35); }
.login-performance::before { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; content: ""; background: rgba(49, 216, 205, .55); }
.login-performance canvas { display: block; width: 100%; height: 100%; }

.auth-form,
.admin-grid form,
.detail-content {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(15, 33, 53, .96), rgba(7, 17, 29, .97));
  box-shadow: var(--shadow);
}
.auth-form::before,
.admin-grid form::before,
.detail-content::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--cyan), transparent 72%);
}
.auth-form { padding: 32px; }
.auth-layout .auth-form { animation: form-enter .72s .12s cubic-bezier(.2, .8, .2, 1) both; }
.auth-layout .auth-form::after { position: absolute; top: 0; left: -36%; width: 36%; height: 2px; content: ""; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: form-scan 3.8s 1.1s ease-in-out infinite; }
label { display: grid; gap: 8px; margin: 17px 0; color: var(--muted); font-size: 12px; font-weight: 650; }
input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #2b4661;
  border-radius: 4px;
  outline: none;
  color: var(--text);
  background: rgba(4, 14, 25, .74);
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
select { appearance: auto; }
input:hover,
select:hover { border-color: #3e647f; }
input:focus,
select:focus { border-color: var(--cyan); background: rgba(5, 20, 32, .96); box-shadow: 0 0 0 3px rgba(49, 216, 205, .1); }
button {
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #031817;
  background: var(--cyan);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
button:hover { transform: translateY(-1px); background: #53e3da; }
button:active { transform: translateY(0); }
.text-button { width: 100%; margin-top: 12px; color: var(--muted); background: transparent; font-weight: 650; }
.text-button:hover { color: var(--cyan); background: var(--cyan-soft); }
.secondary-button { color: var(--text); border-color: var(--line-strong); background: rgba(10, 24, 39, .72); }
.secondary-button:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-soft); }
.icon-button { display: inline-grid; width: 40px; height: 40px; padding: 0; place-items: center; color: var(--text); border-color: var(--line-strong); background: rgba(10, 24, 39, .9); font-size: 21px; }
.icon-button:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-soft); }
.form-error { min-height: 21px; margin-bottom: 0; color: var(--red); font-size: 12px; }
.password-page { width: min(100%, 520px); }
.password-form { margin-top: 22px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-grid;
  width: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  color: var(--muted);
  border: 0;
  background: transparent;
}
.password-toggle:hover { transform: translateY(-50%); color: var(--cyan); background: var(--cyan-soft); }
.password-toggle[aria-pressed="true"] { color: var(--cyan); }
.password-eye { position: relative; display: block; width: 17px; height: 11px; border: 1.5px solid currentColor; border-radius: 60% / 75%; }
.password-eye::after { position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; content: ""; transform: translate(-50%, -50%); border-radius: 50%; background: currentColor; }

@keyframes brand-enter { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes form-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes signal-pulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(49, 216, 205, .08); } 50% { box-shadow: 0 0 0 10px rgba(49, 216, 205, 0); } }
@keyframes form-scan { 0%, 16% { transform: translateX(0); } 55%, 100% { transform: translateX(380%); } }
@media (prefers-reduced-motion: reduce) {
  .brand-panel,
  .auth-layout .auth-form,
  .brand-panel::after,
  .auth-layout .auth-form::after { animation: none; }
}

.topbar,
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar { min-height: 74px; margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.viewer-email { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-ip { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }
.detail-server-ip { margin: 6px 0 0; font-size: 12px; }

.metric-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
#overview-page .metric-grid { margin-bottom: 10px; }
#polymarket-overview-page .metric-grid { margin-bottom: 10px; }
.metric {
  position: relative;
  flex: 1 1 210px;
  min-height: 104px;
  padding: 15px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(15, 34, 54, .98), rgba(7, 18, 30, .96));
  box-shadow: 0 12px 24px rgba(0, 0, 0, .09);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.metric::after { position: absolute; right: 12px; bottom: 12px; width: 26px; height: 26px; border-right: 1px solid rgba(104, 167, 255, .32); border-bottom: 1px solid rgba(104, 167, 255, .32); content: ""; }
.metric:hover { transform: translateY(-3px); border-color: #3a607c; box-shadow: 0 17px 30px rgba(0, 0, 0, .19); }
.metric-3 { border-color: rgba(104, 167, 255, .34); }
.metric-4,
.metric-5 { border-color: rgba(60, 221, 160, .32); }
.metric-1,
.metric-2 {
  flex: 0 1 150px;
  min-width: 130px;
}
.metric-3 { flex-basis: 250px; }
.metric-4,
.metric-5 { flex-basis: 280px; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric .value { margin-top: 11px; font-size: 26px; font-weight: 780; letter-spacing: .01em; white-space: nowrap; }
.metric-rate { font-size: 15px; font-weight: 700; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.metric .value.positive { color: var(--green); }
.metric .value.negative { color: var(--red); }

.table-section,
.detail-section,
.admin-section { padding: 26px 0; }
.section-heading { margin-bottom: 18px; }
.section-heading > div { min-width: 0; }
.account-control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 22px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(8, 21, 35, .82);
}
.account-control-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); align-items: stretch; gap: 10px 18px; min-width: 0; }
.account-control-status > div { display: grid; align-content: center; gap: 3px; min-width: 0; padding: 2px 0; }
.account-control-status span { color: var(--muted); font-size: 11px; }
.account-control-status strong { overflow-wrap: anywhere; font-size: 13px; font-variant-numeric: tabular-nums; }
.account-control-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-control-actions button { min-height: 36px; padding: 7px 12px; }
.account-control-message { grid-column: 1 / -1; margin: -3px 0 0; font-size: 12px; }
button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.account-table-section { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) auto; align-items: end; column-gap: 12px; row-gap: 8px; padding-top: 8px; }
.account-list-heading { justify-content: flex-start; margin-bottom: 0; }
.account-search { width: min(290px, 34vw); margin: 0; }
.account-search span { color: #9db4cc; font-size: 11px; letter-spacing: .04em; }
.account-search input { min-height: 38px; padding-top: 8px; padding-bottom: 8px; }
.account-table-meta { display: flex; grid-column: 3; align-self: end; justify-content: flex-end; margin: 0 2px 2px; }
.account-table-meta #last-updated { margin: 0; white-space: nowrap; }
.account-table-section > .table-wrap { grid-column: 1 / -1; }
.table-wrap { margin-top: 0; overflow: auto; border: 1px solid var(--line); background: rgba(7, 18, 30, .86); box-shadow: var(--shadow); }
.initial-capital-display { display: flex; align-items: center; gap: 8px; min-height: 34px; white-space: nowrap; }
.initial-capital-display strong { color: var(--text); font-variant-numeric: tabular-nums; }
.initial-capital-display.is-empty strong { color: var(--muted); font-weight: 600; }
.stop-loss-display { display: flex; align-items: center; gap: 6px; min-height: 24px; white-space: nowrap; }
.stop-loss-display strong { color: var(--text); font-variant-numeric: tabular-nums; }
.account-name-display { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.account-name-display + .muted { display: block; margin-top: 2px; }
.compact-text-button { width: auto; min-height: 28px; margin: 0; padding: 4px 7px; font-size: 12px; }
.compact-text-button.icon-button { display: inline-grid; width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 6px; place-items: center; border-radius: 6px; }
.compact-text-button.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.compact-text-button.icon-button.initial-capital-edit-button,
.compact-text-button.icon-button.account-name-edit-button,
.compact-text-button.icon-button.stop-loss-reset-button { width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 5px; border-radius: 5px; }
.compact-text-button.icon-button.initial-capital-edit-button svg,
.compact-text-button.icon-button.account-name-edit-button svg,
.compact-text-button.icon-button.stop-loss-reset-button svg { width: 13px; height: 13px; }
.inline-initial-capital-form { display: flex; align-items: center; gap: 8px; min-width: 250px; }
.inline-initial-capital-form input { width: 112px; min-height: 34px; padding: 6px 8px; }
.inline-initial-capital-actions { display: flex; gap: 6px; }
.inline-account-name-form { display: flex; align-items: center; gap: 6px; min-width: 260px; }
.inline-account-name-form input { width: 132px; min-height: 30px; padding: 5px 7px; }
.inline-account-name-actions { display: flex; gap: 5px; }
table { width: 100%; min-width: 900px; border-collapse: collapse; }
th,
td { padding: 14px 15px; text-align: left; border-bottom: 1px solid rgba(33, 58, 82, .78); }
th { color: #9db4cc; background: rgba(17, 37, 58, .93); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
tbody tr { cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(49, 216, 205, .07); box-shadow: inset 3px 0 var(--cyan); }
td strong { font-weight: 750; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 12px; }
.status::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: var(--muted); box-shadow: 0 0 0 3px rgba(142, 164, 189, .1); }
.status.online::before { background: var(--green); box-shadow: 0 0 0 3px rgba(60, 221, 160, .13); }
.status.stale::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(248, 200, 108, .13); }

.detail-content { min-height: 150px; max-height: 560px; margin-top: 0; padding: 0; overflow: auto; }
.detail-content > .empty { margin: 0; }
.detail-content.position-view { min-height: 0; max-height: none; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.detail-content.position-view::before { display: none; }
.detail-row { padding: 10px 0; border-bottom: 1px solid rgba(33, 51, 74, .75); }
.detail-row:last-child { border-bottom: 0; }
.detail-row code { display: block; color: #bad0e6; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.tabs { display: flex; gap: 8px; margin: 0 0 16px; padding: 4px; width: fit-content; border: 1px solid var(--line); background: rgba(8, 19, 32, .72); }
.tabs button { min-height: 34px; padding: 6px 14px; color: var(--muted); border-color: transparent; background: transparent; }
.tabs button:hover { color: var(--text); background: rgba(49, 216, 205, .08); }
.tabs button.active { color: #06201e; background: var(--cyan); }
.position-list { display: grid; gap: 24px; }
.position-event { border-top: 1px solid rgba(157, 180, 204, .24); }
.position-event-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 12px 15px; }
.position-event-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.position-event-title strong,
.position-event-title span { display: block; }
.position-event-title strong { font-size: 15px; }
.position-event-title div > span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.asset-badge { position: relative; display: inline-grid; width: 38px; height: 38px; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(49, 216, 205, .45); border-radius: 6px; color: var(--cyan); background: rgba(49, 216, 205, .1); box-shadow: inset 0 0 16px rgba(49, 216, 205, .08), 0 7px 18px rgba(0, 0, 0, .18); font-size: 11px; font-weight: 850; letter-spacing: .02em; }
.asset-badge::after { position: absolute; right: 3px; bottom: 3px; width: 5px; height: 5px; content: ""; background: currentColor; box-shadow: 0 0 8px currentColor; }
.asset-badge.asset-btc { color: #ffae43; border-color: rgba(255, 174, 67, .58); background: rgba(255, 158, 38, .15); }
.asset-badge.asset-eth { color: #9eb9ff; border-color: rgba(158, 185, 255, .58); background: rgba(96, 128, 235, .16); }
.asset-badge.asset-sol { color: #61e5c3; border-color: rgba(97, 229, 195, .56); background: rgba(42, 173, 143, .14); }
.asset-badge.asset-xrp { color: #d5e2f0; border-color: rgba(213, 226, 240, .46); background: rgba(174, 193, 214, .12); }
.asset-badge.asset-bnb { color: #f5cf6e; border-color: rgba(245, 207, 110, .58); background: rgba(211, 159, 46, .14); }
.asset-badge.asset-doge { color: #e8cf78; border-color: rgba(232, 207, 120, .58); background: rgba(190, 152, 45, .14); }
.asset-badge.asset-hype { color: #f3819a; border-color: rgba(243, 129, 154, .56); background: rgba(199, 65, 97, .14); }
.position-event-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.position-columns,
.position-row,
.position-total { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(90px, 1fr)) minmax(72px, .7fr); align-items: center; gap: 14px; }
.position-columns { padding: 9px 12px; color: var(--muted); border-top: 1px solid rgba(157, 180, 204, .18); border-bottom: 1px solid rgba(157, 180, 204, .18); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.position-row { min-height: 58px; padding: 9px 12px; border-bottom: 1px solid rgba(157, 180, 204, .18); color: #dbe7f3; transition: background .16s ease; }
.position-row:hover { background: rgba(49, 216, 205, .055); }
.position-market { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; align-items: center; min-width: 0; }
.position-market > span:not(.position-side) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.position-market small { grid-column: 2; margin-top: 2px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.position-side { color: var(--green); font-size: 12px; font-weight: 800; }
.position-side.no { color: var(--red); }
.position-total { padding: 13px 12px; color: #d8e3ed; border-bottom: 1px solid rgba(157, 180, 204, .28); font-weight: 700; }
.position-close-button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.detail-content.history-view { min-height: 0; max-height: none; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.detail-content.history-view::before { display: none; }
.detail-content.prediction-resource-view { min-height: 0; max-height: none; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.detail-content.prediction-resource-view::before { display: none; }
.prediction-resource { overflow: hidden; border: 1px solid rgba(45, 77, 104, .82); background: linear-gradient(135deg, rgba(9, 25, 40, .96), rgba(7, 18, 30, .92)); box-shadow: 0 14px 30px rgba(0, 0, 0, .15); }
.prediction-resource-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-bottom: 1px solid rgba(45, 77, 104, .7); background: rgba(14, 34, 54, .54); }
.prediction-resource-header > div > span,
.prediction-resource-header > div > strong,
.prediction-resource-header > div > small { display: block; }
.prediction-resource-header > div > span { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .07em; }
.prediction-resource-header > div > strong { margin-top: 3px; color: var(--text); font-size: 15px; }
.prediction-resource-total { text-align: right; }
.prediction-resource-total small { margin-top: 3px; font-size: 11px; }
.prediction-card-market { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.prediction-card-market > div,
.prediction-card-market > strong { min-width: 0; }
.prediction-card-market strong { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.45; }
.prediction-card-market small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.prediction-outcome { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid rgba(49, 216, 205, .38); border-radius: 999px; color: var(--cyan); background: rgba(49, 216, 205, .08); font-size: 11px; font-weight: 800; white-space: nowrap; }
.prediction-outcome.down { border-color: rgba(244, 92, 113, .48); color: #ff9cac; background: rgba(173, 39, 61, .12); }
.prediction-outcome.neutral { border-color: rgba(157, 180, 204, .38); color: var(--muted); background: rgba(157, 180, 204, .08); }
.pm-resource-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 9px; padding: 13px 16px; border: 1px solid rgba(45, 77, 104, .64); border-radius: 8px; background: linear-gradient(100deg, rgba(14, 34, 54, .5), rgba(9, 25, 40, .24)); box-shadow: inset 0 1px rgba(198, 225, 244, .025); }
.pm-resource-toolbar > div > span,
.pm-resource-toolbar > div > strong { display: block; }
.pm-resource-toolbar > div > span { color: #81909d; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.pm-resource-toolbar > div > strong { margin-top: 3px; color: #e7edf2; font-size: 14px; letter-spacing: .01em; }
.pm-resource-toolbar > small { color: #8d9aa5; font-size: 11px; text-align: right; }
.prediction-positions-resource { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.pm-position-columns,
.pm-position-row { display: grid; grid-template-columns: minmax(320px, 2.15fr) minmax(150px, .9fr) minmax(100px, .7fr) minmax(100px, .7fr) minmax(130px, .8fr); align-items: center; gap: 18px; }
.pm-position-columns { margin-bottom: 9px; padding: 12px 16px 10px; color: #81909d; border-bottom: 1px solid rgba(45, 77, 104, .58); background: transparent; font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.pm-position-row { position: relative; min-height: 74px; margin-top: 8px; padding: 12px 15px 12px 17px; overflow: hidden; border: 1px solid rgba(45, 77, 104, .82); border-radius: 9px; background: linear-gradient(102deg, rgba(13, 30, 45, .72), rgba(9, 23, 36, .42)); color: #dbe7f3; box-shadow: 0 8px 19px rgba(0, 0, 0, .1), inset 0 1px rgba(198, 225, 244, .02); transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.pm-position-row::before,
.pm-history-row::before,
.prediction-trade-row::before { position: absolute; top: 13px; bottom: 13px; left: 0; width: 2px; border-radius: 0 2px 2px 0; background: linear-gradient(#4ed8cd, rgba(78, 216, 205, .08)); content: ''; opacity: .74; }
.pm-position-row:hover { border-color: rgba(74, 169, 179, .78); background: linear-gradient(102deg, rgba(17, 42, 58, .78), rgba(10, 29, 43, .58)); box-shadow: 0 12px 26px rgba(0, 0, 0, .17), inset 0 1px rgba(198, 225, 244, .04); transform: translateY(-1px); }
.pm-position-market { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-position-market > div { min-width: 0; }
.pm-position-market strong { display: block; overflow: hidden; color: #e4e9ed; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.pm-position-market small { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: #8d9aa5; font-size: 11px; }
.pm-asset-icon { display: inline-grid; width: 43px; height: 43px; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; color: #f5f7fa; background: #4450d7; box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 5px 12px rgba(0, 0, 0, .2); font-size: 11px; font-weight: 850; letter-spacing: .02em; }
.pm-asset-eth { color: #eef2ff; background: linear-gradient(145deg, #8298ff, #5e6ddd); }
.pm-asset-sol { color: #0b1c1b; background: linear-gradient(145deg, #aa6dff, #40e1c3 58%, #6584ff); }
.pm-asset-btc { color: #fff4e2; background: #e98a2e; }
.pm-asset-doge { color: #261c07; background: #d8b949; }
.pm-asset-xrp { color: #eaf2f7; background: #384a57; }
.pm-asset-bnb { color: #231b05; background: #e7b82b; }
.pm-asset-pm { color: #eef3f6; background: #32424f; }
.pm-outcome { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border-radius: 5px; color: #63d5a3; background: rgba(41, 168, 107, .2); font-size: 11px; font-weight: 700; }
.pm-outcome.down { color: #fb8795; background: rgba(207, 61, 77, .18); }
.pm-outcome.neutral { color: #a8b4bd; background: rgba(127, 144, 155, .16); }
.pm-position-cell,
.pm-position-value { color: #b1bdc7; font-size: 13px; font-variant-numeric: tabular-nums; }
.pm-price-pair { color: #9faeba; }
.pm-price-pair span { margin: 0 3px; color: #71808c; }
.pm-position-value { text-align: left; }
.pm-position-value strong,
.pm-position-value small { display: block; }
.pm-position-value strong { color: #f0f5f8; font-size: 14px; }
.pm-position-value small { margin-top: 3px; font-size: 11px; }
.prediction-trade-feed-resource { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.prediction-trade-list { display: grid; gap: 8px; }
.prediction-trade-row { position: relative; display: grid; grid-template-columns: 104px minmax(320px, 2.2fr) minmax(104px, .62fr) 154px; align-items: center; gap: 18px; min-height: 72px; padding: 12px 15px 12px 17px; overflow: hidden; border: 1px solid rgba(45, 77, 104, .82); border-radius: 9px; background: linear-gradient(102deg, rgba(13, 30, 45, .72), rgba(9, 23, 36, .42)); color: #dbe7f3; box-shadow: 0 8px 19px rgba(0, 0, 0, .1), inset 0 1px rgba(198, 225, 244, .02); transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.prediction-trade-row::before { background: linear-gradient(#8094a5, rgba(128, 148, 165, .08)); }
.prediction-trade-row:hover { border-color: rgba(74, 169, 179, .78); background: linear-gradient(102deg, rgba(17, 42, 58, .78), rgba(10, 29, 43, .58)); box-shadow: 0 12px 26px rgba(0, 0, 0, .17), inset 0 1px rgba(198, 225, 244, .04); transform: translateY(-1px); }
.prediction-trade-row time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.prediction-activity-type { display: inline-flex; align-items: center; gap: 7px; color: #aebbc7; font-size: 12px; font-weight: 800; white-space: nowrap; }
.prediction-activity-type > span { display: inline-grid; width: 18px; height: 18px; place-items: center; border: 1px solid rgba(157, 180, 204, .55); border-radius: 50%; color: #b8c7d4; background: rgba(157, 180, 204, .08); font-size: 13px; line-height: 1; }
.prediction-activity-type.redeem,
.prediction-activity-type.reward { color: #63d5a3; }
.prediction-activity-type.redeem > span,
.prediction-activity-type.reward > span { border-color: rgba(41, 168, 107, .55); background: rgba(41, 168, 107, .18); color: #63d5a3; }
.prediction-activity-type.buy { color: #d3dde5; }
.prediction-activity-type.sell { color: #ff9cac; }
.prediction-activity-type.sell > span { border-color: rgba(244, 92, 113, .55); color: #ff9cac; }
.prediction-activity-market { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prediction-activity-market > div { min-width: 0; }
.prediction-activity-market strong { display: block; overflow: hidden; color: #e4e9ed; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.prediction-activity-market small { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: #8d9aa5; font-size: 11px; }
.prediction-activity-detail { color: #8d9aa5; }
.prediction-activity-value { color: #e4e9ed; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.prediction-activity-value.debit { color: #e4e9ed; }
.prediction-activity-value.credit { color: #63d5a3; }
.prediction-activity-value.neutral { color: #aebbc7; }
.prediction-position-history-resource { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.pm-history-columns,
.pm-history-row { display: grid; grid-template-columns: 88px minmax(320px, 2.2fr) minmax(120px, .7fr) minmax(130px, .8fr); align-items: center; gap: 18px; }
.pm-history-columns { margin-bottom: 9px; padding: 12px 16px 10px; color: #81909d; border-bottom: 1px solid rgba(45, 77, 104, .58); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.pm-history-row { position: relative; min-height: 74px; margin-top: 8px; padding: 12px 15px 12px 17px; overflow: hidden; border: 1px solid rgba(45, 77, 104, .82); border-radius: 9px; background: linear-gradient(102deg, rgba(13, 30, 45, .72), rgba(9, 23, 36, .42)); color: #dbe7f3; box-shadow: 0 8px 19px rgba(0, 0, 0, .1), inset 0 1px rgba(198, 225, 244, .02); transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.pm-history-row::before { background: linear-gradient(#8b9baa, rgba(139, 155, 170, .08)); }
.pm-history-row:hover { border-color: rgba(74, 169, 179, .78); background: linear-gradient(102deg, rgba(17, 42, 58, .78), rgba(10, 29, 43, .58)); box-shadow: 0 12px 26px rgba(0, 0, 0, .17), inset 0 1px rgba(198, 225, 244, .04); transform: translateY(-1px); }
.pm-history-status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 4px 7px; border: 1px solid rgba(127, 144, 155, .3); border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pm-history-status span { display: inline-grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; font-size: 11px; line-height: 1; }
.pm-history-status.win { color: #63d5a3; }
.pm-history-status.win span { background: rgba(41, 168, 107, .22); }
.pm-history-status.loss { color: #fb8795; }
.pm-history-status.loss span { background: rgba(207, 61, 77, .22); }
.pm-history-status.flat { color: #a8b4bd; }
.pm-history-status.flat span { background: rgba(127, 144, 155, .16); }
.pm-history-market { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-history-market > div { min-width: 0; }
.pm-history-market strong { display: block; overflow: hidden; color: #e4e9ed; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.pm-history-market small { display: block; margin-top: 5px; color: #8d9aa5; font-size: 11px; }
.pm-history-asset-icon { width: 43px; height: 43px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; object-fit: cover; background: #32424f; box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 5px 12px rgba(0, 0, 0, .2); }
.pm-history-cost,
.pm-history-settlement { color: #b1bdc7; font-size: 13px; font-variant-numeric: tabular-nums; }
.pm-history-settlement strong,
.pm-history-settlement small { display: block; }
.pm-history-settlement strong { color: #e4e9ed; font-size: 14px; }
.pm-history-settlement small { margin-top: 3px; font-size: 11px; }
.history-list { display: grid; gap: 24px; }
.history-event { border-top: 1px solid rgba(157, 180, 204, .24); }
.history-event-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 12px 15px; }
.history-columns,
.history-row,
.history-total { display: grid; grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(90px, 1fr)); align-items: center; gap: 14px; }
.history-columns { padding: 9px 12px; color: var(--muted); border-top: 1px solid rgba(157, 180, 204, .18); border-bottom: 1px solid rgba(157, 180, 204, .18); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.history-row { min-height: 59px; padding: 9px 12px; border-bottom: 1px solid rgba(157, 180, 204, .18); color: #dbe7f3; transition: background .16s ease; }
.history-row:hover { background: rgba(49, 216, 205, .055); }
.history-market { min-width: 0; }
.history-market > span,
.history-market small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-market small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.history-total { padding: 13px 12px; color: #d8e3ed; border-bottom: 1px solid rgba(157, 180, 204, .28); font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; gap: 8px; }
.pagination .secondary-button { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.pagination-size { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; }
.pagination-size select { width: auto; min-height: 34px; padding: 5px 27px 5px 9px; font-size: 12px; }
.pagination button:disabled { cursor: not-allowed; opacity: .38; transform: none; }
.pagination button:disabled:hover { color: var(--text); border-color: var(--line-strong); background: rgba(10, 24, 39, .72); }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 0; }
.admin-grid form,
.admin-grid .detail-content { min-height: 300px; padding: 27px; }
.admin-grid .detail-content { margin: 0; }
.admin-grid form { display: flex; flex-direction: column; align-items: stretch; }
.admin-grid form > button { align-self: flex-start; margin-top: 4px; }
.admin-grid form > .code-result { margin-top: auto; padding-top: 16px; }
.admin-grid form h3,
.admin-grid .detail-content h3 { margin-bottom: 8px; }
.agent-key-panel { min-height: 300px; padding: 27px; }
.agent-key-list { display: grid; gap: 10px; margin-top: 16px; }
.agent-key-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid rgba(45, 77, 104, .7); background: rgba(7, 18, 30, .5); }
.agent-key-row strong,
.agent-key-row code,
.agent-key-row span { display: block; }
.agent-key-row strong { color: var(--cyan); font-size: 12px; }
.agent-key-row code { margin-top: 3px; color: var(--text); font-size: 12px; }
.agent-key-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.agent-key-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.agent-key-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.account-delete { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(165, 64, 82, .36); }
.account-delete .muted { margin: 0 0 12px; font-size: 12px; line-height: 1.65; }
.danger-button { border-color: rgba(244, 92, 113, .72); color: #ff9cac; background: rgba(116, 29, 45, .22); }
.danger-button:hover:not(:disabled) { border-color: #ff5c71; color: #fff1f3; background: rgba(151, 35, 54, .38); }
.danger-button:disabled { cursor: not-allowed; opacity: .45; }
.admin-grid .detail-content > p.muted { max-width: 520px; line-height: 1.75; }
.code-result { min-height: 21px; margin-bottom: 0; color: var(--gold); word-break: break-all; font-size: 12px; }
.permission-list { margin-top: 16px; }
.permission-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(33, 58, 82, .8); color: var(--muted); }
.permission-row:last-child { border-bottom: 0; }
.permission-row button { min-height: 32px; padding: 5px 10px; color: var(--cyan); border-color: rgba(49, 216, 205, .28); background: var(--cyan-soft); font-size: 12px; }
.permission-row button:hover { color: #061c1a; background: var(--cyan); }
.recipient-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.recipient-actions button { white-space: nowrap; }
.account-management { display: grid; gap: 16px; }
.account-management-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px);
  gap: 18px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(9, 23, 38, .8);
  box-shadow: var(--shadow);
}
.account-management-toolbar > label { margin: 0; }
.management-panel {
  min-height: 330px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(8, 21, 35, .84);
  box-shadow: var(--shadow);
}
.management-panel::before { display: none; }
.management-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(45, 77, 104, .58); }
.management-panel-heading .eyebrow { margin-bottom: 5px; }
.management-panel-heading h3 { margin: 0; }
.management-panel-hint { padding: 4px 7px; color: var(--cyan); border: 1px solid rgba(49, 216, 205, .26); background: rgba(49, 216, 205, .07); font-size: 10px; white-space: nowrap; }
.management-panel > p.muted { margin: 14px 0 0; max-width: 680px; font-size: 12px; line-height: 1.65; }
.permission-panel { display: block; }
.permission-grant { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 18px; }
.permission-grant label { margin: 0; }
.permission-grant button { min-height: 42px; }
.permission-list-section { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(45, 77, 104, .58); }
.permission-list-section h4 { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.permission-list { min-height: 56px; margin-top: 8px; }
.user-module-permission-panel { display: block; max-width: 980px; }
.user-module-permission-list { display: grid; gap: 10px; margin-top: 18px; }
.user-module-permission-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0; padding: 16px; border: 1px solid rgba(45, 77, 104, .68); background: rgba(6, 20, 33, .42); }
.user-module-permission-row strong { color: var(--text); }
.user-module-permission-row p { margin: 5px 0 0; font-size: 12px; }
.user-module-permission-options { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
.module-permission-option { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.module-permission-option input { accent-color: var(--cyan); }
@media (max-width: 720px) { .user-module-permission-row { align-items: flex-start; flex-direction: column; gap: 12px; } }
.account-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 20px; border: 1px solid rgba(165, 64, 82, .4); background: rgba(72, 20, 32, .13); }
.account-danger-zone strong { color: #ffbdc7; font-size: 13px; }
.account-danger-zone p { margin: 5px 0 0; max-width: 760px; font-size: 11px; line-height: 1.55; }
.account-danger-zone button { flex: 0 0 auto; }
#email-recipient-form label:has(input[type="checkbox"]),
#email-recipient-form label:has(input[type="radio"]) { display: flex; align-items: center; gap: 9px; margin: 12px 0; }
#email-recipient-form input[type="checkbox"],
#email-recipient-form input[type="radio"] { width: 15px; min-height: 15px; margin: 0; accent-color: var(--cyan); }
.empty { padding: 30px 20px; color: var(--muted); text-align: center; }

@media (max-width: 1080px) {
  .shell { padding: 24px; }
}
@media (max-width: 760px) {
  .shell { padding: 18px; }
  .auth-layout { min-height: calc(100vh - 36px); grid-template-columns: 1fr; gap: 38px; }
  .brand-panel { padding-left: 20px; }
  .brand-panel h1 { font-size: 44px; }
  .login-performance { height: 122px; max-width: 100%; margin-top: 24px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 18px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .viewer-email { flex: 1 1 180px; }
  .metric-grid,
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-management-toolbar { grid-template-columns: 1fr; }
  .metric { min-height: 104px; padding: 14px; }
  .metric .value { font-size: 22px; }
  .metric-rate { font-size: 13px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .account-table-section { grid-template-columns: 1fr; row-gap: 8px; }
  .account-table-meta { grid-column: 1; justify-content: flex-start; }
  .account-search { width: min(100%, 360px); }
  .account-table-meta { margin-top: -2px; }
  .pagination { align-items: flex-start; flex-wrap: wrap; justify-content: flex-start; }
  .account-control-panel { grid-template-columns: 1fr; gap: 12px; padding: 13px; }
  .account-control-status { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .account-control-status > div { min-height: 54px; padding: 9px 10px; border: 1px solid rgba(45, 77, 104, .58); background: rgba(7, 18, 30, .35); }
  .account-control-actions { width: 100%; }
  .account-control-actions button { width: 100%; }
  .account-control-message { margin: 0; line-height: 1.55; }
  .position-columns,
  .position-row,
  .position-total,
  .history-columns,
  .history-row,
  .history-total { min-width: 760px; }
  .position-event,
  .history-event { overflow-x: auto; }
  .prediction-trade-row { grid-template-columns: 96px minmax(230px, 1fr) minmax(92px, .5fr) 136px; gap: 12px; padding: 12px 14px; }
  .pm-position-columns { display: none; }
  .pm-history-columns { display: none; }
  .pm-position-row { grid-template-columns: minmax(0, 1fr) minmax(118px, .65fr); gap: 10px 16px; padding: 13px; }
  .pm-history-row { grid-template-columns: minmax(0, 1fr) minmax(112px, .62fr); gap: 10px 16px; padding: 13px; }
  .pm-position-market { grid-column: 1 / -1; }
  .pm-history-market { grid-column: 1 / -1; }
  .pm-trade-amount::before,
  .pm-win-amount::before,
  .pm-position-value::before { display: block; margin-bottom: 3px; color: #81909d; font-size: 10px; }
  .pm-trade-amount::before { content: '交易金额'; }
  .pm-win-amount::before { content: '可赢利益'; }
  .pm-position-value::before { content: '价值'; }
}
@media (max-width: 480px) {
  .shell { padding: 14px; }
  .metric-grid,
  .admin-grid { grid-template-columns: 1fr; }
  .account-name-edit,
  .permission-grant { grid-template-columns: 1fr; }
  .account-name-edit button,
  .permission-grant button { justify-self: start; }
  .account-danger-zone { align-items: flex-start; flex-direction: column; }
  .auth-form,
  .admin-grid form,
  .admin-grid .detail-content { padding: 22px; }
  .topbar-actions > .secondary-button { padding-right: 11px; padding-left: 11px; }
  .account-control-status { grid-template-columns: 1fr; }
  .pm-resource-toolbar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pm-resource-toolbar > small { text-align: left; }
  .prediction-trade-row { grid-template-columns: 1fr auto; gap: 9px 12px; padding: 13px; }
  .prediction-activity-type { grid-column: 1; grid-row: 1; }
  .prediction-activity-market { grid-column: 1 / -1; grid-row: 2; }
  .prediction-activity-value { grid-column: 2; grid-row: 1; }
  .prediction-trade-row time { grid-column: 2; grid-row: 3; }
}
