:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --bg-raised: #111417;
  --panel: #15191d;
  --panel-2: #1a2025;
  --panel-3: #20272d;
  --line: #2b343b;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #edf2f1;
  --muted: #9ca9a8;
  --muted-2: #74817f;
  --green: #2fd18a;
  --green-soft: rgba(47, 209, 138, 0.12);
  --red: #ff6868;
  --red-soft: rgba(255, 104, 104, 0.12);
  --amber: #f2c66d;
  --amber-soft: rgba(242, 198, 109, 0.13);
  --blue: #7db9ff;
  --blue-soft: rgba(125, 185, 255, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #121619 0, var(--bg) 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.access-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 9, 0.78);
  backdrop-filter: blur(10px);
}

.access-overlay[hidden],
.profit-panel[hidden] {
  display: none;
}

.access-box {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.access-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.access-box h2,
.access-box p {
  margin: 0;
}

.access-box > .eyebrow,
.access-box > h2 {
  padding-right: 44px;
}

.access-box h2 {
  font-size: 22px;
}

.access-box p {
  color: var(--muted);
}

.access-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.terms-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101519;
  color: #dce6e4;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.terms-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--green);
}

.text-button {
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  transform: none;
  color: #b7d9ff;
  background: transparent;
}

.access-error {
  min-height: 18px;
  color: #ffb7b7;
  font-size: 13px;
}

.member-status,
.payment-info {
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101519;
  color: #dce6e4;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.42;
}

.member-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
}

