/* ── Kintamieji (dark tema) ─────────────────────────────── */
:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2a2d3e;
  --text:     #e2e8f0;
  --sub:      #94a3b8;
  --accent:   #7c6cfc;
  --green:    #4ade80;
  --red:      #f87171;
  --yellow:   #fbbf24;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,0.3);
}
[data-theme="light"] {
  --bg:       #f0f2f6;
  --surface:  #ffffff;
  --border:   #d1d5db;
  --text:     #1e293b;
  --sub:      #64748b;
  --accent:   #5046e5;
  --shadow:   0 2px 12px rgba(0,0,0,0.08);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ── Nav juosta ─────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.greeting { font-size: 13px; color: var(--sub); }
.greeting strong { color: var(--text); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-icon {
  font-size: 18px;
  padding: 4px 7px;
  border-radius: 6px;
  opacity: 0.4;
  transition: opacity 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  line-height: 1;
}
.nav-icon:hover  { opacity: 1; background: var(--border); }
.nav-icon.active { opacity: 1; color: var(--accent); }

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ── Kortelės ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sub);
  margin-bottom: 4px;
}
.card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.card-sub {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
}

/* ── Metrikų eilutė ─────────────────────────────────────── */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Sekcijų antraštės ──────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── Grid lentelė ───────────────────────────────────────── */
.grid-table {
  width: 100%;
  border-collapse: collapse;
}
.grid-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sub);
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.grid-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.grid-table tr:last-child td { border-bottom: none; }
.grid-table tr:hover td { background: var(--border); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green  { background: rgba(74,222,128,0.15); color: var(--green); }
.badge-yellow { background: rgba(251,191,36,0.15); color: var(--yellow); }
.badge-gray   { background: var(--border); color: var(--sub); }

.pos  { color: var(--green); }
.neg  { color: var(--red); }
.muted{ color: var(--sub); }

/* ── DCA kortelės ───────────────────────────────────────── */
.dca-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s;
}

/* ── Log ────────────────────────────────────────────────── */
.log-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px;
  color: var(--sub);
  max-height: 260px;
  overflow-y: auto;
  line-height: 1.6;
}
.log-box p { margin: 0; }
.log-buy    { color: #60a5fa; }
.log-sell   { color: #4ade80; }
.log-err    { color: #f87171; }
.log-warn   { color: #fbbf24; }

/* ── Login puslapis ─────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-logo {
  font-size: 36px;
  text-align: center;
  margin-bottom: 6px;
}
.login-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-sub {
  text-align: center;
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 28px;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}
.btn-primary:hover { opacity: 0.88; }
.error-msg {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  margin-bottom: 16px;
}

/* ── Investor kortelės ──────────────────────────────────── */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.inv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.inv-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 6px;
}
.inv-row span:last-child { color: var(--text); font-weight: 600; }

/* ── DUK ────────────────────────────────────────────────── */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "＋"; color: var(--sub); font-size: 16px; }
details[open] summary::after { content: "－"; }
details .duk-body {
  padding: 0 16px 14px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Refresh indikatorius ───────────────────────────────── */
.refresh-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-left: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 12px 10px; }
  .card-value { font-size: 18px; }
}

/* ── TF mygtukų stiliai ────────────────────────────────────────── */
.tf-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}
.tf-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tf-btn-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Įžanga ─────────────────────────────────────────────────────── */
.intro-wrap {
  padding: 20px 20px 16px;
  font-size: 13px;
  line-height: 1.8;
}
.intro-wrap p { color: var(--sub); margin: 0 0 12px; }
.intro-wrap ul { padding-left: 20px; margin: 0 0 16px; }
.intro-wrap li { color: var(--sub); margin-bottom: 5px; }
.intro-wrap li strong { color: var(--text); }

.intro-disclaimer {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--yellow);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.intro-disclaimer strong { color: var(--yellow); }

