/* ZORVO dashboard design system — plain CSS, no build step. */

:root {
  color-scheme: light dark;

  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e2e4ee;
  --text: #14162b;
  --text-muted: #5c5f78;
  --text-faint: #8b8ea3;

  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef0ff;
  --accent: #0ea5a3;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --success: #16a34a;
  --success-soft: #dcfce7;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(20, 22, 43, 0.04), 0 8px 24px rgba(20, 22, 43, 0.06);
  --shadow-lg: 0 4px 12px rgba(20, 22, 43, 0.08), 0 16px 40px rgba(20, 22, 43, 0.10);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1020;
    --surface: #171933;
    --surface-raised: #1e2140;
    --border: #2b2e52;
    --text: #eef0ff;
    --text-muted: #a8abc9;
    --text-faint: #6f7295;
    --brand-soft: #24265a;
    --danger-soft: #3a1620;
    --warning-soft: #3a2a0f;
    --success-soft: #123420;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1020;
  --surface: #171933;
  --surface-raised: #1e2140;
  --border: #2b2e52;
  --text: #eef0ff;
  --text-muted: #a8abc9;
  --text-faint: #6f7295;
  --brand-soft: #24265a;
  --danger-soft: #3a1620;
  --warning-soft: #3a2a0f;
  --success-soft: #123420;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--brand); }

/* Any class-based `display` rule (author origin) always beats the browser's
   built-in `[hidden] { display: none }` rule (user-agent origin), regardless
   of selector specificity — so toggling an element's `hidden` property in JS
   silently does nothing if that element's own class sets `display` (e.g.
   .btn, .card, .tab-panel). This single !important rule makes `[hidden]`
   authoritative everywhere in the app, instead of patching one selector at a
   time (already bit us twice: the guide-widget panel, then the Cancel-edit
   button). */
[hidden] { display: none !important; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.centered-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* --- Top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  height: 26px;
  width: 26px;
  border-radius: 7px;
  flex-shrink: 0;
}
.topbar .role-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-strong);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 10px;
}
.topbar .actions { display: flex; align-items: center; gap: 12px; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card + .card { margin-top: 20px; }
.card h2 {
  margin: 0 0 4px;
  font-size: 16px;
}
.card .card-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}
/* Trading Master dashboard split — left is the Trading Master's own setup
   and activity, right is everything about their customers. Independent
   column heights (align-items: start) rather than a match-height layout:
   the two sides naturally hold a different amount of content. */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.dashboard-col-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
@media (max-width: 900px) {
  .dashboard-columns { grid-template-columns: 1fr; gap: 8px; }
}

/* Collapsible cards (native <details>/<summary>) — used for forms that are
   used occasionally rather than read constantly, so the dashboard's default
   view stays short enough to see the important always-visible parts (kill
   switch, desk list, customer list, accounts table) without scrolling past
   a wall of forms to reach them. */
.card > details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  margin: -8px -10px 0;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.card > details > summary:hover,
.card > details > summary:focus-visible { background: var(--brand-soft); }
.card > details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.card > details > summary::-webkit-details-marker { display: none; }
.card > details > summary::marker { content: ''; }
.card > details:not([open]) > summary .card-sub { margin-bottom: 0; }
/* A clearly-visible round chevron button, not a faint text arrow, so it
   reads as "there's more here" at a glance rather than being missed. */
.details-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s ease;
}
.card > details[open] > summary .details-chevron { transform: rotate(90deg); }
/* Inline expand/collapse indicator for accordion-style table rows (e.g. a
   trade row that expands to show its audit trail directly beneath it). */
.row-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
}
/* .card + .card's margin-top is for cards stacked in normal flow; inside a
   grid it also matches later cards in the same row (DOM-adjacent, not
   visually adjacent), pushing them down and making them look shorter than
   the row's first card even though the grid already spaces them via gap. */
.card-grid > .card + .card { margin-top: 0; }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
}
.auth-card .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; margin-bottom: 4px;
}
.auth-card p.tagline {
  color: var(--text-muted); margin: 0 0 24px; font-size: 13px;
}

