/* ── Client page overrides ── */
/* nav-sub */
.nav-sub { padding-left: 40px !important; font-size: 12px !important; opacity: 0.85; }
.nav-sub::before { content: '└ '; color: var(--border); }

/* Locked signals */
.signal-locked { opacity: 0.45; user-select: none; }
.lock-badge {
  display: inline-block; font-size: 11px; color: var(--accent);
  background: var(--accent-dim); border-radius: 4px;
  padding: 2px 7px; margin-left: 6px;
}

/* Signal cards */
.signal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.signal-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.signal-card-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--bg); display: block; }
.signal-card-img-placeholder {
  width: 100%; aspect-ratio: 1/1; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--border);
}
.signal-card-body { padding: 10px 12px; }
.signal-card-pair { font-weight: 700; font-size: 14px; }
.signal-card-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.signal-card-row  { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; }
.signal-card-locked { filter: blur(4px); pointer-events: none; user-select: none; }

/* Subscription cards */
.sub-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 24px; margin-bottom: 20px;
}
.sub-plan-badge {
  display: inline-block; padding: 4px 14px; border-radius: 4px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.plan-free  { background: rgba(74,85,112,.2);  color: var(--muted2); }
.plan-basic { background: var(--accent-dim);   color: var(--accent); }
.plan-pro   { background: var(--green-dim);    color: var(--green); }

/* Payment steps */
.pay-step { display: none; }
.pay-step.active { display: block; }
.address-box {
  background: var(--bg); border: 1px solid var(--border2); border-radius: 6px;
  padding: 14px 16px; font-family: var(--mono); font-size: 13px;
  word-break: break-all; margin: 12px 0;
  display: flex; align-items: center; gap: 10px;
}
.address-box span { flex: 1; }
.copy-btn {
  background: none; border: 1px solid var(--border2); color: var(--muted);
  border-radius: 4px; padding: 4px 10px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; white-space: nowrap; transition: .15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }

/* Stats */
.stats-summary {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 20px;
}

/* Chart toggles */
.lw-toggle {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  color: var(--muted); user-select: none; white-space: nowrap; font-size: 11px;
}
.lw-toggle input[type=checkbox] { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.lw-toggle:hover { color: var(--text); }
.lw-toggle-dot { width: 10px; height: 3px; border-radius: 2px; display: inline-block; flex-shrink: 0; }

/* LW Chart layout */
.lw-chart-wrap { display: flex; flex-direction: column; width: 100%; height: 100%; gap: 0; }
.lw-chart-price { flex: 1; min-height: 0; }
.lw-chart-rsi   { height: 120px; flex-shrink: 0; border-top: 1px solid var(--border); }
.lw-chart-legend {
  position: absolute; top: 6px; left: 8px; z-index: 10;
  display: flex; gap: 12px; font-size: 11px; pointer-events: none;
}
.lw-chart-legend span { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.lw-chart-loading { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 14px; }

/* Helper layout */
.helper-layout { display: flex; gap: 0; height: calc(100vh - 80px); overflow: hidden; }
.helper-nav { width: 180px; flex-shrink: 0; border-right: 1px solid var(--border); padding: 8px 0; }
.helper-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 13px; cursor: pointer;
  color: var(--muted); border-left: 3px solid transparent;
  transition: all .15s; border-radius: 0 4px 4px 0; margin-right: 8px;
}
.helper-nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.helper-nav-item.active { background: var(--accent-dim); color: var(--text); border-left-color: var(--accent); }
.helper-nav-item.locked { opacity: .5; cursor: default; }
.helper-main { flex: 1; padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.helper-input-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.helper-input-row input, .helper-input-row select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 4px; padding: 7px 12px; font-size: 14px;
}
.helper-input-row input { width: 140px; }
.helper-output {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 16px 20px; font-size: 13px; line-height: 1.6;
  overflow-y: auto; min-height: 300px; white-space: pre-wrap; font-family: var(--mono);
}
.helper-output.has-image { padding: 0; background: transparent; border: none; font-family: inherit; }
.helper-output img { width: 100%; border-radius: 6px; display: block; }
.helper-type-toggle {
  display: flex; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.helper-type-toggle button {
  flex: 1; background: none; border: none; color: var(--muted); padding: 6px 14px;
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.helper-type-toggle button.active { background: var(--accent); color: #000; font-weight: 700; }
.helper-lock-notice {
  background: var(--accent-dim); border: 1px solid rgba(0,200,255,.25);
  border-radius: 6px; padding: 12px 16px; font-size: 13px; color: var(--accent);
}

/* Helper history chips */
.helper-history { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.helper-chip {
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer; transition: all .15s;
}
.helper-chip:hover { border-color: var(--accent); color: var(--text); }

/* Report HTML output */
.report-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px 16px; margin-bottom: 12px;
}
.report-section-title {
  font-weight: 700; font-size: 13px; color: var(--text);
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.report-line { font-size: 13px; line-height: 1.7; color: var(--muted2); }
.report-line b { color: var(--text); }
.report-line code {
  background: var(--accent-dim); color: var(--accent);
  border-radius: 3px; padding: 1px 5px; font-family: var(--mono);
}

/* Entries */
.entry-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 16px 20px; margin-bottom: 12px;
}
.entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.entry-pair { font-weight: 700; font-size: 15px; }
.entry-dir { padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.entry-long  { background: var(--green-dim); color: var(--green); }
.entry-short { background: var(--red-dim);   color: var(--red); }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.entry-field { font-size: 12px; }
.entry-field-label { color: var(--muted); margin-bottom: 2px; }
.entry-field-value { font-weight: 600; color: var(--text); }

/* ══════════════════════════════════════════
   Client Mobile (≤768px)
══════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Signal cards: 2 columns */
  .signals-grid,
  [id="signals-list"],
  .signals-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Stats summary: 2 columns */
  .stats-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Helper: stack vertically, remove fixed height */
  .helper-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .helper-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }
  .helper-nav-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    margin-right: 0;
    padding: 10px 14px;
    white-space: nowrap;
  }
  .helper-nav-item.active {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
    background: var(--accent-dim);
  }
  .helper-main {
    padding: 14px 16px;
    height: auto;
    min-height: 300px;
    overflow-y: visible;
  }

  /* Chart: reasonable height on mobile */
  .lw-chart-wrap { height: 320px; min-height: 280px; }
  .lw-chart-price { flex: 1; }
  .lw-chart-rsi   { height: 90px; }

  /* Address box: wrap on mobile */
  .address-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    word-break: break-all;
  }
  .copy-btn { width: 100%; text-align: center; }

  /* Entry grid: smaller min */
  .entry-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ══════════════════════════════════════════
   Client Mobile (≤480px)
══════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Signal cards: 1 column on tiny screens */
  .signals-grid,
  [id="signals-list"],
  .signals-list {
    grid-template-columns: 1fr !important;
  }

  /* Stats: 2 columns */
  .stats-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Sub-card padding */
  .sub-card { padding: 16px; }

  /* Entry card */
  .entry-card { padding: 12px 14px; }
  .entry-pair { font-size: 14px; }
  .entry-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }

  /* Chart: compact */
  .lw-chart-wrap { height: 260px; }
  .lw-chart-rsi  { height: 70px; }

  /* Helper input row: stack */
  .helper-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .helper-input-row input { width: 100%; }
}

/* ══════════════════════════════════════════
   Dashboard — Cozy redesign
══════════════════════════════════════════ */

/* Welcome banner */
.dash-welcome {
  background: linear-gradient(135deg, rgba(0,200,255,.05) 0%, rgba(0,255,159,.03) 100%);
  border: 1px solid rgba(0,200,255,.12);
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dash-greeting {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.dash-welcome-sub {
  font-size: 13px;
  color: var(--muted);
}
.dash-welcome-meta {
  text-align: right;
  flex-shrink: 0;
}

/* Active products pill row */
.dash-products {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

/* 2-col: news + FAQ */
.dash-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}
.dash-news, .dash-faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.dash-block-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* News list */
.dash-news-list { display: flex; flex-direction: column; }
.dash-news-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.dash-news-item:last-child { border-bottom: none; padding-bottom: 0; }
.dash-news-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,200,255,.4);
}
.dash-news-text { font-size: 13px; color: var(--text); line-height: 1.4; margin-bottom: 3px; }
.dash-news-date { font-size: 11px; color: var(--muted); }

/* FAQ accordion */
.dash-faq-list { display: flex; flex-direction: column; }
.dash-faq-item { border-bottom: 1px solid var(--border); }
.dash-faq-item:last-child { border-bottom: none; }
.dash-faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  user-select: none;
  gap: 8px;
  transition: color .15s;
}
.dash-faq-q:hover { color: var(--accent); }
.dash-faq-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: transform .2s;
  flex-shrink: 0;
  line-height: 1;
}
.dash-faq-item.open .dash-faq-arrow { transform: rotate(90deg); color: var(--accent); }
.dash-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.dash-faq-item.open .dash-faq-a { max-height: 240px; padding-bottom: 12px; }

@media (max-width: 720px) {
  .dash-welcome { flex-direction: column; align-items: flex-start; }
  .dash-welcome-meta { text-align: left; }
  .dash-grid2 { grid-template-columns: 1fr; }
}