.intro-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 24px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.intro-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 12px;
}
.intro-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sub);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.intro-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--sub);
  vertical-align: top;
}
.intro-table td strong { color: var(--text); }
.intro-table tr:last-child td { border-bottom: none; }
.intro-table tr:hover td { background: rgba(255,255,255,0.03); }

.intro-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.intro-badge.red    { background: rgba(248,113,113,0.12); color: var(--red); }
.intro-badge.yellow { background: rgba(251,191,36,0.12);  color: var(--yellow); }
.intro-badge.gray   { background: var(--border); color: var(--sub); }

.intro-hacks {
  padding-left: 0;
  list-style: none;
  margin: 0 0 16px;
}
.intro-hacks li {
  padding: 10px 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 8px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.6;
  border-radius: 0 6px 6px 0;
}
.intro-hacks li:hover { border-left-color: var(--accent); background: rgba(124,108,252,0.04); }
.intro-hacks li strong { color: var(--text); display: block; margin-bottom: 2px; }
.intro-meta {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-left: 6px;
}
.intro-hypothesis {
  background: rgba(124,108,252,0.07);
  border: 1px solid rgba(124,108,252,0.25);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--sub);
  margin-top: 8px;
}
.intro-hypothesis strong { color: var(--accent); }

/* Binance vs HL badge'ai */
.intro-badge.hl  { background: rgba(96,165,250,0.12); color: #60a5fa; }
.intro-badge.bnb { background: rgba(251,191,36,0.12);  color: var(--yellow); }
.intro-badge.tie { background: var(--border); color: var(--sub); }

/* Palyginimo lentelė */
.cmp-table td:last-child { text-align: center; }

/* "Kada rinktis" kortelės */
.cmp-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 600px) {
  .cmp-cards { grid-template-columns: 1fr; }
}
.cmp-card {
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12px;
}
.cmp-card ul {
  padding-left: 16px;
  margin: 8px 0 0;
}
.cmp-card li {
  margin-bottom: 5px;
  line-height: 1.5;
}
.cmp-card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.cmp-bnb {
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
}
.cmp-bnb .cmp-card-title { color: var(--yellow); }
.cmp-bnb li { color: var(--sub); }
.cmp-hl {
  background: rgba(96,165,250,0.06);
  border: 1px solid rgba(96,165,250,0.2);
}
.cmp-hl .cmp-card-title { color: #60a5fa; }
.cmp-hl li { color: var(--sub); }

/* ── Changelog ─────────────────────────────────────────────────── */
.changelog-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.changelog-details > summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  color: var(--text);
}
.changelog-details > summary::-webkit-details-marker { display: none; }
.changelog-details > summary::after { content: "＋"; color: var(--sub); font-size: 16px; }
.changelog-details[open] > summary::after { content: "－"; }
.changelog-details[open] > summary {
  border-bottom: 1px solid var(--border);
}

.changelog-wrap {
  padding: 20px 20px 8px;
  font-size: 13px;
  line-height: 1.8;
}
.changelog-wrap h1 { display: none; }
.changelog-wrap h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.changelog-wrap h2:first-child { margin-top: 4px; }
.changelog-wrap h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.changelog-wrap ul {
  padding-left: 20px;
  margin: 4px 0 12px;
}
.changelog-wrap li {
  color: var(--sub);
  margin-bottom: 5px;
}
.changelog-wrap li strong { color: var(--text); }
.changelog-wrap hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.changelog-wrap p { color: var(--sub); margin: 6px 0; }

/* ── Grid kortelės ─────────────────────────────────────────────── */
.grid-cards-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
@media (min-width: 640px) {
  .grid-cards-wrap { grid-template-columns: repeat(3, 1fr); }
}

.gcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.gcard-off  { opacity: 0.45; }
.gcard-wait { opacity: 0.7; }

.gcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.gcard-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.gcard-prices {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.gcard-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.gcard-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.gcard-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--sub);
  font-family: 'JetBrains Mono', monospace;
}
