/* ═══════════════════════════════════════════════════════════════════════════
 * Asset Detail Redesign — concept design system, scoped to #asset-modal only.
 * Applies the standalone concept's navy/teal palette + chart-first layout to the
 * live asset-detail full-page modal without touching the rest of the platform.
 * Token overrides are scoped to #asset-modal so all existing inline var(--…)
 * usages inside the modal adopt the concept look automatically.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── Concept tokens (dark) — scoped to the modal ───────────────────────────── */
#asset-modal {
  --bg: #0A0F1A;
  --surface: #0F1522;
  --surface-2: #131A2A;
  --surface-3: #18202F;
  --border: #212B3D;
  --border-2: #2E3A4F;
  --text: #E8EDF4;
  --muted: #9AA7BC;
  --faint: #6B7788;
  --accent: #2DD4BF;
  --accent-glow: rgba(45,212,191,0.10);
  --green: #34D399;
  --red: #F87171;
  --gold: #FBBF24;
  --blue: #5B9DF9;
  --ad-up: #34D399;
  --ad-down: #F87171;
  --ad-warn: #FBBF24;
  --ad-neutral: #6B7788;
  --ad-focus: #7DD3FC;
  --ad-rail-w: 340px;
}

/* ── Concept tokens (light) ────────────────────────────────────────────────── */
[data-theme="light"] #asset-modal {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F0F3F8;
  --surface-3: #E6EBF2;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --text: #0F172A;
  --muted: #64748B;
  --faint: #94A3B8;
  --accent: #0D9488;
  --accent-glow: rgba(13,148,136,0.08);
  --green: #059669;
  --red: #DC2626;
  --gold: #D97706;
  --blue: #2563EB;
  --ad-up: #059669;
  --ad-down: #DC2626;
  --ad-warn: #D97706;
  --ad-neutral: #94A3B8;
  --ad-focus: #0EA5E9;
}

/* No gradients/glass/glow — flat surfaces + hairline borders. */
#asset-modal .ad-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
#asset-modal .ad-panel + .ad-panel { margin-top: 14px; }
#asset-modal .ad-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border);
}
#asset-modal .ad-panel__title { font-size: 13px; font-weight: 700; color: var(--text); }
#asset-modal .ad-panel__sub { font-size: 11px; color: var(--muted); }
#asset-modal .ad-panel__body { padding: 14px; }

/* ── 5-cell market snapshot ────────────────────────────────────────────────── */
#asset-modal .ad-snapshot {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
#asset-modal .ad-snap-cell {
  background: var(--surface);
  padding: 12px 14px;
  min-width: 0;
}
#asset-modal .ad-snap-cell__label {
  font-size: 10px; letter-spacing: .4px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px; white-space: nowrap;
}
#asset-modal .ad-snap-cell__val {
  font-size: 15px; font-weight: 700; font-family: var(--font-mono);
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#asset-modal .ad-snap-cell__val.up { color: var(--ad-up); }
#asset-modal .ad-snap-cell__val.down { color: var(--ad-down); }

/* ── 12-col workspace: chart(main) + decision rail ─────────────────────────── */
#asset-modal .ad-workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr) var(--ad-rail-w);
  grid-template-areas: "main rail" "details rail";
  gap: 14px;
  padding: 14px;
  align-items: start;
}
#asset-modal .ad-main    { grid-area: main; min-width: 0; }
#asset-modal .ad-rail    { grid-area: rail; min-width: 0; align-self: stretch; }
#asset-modal .ad-details { grid-area: details; min-width: 0; }

#asset-modal .ad-mini-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px;
}