.login-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.login-code-row input {
  font-weight: 900;
  letter-spacing: 2px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pricing-card {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #11181d;
}

.pricing-card strong {
  font-size: 16px;
}

.pricing-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.payment-box {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(125, 185, 255, 0.24);
  border-radius: 8px;
  background: rgba(125, 185, 255, 0.07);
}

.payment-box[hidden] {
  display: none;
}

.payment-qr {
  width: min(190px, 100%);
  max-height: 190px;
  object-fit: contain;
  justify-self: center;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #fff;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 48px) 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 20, 23, 0.92);
  backdrop-filter: blur(12px);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.language-control {
  display: grid;
  grid-template-columns: auto minmax(112px, 140px);
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101418;
}

.language-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.language-control select {
  height: 30px;
  min-width: 112px;
  padding: 0 8px;
  border-color: transparent;
  background: var(--panel-2);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.app-header > div:first-child {
  min-width: 0;
}

main {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 3vw, 34px) 34px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
input,
button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
}

select,
input {
  width: 100%;
  min-width: 0;
  padding: 0 11px;
  outline: none;
}

select:focus,
input:focus {
  border-color: rgba(125, 185, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(125, 185, 255, 0.12);
}

button {
  display: inline-grid;
  place-items: center;
  min-width: 112px;
  padding: 0 14px;
  border-color: rgba(47, 209, 138, 0.54);
  background: #1c7a55;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  touch-action: manipulation;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 209, 138, 0.82);
  background: #21845e;
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

button:focus-visible {
  outline: 2px solid rgba(125, 185, 255, 0.82);
  outline-offset: 2px;
}

.secondary-button,
.icon-button {
  border-color: var(--line);
  background: var(--panel-3);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #47545d;
  background: #263039;
}

.secondary-button {
  min-width: 104px;
}

.login-button {
  min-width: 132px;
  border-color: rgba(47, 209, 138, 0.72);
  color: #061c12;
  background: linear-gradient(180deg, #72e7aa, #2fcf89);
  box-shadow: 0 8px 22px rgba(47, 209, 138, 0.2);
}

.login-button:hover {
  border-color: rgba(125, 240, 168, 0.95);
  background: linear-gradient(180deg, #83efb7, #39d694);
}

.danger-button {
  border-color: rgba(255, 104, 104, 0.42);
  color: #ffd7d7;
}

.icon-button {
  min-width: 38px;
  width: 38px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 144px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #101418;
  font-size: 13px;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(96px, 124px) minmax(260px, 1fr) minmax(110px, 145px) minmax(110px, 145px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 29, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.symbols-field input {
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.metric {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 82px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-grid .metric:nth-child(1) {
  border-color: rgba(47, 209, 138, 0.32);
}

.summary-grid .metric:nth-child(2) {
  border-color: rgba(255, 104, 104, 0.32);
}

.summary-grid .metric:nth-child(3) {
  border-color: rgba(242, 198, 109, 0.28);
}

.summary-filter {
  height: auto;
  min-width: 0;
  place-items: stretch;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.summary-filter:hover {
  transform: none;
  border-color: rgba(125, 185, 255, 0.5);
  background:
    linear-gradient(180deg, rgba(125, 185, 255, 0.08), transparent),
    var(--panel);
}

.summary-filter.is-active {
  border-color: rgba(125, 185, 255, 0.84);
  background:
    linear-gradient(180deg, rgba(125, 185, 255, 0.14), transparent),
    #12191f;
  box-shadow: 0 0 0 1px rgba(125, 185, 255, 0.18);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
}

.metric.compact {
  min-height: 70px;
  padding: 12px;
}

.metric.compact strong {
  font-size: 21px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.signals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.signal-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.signal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line);
}

.signal-card.is-long {
  border-color: rgba(47, 209, 138, 0.26);
}

.signal-card.is-long::before {
  background: var(--green);
}

.signal-card.is-short {
  border-color: rgba(255, 104, 104, 0.28);
}

.signal-card.is-short::before {
  background: var(--red);
}

.signal-card.is-wait::before {
  background: var(--amber);
}

.signal-card.is-strong {
  box-shadow: 0 0 0 1px rgba(47, 209, 138, 0.18), 0 14px 34px rgba(0, 0, 0, 0.22);
}

.signal-card.is-abnormal {
  border-color: rgba(125, 185, 255, 0.34);
}

.signal-card.is-abnormal::before {
  background: var(--blue);
}

.signal-card.is-error::before {
  background: #996060;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.symbol {
  margin: 0;
  font-size: 18px;
  line-height: 1.05;
}

.market {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

.badge {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.badge.long {
  color: #082017;
  background: var(--green);
}

.badge.long.strong {
  color: #05160e;
  background: #7df0a8;
  border-color: rgba(255, 255, 255, 0.28);
}

.badge.short {
  color: #270909;
  background: var(--red);
}

.badge.abnormal {
  color: #061522;
  background: var(--blue);
}

.badge.wait {
  color: #251b05;
  background: var(--amber);
}

.badge.error {
  color: #fff;
  background: #8d4747;
}

.price-row,
.levels,
.indicators {
  display: grid;
  gap: 5px;
}

.signal-strip,
.compact-risk {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.signal-strip span,
.compact-risk span {
  flex: 1 1 auto;
  min-width: max-content;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--muted-2);
  background: #101519;
  font-size: 11px;
  line-height: 1.25;
}

.signal-strip strong,
.compact-risk strong {
  color: var(--text);
  font-size: 12px;
}

.price-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.levels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-levels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.indicators {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cell {
  min-width: 0;
  min-height: 42px;
  padding: 6px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #11161a;
}

.cell span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}

.cell strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.25;
}

.signal-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #d8dfde;
  font-size: 12px;
  line-height: 1.35;
}

.signal-details {
  border-top: 1px solid var(--line-soft);
  padding-top: 3px;
}

.signal-details summary {
  cursor: pointer;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.detail-metrics span {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--muted-2);
  background: #101519;
  font-size: 11px;
}

.detail-metrics strong {
  color: var(--text);
}

.reasons {
  margin: 7px 0 0;
  padding: 0 0 0 18px;
  color: #d8dfde;
  line-height: 1.38;
  font-size: 12px;
}

.reasons li + li {
  margin-top: 4px;
}

.filters,
.strong-note,
.risk-note,
.funding-note {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.42;
}

.filters {
  margin: -2px 0 0;
  padding-left: 28px;
  border: 1px solid rgba(242, 198, 109, 0.32);
  color: #efd59b;
  background: var(--amber-soft);
}

.strong-note {
  border: 1px solid rgba(47, 209, 138, 0.34);
  color: #a8f2c6;
  background: var(--green-soft);
  font-weight: 800;
}

.risk-note,
.funding-note {
  border: 1px solid rgba(125, 185, 255, 0.28);
  color: #d8e9fb;
  background: var(--blue-soft);
}

.funding-threshold-control {
  display: grid;
  grid-template-columns: auto minmax(150px, 220px);
  align-items: center;
  justify-content: start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101519;
}

.funding-threshold-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profit-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(5, 7, 9, 0.58);
  backdrop-filter: blur(7px);
}

.profit-sheet {
  display: grid;
  align-content: start;
  gap: 12px;
  width: min(960px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.terms-sheet {
  max-width: min(880px, calc(100vw - 24px));
}

.terms-content {
  display: grid;
  gap: 12px;
  color: #dbe5e4;
}

.terms-content section {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #11161a;
}

.terms-content h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 14px;
}

.terms-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.section-title {
  position: sticky;
  top: -16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px -16px 0;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 25, 29, 0.96);
  backdrop-filter: blur(10px);
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.backtest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.records {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11161a;
}

.records + .records {
  margin-top: 10px;
}

.records-title {
  margin: 0;
  padding: 12px 12px 0;
  color: var(--text);
  background: #11161a;
  font-size: 13px;
  font-weight: 800;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #11161a;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-weight: 800;
  background: #182027;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.empty-records {
  padding: 18px;
  color: var(--muted);
  background: #11161a;
}

.email-form {
  display: grid;
  gap: 12px;
}

.email-preferences {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.email-preferences .email-enabled {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101519;
  font-size: 12px;
  font-weight: 800;
}

.mail-provider-status {
  color: var(--muted);
}

.mail-provider-status.is-error {
  border-color: rgba(255, 104, 104, 0.34);
  color: #ffb7b7;
}

.api-scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.api-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.email-enabled {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.email-enabled input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--green);
}

.error-text {
  color: #ffb7b7;
}

.is-refreshing {
  opacity: 0.72;
  transition: opacity 160ms ease;
}

.loading-card {
  min-height: 220px;
  align-content: center;
}

.loading-line {
  height: 15px;
  width: 64%;
  border-radius: 7px;
  background: linear-gradient(90deg, #151b20, #27313a, #151b20);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}

.loading-line.wide {
  width: 84%;
}

.loading-line.short {
  width: 42%;
}

.loading-panel {
  background: linear-gradient(90deg, #11161a, #20272d, #11161a);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 48px) 28px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
}

.footer-terms {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .symbols-field {
    grid-column: 1 / -1;
  }

  .toolbar > button {
    grid-column: 1 / -1;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .signals {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .levels,
  .indicators {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(180deg, #111519 0, var(--bg) 190px),
      var(--bg);
    font-size: 13px;
  }

  .app-header {
    position: sticky;
    padding: calc(8px + env(safe-area-inset-top)) 10px 9px;
    align-items: stretch;
    gap: 9px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  main {
    padding: 9px 9px calc(22px + env(safe-area-inset-bottom));
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
  }

  h1 {
    font-size: 19px;
    width: 100%;
    max-width: calc(100vw - 28px);
    white-space: normal;
    word-break: break-word;
  }

  .app-header > div:first-child {
    width: 100%;
    max-width: 100%;
  }

  .access-box {
    max-height: calc(100vh - 22px);
    overflow: auto;
    padding: 16px;
  }

  .member-fields,
  .login-code-row,
  .access-actions {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    min-height: 62px;
    padding: 8px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }

  .header-actions > * {
    width: 100%;
  }

  .language-control {
    grid-column: auto;
    grid-template-columns: 1fr;
    height: 36px;
    padding: 0 7px;
  }

  .language-control span {
    display: none;
  }

  .language-control select {
    height: 28px;
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }

  .header-actions button,
  .toolbar > button {
    height: 36px;
    min-width: 0;
    padding: 0 6px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
  }

  .header-actions .login-button {
    grid-column: 1 / -1;
    height: 40px;
    font-size: 13px;
  }

  .status-pill {
    grid-column: 1 / -1;
    justify-content: start;
    min-width: 0;
    height: 31px;
    padding: 0 9px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
  }

  select,
  input {
    height: 36px;
    padding: 0 9px;
    font-size: 12px;
  }

  label {
    gap: 5px;
    font-size: 10px;
  }

  .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "interval capital risk"
      "symbols symbols symbols"
      "scan scan scan";
    gap: 7px;
    padding: 9px;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(18, 22, 26, 0.98);
    box-shadow: none;
  }

  .toolbar label:nth-child(1) {
    grid-area: interval;
  }

  .symbols-field {
    grid-area: symbols;
  }

  .toolbar label:nth-child(3) {
    grid-area: capital;
  }

  .toolbar label:nth-child(4) {
    grid-area: risk;
  }

  .symbols-field input {
    font-size: 12px;
  }

  .toolbar > button {
    grid-area: scan;
    height: 40px;
    font-size: 13px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 9px 0;
  }

  .signals {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .metric {
    min-height: 56px;
    padding: 8px 7px;
    gap: 5px;
  }

  .summary-filter {
    min-height: 56px;
  }

  .metric span {
    font-size: 10px;
  }

  .metric strong {
    font-size: 22px;
  }

  .signal-card {
    min-height: 0;
    padding: 9px 9px 8px 10px;
    gap: 6px;
    border-color: rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 44%),
      var(--panel);
    box-shadow: none;
  }

  .card-top {
    align-items: flex-start;
    gap: 7px;
  }

  .symbol {
    font-size: 18px;
  }

  .market {
    display: none;
  }

  .badge {
    min-width: 56px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .signal-strip,
  .compact-risk {
    gap: 4px;
  }

  .signal-strip span,
  .compact-risk span {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    padding: 5px 6px;
    border-radius: 7px;
    font-size: 10px;
  }

  .signal-strip strong,
  .compact-risk strong {
    font-size: 11px;
  }

  .price-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .levels,
  .indicators {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .compact-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .cell {
    min-height: 38px;
    padding: 5px 6px;
  }

  .cell span {
    font-size: 9px;
  }

  .cell strong {
    font-size: 11px;
  }

  .signal-summary {
    font-size: 11px;
  }

  .signal-details {
    padding-top: 2px;
  }

  .signal-details summary {
    font-size: 10px;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .reasons {
    padding-left: 15px;
    font-size: 11px;
  }

  .filters,
  .strong-note,
  .risk-note,
  .funding-note {
    padding: 7px 8px;
    font-size: 11px;
  }

  .funding-threshold-control {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }

  .backtest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .metric.compact {
    min-height: 54px;
    padding: 8px;
  }

  .metric.compact strong {
    font-size: 18px;
  }

  .profit-panel {
    align-items: flex-end;
    padding: 0;
  }

  .profit-sheet {
    width: 100%;
    max-height: 90vh;
    min-height: 68vh;
    padding: 12px 10px calc(14px + env(safe-area-inset-bottom));
    border-radius: 10px 10px 0 0;
    border-left: 0;
    border-right: 0;
    gap: 10px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    margin: -12px -10px 0;
    padding: 12px 10px 10px;
    top: -12px;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .section-title span {
    font-size: 11px;
  }

  .panel-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .panel-actions .secondary-button {
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .icon-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .records {
    margin-left: -1px;
    margin-right: -1px;
  }

  table {
    min-width: 640px;
  }

  th,
  td {
    padding: 8px 9px;
    font-size: 12px;
  }

  .email-form {
    gap: 10px;
  }

  .access-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .api-scope-grid,
  .email-preferences,
  .api-actions {
    grid-template-columns: 1fr;
  }
}

/* Final terminal UI overrides */
body {
  background: #080a0d;
}

.app-header {
  align-items: center;
  gap: 16px;
  padding: 13px clamp(14px, 3vw, 34px);
  border-bottom-color: rgba(226, 235, 240, 0.08);
  background: rgba(10, 13, 16, 0.94);
}

.app-header h1 {
  max-width: none;
  font-size: clamp(18px, 1.8vw, 23px);
  line-height: 1.15;
  white-space: nowrap;
}

.app-header > div:first-child {
  flex: 0 0 auto;
}

.header-actions {
  gap: 7px;
}

.header-actions button,
.language-control,
.status-pill {
  height: 36px;
}

.header-actions button {
  min-width: 86px;
  padding: 0 11px;
  border-color: rgba(226, 235, 240, 0.09);
  color: #dfe7e5;
  background: #131920;
  box-shadow: none;
  font-size: 12px;
}

.header-actions .login-button {
  min-width: 92px;
  border-color: rgba(50, 213, 131, 0.5);
  color: #061710;
  background: var(--green);
}

main {
  width: min(1500px, 100%);
  padding: 14px clamp(10px, 2vw, 26px) 30px;
}

.toolbar {
  grid-template-columns: minmax(78px, 102px) minmax(260px, 1fr) minmax(98px, 120px) minmax(98px, 120px) minmax(122px, auto);
  gap: 9px;
  padding: 10px;
  border-color: rgba(226, 235, 240, 0.08);
  background: #0f1419;
  box-shadow: none;
}

.toolbar > button,
#scan {
  border-color: rgba(245, 196, 81, 0.48);
  color: #211705;
  background: var(--amber);
}

.summary-grid {
  gap: 9px;
  margin: 10px 0;
}

.summary-filter {
  min-height: 66px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 11px 12px;
  background: #0f1419;
}

.summary-filter strong {
  justify-self: end;
  font-size: 30px;
}

.signals {
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 10px;
}

.signal-card {
  gap: 8px;
  padding: 12px;
  border-color: rgba(226, 235, 240, 0.08);
  background: #0f1419;
  box-shadow: none;
}

.signal-card.is-wait {
  opacity: 0.68;
}

.signal-card.is-strong,
.signal-card.is-long {
  background: linear-gradient(180deg, rgba(50, 213, 131, 0.045), transparent 42%), #0f1419;
}

.signal-card.is-short {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.045), transparent 42%), #0f1419;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.compact-risk {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.levels.compact-levels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.signal-strip span,
.compact-risk span,
.cell {
  min-width: 0;
  border-color: rgba(226, 235, 240, 0.07);
  background: #0b1015;
}

.profit-panel {
  z-index: 50;
  background: rgba(3, 5, 7, 0.68);
}

.profit-sheet {
  width: min(1080px, 100%);
  border-color: rgba(226, 235, 240, 0.1);
  background: #0f1419;
}

.mobile-dock {
  display: none;
}

@media (max-width: 640px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
    background: #080a0d;
  }

  .app-header {
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    gap: 8px;
  }

  .app-header h1 {
    font-size: 17px;
    white-space: nowrap;
  }

  .header-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions > * {
    flex: 0 0 auto;
    width: auto;
  }

  .language-control {
    grid-template-columns: 1fr;
    flex-basis: 76px;
    min-width: 76px;
  }

  .header-actions button {
    min-width: 74px;
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .header-actions .login-button {
    grid-column: auto;
    min-width: 76px;
    height: 34px;
    font-size: 12px;
  }

  #fundingToggle,
  #simToggle,
  #profitToggle {
    display: none;
  }

  .status-pill {
    display: none;
  }

  main {
    padding: 8px 8px 12px;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "symbols symbols"
      "interval scan"
      "capital risk";
    gap: 7px;
    padding: 8px;
  }

  .toolbar label:nth-child(1) {
    grid-area: interval;
  }

  .symbols-field {
    grid-area: symbols;
  }

  .toolbar label:nth-child(3) {
    grid-area: capital;
  }

  .toolbar label:nth-child(4) {
    grid-area: risk;
  }

  .toolbar > button {
    grid-area: scan;
    height: 36px;
  }

  .summary-grid {
    gap: 6px;
    margin: 8px 0;
  }

  .summary-filter {
    min-height: 54px;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .summary-filter strong {
    justify-self: start;
    font-size: 23px;
  }

  .signals {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .signal-card {
    padding: 10px;
  }

  .signal-strip,
  .compact-risk,
  .levels.compact-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profit-sheet {
    max-height: 88vh;
    min-height: 64vh;
    border-radius: 11px 11px 0 0;
  }

  footer {
    display: none;
  }

  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(226, 235, 240, 0.1);
    background: rgba(10, 13, 16, 0.96);
    backdrop-filter: blur(12px);
  }

  .mobile-dock button {
    min-width: 0;
    height: 42px;
    padding: 0 4px;
    border-color: rgba(226, 235, 240, 0.08);
    color: #dbe5e3;
    background: #111820;
    font-size: 11px;
  }

  .mobile-dock button:first-child {
    border-color: rgba(245, 196, 81, 0.42);
    color: #211705;
    background: var(--amber);
  }
}

/* Monitoring-console refresh */
:root {
  --console-bg: #07090a;
  --console-panel: #0d1114;
  --console-panel-2: #10161a;
  --console-border: rgba(217, 229, 226, 0.09);
  --console-border-strong: rgba(217, 229, 226, 0.16);
}

body {
  background:
    linear-gradient(180deg, #0c1012 0, #07090a 300px),
    var(--console-bg);
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 70px;
  padding: 10px clamp(14px, 2.4vw, 30px);
  border-bottom: 1px solid var(--console-border);
  background: rgba(8, 10, 12, 0.97);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 16px 40px rgba(0, 0, 0, 0.28);
}

.app-header .eyebrow {
  margin-bottom: 4px;
  color: #70c4ff;
  font-size: 10px;
}

.app-header h1 {
  font-size: clamp(18px, 1.35vw, 22px);
  font-weight: 900;
}

.header-actions {
  display: grid;
  grid-template-columns: minmax(118px, 150px) repeat(9, minmax(76px, auto)) minmax(150px, auto);
  justify-content: end;
  align-items: center;
  gap: 6px;
}

.header-actions button,
.language-control,
.status-pill {
  height: 34px;
  border-radius: 6px;
}

.header-actions button {
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--console-border);
  background: #11171c;
  color: #dce7e5;
  font-size: 11px;
  font-weight: 850;
}

.header-actions button:hover,
.summary-filter:hover,
.mobile-dock button:hover {
  transform: translateY(-1px);
}

.header-actions .login-button {
  border-color: rgba(47, 209, 138, 0.52);
  background: linear-gradient(180deg, #39df95 0, #20b976 100%);
  color: #03140d;
}

.header-actions .member-nav-button {
  border-color: rgba(125, 185, 255, 0.28);
  color: #cfe5fb;
  background: rgba(125, 185, 255, 0.08);
}

.language-control {
  grid-template-columns: auto minmax(72px, 1fr);
  padding: 0 8px;
  border-color: var(--console-border);
  background: #0d1317;
}

.language-control span {
  font-size: 10px;
}

.language-control select {
  min-width: 70px;
  height: 26px;
  background: #141b21;
}

.status-pill {
  justify-content: center;
  min-width: 150px;
  border-color: rgba(125, 185, 255, 0.2);
  background: rgba(125, 185, 255, 0.07);
  color: #cfe5fb;
  font-size: 11px;
}

main {
  width: min(1680px, 100%);
  padding: 12px clamp(10px, 1.8vw, 24px) 32px;
}

.toolbar {
  position: sticky;
  top: 70px;
  z-index: 8;
  grid-template-columns: 92px minmax(300px, 1fr) 110px 110px 126px;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--console-border);
  border-radius: 8px;
  background: rgba(13, 17, 20, 0.96);
  backdrop-filter: blur(12px);
}

.toolbar label {
  gap: 4px;
}

.toolbar label span {
  color: #74827f;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select {
  height: 34px;
  border-radius: 6px;
  border-color: rgba(217, 229, 226, 0.08);
  background: #0a0f12;
}

.toolbar > button,
#scan {
  min-height: 34px;
  border-radius: 6px;
  border-color: rgba(242, 198, 109, 0.6);
  background: linear-gradient(180deg, #f8d47a 0, #d89f38 100%);
  color: #1b1203;
}

@media (min-width: 1120px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "toolbar toolbar"
      "signals summary";
    align-items: start;
    gap: 10px;
  }

  .toolbar {
    grid-area: toolbar;
  }

  .summary-grid {
    position: sticky;
    top: 132px;
    grid-area: summary;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--console-border);
    border-radius: 8px;
    background: var(--console-panel);
  }

  .signals {
    grid-area: signals;
  }
}

.summary-filter {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--console-border);
  border-radius: 7px;
  background: #0a0f12;
}

.summary-filter span {
  color: #9ca9a8;
  font-size: 12px;
  font-weight: 900;
}

.summary-filter strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.summary-filter[data-signal-filter="LONG"] {
  border-left: 3px solid var(--green);
}

.summary-filter[data-signal-filter="SHORT"] {
  border-left: 3px solid var(--red);
}

.summary-filter[data-signal-filter="WAIT"] {
  border-left: 3px solid var(--amber);
}

.summary-filter.is-active {
  border-color: rgba(125, 185, 255, 0.42);
  background: rgba(125, 185, 255, 0.09);
}

.signals {
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 9px;
}

.signal-card {
  gap: 7px;
  padding: 10px 10px 9px 12px;
  border: 1px solid var(--console-border);
  border-radius: 7px;
  background: var(--console-panel);
  box-shadow: none;
}

.signal-card::before {
  width: 3px;
}

.signal-card:hover {
  border-color: var(--console-border-strong);
  background: var(--console-panel-2);
}

.signal-card.is-long {
  border-color: rgba(47, 209, 138, 0.24);
}

.signal-card.is-short {
  border-color: rgba(255, 104, 104, 0.24);
}

.signal-card.is-wait {
  opacity: 0.78;
}

.signal-card.is-strong {
  border-color: rgba(47, 209, 138, 0.52);
  box-shadow: inset 0 0 0 1px rgba(47, 209, 138, 0.16);
}

.card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.symbol {
  overflow: hidden;
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.market {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.badge {
  min-width: 58px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  font-size: 11px;
}

.signal-strip,
.compact-risk,
.levels.compact-levels {
  gap: 4px;
}

.signal-strip span,
.compact-risk span,
.cell {
  border-radius: 5px;
  border-color: rgba(217, 229, 226, 0.06);
  background: #090d10;
}

.signal-strip span,
.compact-risk span {
  padding: 4px 5px;
  font-size: 10px;
}

.signal-strip strong,
.compact-risk strong,
.cell strong {
  font-variant-numeric: tabular-nums;
}

.cell {
  min-height: 38px;
  padding: 5px 6px;
}

.cell span {
  font-size: 9px;
}

.signal-summary {
  min-height: 32px;
  padding: 6px 0 0;
  border-top: 1px solid rgba(217, 229, 226, 0.06);
  color: #cdd8d6;
  font-size: 11px;
}

.signal-details {
  padding-top: 2px;
}

.signal-details summary {
  color: #768582;
}

.profit-sheet {
  width: min(1160px, calc(100vw - 24px));
  border-radius: 9px;
  background: #0d1114;
}

.backtest-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.records table {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1400px) {
  .signals {
    grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  }
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .header-actions {
    display: flex;
    justify-content: flex-start;
  }

  .toolbar {
    top: 112px;
  }
}

@media (max-width: 640px) {
  .app-header {
    display: grid;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: calc(7px + env(safe-area-inset-top)) 8px 7px;
  }

  .app-header .eyebrow {
    font-size: 9px;
  }

  .app-header h1 {
    max-width: calc(100vw - 16px);
    font-size: 16px;
  }

  .header-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
  }

  .header-actions button,
  .language-control {
    height: 32px;
    border-radius: 6px;
  }

  .toolbar {
    position: sticky;
    top: 92px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border-radius: 7px;
  }

  input,
  select {
    height: 32px;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 7px 0;
  }

  .summary-filter {
    min-height: 48px;
    padding: 7px;
  }

  .summary-filter span {
    font-size: 10px;
  }

  .summary-filter strong {
    font-size: 20px;
  }

  .signals {
    gap: 7px;
  }

  .signal-card {
    border-radius: 7px;
  }

  .symbol {
    font-size: 16px;
  }

  .market {
    max-width: 210px;
  }

  .badge {
    min-width: 50px;
    min-height: 26px;
  }

  .signal-summary {
    min-height: 0;
  }

  .mobile-dock {
    display: grid !important;
    border-top-color: rgba(217, 229, 226, 0.12);
    background: rgba(8, 10, 12, 0.98);
  }

  .mobile-dock button {
    height: 40px;
    border-radius: 7px;
  }
}

/* SaaS-style account and membership flow */
.access-overlay {
  align-items: start;
  justify-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.access-box.auth-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  gap: 0;
  padding: 0;
  border-color: rgba(217, 229, 226, 0.12);
  background: #0b1013;
}

.auth-header {
  display: grid;
  gap: 8px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(217, 229, 226, 0.08);
  background: linear-gradient(180deg, rgba(125, 185, 255, 0.08), rgba(125, 185, 255, 0));
}

.auth-header h2 {
  padding-right: 48px;
}

.auth-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(217, 229, 226, 0.08);
  background: #090d10;
}

.auth-stepper span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(217, 229, 226, 0.08);
  border-radius: 7px;
  color: #a9b8b5;
  background: #0e1418;
  font-size: 12px;
  font-weight: 850;
}

.auth-stepper strong {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #07140e;
  background: var(--green);
  font-size: 11px;
}

.auth-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 8px;
  margin: 14px 22px 0;
  padding: 12px;
  border: 1px solid rgba(125, 185, 255, 0.22);
  border-radius: 8px;
  background: rgba(125, 185, 255, 0.08);
}

.auth-overview span,
.auth-overview em {
  min-width: 0;
  overflow: hidden;
  color: #9fb1ae;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-overview strong {
  min-width: 0;
  overflow: hidden;
  color: #edf7f4;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dialog > .member-status {
  margin: 10px 22px 0;
}

.auth-section {
  display: grid;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid rgba(217, 229, 226, 0.08);
}

.auth-header {
  order: 1;
}

.auth-stepper {
  order: 2;
}

.auth-overview {
  order: 3;
}

.auth-dialog > .member-status {
  order: 4;
}

.auth-section-login {
  order: 5;
}

.auth-section-plans {
  order: 6;
}

.auth-admin {
  order: 7;
}

.auth-section-terms {
  order: 8;
}

.auth-dialog.has-user .auth-section-plans {
  order: 5;
}

.auth-dialog.has-user .auth-section-login {
  order: 6;
}

.auth-dialog.auth-mode-login .auth-stepper,
.auth-dialog.auth-mode-login .auth-overview,
.auth-dialog.auth-mode-login > .member-status,
.auth-dialog.auth-mode-login .auth-section-plans,
.auth-dialog.auth-mode-login .auth-admin {
  display: none;
}

.auth-dialog.auth-mode-member .auth-admin {
  display: none;
}

.auth-dialog.auth-mode-member.has-user .auth-section-login {
  display: none;
}

.auth-dialog.auth-mode-admin .auth-stepper,
.auth-dialog.auth-mode-admin .auth-overview,
.auth-dialog.auth-mode-admin > .member-status,
.auth-dialog.auth-mode-admin .auth-section-login,
.auth-dialog.auth-mode-admin .auth-section-plans {
  display: none;
}

.auth-dialog.auth-mode-admin .auth-admin {
  display: block;
}

.auth-dialog.auth-mode-admin #accessSubmit,
.auth-dialog.auth-mode-member.has-user #accessSubmit {
  display: none;
}

.auth-dialog.auth-mode-admin .access-actions,
.auth-dialog.auth-mode-member.has-user .access-actions {
  grid-template-columns: 1fr;
}

.auth-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-section-title span {
  color: #eef7f4;
  font-size: 13px;
  font-weight: 900;
}

.auth-section-title strong {
  padding: 4px 8px;
  border: 1px solid rgba(47, 209, 138, 0.28);
  border-radius: 999px;
  color: #a8f2c6;
  background: rgba(47, 209, 138, 0.08);
  font-size: 11px;
}

.auth-dialog .member-fields,
.auth-dialog .login-code-row {
  gap: 8px;
}

.auth-dialog .pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-dialog .pricing-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  min-height: 128px;
  padding: 12px;
  border-color: rgba(217, 229, 226, 0.08);
  background: #0e1418;
}

.auth-dialog .pricing-card:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 185, 255, 0.28);
}

.auth-dialog .pricing-card.is-selected {
  border-color: rgba(47, 209, 138, 0.58);
  background: linear-gradient(180deg, rgba(47, 209, 138, 0.12), rgba(47, 209, 138, 0.03)), #0e1418;
  box-shadow: inset 0 0 0 1px rgba(47, 209, 138, 0.12);
}

.pricing-card em {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid rgba(125, 185, 255, 0.2);
  border-radius: 999px;
  color: #cfe5fb;
  background: rgba(125, 185, 255, 0.08);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.pricing-card small {
  color: #94a5a2;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.38;
}

.auth-dialog .payment-box {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.45fr);
  align-items: start;
  gap: 9px;
}

.auth-dialog .payment-info,
.auth-dialog #paymentPlan,
.auth-dialog #paymentAmount,
.auth-dialog #paymentOrderId,
.auth-dialog #paymentNote,
.auth-dialog #paymentSubmit,
.auth-dialog #paymentMessage {
  grid-column: 1;
}

.auth-dialog .payment-qr {
  grid-column: 2;
  grid-row: 1 / span 5;
}

.auth-admin {
  margin: 0 22px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 229, 226, 0.08);
  border-radius: 8px;
  background: #090d10;
}

.auth-admin summary {
  cursor: pointer;
  color: #9fb1ae;
  font-size: 12px;
  font-weight: 900;
}

.auth-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.auth-section-terms {
  padding-top: 0;
}

.auth-dialog.has-user .auth-section-login .auth-section-title strong {
  border-color: rgba(125, 185, 255, 0.3);
  color: #cfe5fb;
  background: rgba(125, 185, 255, 0.08);
}

.auth-dialog.is-expired .auth-overview {
  border-color: rgba(242, 198, 109, 0.38);
  background: rgba(242, 198, 109, 0.08);
}

.auth-dialog.is-paid .auth-overview {
  border-color: rgba(47, 209, 138, 0.35);
  background: rgba(47, 209, 138, 0.08);
}

.auth-dialog.has-admin .auth-overview {
  border-color: rgba(125, 185, 255, 0.35);
}

@media (max-width: 640px) {
  .access-overlay {
    padding: 8px;
  }

  .access-box.auth-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .auth-header,
  .auth-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .auth-stepper {
    grid-template-columns: 1fr;
    padding: 10px 14px;
  }

  .auth-overview {
    grid-template-columns: 1fr;
    margin-left: 14px;
    margin-right: 14px;
  }

  .auth-dialog > .member-status {
    margin-left: 14px;
    margin-right: 14px;
  }

  .auth-dialog .member-fields,
  .auth-dialog .login-code-row,
  .auth-dialog .pricing-grid,
  .auth-admin-row,
  .auth-dialog .payment-box {
    grid-template-columns: 1fr;
  }

  .auth-dialog .payment-qr {
    grid-column: 1;
    grid-row: auto;
  }

  .auth-admin {
    margin-left: 14px;
    margin-right: 14px;
  }
}