/* --- Forms --- */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}
input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(0.92); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
/* Plain glyphs (✕) render visually larger than emoji at the same font-size —
   scale just those down so icon buttons in the same row look consistent. */
.icon-btn-glyph { font-size: 12px; font-weight: 700; }

/* Broker kill-switch rows */
.bks-name { font-weight: 600; letter-spacing: 0.02em; }
.bks-action { text-align: right; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

/* --- Badges --- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--border); color: var(--text-muted); }

/* --- Misc --- */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}
.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: -10px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 4px;
}
.section-sub {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 13px;
}
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}
code, .mono { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; }
.copy-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  word-break: break-all;
}

/* --- Marketing homepage --- */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.home-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-nav .brand {
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-nav .actions { display: flex; gap: 10px; }

.hero {
  background: linear-gradient(180deg, var(--brand-soft), var(--bg) 70%);
  padding: 72px 24px;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 32px;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.home-section { padding-top: 12px; padding-bottom: 12px; }

.home-footer {
  text-align: center;
  padding: 32px 24px 60px;
  color: var(--text-faint);
  font-size: 13px;
}

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .home-nav .actions { flex-direction: column; gap: 6px; }
  .home-nav-inner { flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
}

/* --- Onboarding step mockups (illustrative, not live screenshots) --- */
.step-card { display: flex; flex-direction: column; gap: 16px; }
.mockup-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mockup-chrome {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mockup-chrome span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
}
.mockup-body { padding: 14px; font-size: 12px; }
.mockup-body label {
  font-size: 10px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}
.mockup-body input, .mockup-body select {
  font-size: 12px; padding: 6px 8px; margin-bottom: 8px; pointer-events: none;
}
.mockup-body .btn { font-size: 12px; padding: 6px 12px; pointer-events: none; }
.mockup-link {
  margin-top: 8px;
  font-size: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  word-break: break-all;
  color: var(--text-faint);
}

/* --- Screenshot placeholders (guide pages) --- */
.screenshot-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 14px 16px;
  margin: 10px 0 18px;
  font-size: 13px;
}
.screenshot-placeholder .ss-label {
  font-weight: 700;
  color: var(--brand-strong);
  display: block;
  margin-bottom: 4px;
}
.guide-step {
  margin: 22px 0;
  padding-left: 16px;
  border-left: 3px solid var(--brand-soft);
}
.guide-step h3 { margin: 0 0 8px; font-size: 16px; }
.limitation-list li, .prereq-list li { margin-bottom: 6px; }

/* --- AI onboarding widget --- */
.ai-widget-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-size: 22px;
  z-index: 40;
}
.ai-widget-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 340px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
}
.ai-widget-panel[hidden] {
  display: none;
}
.ai-widget-panel .ai-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-widget-panel .ai-header button {
  background: none; border: none; color: white; cursor: pointer; font-size: 16px;
}
.ai-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.ai-msg-user { align-self: flex-end; background: var(--brand); color: white; border-bottom-right-radius: 3px; }
.ai-msg-assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.ai-widget-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.ai-widget-input input { margin-bottom: 0; }

/* --- Signal Provider Analytics (provider.html) --- */
.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--brand); }

.provider-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.provider-title { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
.provider-sub { margin: 0; font-size: 13px; color: var(--text-muted); }

.date-range-group {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.custom-range-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.custom-range-panel[hidden] {
  display: none;
}
.custom-range-panel input[type="date"] {
  width: auto;
  margin-bottom: 0;
}
.range-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.range-btn:hover { color: var(--text); }
.range-btn.active { background: var(--brand); color: white; }

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand-strong); border-bottom-color: var(--brand); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.kpi-tile.kpi-wide { grid-column: span 2; }
.kpi-tile.kpi-muted { background: var(--bg); box-shadow: none; }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 6px; }
.kpi-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-tile.kpi-muted .kpi-value { font-size: 15px; color: var(--text-faint); font-weight: 600; }
.kpi-hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* Compact variant for the Overview KPI row on master.html only — scoped by
   id so provider.html/customer.html's own KPI tiles are unaffected. */
#master-kpis.kpi-grid { gap: 10px; }
#master-kpis .kpi-tile { padding: 10px 14px; }
#master-kpis .kpi-value { font-size: 18px; }
#master-kpis .kpi-label { margin-bottom: 3px; }