/* ── Confluence strip ──────────────────────────────────────────────────────── */
#asset-modal .ad-conf-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border);
}
#asset-modal .ad-conf-factor { background: var(--surface); }
#asset-modal .ad-conf-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 11px 12px; background: transparent; border: 0;
  cursor: pointer; text-align: left; min-height: 44px; color: var(--text);
}
#asset-modal .ad-conf-btn:hover { background: var(--surface-2); }
#asset-modal .ad-conf-name { font-size: 11px; font-weight: 600; color: var(--muted); }
#asset-modal .ad-conf-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
}
#asset-modal .ad-conf-status.bull { color: var(--ad-up); }
#asset-modal .ad-conf-status.bear { color: var(--ad-down); }
#asset-modal .ad-conf-status.warn { color: var(--ad-warn); }
#asset-modal .ad-conf-status.neutral { color: var(--muted); }
#asset-modal .ad-conf-meter {
  height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; margin: 0 12px 10px;
}
#asset-modal .ad-conf-meter > i { display: block; height: 100%; border-radius: 2px; }
#asset-modal .ad-conf-detail {
  display: none; padding: 0 12px 11px; font-size: 11px; line-height: 1.5; color: var(--muted);
}
#asset-modal .ad-conf-factor.open .ad-conf-detail { display: block; }
#asset-modal .ad-conf-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px;
}

/* ── Decision rail cards ───────────────────────────────────────────────────── */
#asset-modal .ad-signal-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px 0; font-size: 11px; color: var(--muted); font-weight: 600;
}
#asset-modal .ad-sample-chip {
  font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; background: var(--surface-3); color: var(--muted);
}
#asset-modal .ad-confidence { padding: 0 14px 14px; }
#asset-modal .ad-confidence__row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
#asset-modal .ad-confidence__val { font-family: var(--font-mono); font-weight: 700; color: var(--text); }
#asset-modal .ad-confidence__track {
  display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--surface-3);
}
#asset-modal .ad-confidence__track > i { height: 100%; }
#asset-modal .ad-confidence__legend {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 10px; color: var(--muted);
}
#asset-modal .ad-lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

#asset-modal .ad-list-block { margin-bottom: 14px; }
#asset-modal .ad-list-block:last-child { margin-bottom: 0; }
#asset-modal .ad-list-block h4,
#asset-modal .ad-invalidation h4 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
}
#asset-modal .ad-item-row { display: flex; gap: 8px; margin-bottom: 7px; font-size: 12px; line-height: 1.45; color: var(--text); }
#asset-modal .ad-item-marker { flex-shrink: 0; width: 3px; border-radius: 2px; align-self: stretch; min-height: 16px; background: var(--muted); }
#asset-modal .ad-item-marker.up { background: var(--ad-up); }
#asset-modal .ad-item-marker.risk { background: var(--ad-down); }
#asset-modal .ad-item-marker.warn { background: var(--ad-warn); }
#asset-modal .ad-invalidation {
  border: 1px solid var(--border-2); border-left: 3px solid var(--ad-down);
  border-radius: 0 8px 8px 0; padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--text);
}

/* ── Accordions (details) ──────────────────────────────────────────────────── */
#asset-modal .ad-accordion { border-top: 1px solid var(--border); }
#asset-modal .ad-accordion:first-child { border-top: 0; }
#asset-modal .ad-acc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 14px; min-height: 44px; background: transparent; border: 0;
  cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600; text-align: left;
}
#asset-modal .ad-acc-head:hover { background: var(--surface-2); }
#asset-modal .ad-acc-chev { transition: transform .18s ease; color: var(--muted); flex-shrink: 0; }
#asset-modal .ad-acc-head[aria-expanded="true"] .ad-acc-chev { transform: rotate(180deg); }
#asset-modal .ad-acc-panel { display: none; padding: 4px 14px 16px; }
#asset-modal .ad-acc-panel.open { display: block; }
#asset-modal .ad-kv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
#asset-modal .ad-kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--surface); }
#asset-modal .ad-kv dt { font-size: 11px; color: var(--muted); }
#asset-modal .ad-kv dd { margin: 0; font-size: 12px; font-weight: 700; font-family: var(--font-mono); color: var(--text); }

