/* Davin AI experience refresh — additive layer; existing IDs and behaviors remain intact. */
:root {
  --dx-radius: 18px;
  --dx-radius-sm: 12px;
  --dx-line: color-mix(in srgb, var(--border, #293044) 78%, transparent);
  --dx-glow: 0 18px 52px rgba(0,0,0,.18);
}
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent, #f0b429); outline-offset: 3px;
}
.topbar {
  border-bottom: 1px solid var(--dx-line) !important;
  background: color-mix(in srgb, var(--bg2, #0b0d16) 88%, transparent) !important;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar-logo { letter-spacing: -.035em; font-weight: 850 !important; }
#tab-dashboard { padding-bottom: max(96px, env(safe-area-inset-bottom)) !important; }
#tab-dashboard > * { max-width: 1440px; margin-left: auto; margin-right: auto; }
#tab-dashboard .dash-welcome-block {
  position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid var(--dx-line) !important; border-radius: 22px !important;
  padding: clamp(20px, 3.2vw, 34px) !important;
  background: radial-gradient(ellipse at 95% 0%, rgba(240,180,41,.14), transparent 42%),
              radial-gradient(ellipse at 0% 100%, rgba(0,212,170,.08), transparent 38%),
              var(--bg2) !important;
  box-shadow: var(--dx-glow);
}
#tab-dashboard .dash-welcome-title { font-size: clamp(23px, 3vw, 32px) !important; letter-spacing: -.045em; line-height: 1.15; }
#tab-dashboard .dash-welcome-sub { max-width: 56ch; line-height: 1.65; }
#tab-dashboard .dash-snapshot-card, #tab-dashboard .signal-box, #tab-dashboard .market-pulse-card {
  border: 1px solid var(--dx-line) !important; border-radius: var(--dx-radius) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.12); overflow: hidden;
}
#tab-dashboard .dash-snapshot-card { padding: clamp(15px, 2.4vw, 24px) !important; }
#tab-dashboard .dash-snapshot-header { align-items: center; }
#tab-dashboard .dash-snapshot-title { font-size: 16px !important; letter-spacing: -.015em; }
#tab-dashboard .dash-snapshot-grid { gap: 10px !important; }
#tab-dashboard .dash-snap-item {
  min-width: 0; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--dx-line); background: color-mix(in srgb, var(--bg3, #111522) 80%, transparent);
}
#tab-dashboard .dash-snap-label { line-height: 1.45; }
#tab-dashboard .dash-snap-val { font-size: clamp(19px, 2.5vw, 27px) !important; letter-spacing: -.04em; overflow-wrap: anywhere; }
#tab-dashboard .section-title { letter-spacing: -.025em; font-size: clamp(17px, 2vw, 21px); }
#tab-dashboard .status-bar { flex-wrap: wrap; gap: 8px; }
#tab-dashboard .status-item { border: 1px solid var(--dx-line); border-radius: 999px; padding: 8px 12px; background: var(--bg2); }
#tab-dashboard .market-pulse-header { gap: 12px; flex-wrap: wrap; }
#tab-dashboard .dash-news-header { align-items: center; flex-wrap: wrap; gap: 12px; }
#tab-dashboard .btn-ai-trading { min-height: 46px; border-radius: 12px; font-weight: 800; transition: transform .18s ease, filter .18s ease; }
#tab-dashboard .btn-ai-trading:hover { transform: translateY(-1px); filter: brightness(1.06); }
/* Give active tool surfaces the same refined frame without changing their internal logic. */
#tab-news, #tab-chart, #tab-livechart, #tab-aichat, #tab-strategy, #tab-backtest,
#tab-botmanager, #tab-history, #tab-performance, #tab-journal, #tab-positioncalc,
#tab-prompttrading, #tab-heatmap, #tab-pulse, #tab-proppass {
  scrollbar-color: color-mix(in srgb, var(--accent, #f0b429) 38%, transparent) transparent;
  scrollbar-width: thin;
}
#tab-news .section-title, #tab-strategy .section-title, #tab-history .section-title,
#tab-performance .section-title, #tab-journal .section-title { letter-spacing: -.025em; }
/* Shared touch-friendly controls, but no global fixed dimensions that would clip long labels. */
#tab-dashboard button, #tab-news button, #tab-strategy button, #tab-history button,
#tab-performance button, #tab-journal button { touch-action: manipulation; }
/* Drawer/top navigation refinements. */
.drawer-item { transition: background .16s ease, color .16s ease, transform .16s ease; }
.drawer-item:active { transform: scale(.99); }
/* Layout safeguards for narrow phones and small landscape screens. */
@media (max-width: 680px) {
  #tab-dashboard { padding-left: 12px !important; padding-right: 12px !important; }
  #tab-dashboard .dash-welcome-block { border-radius: 17px !important; gap: 12px; }
  #tab-dashboard .dash-snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #tab-dashboard .dash-snap-item { padding: 11px; }
  #tab-dashboard .dash-snap-label { font-size: 10px; }
  #tab-dashboard .dash-snap-val { font-size: 20px !important; }
  #tab-dashboard .dash-snapshot-divider { margin: 14px 0; }
  #tab-dashboard .market-pulse-card, #tab-dashboard .signal-box { border-radius: 15px !important; }
}
@media (max-width: 360px) {
  #tab-dashboard { padding-left: 8px !important; padding-right: 8px !important; }
  #tab-dashboard .dash-snapshot-grid { gap: 6px !important; }
  #tab-dashboard .dash-snap-item { padding: 9px; }
  #tab-dashboard .dash-snap-val { font-size: 18px !important; }
}
@media (min-width: 1100px) {
  #tab-dashboard { padding-left: clamp(24px, 3vw, 48px) !important; padding-right: clamp(24px, 3vw, 48px) !important; }
  #tab-dashboard .dash-snapshot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Consistent polish across the rest of the active analysis workspaces. */
#tab-chart, #tab-news, #tab-strategy, #tab-aichat, #tab-history, #tab-performance,
#tab-botmanager, #tab-journal, #tab-positioncalc, #tab-prompttrading {
  line-height: 1.55;
}
#tab-chart input, #tab-chart select, #tab-news input, #tab-news select,
#tab-strategy input, #tab-strategy select, #tab-strategy textarea,
#tab-journal input, #tab-journal select, #tab-journal textarea,
#tab-positioncalc input, #tab-positioncalc select, #tab-prompttrading input,
#tab-prompttrading select, #tab-aichat textarea {
  max-width: 100%; min-width: 0; border-radius: 10px;
}
#tab-chart button, #tab-news button, #tab-strategy button, #tab-aichat button,
#tab-history button, #tab-performance button, #tab-botmanager button,
#tab-journal button, #tab-positioncalc button, #tab-prompttrading button {
  transition: filter .16s ease, transform .16s ease, border-color .16s ease;
}
#tab-chart button:hover, #tab-news button:hover, #tab-strategy button:hover,
#tab-history button:hover, #tab-performance button:hover, #tab-journal button:hover {
  filter: brightness(1.06);
}
/* Explicitly parked roadmap modules: no dead/half-working controls are shown as live. */
.dx-coming-soon-panel {
  min-height: min(68vh, 620px); display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center; gap: 16px;
  margin: clamp(12px, 3vw, 34px); padding: clamp(24px, 5vw, 64px);
  border: 1px solid var(--dx-line); border-radius: 24px; overflow: hidden;
  background: radial-gradient(ellipse at 95% 0%, rgba(240,180,41,.14), transparent 42%),
              radial-gradient(ellipse at 0% 100%, rgba(0,212,170,.10), transparent 45%), var(--bg2);
  box-shadow: var(--dx-glow); position: relative; isolation: isolate;
}
.dx-coming-soon-panel::before { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; bottom: -90px; border: 1px solid rgba(240,180,41,.17); border-radius: 50%; box-shadow: 0 0 0 30px rgba(240,180,41,.025), 0 0 0 60px rgba(0,212,170,.025); z-index: -1; }
.dx-coming-soon-kicker { font: 800 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--accent, #f0b429); }
.dx-coming-soon-panel h1 { margin: 0; font-size: clamp(28px, 5vw, 48px); line-height: 1.08; letter-spacing: -.05em; max-width: 13ch; }
.dx-coming-soon-panel p { margin: 0; max-width: 58ch; color: var(--text2, #a0a8c0); font-size: clamp(14px, 1.8vw, 17px); line-height: 1.75; }
.dx-coming-soon-panel .dx-back-dashboard { margin-top: 8px; min-height: 44px; padding: 0 18px; border: 1px solid rgba(240,180,41,.35); border-radius: 11px; color: #111; background: linear-gradient(135deg, #f0b429, #ffd166); font-weight: 800; cursor: pointer; }
.tab.dx-coming-soon > :not(.dx-coming-soon-panel) { display: none !important; }
.tab.dx-coming-soon { padding: 0 !important; }
@media (max-width: 520px) { .dx-coming-soon-panel { min-height: 60vh; margin: 10px; padding: 26px 22px; border-radius: 18px; } }
