/* ═══ Tradara design tokens ═══
   Palette: espresso night + molten amber (MFF_FX heritage, refined)
   Display: Fraunces (warm, feminine, characterful) · Body/UI: Outfit
   Signature: the Tradara orb — a breathing amber sphere; she glows when she speaks. */
:root {
  --bg: #16100b;            /* espresso night */
  --bg-raise: #211812;      /* card surface */
  --bg-sunken: #0f0a06;
  --line: #3a2c20;
  --text: #f4ece3;
  --text-dim: #b39f8d;
  --amber: #ff9d2e;         /* molten amber — Tradara's glow */
  --amber-deep: #e2670f;
  --good: #57d9a3;
  --bad: #ff6b5e;
  --radius: 14px;
  --font-display: "Fraunces", serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}
.hidden { display: none !important; }

/* ═══ The orb — signature element ═══ */
.orb {
  width: 84px; height: 84px; border-radius: 50%;
  margin: 0 auto 18px;
  background: radial-gradient(circle at 32% 30%, #ffd9a0, var(--amber) 45%, var(--amber-deep) 80%);
  box-shadow: 0 0 34px rgba(255, 157, 46, .45), 0 0 90px rgba(226, 103, 15, .25);
  animation: breathe 4.5s ease-in-out infinite;
}
.orb.small { width: 44px; height: 44px; margin: 0; flex: none; }
.orb.speaking { animation: pulse .9s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 34px rgba(255,157,46,.45);} 50% { transform: scale(1.12); box-shadow: 0 0 60px rgba(255,157,46,.75);} }
@media (prefers-reduced-motion: reduce) { .orb, .orb.speaking { animation: none; } }

/* ═══ Auth ═══ */
.screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); text-align: center; }
.brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 3.4rem);
  font-weight: 650; letter-spacing: -0.01em;
  color: var(--amber);
}
.tagline { color: var(--text-dim); margin: 6px 0 28px; }
.tagline .by { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.auth-form { display: grid; gap: 12px; text-align: left; }
input, select, textarea {
  width: 100%; padding: 13px 14px;
  background: var(--bg-raise); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}
textarea { min-height: 84px; resize: vertical; }
.switch { color: var(--text-dim); font-size: .9rem; text-align: center; }
.switch a { color: var(--amber); }
.error { color: var(--bad); min-height: 1.4em; margin-top: 10px; font-size: .9rem; }

/* ═══ Password show/hide ═══ */
.pw-field { position: relative; }
.pw-field input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 1.05rem; padding: 8px;
  opacity: .65; line-height: 1;
}
.pw-toggle:hover { opacity: 1; }

/* ═══ Buttons ═══ */
button { font: inherit; cursor: pointer; border: none; border-radius: var(--radius); }
.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  color: #241304; font-weight: 700; padding: 13px 18px;
}
.btn-primary.slim { padding: 10px 16px; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); padding: 12px; width: 100%; margin-top: 8px; }
.icon-btn { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 50%; width: 42px; height: 42px; font-size: 1.05rem; }

/* ═══ App layout ═══ */
#app { max-width: 760px; margin: 0 auto; padding: 20px 16px 96px; }
.tab { display: none; }
.tab.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }

.page-head { margin: 6px 0 18px; }
.page-head h2, .coach-head h2 { font-family: var(--font-display); font-weight: 650; font-size: 1.7rem; }
.sub { color: var(--text-dim); font-size: .92rem; }