/* ── Fundamentals drawer ───────────────────────────────────────────────────── */
/* Anchored to the viewport (position:fixed), not to #asset-modal-inner. The inner
 * scroll body can carry a nonzero scrollLeft (wide chart content, overflow-x clipped),
 * which would drag a position:absolute right:0 child off the left edge. #asset-modal is
 * a fixed fullpage container with no transformed/filtered ancestor, so fixed anchors to
 * the true viewport and the drawer stays flush to the right edge at every breakpoint. */
#asset-modal .ad-drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 40;
}
#asset-modal .ad-drawer-scrim.open { opacity: 1; pointer-events: auto; }
#asset-modal .ad-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--surface); border-left: 1px solid var(--border-2);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1);
  z-index: 41; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.3);
}
#asset-modal .ad-drawer.open { transform: translateX(0); }
#asset-modal .ad-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
#asset-modal .ad-drawer__head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
#asset-modal .ad-drawer__body { padding: 18px; overflow-y: auto; flex: 1; min-height: 0; }
#asset-modal .ad-drawer-close {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Header Fundamentals button ────────────────────────────────────────────── */
#asset-modal .ad-fund-btn {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; min-height: 34px; display: inline-flex; align-items: center; gap: 6px;
}
#asset-modal .ad-fund-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mobile tabs (hidden on desktop) ───────────────────────────────────────── */
#asset-modal .ad-mobile-tabs { display: none; }
#asset-modal .ad-pane { display: block; }

/* ── Responsive: tablet/narrow — rail drops below main ─────────────────────── */
@media (max-width: 1024px) {
  #asset-modal .ad-workspace {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "rail" "details";
  }
  #asset-modal .ad-conf-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive: mobile — single column, tabbed panes, chart first ─────────── */
@media (max-width: 768px) {
  #asset-modal .ad-mobile-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--surface); z-index: 10;
  }
  #asset-modal .ad-tab {
    flex: 1; padding: 12px 8px; min-height: 44px; background: transparent; border: 0;
    border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  }
  #asset-modal .ad-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  #asset-modal .ad-workspace { display: block; padding: 12px; }
  #asset-modal .ad-main, #asset-modal .ad-rail, #asset-modal .ad-details { margin-bottom: 0; }
  /* Only the active pane shows */
  #asset-modal .ad-pane[data-adpane] { display: none; }
  #asset-modal .ad-pane[data-adpane].active { display: block; }
  #asset-modal .ad-snapshot { grid-template-columns: repeat(2, 1fr); }
  #asset-modal .ad-conf-grid { grid-template-columns: repeat(2, 1fr); }
  #asset-modal .ad-mini-grid { grid-template-columns: 1fr; }
  /* Timeframe chips at 44px each can exceed the panel head width at 390 — let
   * the row scroll horizontally instead of pushing page-level overflow (Req 4). */
  #asset-modal .ad-panel__head { flex-wrap: wrap; }
  #asset-modal #modal-tf-row {
    overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #asset-modal #modal-tf-row::-webkit-scrollbar { display: none; }
  #asset-modal #modal-tf-row .filter-btn { flex-shrink: 0; }
}

/* ── Landscape phones: keep chart usable, 2-col snapshot ───────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  #asset-modal .ad-snapshot { grid-template-columns: repeat(5, 1fr); }
}

/* ── Metric snapshot: horizontal strip (concept). #modal-kpi-row carries both
 * .ad-snapshot (grid) and .ad-pane (block, declared later ⇒ was winning and
 * collapsing the 5 cells into a vertical stack). Re-assert grid for the SHOWN
 * pane at a specificity that beats `.ad-pane[data-adpane].active`, without
 * touching the mobile `:not(.active)` hide rule. */
#asset-modal .ad-snapshot.ad-pane.active { display: grid; }

/* Desktop determinism (Blocker-3 resize/reload race): the .ad-pane / .active
 * mechanism only governs the MOBILE tabbed panes. On desktop there are no tabs,
 * so the snapshot must ALWAYS be a 5-cell horizontal grid regardless of whether
 * the mobile pane classes happen to be present at a given tick. A prior race
 * (reload after a 1440→…→1440 resize cycle where .active was momentarily absent)
 * let the base `.ad-pane { display:block }` collapse the 5 metrics into a stack.
 * Pin it deterministically here (higher specificity + !important) so arbitrary
 * resize cycles and theme switches cannot regress it. Tablet/mobile still reflow
 * via the media queries below. */