/* Slightly quieter card treatment for the three "do something" action cards
   (Post a signal, Add a customer, Bulk onboard) now that the Overview KPI
   row above them is the page's primary focus — not used elsewhere. */
.card.card-quiet { box-shadow: none; }

.health-grid { display: flex; flex-direction: column; gap: 12px; }
.health-item { display: flex; align-items: flex-start; gap: 10px; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; background: var(--text-faint); }
.health-healthy .health-dot { background: var(--success); }
.health-warning .health-dot { background: var(--warning); }
.health-error .health-dot { background: var(--danger); }
.health-neutral .health-dot { background: var(--text-faint); }
.health-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.health-text { font-size: 13px; }
.health-errors { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }

.activity-list { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-search { width: auto; margin-bottom: 0; min-width: 180px; }
.toolbar-actions select { width: auto; margin-bottom: 0; }

.export-bar { display: flex; justify-content: flex-end; margin: 24px 0 0; }

/* --- Customer search combo box (master.html "Create / edit customer") --- */
.combo-wrap { position: relative; }
.combo-results {
  position: absolute;
  top: calc(100% - 12px);
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
}
.combo-result-item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}
.combo-result-item:hover,
.combo-result-item.active { background: var(--brand-soft); }
.combo-result-item + .combo-result-item { border-top: 1px solid var(--border); }
.row-highlight { background: var(--brand-soft) !important; transition: background 0.3s ease; }

#volume-chart { width: 100%; display: block; }

/* Home-page nav dropdowns ("For Traders" / "For Trading Masters") */
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.nav-menu-panel a { padding: 10px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav-menu-panel a:hover { background: var(--bg); }

/* =========================================================
   Marketplace — "Find a Trading Master"
   ========================================================= */
.mp-body { background: var(--bg); }
.mp-topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--surface) 82%, transparent); }
.mp-brand { color: var(--text); text-decoration: none; }

.mp-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 64px;
  background:
    radial-gradient(1000px 400px at 15% -10%, color-mix(in srgb, #4f46e5 22%, transparent), transparent 70%),
    radial-gradient(800px 380px at 90% 10%, color-mix(in srgb, #0ea5a3 20%, transparent), transparent 70%),
    linear-gradient(180deg, var(--brand-soft), var(--bg));
  border-bottom: 1px solid var(--border);
}
.mp-hero-glow {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}
.mp-hero-inner { position: relative; max-width: 860px; margin: 0 auto; text-align: center; }
.mp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--brand-strong); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  box-shadow: var(--shadow);
}
.mp-eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px color-mix(in srgb, #10b981 25%, transparent); }
.mp-title { font-size: clamp(30px, 5vw, 50px); line-height: 1.08; letter-spacing: -0.025em; margin: 22px 0 16px; font-weight: 800; }
.mp-title-accent { background: linear-gradient(90deg, #4f46e5, #0ea5a3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mp-sub { font-size: 17px; line-height: 1.6; color: var(--text-muted); max-width: 620px; margin: 0 auto 32px; }

.mp-controls { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mp-search {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 560px;
  padding: 0 18px; height: 54px;
  background: var(--surface); color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: border-color .15s, box-shadow .15s;
}
.mp-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-lg); color: var(--brand); }
.mp-search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text); padding: 0; height: 100%; margin: 0; box-shadow: none; }
.mp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); cursor: pointer;
  transition: all .15s ease;
}
.mp-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.mp-chip.is-active { color: #fff; background: linear-gradient(135deg, #4f46e5, #6366f1); border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, #4f46e5 35%, transparent); }
.mp-chip.is-active .mp-code { background: rgba(255,255,255,.22); color: #fff; }
.mp-code {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 5px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand-strong);
}

.mp-page { padding-top: 36px; }
.mp-steps { list-style: none; margin: 0 0 44px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mp-steps li {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.mp-steps li div { display: flex; flex-direction: column; gap: 2px; }
.mp-steps strong { font-size: 14px; }
.mp-steps li span:not(.mp-step-num) { font-size: 13px; color: var(--text-muted); }
.mp-step-num {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #0ea5a3);
}

.mp-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mp-results-title { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.mp-count { font-size: 13px; color: var(--text-faint); font-weight: 600; }

.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mp-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: mp-rise .45s ease both;
}
.mp-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, #4f46e5, #0ea5a3);
  opacity: 0; transition: opacity .2s ease;
}
.mp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.mp-card:hover::before { opacity: 1; }
@keyframes mp-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.mp-card-head { display: flex; align-items: center; gap: 14px; }
.mp-avatar {
  flex: none; width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .25), inset 0 1px 0 rgba(255,255,255,.25);
}
.mp-card-titles { min-width: 0; }
.mp-card-name { margin: 0 0 5px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-faint); }
.mp-verified { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--success); }
.mp-verified::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.mp-card-desc {
  margin: 0; flex: 1;
  font-size: 14px; line-height: 1.6; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.mp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
}
.mp-card-cta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  color: var(--brand-strong); background: var(--brand-soft);
  transition: background .2s ease, color .2s ease;
}
.mp-arrow { transition: transform .2s ease; }
.mp-card:hover .mp-card-cta { color: #fff; background: linear-gradient(135deg, #4f46e5, #6366f1); }
.mp-card:hover .mp-arrow { transform: translateX(4px); }
.mp-card-cta:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft), 0 0 0 5px var(--brand); }