.card {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  display: grid; gap: 12px;
}
.card h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 2px; }
.stat-label { color: var(--text-dim); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.stat-value.good { color: var(--good); }
.stat-value.bad { color: var(--bad); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; color: var(--text-dim); font-size: .92rem; }
.summary-grid b { color: var(--text); font-size: 1.15rem; display: block; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { background: var(--bg-raise); border: 1px solid var(--line); color: var(--text); padding: 16px 12px; text-align: left; font-weight: 600; }
.quick:hover { border-color: var(--amber); }

/* ═══ Analyze ═══ */
/* ═══ Analyze: timeframe slots ═══ */
.tf-slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .tf-slots { grid-template-columns: repeat(4, 1fr); } }
.tf-slot { position: relative; }
.tf-slot-label { position: absolute; top: 6px; left: 8px; z-index: 2; font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--amber); background: color-mix(in srgb, var(--bg-sunken) 80%, transparent); padding: 2px 6px; border-radius: 6px; }
.tf-dropzone {
  display: grid; place-items: center; min-height: 92px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--text-dim); cursor: pointer; padding: 10px; text-align: center;
  font-size: .82rem; position: relative; overflow: hidden;
}
.tf-dropzone:hover { border-color: var(--amber); color: var(--amber); }
.tf-slot.drag-over .tf-dropzone { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.tf-slot-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius) - 2px); }
.tf-slot-remove {
  position: absolute; top: 4px; right: 4px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bad); color: #fff; border: none; font-size: .74rem; line-height: 1;
}
.tf-slot.locked .tf-dropzone { opacity: .45; cursor: not-allowed; }
.tf-slot.locked .tf-dropzone:hover { border-color: var(--line); color: var(--text-dim); }
.tf-slot-lock { font-size: 1.3rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.bias-buy { color: var(--good); } .bias-sell { color: var(--bad); } .bias-no_trade { color: var(--text-dim); }
.result-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; font-size: .95rem; }
.result-kv b { display: block; font-size: 1.1rem; }
.annotated-chart { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.annotation-note { font-style: italic; opacity: .8; }

/* ═══ Redesigned analysis result screen ═══ */
.result-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.result-header h3 { font-family: var(--font-display); font-size: 1.2rem; }

.bias-banner { display: flex; justify-content: space-between; align-items: center; border-radius: var(--radius); padding: 16px; }
.bias-banner-buy { background: color-mix(in srgb, var(--good) 16%, var(--bg-raise)); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }
.bias-banner-sell { background: color-mix(in srgb, var(--bad) 16%, var(--bg-raise)); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.bias-banner-none { background: var(--bg-raise); border: 1px solid var(--line); justify-content: center; padding: 18px; }
.bias-icon-label { display: flex; align-items: center; gap: 12px; }
.bias-icon { font-size: 1.6rem; }
.bias-icon-label b { font-size: 1.15rem; display: block; }
.confidence { text-align: right; }
.confidence b { font-size: 1.4rem; color: var(--amber); display: block; }

.entry-zone-box { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.entry-zone-box b { font-size: 1.3rem; font-family: var(--font-display); }

.sl-rr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-box, .rr-box { border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; }
.sl-box { background: color-mix(in srgb, var(--bad) 14%, var(--bg-raise)); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.rr-box { background: color-mix(in srgb, var(--good) 14%, var(--bg-raise)); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.sl-box b, .rr-box b { font-size: 1.25rem; }

.tp-section { display: grid; gap: 8px; }
.tp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.tp-box { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; display: grid; gap: 2px; }
.tp-box span { font-size: .72rem; color: var(--good); font-weight: 700; }
.tp-box b { font-size: 1.05rem; }

.factors-section { display: grid; gap: 12px; }
.factor-group span { font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.factor-group.bullish span { color: var(--good); }
.factor-group.bearish span { color: var(--bad); }
.factor-group ul { list-style: none; margin-top: 6px; display: grid; gap: 4px; }
.factor-group li { font-size: .88rem; color: var(--text-dim); padding-left: 14px; position: relative; }
.factor-group li::before { content: "•"; position: absolute; left: 0; }

.ai-commentary-box { background: var(--bg-raise); border-left: 3px solid var(--amber); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 16px; display: grid; gap: 8px; }
.commentary-label { font-size: .78rem; font-weight: 700; color: var(--amber); letter-spacing: .03em; }
.ai-commentary-box p { font-size: .92rem; color: var(--text-dim); }

.center { text-align: center; }
.disclaimer-box { background: color-mix(in srgb, var(--amber) 12%, var(--bg-raise)); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); border-radius: var(--radius); padding: 12px 14px; font-size: .82rem; color: var(--text-dim); }

.inline-journal, .inline-journal-locked { display: grid; gap: 10px; }
.outcome-toggle { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 480px) { .outcome-toggle { grid-template-columns: repeat(4, 1fr); } }
.outcome-btn { background: var(--bg-sunken); border: 1px solid var(--line); color: var(--text-dim); padding: 10px 6px; border-radius: 10px; font-size: .82rem; font-weight: 600; }
.outcome-btn.active { background: var(--amber); border-color: var(--amber); color: #241304; }
.inline-journal textarea { min-height: 70px; }

/* ═══ Coach ═══ */
.coach-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.coach-head > div { flex: 1; }
.messages { display: grid; gap: 10px; min-height: 40vh; max-height: 56vh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 85%; padding: 12px 14px; border-radius: var(--radius); font-size: .96rem; white-space: pre-wrap; }
.msg.user { background: linear-gradient(135deg, var(--amber), var(--amber-deep)); color: #241304; justify-self: end; border-bottom-right-radius: 4px; }
.msg.tradara { background: var(--bg-raise); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 4px; }
.composer { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.composer input { flex: 1; }
#mic-btn.listening { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 14px rgba(255,157,46,.4); }

/* ═══ Journal ═══ */
.check { display: flex; gap: 8px; align-items: center; color: var(--text-dim); font-size: .92rem; }
.check input { width: auto; }
.j-entry { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; font-size: .93rem; }
.j-entry .dim { color: var(--text-dim); }
.calc-out { color: var(--amber); font-weight: 700; }
.calc-warning { color: var(--bad); font-size: .85rem; min-height: 1.2em; }
.admin-delete { background: transparent; border: 1px solid var(--bad); color: var(--bad); padding: 4px 10px; border-radius: 8px; font-size: .78rem; }

/* ═══ Admin Panel ═══ */
.admin-panel-head { display: flex; align-items: center; gap: 12px; }
.admin-subtabs { display: flex; gap: 8px; margin: 4px 0 16px; overflow-x: auto; }
.admin-subtab-btn { background: var(--bg-raise); border: 1px solid var(--line); color: var(--text-dim); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.admin-subtab-btn.active { background: var(--amber); border-color: var(--amber); color: #241304; }
.admin-subtab-panel.hidden { display: none; }
.request-card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; display: grid; gap: 8px; }
.request-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.request-top b { font-size: 1rem; }
.request-actions { display: flex; gap: 8px; }
.btn-approve { background: var(--good); color: #072418; font-weight: 700; padding: 8px 16px; border-radius: 8px; }
.btn-reject { background: transparent; border: 1px solid var(--bad); color: var(--bad); padding: 8px 16px; border-radius: 8px; }
.user-row { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.user-row .dim { color: var(--text-dim); font-size: .82rem; }

/* ═══ Pricing / Checkout ═══ */
.pricing-head { display: flex; align-items: center; gap: 12px; }
.plans-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.plan-card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; }
.plan-card.featured { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.plan-card h3 { font-family: var(--font-display); font-size: 1.3rem; }
.plan-price { font-size: 1.8rem; font-weight: 700; color: var(--amber); }
.plan-price small { font-size: .9rem; color: var(--text-dim); font-weight: 400; }
.plan-price-ngn { font-size: .82rem; color: var(--text-dim); }
.plan-features { list-style: none; display: grid; gap: 6px; font-size: .88rem; color: var(--text-dim); }
.plan-features li::before { content: "✓ "; color: var(--good); font-weight: 700; }

.pay-method-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.pay-method-btn { flex: 1; background: var(--bg-sunken); border: 1px solid var(--line); color: var(--text-dim); padding: 10px; border-radius: 10px; font-weight: 600; font-size: .88rem; }
.pay-method-btn.active { background: var(--amber); border-color: var(--amber); color: #241304; }
.pay-method-panel.hidden { display: none; }
.instructions-box { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; margin-bottom: 10px; }
.instr-row { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.instr-row span { color: var(--text-dim); }
.instr-row b { text-align: right; word-break: break-all; }

/* ═══ Trading sessions ═══ */
.sessions-bars { display: grid; gap: 12px; }
.session-row { display: grid; gap: 4px; }
.session-name { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; color: var(--text-dim); }
.session-hours { flex: 1; font-size: .78rem; opacity: .75; }
.session-name em { font-style: normal; font-weight: 700; }
.session-open { color: var(--good); }
.session-closed { color: var(--text-dim); }
.session-bar { position: relative; height: 10px; background: var(--bg-sunken); border-radius: 6px; overflow: hidden; }
.session-fill { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--amber), var(--amber-deep)); border-radius: 6px; opacity: .8; }
.session-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); box-shadow: 0 0 6px var(--text); }

/* ═══ Market news embed ═══ */
.news-embed iframe { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); }
.news-embed a { color: var(--amber); }
.myfxbook-credit { text-align: center; font-size: .78rem; color: var(--text-dim); margin-top: 6px; }

/* ═══ Market news cards ═══ */
.news-cards { display: grid; gap: 10px; margin-bottom: 4px; }
.news-card { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; }
.news-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.news-card-top h4 { font-family: var(--font-display); font-weight: 650; font-size: 1rem; }
.news-card p { font-size: .9rem; color: var(--text-dim); }
.news-card-meta { font-size: .76rem; opacity: .75; }
.impact-badge { flex: none; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: capitalize; }
.impact-low { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.impact-medium { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
.impact-high { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }

/* ═══ Forex classes ═══ */
.classes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.class-card { display: grid; gap: 8px; }
.class-embed { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.class-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.class-card p { font-size: .9rem; color: var(--text-dim); }

/* ═══ Bottom nav ═══ */
.bottom-nav {
  position: fixed; inset: auto 0 0 0;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg-sunken) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-btn { background: none; color: var(--text-dim); display: grid; justify-items: center; gap: 2px; font-size: 1.1rem; padding: 4px 10px; }
.nav-btn span { font-size: .66rem; letter-spacing: .03em; }
.nav-btn.active { color: var(--amber); }

@media (min-width: 700px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══ Live markets board (Home) ═══ */
.markets-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.markets-head .dim { font-size: .75rem; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-sunken); color: var(--text-dim);
  font-family: var(--font-body); font-size: .85rem; cursor: pointer;
}
.chip.active { background: var(--amber); border-color: var(--amber); color: #1c1006; font-weight: 600; }
.markets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.q-tile {
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: grid; gap: 2px;
}
.q-sym { font-size: .78rem; color: var(--text-dim); letter-spacing: .02em; }
.q-price { font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.q-chg { font-size: .78rem; font-variant-numeric: tabular-nums; }
.q-chg.up { color: var(--good); }
.q-chg.down { color: var(--bad); }
.q-tile.empty .q-price { color: var(--text-dim); font-weight: 400; }

/* ═══ Trade history ═══ */
.btn-ghost {
  width: 100%; padding: 12px; border-radius: var(--radius);
  background: transparent; border: 1px dashed var(--line);
  color: var(--text-dim); font-family: var(--font-body); font-size: .95rem; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.h-row {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 10px;
}
.h-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.h-sym { font-weight: 650; }
.h-kind { font-size: .72rem; color: var(--text-dim); background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.h-mid { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--text-dim); margin-top: 6px; font-variant-numeric: tabular-nums; }
.h-out { font-size: .85rem; font-weight: 600; }
.h-out.win { color: var(--good); }
.h-out.loss { color: var(--bad); }
.h-out.neutral { color: var(--text-dim); font-weight: 400; }
.h-date { font-size: .75rem; color: var(--text-dim); }
.h-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.h-actions button {
  padding: 5px 12px; font-size: .78rem; border-radius: 999px; cursor: pointer;
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--text-dim);
}
.h-actions button:hover { border-color: var(--amber); color: var(--amber); }
.h-notes { font-size: .82rem; color: var(--text-dim); margin-top: 7px; font-style: italic; }

/* ═══ Home redesign: quick actions grid ═══ */
.section-title { font-family: var(--font-display); font-size: 1.1rem; margin: 18px 0 10px; }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border-radius: var(--radius);
  background: var(--bg-raise); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-body); font-size: .85rem; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.qa-tile:hover { border-color: var(--amber); }
.qa-tile:active { transform: scale(.97); }
.qa-tile.primary { background: linear-gradient(135deg, var(--amber), var(--amber-deep)); color: #1c1006; font-weight: 650; border: none; }
.qa-ico { font-size: 1.4rem; }

/* ═══ Visual trading summary ═══ */
.summary-visual { display: flex; gap: 22px; align-items: center; justify-content: space-around; flex-wrap: wrap; }
.donut-wrap { text-align: center; }
.donut { width: 128px; height: 128px; }
.donut-big { fill: var(--text); font-size: 24px; font-weight: 700; font-family: var(--font-body); }
.donut-small { fill: var(--text-dim); font-size: 11px; font-family: var(--font-body); }
.legend { display: flex; gap: 12px; justify-content: center; margin-top: 8px; font-size: .78rem; color: var(--text-dim); }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot.win { background: var(--good); } .dot.loss { background: var(--bad); } .dot.be { background: var(--amber); }
.bias-wrap { text-align: center; }
.bias-title { font-size: .82rem; color: var(--text-dim); margin-bottom: 8px; }
.bias-bars { display: flex; gap: 20px; align-items: flex-end; justify-content: center; min-height: 100px; }
.bias-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bias-bar { width: 26px; border-radius: 6px 6px 3px 3px; }
.bias-bar.buy { background: var(--good); } .bias-bar.sell { background: var(--bad); } .bias-bar.nt { background: var(--line); }
.bias-n { font-size: .8rem; font-weight: 650; }
.bias-label { font-size: .72rem; color: var(--text-dim); }

/* ═══ Tutorial banner cards ═══ */
.tutorials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tut-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center; text-decoration: none;
  border: 1px solid var(--line);
}
.tut-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.85)); }
.tut-title {
  position: relative; z-index: 1; padding: 12px 14px; color: #fff; font-weight: 650; font-size: .95rem;
  background: linear-gradient(90deg, var(--amber-deep), transparent); border-radius: 0 0 var(--radius) var(--radius);
}
.tut-play {
  position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -60%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 157, 46, .92); color: #1c1006; font-size: 1.3rem;
  box-shadow: 0 0 24px rgba(255, 157, 46, .5);
}

/* ═══ Collapsible live markets bar ═══ */
.collapse-bar {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-raise); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-body); font-size: .95rem; font-weight: 600; cursor: pointer;
}
.collapse-bar:hover { border-color: var(--amber); }
#markets-card { margin-top: 10px; }

/* ═══ Connect page ═══ */
.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.connect-card {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 18px;
  border-radius: var(--radius); text-decoration: none; color: #fff;
  transition: transform .12s;
}
.connect-card:hover { transform: translateY(-2px); }
.connect-ico { font-size: 1.5rem; }
.connect-desc { font-size: .8rem; opacity: .9; }
.c-youtube { background: linear-gradient(135deg, #e63e2f, #c4231a); }
.c-tiktok { background: linear-gradient(135deg, #e0407c, #c02360); }
.c-instagram { background: linear-gradient(135deg, #a24bd6, #d6367c); }
.c-telegram { background: linear-gradient(135deg, #3a7bd5, #2456c4); }

/* ═══ Admin content section ═══ */
.link-label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: 10px; }
.link-label input { margin-top: 4px; }

/* ═══ Universal page back-arrow header ═══ */
.page-head-nav { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.page-head-nav > div { flex: 1; }
.back-btn { flex: none; }

/* ═══ Analyze page: usage bar, chips-as-select, camera capture ═══ */
.usage-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; font-size: .88rem; color: var(--text-dim);
}
.usage-bar span:last-child { color: var(--amber); font-weight: 650; font-variant-numeric: tabular-nums; }
.field-label { font-size: .82rem; color: var(--text-dim); margin: 12px 0 6px; }
.tf-slot { position: relative; }
.tf-slot-camera {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(22,16,11,.75); border: 1px solid var(--line); color: var(--text);
  font-size: .85rem; display: grid; place-items: center; cursor: pointer;
}
.tf-slot-camera:hover { border-color: var(--amber); }

/* ═══ Analyze page: recent analyses feed ═══ */
#analyze-recent-list .h-row .h-actions { justify-content: flex-end; }
.h-del { color: var(--bad) !important; }
.h-del:hover { border-color: var(--bad) !important; color: var(--bad) !important; }

/* ═══ Mobile refinements ═══ */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .qa-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .qa-tile { padding: 13px 6px; font-size: .78rem; }
  .qa-ico { font-size: 1.25rem; }
  .tf-slots { grid-template-columns: repeat(2, 1fr); }
  .markets-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .summary-visual { flex-direction: column; gap: 16px; }
  .connect-grid { grid-template-columns: 1fr 1fr; }
  .page-head h2, .coach-head h2 { font-size: 1.4rem; }
  .card { padding: 14px; }
}
@media (max-width: 360px) {
  .qa-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ Clickable history/analyze rows ═══ */
.h-row.clickable { cursor: pointer; position: relative; padding-right: 30px; transition: border-color .15s; }
.h-row.clickable:hover { border-color: var(--amber); }
.h-row.clickable::after {
  content: '›'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   Motion pass — Tradara should feel alive, not static.
   Everything here is transform/opacity based (cheap to animate) and
   the whole block is neutralised under prefers-reduced-motion at the
   bottom, so nobody gets motion they didn't ask for.
   ═══════════════════════════════════════════════════════════════ */

/* Smooth base — every interactive surface eases instead of snapping */
button, .chip, .qa-tile, .nav-btn, .connect-card, .tut-card, .h-row,
input, select, .icon-btn, .pw-toggle {
  transition: transform .16s cubic-bezier(.2,.8,.2,1), border-color .16s ease,
              background-color .16s ease, color .16s ease, box-shadow .16s ease, filter .16s ease;
}

/* Press feedback — every tappable thing gives a tiny satisfying squeeze */
.qa-tile:active, .chip:active, .connect-card:active, .tut-card:active,
.btn-primary:active, .btn-ghost:active, .icon-btn:active, .h-row.clickable:active {
  transform: scale(.96);
}
.qa-tile:hover { transform: translateY(-2px); }
.icon-btn:hover { transform: rotate(-8deg); border-color: var(--amber); }
.chip:hover { transform: translateY(-1px); }

/* Buttery button glow-up */
.btn-primary { transition: filter .18s ease, transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease; }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(255, 157, 46, .35); }

/* ═══ Page entrance — tab content settles in, doesn't just appear ═══ */
.tab.active { animation: tabIn .32s cubic-bezier(.2,.8,.2,1); }
@keyframes tabIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ═══ Staggered card/tile entrance on Home & grids ═══ */
.qa-grid .qa-tile, .stat-row .stat-card, .connect-grid .connect-card,
.tutorials-grid .tut-card, .markets-grid .q-tile {
  animation: riseIn .42s cubic-bezier(.2,.8,.2,1) both;
}
.qa-grid .qa-tile:nth-child(1){animation-delay:.02s} .qa-grid .qa-tile:nth-child(2){animation-delay:.06s}
.qa-grid .qa-tile:nth-child(3){animation-delay:.10s} .qa-grid .qa-tile:nth-child(4){animation-delay:.14s}
.qa-grid .qa-tile:nth-child(5){animation-delay:.18s} .qa-grid .qa-tile:nth-child(6){animation-delay:.22s}
.qa-grid .qa-tile:nth-child(7){animation-delay:.26s} .qa-grid .qa-tile:nth-child(8){animation-delay:.30s}
.qa-grid .qa-tile:nth-child(9){animation-delay:.34s}
.stat-row .stat-card:nth-child(1){animation-delay:.02s} .stat-row .stat-card:nth-child(2){animation-delay:.08s}
.stat-row .stat-card:nth-child(3){animation-delay:.14s} .stat-row .stat-card:nth-child(4){animation-delay:.20s}
@keyframes riseIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* h-row lists (history, licenses, analyses…) settle in one after another, capped so long lists don't crawl */
.h-row { animation: riseIn .36s cubic-bezier(.2,.8,.2,1) both; }
.h-row:nth-child(1){animation-delay:.01s} .h-row:nth-child(2){animation-delay:.04s}
.h-row:nth-child(3){animation-delay:.07s} .h-row:nth-child(4){animation-delay:.10s}
.h-row:nth-child(5){animation-delay:.13s} .h-row:nth-child(n+6){animation-delay:.15s}
.h-row.clickable:hover { transform: translateX(3px); }

/* Cards breathe in gently when a screen first renders them */
.card { animation: riseIn .4s cubic-bezier(.2,.8,.2,1) both; }

/* ═══ Chat bubbles pop in as they're sent/received ═══ */
.msg { animation: bubbleIn .28s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* ═══ Bottom nav — active tab gets a lively glow + icon bounce ═══ */
.nav-btn.active { animation: navPop .3s cubic-bezier(.34,1.56,.64,1); text-shadow: 0 0 16px rgba(255,157,46,.55); }
@keyframes navPop { 0% { transform: scale(1); } 45% { transform: scale(1.22) translateY(-2px); } 100% { transform: scale(1); } }

/* ═══ Donut chart — draws itself in rather than just appearing ═══ */
.donut circle { animation: donutGrow .7s cubic-bezier(.16,1,.3,1) both; transform-origin: 64px 64px; }
.donut circle:nth-child(1){animation-delay:0s} .donut circle:nth-child(2){animation-delay:.12s} .donut circle:nth-child(3){animation-delay:.24s}
@keyframes donutGrow { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.bias-bar { animation: barGrow .5s cubic-bezier(.16,1,.3,1) both; transform-origin: bottom; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ═══ Live price flash — a quote briefly glows when it updates ═══ */
.q-tile.flash-up { animation: flashUp .9s ease; }
.q-tile.flash-down { animation: flashDown .9s ease; }
@keyframes flashUp { 0% { background: color-mix(in srgb, var(--good) 28%, var(--bg-sunken)); } 100% { background: var(--bg-sunken); } }
@keyframes flashDown { 0% { background: color-mix(in srgb, var(--bad) 28%, var(--bg-sunken)); } 100% { background: var(--bg-sunken); } }

/* Live markets bar caret + collapse feel springy */
#markets-caret { display: inline-block; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.collapse-bar[aria-expanded="true"] #markets-caret { transform: rotate(90deg); }
#markets-card:not(.hidden) { animation: expandDown .25s cubic-bezier(.2,.8,.2,1); }
@keyframes expandDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ═══ Auth screen — brand mark drifts up into place, orb breathes underneath ═══ */
.brand { animation: brandIn .6s cubic-bezier(.16,1,.3,1) both; }
.tagline { animation: brandIn .6s cubic-bezier(.16,1,.3,1) .1s both; }
.auth-form { animation: brandIn .6s cubic-bezier(.16,1,.3,1) .18s both; }
@keyframes brandIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ═══ Shimmering "Loading" — replaces static text with animated ellipsis ═══ */
.loading-dots::after {
  content: ''; display: inline-block; width: 1.2em; text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75%, 100% { content: '...'; } }

/* ═══ Result reveal — analysis bias banner + boxes cascade in ═══ */
.bias-banner, .entry-zone-box, .sl-rr-row, .tp-section, .factors-section, .ai-commentary-box {
  animation: riseIn .4s cubic-bezier(.2,.8,.2,1) both;
}
.entry-zone-box { animation-delay: .05s; } .sl-rr-row { animation-delay: .1s; }
.tp-section { animation-delay: .15s; } .factors-section { animation-delay: .2s; } .ai-commentary-box { animation-delay: .25s; }

/* Toast-style save confirmations (Content/Discounts/Links admin messages) pop gently */
#tut-msg:not(:empty), #links-msg:not(:empty), #disc-msg:not(:empty), #issue-msg:not(:empty) { animation: riseIn .25s ease both; }

/* ═══ Respect reduced motion — the whole motion system stands down ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ═══════════════════════════════════════════════════════════════
   The grand entrance — splash intro + ambient embers.
   Splash: the orb wakes, the name rises, then the veil lifts.
   Embers: tiny amber sparks drifting up behind everything, always.
   ═══════════════════════════════════════════════════════════════ */

/* ═══ Splash intro ═══ */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 60%, #241812 0%, var(--bg) 55%, #0a0603 100%);
  transition: opacity .6s ease, visibility .6s;
}
#splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-orb {
  width: 110px; height: 110px; margin: 0 auto 26px;
  animation: orbWake 1.4s cubic-bezier(.16,1,.3,1) both, breathe 4.5s ease-in-out 1.4s infinite;
}
@keyframes orbWake {
  0%   { opacity: 0; transform: scale(.2); box-shadow: 0 0 0 rgba(255,157,46,0); }
  55%  { opacity: 1; transform: scale(1.12); box-shadow: 0 0 90px rgba(255,157,46,.8), 0 0 160px rgba(226,103,15,.5); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 0 34px rgba(255,157,46,.45), 0 0 90px rgba(226,103,15,.25); }
}
.splash-brand {
  font-family: var(--font-display); font-size: clamp(2.8rem, 10vw, 4rem);
  font-weight: 650; color: var(--amber); letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--amber-deep) 20%, #ffd9a0 50%, var(--amber) 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: brandRise .8s cubic-bezier(.16,1,.3,1) .5s both, brandShine 2.2s ease .9s;
}
@keyframes brandRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes brandShine { 0% { background-position: 180% 0; } 100% { background-position: 0% 0; } }
.splash-tag {
  color: var(--text-dim); font-size: .95rem; margin-top: 8px;
  animation: brandRise .7s cubic-bezier(.16,1,.3,1) .85s both;
}

/* ═══ Ambient embers ═══ */
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -12px; left: var(--x);
  width: var(--size); height: var(--size); border-radius: 50%;
  background: radial-gradient(circle, #ffd9a0 0%, var(--amber) 55%, transparent 75%);
  opacity: 0;
  animation: emberRise var(--dur) linear var(--delay) infinite;
  filter: blur(.4px);
}
@keyframes emberRise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  8%   { opacity: var(--peak); }
  55%  { transform: translate(var(--sway), -55vh) scale(.85); opacity: calc(var(--peak) * .6); }
  100% { transform: translate(calc(var(--sway) * -0.6), -108vh) scale(.5); opacity: 0; }
}

/* A slow, warm aurora drifting deep in the background */
#ambient::before {
  content: ''; position: absolute; inset: -30%;
  background: radial-gradient(ellipse 42% 30% at 22% 78%, rgba(226,103,15,.10), transparent 70%),
              radial-gradient(ellipse 36% 26% at 80% 18%, rgba(255,157,46,.07), transparent 70%);
  animation: auroraDrift 26s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  from { transform: translate(-3%, 2%) rotate(-2deg); }
  to   { transform: translate(3%, -2%) rotate(2deg); }
}

/* Content sits above the ambient layer */
.screen, #app { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  #splash { display: none; }
  #ambient { display: none; }
}