@media (min-width: 769px) {
  #asset-modal #modal-kpi-row.ad-snapshot {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * CONCEPT SHELL — persistent left nav rail + main column, in-header theme
 * toggle & Trade Ticket button, and the focus-trapped Trade Ticket dialog.
 * The fullpage inner is a flex COLUMN by the base modal CSS; here we make the
 * inner a flex ROW so the rail sits to the LEFT of the main column, and the
 * main column stacks header / scroll body / action bar as before.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Fullpage inner becomes a row: [rail][main-col]. Higher specificity + !important
 * beats the base `#asset-modal-inner { flex-direction:column !important }`. */
#asset-modal.asset-modal-fullpage #asset-modal-inner.ad-inner {
  flex-direction: row !important;
}
#asset-modal .ad-main-col {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}

/* ── Left navigation rail ──────────────────────────────────────────────────── */
#asset-modal .ad-nav-rail {
  flex-shrink: 0; width: 232px; height: 100%;
  background: var(--surface-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px; overflow-y: auto; overflow-x: hidden;
  box-sizing: border-box;
}
#asset-modal .ad-nav-rail[hidden] { display: none; }
#asset-modal .ad-rail__brand {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
#asset-modal .ad-rail__brand-mark { color: var(--accent); font-size: 15px; line-height: 1; }
#asset-modal .ad-rail__brand-text {
  font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: .2px;
  display: inline-flex; align-items: center; gap: 7px;
}
#asset-modal .ad-rail__brand-badge {
  font-size: 8px; font-weight: 800; letter-spacing: .6px; color: var(--accent);
  background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: 5px; padding: 2px 5px; text-transform: uppercase;
}
#asset-modal .ad-nav-group {
  font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--faint); padding: 12px 8px 4px;
}
#asset-modal .ad-nav-group-items { display: flex; flex-direction: column; gap: 1px; }
#asset-modal .ad-nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; min-height: 44px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 600; text-align: left; box-sizing: border-box;
}
#asset-modal .ad-nav-item:hover { background: var(--surface-3); color: var(--text); }
#asset-modal .ad-nav-item.active {
  background: var(--accent-glow); color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
#asset-modal .ad-nav-item__label {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Rail hamburger (mobile/tablet only) ───────────────────────────────────── */
#asset-modal .ad-rail-menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); cursor: pointer;
}
#asset-modal .ad-rail-menu-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── In-header Theme toggle + Trade Ticket buttons ─────────────────────────── */
#asset-modal .ad-theme-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 34px;
}
#asset-modal .ad-theme-btn:hover { border-color: var(--accent); color: var(--accent); }
#asset-modal .ad-ticket-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #05201C;
  font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; min-height: 34px;
}
#asset-modal .ad-ticket-btn:hover { filter: brightness(1.06); }
#asset-modal .ad-ticket-btn--block {
  width: 100%; justify-content: center; padding: 12px 16px; margin-top: 2px;
}