.mp-skeleton { min-height: 250px; animation: none; background: linear-gradient(100deg, var(--surface) 30%, var(--bg) 50%, var(--surface) 70%); background-size: 200% 100%; animation: mp-shimmer 1.3s linear infinite; }
.mp-skeleton:hover { transform: none; box-shadow: var(--shadow); }
@keyframes mp-shimmer { to { background-position: -200% 0; } }

.mp-empty {
  text-align: center; padding: 56px 24px;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.mp-empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }
.mp-empty h3 { margin: 0 0 6px; font-size: 17px; }
.mp-empty p { margin: 0; color: var(--text-muted); font-size: 14px; }

.mp-cta {
  margin-top: 40px; padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, #4f46e5 12%, var(--surface)), color-mix(in srgb, #0ea5a3 12%, var(--surface)));
  border: 1px solid var(--border);
}
.mp-cta h3 { margin: 0 0 4px; font-size: 17px; }
.mp-cta p { margin: 0; color: var(--text-muted); font-size: 14px; }

@media (max-width: 760px) {
  .mp-steps { grid-template-columns: 1fr; }
  .mp-cta { flex-direction: column; align-items: flex-start; }
  .mp-hero { padding: 48px 16px 44px; }
  .mp-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-card, .mp-skeleton { animation: none; }
  .mp-card:hover { transform: none; }
}
.mp-body a.btn, .mp-card-cta { text-decoration: none; }
.mp-body { --mp-accent-text: var(--brand-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mp-body { --mp-accent-text: #a5b4fc; } }
:root[data-theme="dark"] .mp-body { --mp-accent-text: #a5b4fc; }
.mp-eyebrow, .mp-code, .mp-card-cta { color: var(--mp-accent-text); }

/* Customer Portal — per-broker "how to get your API key" panel */
.broker-help {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin: -4px 0 16px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
}
.broker-help-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.broker-help-text strong { color: var(--text); }
.broker-help-text span { color: var(--text-muted); }
.broker-help-links { display: flex; gap: 8px; flex-wrap: wrap; }
.broker-help-link {
  display: inline-flex; align-items: center;
  padding: 7px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  transition: border-color .15s, color .15s;
}
.broker-help-link:hover { border-color: var(--brand); color: var(--brand); }
.broker-help-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.broker-help-primary:hover { color: #fff; filter: brightness(0.93); }

/* ZORVO logo + wordmark links home on every page */
.brand-link {
  display: inline-flex; align-items: center; gap: inherit;
  color: inherit; text-decoration: none;
  border-radius: 8px;
}
.brand-link:hover { opacity: 0.85; }
.brand-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.auth-card .logo .brand-link { gap: 10px; }
.topbar .brand .brand-link, .home-nav .brand .brand-link { gap: 8px; }
