.topbar {
  grid-template-columns: 1fr auto auto auto;
}

.account-box {
  display: flex;
  justify-content: flex-end;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-menu span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.account-btn,
.ghost-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.account-btn {
  background: linear-gradient(135deg, #e9fbff, #c7d2fe);
  color: #06101b;
}

.ghost-btn {
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 18, .72);
  backdrop-filter: blur(14px);
}

.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(13, 23, 40, .98), rgba(6, 11, 22, .98));
  box-shadow: 0 28px 100px rgba(0, 0, 0, .55);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  cursor: pointer;
}

.auth-kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.auth-copy h2 {
  margin: 8px 0 6px;
  font-size: 28px;
}

.auth-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  margin: 0;
  min-height: 46px;
  border-radius: 6px;
  width: 100%;
}

.auth-form input:focus-visible,
.auth-card button:focus-visible,
.auth-demo summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.auth-form input[aria-invalid="true"] {
  border-color: var(--red);
}

.auth-form .auth-password-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 400;
}

.auth-password-option input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.auth-demo {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.auth-demo summary { cursor: pointer; }
.auth-demo p { margin: 8px 0 0; }
body.auth-open { overflow: hidden; }
.auth-submit { min-height: 46px; border-radius: 6px; }
.auth-submit:disabled { opacity: .65; cursor: wait; }
@media (max-width: 480px) {
  .auth-modal { padding: 16px; }
  .auth-card { padding: 24px; }
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.auth-message.ok {
  color: var(--green);
}

.auth-submit {
  width: 100%;
  margin-top: 2px;
}

.auth-switch {
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 900;
  cursor: pointer;
}

.signal-card {
  position: relative;
  overflow: hidden;
}

.signal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(103, 232, 249, .08), transparent 36%, rgba(34, 197, 94, .06));
}

.signal-card > * {
  position: relative;
  z-index: 1;
}

.signal-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(15, 23, 42, .5);
}

.signal-hero h2 {
  margin: 5px 0 0;
  font-size: 24px;
  line-height: 1.18;
}

.signal-summary,
.simple-reason {
  margin: 10px 2px 0;
  color: #dbeafe;
  line-height: 1.55;
}

.score-wrap {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(2, 6, 23, .42);
}

.score-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.score-label b {
  color: #eef5ff;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.ai-button {
  width: 100%;
  margin-top: 0;
}

.ai-action {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(103, 232, 249, .16);
  border-radius: 14px;
  background: rgba(103, 232, 249, .06);
}

.ai-analysis {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-analysis.ok {
  color: #dbeafe;
}

.ai-analysis.error {
  color: var(--red);
}

.analysis-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(15, 23, 42, .52);
}

.analysis-panel .section-head {
  margin-bottom: 8px;
}

.analysis-panel p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.55;
}

.prediction-meter {
  display: grid;
  grid-template-columns: minmax(74px, auto) 1fr minmax(110px, auto);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}

.prediction-meter strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.prediction-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.prediction-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
  transition: width .35s ease;
}

#predictionScore.up,
#predictionLevel.up {
  color: var(--green);
}

#predictionScore.down,
#predictionLevel.down {
  color: var(--red);
}

#predictionScore.neutral,
#predictionLevel.neutral {
  color: var(--yellow);
}

#lineSurfaceBias {
  font-weight: 900;
}

#lineSurfaceBias.up {
  color: var(--green);
}

#lineSurfaceBias.down {
  color: var(--red);
}

#lineSurfaceBias.neutral {
  color: var(--yellow);
}

.chart-action {
  border: 1px solid rgba(103, 232, 249, .35);
  border-radius: 10px;
  background: rgba(103, 232, 249, .12);
  color: #dffbff;
  cursor: pointer;
  font-weight: 800;
}

.chart-action:hover {
  background: rgba(103, 232, 249, .2);
}

.chart-action:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.risk-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.simple-risk {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.risk-levels span {
  min-width: 0;
  padding: 11px;
  border-left: 3px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(15, 23, 42, .55);
}

.risk-levels .entry {
  border-left-color: #67e8f9;
}

.risk-levels .stop {
  border-left-color: var(--red);
}

.risk-levels .target {
  border-left-color: var(--green);
}

.risk-levels small,
.risk-levels b {
  display: block;
}

.risk-levels b {
  overflow: hidden;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-box strong {
  transition: color .15s ease, text-shadow .15s ease, transform .15s ease;
}

.price-box strong.tick-up {
  color: var(--green);
  text-shadow: 0 0 18px rgba(34, 197, 94, .55);
  transform: translateY(-1px);
}

.price-box strong.tick-down {
  color: var(--red);
  text-shadow: 0 0 18px rgba(244, 63, 94, .55);
  transform: translateY(1px);
}

.book {
  transition: border-color .12s ease, box-shadow .12s ease;
}

.book.depth-flash {
  border-color: rgba(103, 232, 249, .45);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, .16), 0 18px 50px rgba(103, 232, 249, .12);
}

.price-pulse {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
}

.price-pulse.up {
  color: var(--green);
}

.price-pulse.down {
  color: var(--red);
}

@media (max-width: 850px) {
  .account-box {
    justify-content: flex-start;
  }

  .account-menu {
    width: 100%;
    justify-content: space-between;
  }

  .prediction-meter {
    grid-template-columns: 1fr;
  }

  .signal-hero {
    flex-direction: column;
  }

}