/* ── Trade Ticket dialog (focus-trapped; anchored to viewport) ─────────────── */
.ad-ticket-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 30040;
}
.ad-ticket-scrim.open { opacity: 1; pointer-events: auto; }
.ad-ticket-dialog {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 94vw);
  background: var(--surface); border-left: 1px solid var(--border-2);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
  z-index: 30041; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.35);
}
.ad-ticket-dialog.open { transform: translateX(0); }
.ad-ticket__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ad-ticket__head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.ad-ticket-close {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ad-ticket-close:hover { border-color: var(--accent); color: var(--accent); }
.ad-ticket__body { padding: 18px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.ad-ticket-summary {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px;
}
.ad-ticket-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-top: 1px solid var(--border);
}
.ad-ticket-row:first-child { border-top: 0; }
.ad-ticket-row__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.ad-ticket-row__val { font-size: 13px; color: var(--text); font-weight: 800; font-family: var(--font-mono); }
.ad-ticket-note {
  font-size: 12px; line-height: 1.5; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px;
}
.ad-ticket-note strong { color: var(--text); }
.ad-ticket-field-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--muted); margin: 12px 0 6px;
}
.ad-ticket-side { display: flex; gap: 8px; }
.ad-ticket-side__btn {
  flex: 1; padding: 10px 0; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.ad-ticket-side__btn.active {
  border-color: var(--accent); background: var(--accent-glow); color: var(--accent);
}
.ad-ticket-input {
  width: 100%; box-sizing: border-box; padding: 11px 12px; min-height: 44px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 14px; font-family: var(--font-mono);
}
.ad-ticket-input:focus { outline: 2px solid var(--ad-focus); outline-offset: 1px; border-color: var(--accent); }
.ad-ticket-dialog .ad-ticket-btn {
  border: 1px solid var(--accent); background: var(--accent); color: #05201C;
  font-size: 13px; font-weight: 800; cursor: pointer; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ad-ticket-dialog .ad-ticket-btn[disabled] {
  opacity: .55; cursor: not-allowed; filter: none;
  background: var(--surface-2); color: var(--muted); border-color: var(--border);
}
.ad-ticket-dialog button:focus-visible {
  outline: 2px solid var(--ad-focus); outline-offset: 2px; border-radius: 8px;
}

/* ── Rail as off-canvas drawer on tablet/mobile ────────────────────────────── */
@media (max-width: 1024px) {
  #asset-modal .ad-rail-menu-btn { display: inline-flex; }
  #asset-modal .ad-nav-rail {
    position: fixed; top: 0; left: 0; height: 100%; width: min(264px, 82vw);
    z-index: 30030; transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 30px rgba(0,0,0,.35);
  }
  #asset-modal .ad-nav-rail[hidden] { display: flex; }
  #asset-modal.ad-rail-open .ad-nav-rail { transform: translateX(0); }
  /* Scrim behind the open drawer */
  #asset-modal.ad-rail-open .ad-main-col::before {
    content: ''; position: fixed; inset: 0; z-index: 30025;
    background: rgba(0,0,0,.5);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ad-ticket-dialog, .ad-ticket-scrim, #asset-modal .ad-nav-rail { transition: none !important; }
}

/* ── Touch targets: every interactive modal control ≥44px (Req 6) ──────────────
 * min-width/min-height override inline width/height per CSS clamping, so the 34px
 * inline header/drawer buttons are lifted to 44px without editing markup. */
#asset-modal [data-ceh-click="h0229"],
#asset-modal #modal-trade-unavailable,
#asset-modal .ad-theme-btn,
#asset-modal .ad-fund-btn,
#asset-modal .ad-ticket-btn,
#asset-modal .ad-rail-menu-btn,
#asset-modal .ad-drawer-close,
#asset-modal .filter-btn,
#asset-modal .ad-conf-btn,
#asset-modal .ad-acc-head,
#asset-modal .ad-tab,
#asset-modal #ad-watch-btn,
#asset-modal #ad-alert-btn,
.ad-ticket-dialog .ad-ticket-close,
.ad-ticket-dialog .ad-ticket-btn,
.ad-ticket-dialog .ad-ticket-side__btn {
  min-height: 44px;
  min-width: 44px;
}
/* Status chip is inline-styled; force flex centering so the 44px min box is
 * honored without shifting label alignment (Req 4). */
#asset-modal #modal-trade-unavailable {
  display: inline-flex; align-items: center; justify-content: center;
}
#asset-modal .filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Accessibility ─────────────────────────────────────────────────────────── */
#asset-modal button:focus-visible,
#asset-modal a:focus-visible,
#asset-modal [tabindex]:focus-visible {
  outline: 2px solid var(--ad-focus); outline-offset: 2px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  #asset-modal .ad-drawer,
  #asset-modal .ad-drawer-scrim,
  #asset-modal .ad-acc-chev { transition: none !important; }
}
