:root {
  --bg: #0b0f1a;
  --card: #12192a;
  --muted: #a9b5d1;
  --text: #e7eeff;
  --brand: #6aa2ff;
  --danger: #ff6a6a;
  --ok: #4ee1a0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    Segoe UI,
    Inter,
    Arial,
    sans-serif;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #0e1526;
  border-bottom: 1px solid #1c2740;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav a,
.nav button {
  color: var(--text);
  background: transparent;
  border: 1px solid #263150;
  padding: 6px 10px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}
.container {
  max-width: 85%;
  margin: 20px auto;
  padding: 0 16px;
}
.hero {
  background: linear-gradient(180deg, #101933, #0b0f1a);
  border: 1px solid #1f2a49;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 16px;
}
/* Brand with logo */
.nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav .brand .logo {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px #1f2a49,
    0 6px 20px rgba(0, 0, 0, 0.25);
  object-fit: cover;
}

/* Hero with image */
.hero-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.hero-copy {
  flex: 1 1 320px;
  min-width: 280px;
}
.hero-art-wrap {
  flex: 1 1 320px;
  display: flex;
  justify-content: center;
}
.hero-art {
  max-width: 560px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid #1f2a49;
  background: #0e1526;
}

/* Optional: make hero image full-bleed on small screens */
@media (max-width: 640px) {
  .hero-art {
    max-width: 100%;
  }
}

.card {
  background: var(--card);
  border: 1px solid #1f2a49;
  padding: 16px;
  border-radius: 16px;
  margin: 8px;
  flex: 1;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.list li {
  padding: 8px 6px;
  border-bottom: 1px solid #263150;
}
#newsList li a {
    color: #f0f8ff;
}
#newsList li div a {
    color: #f0f8ff;
}
.auth-card input,
.card input,
.card select {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #263150;
  background: #0e1526;
  color: var(--text);
  margin-bottom: 4px;
  margin-top: 4px;
}
.card button {
  background: #1c2740;
  border: 1px solid #2a3863;
  border-radius: 10px;
  color: #e7eeff;
  padding: 8px 10px;
}
.ok {
  color: var(--ok);
}
.danger {
  color: var(--danger);
}
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
#watchForm {
  display: flex;
  align-items: center;
  gap: 8px; /* space between input and button */
}

#watchForm input {
  flex: 1; /* input takes remaining space */
  min-width: 0; /* prevents overflow in narrow layouts */
}

#watchForm button {
  flex: 0 0 auto; /* button stays its natural width */
}

/* Optional: stack on small screens */
@media (max-width: 420px) {
  #watchForm {
    flex-wrap: wrap;
  }
  #watchForm button {
    width: 100%;
  }
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.kpi {
  background: #0e1526;
  border: 1px solid #263150;
  border-radius: 12px;
  padding: 12px;
}
.kpi-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 20px;
  font-weight: 600;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #263150;
}
.pill-up {
  background: rgba(78, 225, 160, 0.1);
  border-color: rgba(78, 225, 160, 0.35);
  color: var(--ok);
}
.pill-down {
  background: rgba(255, 106, 106, 0.08);
  border-color: rgba(255, 106, 106, 0.35);
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 8px;
  border-bottom: 1px solid #263150;
  text-align: left;
  white-space: nowrap;
}
.table th {
  color: var(--muted);
  font-weight: 500;
}
.gain {
  color: var(--ok);
  font-weight: 600;
}
.loss {
  color: var(--danger);
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
/* Base button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid #2a3863;
  background: #1c2740;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25) inset;
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--ring),
    0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Primary style with subtle gradient using your brand colors */
.btn-primary {
  background: #5a8bff !important;
  border-color: rgba(106, 162, 255, 0.6);
}

.btn-primary:hover {
  background: #87aafc !important;
  border-color: rgba(106, 162, 255, 0.8);
}

.btn-secondary {
  background: #e7593f !important;
  border-color: rgba(106, 162, 255, 0.6);
}

.btn-secondary:hover {
  background: #e38371 !important;
  border-color: rgba(106, 162, 255, 0.8);
}

/* Disabled */
.btn:disabled {
  opacity: 0.7;
  filter: grayscale(0.2);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading state (spinner) — add class "loading" to the button */
.btn.loading {
  color: transparent;
  position: relative;
  pointer-events: none;
}
.btn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  animation: btnspin 1s linear infinite;
}
@keyframes btnspin {
  to {
    transform: rotate(360deg);
  }
}
/* small button */
button.mini {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
  background: #0e1526;
  border: 1px solid #263150;
  color: var(--text);
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.site-footer {
  margin-top: 24px;
  background: #0e1526;
  border-top: 1px solid #1f2a49;
  color: var(--text);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 16px;
}
.footer-col h4 {
  margin: 0 0 8px 0;
  font-weight: 600;
}
.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-plain li {
  margin: 6px 0;
}
.site-footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed #263150;
}
.site-footer a:hover {
  border-bottom-color: transparent;
}

.email {
  color: #cbc9c9;
  font-size: large;
  font-weight: bolder;
}

.ticker-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ticker-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.ticker-price-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.ticker-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ticker-last {
  font-size: 36px;
  font-weight: 700;
}
.ticker-sub {
  font-size: 16px;
  font-weight: 600;
}
.ticker-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}
.ticker-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.ticker-controls select {
  min-width: 120px;
}
.chart-error {
  margin-top: 10px;
  font-size: 14px;
}
.ticker-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.ticker-link:hover {
  text-decoration: underline;
}
.ticker-trend {
  margin-top: 12px;
}
.table.compact th,
.table.compact td {
  padding: 6px 8px;
  font-size: 13px;
}
.position-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 12px;
}
.position-line .label {
  color: var(--muted);
}
.event-title {
  font-weight: 600;
}
.event-date {
  font-size: 13px;
}
.event-meta {
  font-size: 12px;
}

/* Login/Register form in one line */
#loginForm{
  display: grid;
  grid-template-columns: 1fr 1fr auto; /* username | password | button */
  gap: 8px;
  align-items: center;
  margin: 20px 20%
}

#loginForm input{
  width: auto;          /* override global 100% */
  min-width: 160px;     /* prevent squish */
}

#loginForm button{
  white-space: nowrap;  /* keep label on one line */
}

/* Optional: stack on very small screens */
@media (max-width: 520px){
  #loginForm{ grid-template-columns: 1fr; }
  #loginForm button{ width: 100%; }
}
