/* ═══════════════════════════════════════════════════════
   app.css — Component & layout styles
   Relies on material.css for design tokens (loaded first)
   ═══════════════════════════════════════════════════════ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  line-height: 1.6;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-sys-color-outline); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-outline-variant); }
* { scrollbar-width: thin; scrollbar-color: var(--md-sys-color-outline) transparent; }

/* ── Shell & layout ── */
.app-layout { display: flex; min-height: 100vh; }
.app-layout__content {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-width-expanded);
  transition: margin-left var(--sidebar-transition);
  display: flex; flex-direction: column;
  background: var(--md-sys-color-surface-container);
}
.sidebar--collapsed ~ .app-layout__content {
  margin-left: var(--sidebar-width-collapsed);
}
main { flex: 1; padding: 16px 20px 28px; width: 100%; max-width: 100%; }
@media (max-width: 768px) {
  main { padding: 16px 14px 28px; }
  .app-layout__content { margin-left: 0 !important; }
}

/* ── Top bar (slim, content area) ── */
.app-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 44px;
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 92%, transparent);
  border-bottom: 1px solid var(--md-sys-color-outline);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.app-topbar__title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0; color: var(--md-sys-color-on-surface);
}
.app-topbar__menu {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant); padding: 4px;
  border-radius: 8px; transition: background 0.15s;
}
.app-topbar__menu:hover { background: var(--md-sys-color-surface-variant); }
.app-topbar__menu .material-symbols-outlined { font-size: 22px; }
@media (max-width: 768px) {
  .app-topbar__menu { display: flex; align-items: center; }
}

/* ── Sidebar ── */
:root {
  --sidebar-width-collapsed: 56px;
  --sidebar-width-expanded: 220px;
  --sidebar-transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width-expanded);
  background: var(--md-sys-color-surface);
  border-right: 1px solid var(--md-sys-color-outline);
  display: flex; flex-direction: column;
  z-index: 200; overflow: visible;
  transition: width var(--sidebar-transition);
}
.sidebar--collapsed { width: var(--sidebar-width-collapsed); }

/* Sidebar header (brand + toggle) */
.sidebar-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; height: 48px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 50%, transparent);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--md-sys-color-on-surface);
  white-space: nowrap; overflow: hidden; flex: 1; min-width: 0;
}
.sidebar-brand__icon {
  font-size: 24px; color: var(--md-sys-color-primary); flex-shrink: 0;
}
.sidebar-brand__text {
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  opacity: 1; transition: opacity 180ms ease;
}
.sidebar--collapsed .sidebar-brand__text { opacity: 0; pointer-events: none; }
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  background: none; border: none; border-radius: 8px;
  cursor: pointer; color: var(--md-sys-color-on-surface-variant);
  transition: background 0.15s ease;
}
.sidebar-toggle:hover { background: var(--md-sys-color-surface-variant); }
.sidebar--collapsed .sidebar-toggle { margin: 0 auto; }

/* Sidebar nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 6px; display: flex; flex-direction: column; gap: 1px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }

/* Nav items */
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px; height: 36px; border-radius: 8px;
  text-decoration: none; color: var(--md-sys-color-on-surface-variant);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  border: none; background: none; cursor: pointer; width: 100%;
  font-family: inherit;
}
.sidebar-item__icon {
  font-size: 20px; flex-shrink: 0; width: 24px; text-align: center;
}
.sidebar-item__label {
  opacity: 1; transition: opacity 180ms ease;
  overflow: hidden; text-overflow: ellipsis;
}
.sidebar--collapsed .sidebar-item__label { opacity: 0; pointer-events: none; }
.sidebar-item:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
  color: var(--md-sys-color-on-surface);
}
.sidebar-item--active {
  background: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
  color: var(--md-sys-color-primary);
}
.sidebar-item--active .sidebar-item__icon { color: var(--md-sys-color-primary); }
.sidebar-item--active:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent);
}

.sidebar-item--disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Back-to-app link in admin sidebar */
.sidebar-item--back {
  color: var(--md-sys-color-primary);
  margin-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 50%, transparent);
  border-radius: 8px 8px 0 0;
  padding-bottom: 10px;
}
.sidebar-item--back:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

/* Research label (non-collapsible section header) */
.sidebar-label {
  padding: 12px 10px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.6;
  user-select: none;
}
.sidebar--collapsed .sidebar-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }


/* Inline connect prompt inside Account section */
.sidebar-connect-prompt {
  padding: 10px 8px;
}
.sidebar-connect-prompt__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--md-sys-color-tertiary);
  margin: 0 0 6px;
}
.sidebar-connect-prompt__list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.sidebar-connect-prompt__list li {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  padding: 2px 0;
  line-height: 1.6;
}
.sidebar-connect-prompt__list li::before {
  content: "•";
  margin-right: 6px;
  color: var(--md-sys-color-outline);
}
.sidebar-connect-prompt__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--md-sys-color-tertiary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}
.sidebar-connect-prompt__btn:hover { opacity: 0.85; }
.sidebar-connect-prompt__btn .material-symbols-outlined { font-size: 14px; }

/* Sections */
.sidebar-section { display: flex; flex-direction: column; }
.sidebar-section__header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px; height: 36px; border-radius: 8px;
  background: none; border: none; cursor: pointer; width: 100%;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px; font-weight: 600; font-family: inherit;
  white-space: nowrap; transition: background 0.15s ease;
}
.sidebar-section__header:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent);
}
.sidebar-section__icon {
  font-size: 20px; flex-shrink: 0; width: 24px; text-align: center;
}
.sidebar-section__label {
  flex: 1; text-align: left;
  opacity: 1; transition: opacity 180ms ease;
}
.sidebar--collapsed .sidebar-section__label { opacity: 0; pointer-events: none; }
.sidebar-section__chevron {
  font-size: 18px; flex-shrink: 0;
  transition: transform 200ms ease;
  opacity: 1; transition: transform 200ms ease, opacity 180ms ease;
}
.sidebar--collapsed .sidebar-section__chevron { opacity: 0; pointer-events: none; }
.sidebar-section--open .sidebar-section__chevron { transform: rotate(180deg); }

/* Label-style section header (Research, Account) */
.sidebar-section__header--label {
  padding: 12px 10px 4px;
  height: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.6;
  border-radius: 0;
}
.sidebar-section__header--label:hover {
  background: none;
  opacity: 0.85;
}
.sidebar-section__header--label .sidebar-section__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.sidebar-section__header--label .sidebar-section__chevron {
  font-size: 16px;
  opacity: 0.7;
}
.sidebar--collapsed .sidebar-section__header--label {
  opacity: 0; height: 0; padding: 0; overflow: hidden;
}

/* Section items container */
.sidebar-section__items {
  max-height: 0; overflow: hidden;
  transition: max-height 250ms ease-in-out;
  padding-left: 10px;
}
.sidebar-section__items--flush { padding-left: 0; }
.sidebar-section--open .sidebar-section__items { max-height: 600px; }
.sidebar--collapsed .sidebar-section__items { max-height: 0 !important; }

/* Sidebar bottom area */
.sidebar-bottom {
  margin-top: auto;
  padding: 6px;
  border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 50%, transparent);
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 2px;
}
.sidebar-theme-toggle { color: var(--md-sys-color-on-surface-variant); flex: 0 0 auto; width: auto; }
.sidebar-theme-toggle .sidebar-item__label { display: none; }
.sidebar-admin-link { flex: 0 0 auto; width: auto; color: var(--md-sys-color-on-surface-variant); }
.sidebar-auth { padding: 0; flex: 0 0 auto; }

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 199;
  opacity: 0; transition: opacity 300ms ease;
}
.sidebar-backdrop.show { display: block; opacity: 1; }

/* Mobile sidebar */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width-expanded);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar--mobile-open { transform: translateX(0); }
  .sidebar--collapsed { width: var(--sidebar-width-expanded); }
  .sidebar-toggle { display: none; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid var(--md-sys-color-outline);
  padding: 9px 18px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  transition: all .15s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(.btn-primary):not(.trade-drawer__place-btn):not(.roll-bulk-action-btn) { background: var(--md-sys-color-surface-variant); }
.btn:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.btn-primary {
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-color: transparent;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 14px color-mix(in srgb, var(--md-sys-color-primary) 40%, transparent); }
.btn-secondary { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-surface); border-color: var(--md-sys-color-outline); }
.btn-ghost { background: transparent; border-color: var(--md-sys-color-outline); color: var(--md-sys-color-on-surface); }
.btn-ghost:hover { background: var(--md-sys-color-surface-variant); }
.btn-danger {
  background: color-mix(in srgb, var(--md-sys-color-error) 15%, var(--md-sys-color-surface-container));
  color: var(--md-sys-color-error);
  border-color: color-mix(in srgb, var(--md-sys-color-error) 40%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, var(--md-sys-color-error) 25%, var(--md-sys-color-surface-container)); }
.btn-sm { padding: 7px 16px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 7px 10px; }
.inline-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* ── Tags & badges ── */
.pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface-variant); }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface-variant); }
.tag-call, .tag-buy { color: #22c55e; border-color: color-mix(in srgb, #22c55e 40%, transparent); }
.tag-put, .tag-sell { color: #ef4444; border-color: color-mix(in srgb, #ef4444 40%, transparent); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600; font-size: 12px;
}

/* ── Forms ── */
label {
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
  display: flex; align-items: flex-end; min-height: 28px;
  margin-bottom: 5px; font-weight: 600; line-height: 1.2; word-break: break-word;
}
input[type="text"], input[type="number"], input[type="date"],
input[type="email"], input[type="password"], select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 14px; font-weight: 500; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 0.5; }
input:focus, select:focus {
  outline: none; border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%239ca3af'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 18px;
  padding-right: 32px;
}
input[type="file"] {
  padding: 12px; border: 2px dashed var(--md-sys-color-outline);
  border-radius: 12px; background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface); cursor: pointer; width: 100%; transition: border-color .2s;
}
input[type="file"]:hover { border-color: var(--md-sys-color-primary); }

/* ── Toolbar (positions header controls) ── */
.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: nowrap;
}
.toolbar .btn { flex-shrink: 0; }
.toolbar .btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.toolbar .btn-icon { height: 36px; width: 36px; padding: 0; }
.toolbar-input, .toolbar-select {
  height: 36px; padding: 0 12px; min-width: 0;
  border: 1px solid var(--md-sys-color-outline); border-radius: 8px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface); font-size: 13px; font-family: inherit;
}
.toolbar-input--wide { width: 160px; }
.toolbar-input--narrow { width: 90px; }
.ticker-input-wrap { position: relative; display: inline-flex; }
.ticker-input-wrap .toolbar-input { padding-right: 22px; width: 100%; min-width: 80px; }
.ticker-clear-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--md-sys-color-on-surface-variant); font-size: 16px; line-height: 1; padding: 2px; opacity: 0.5; }
.ticker-clear-btn:hover { opacity: 1; }
.toolbar-slider {
  display: flex; align-items: center; gap: 6px; height: 36px;
}
.toolbar-slider__label {
  font-size: 12px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); white-space: nowrap;
}
.toolbar-slider input[type="range"] {
  width: 80px; cursor: pointer; accent-color: var(--md-sys-color-primary);
}
.toolbar-select {
  padding-right: 32px; font-weight: 600; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%239ca3af'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 18px;
}
.toolbar-input:focus, .toolbar-select:focus {
  outline: none; border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
}


/* Account multi-select dropdown */
.acct-multiselect { position: relative; }
.acct-toggle {
  text-align: left; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 130px;
}
.acct-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  min-width: 200px; max-height: 240px; overflow-y: auto;
  background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 4px 0; margin-top: 2px;
}
.acct-multiselect.open .acct-menu { display: block; }
.acct-option {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
  font-size: 13px; color: var(--md-sys-color-on-surface); white-space: nowrap;
}
.acct-option:hover { background: var(--md-sys-color-surface-container-high); }
.acct-option input[type="checkbox"] { accent-color: var(--md-sys-color-primary); }
.acct-cell { font-size: 11px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }

/* Header controls (legacy) */
.header-controls {
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 10px; padding: 8px 24px 0;
  margin-bottom: 10px; position: relative; z-index: 1;
}
.header-controls label { margin: 0; align-self: center; min-height: auto; }
.header-controls select { width: auto; min-width: 160px; padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ── Ticker Context Bar (shared) ── */
.ia-context-bar { display: flex; align-items: center; gap: 0.5rem; padding: 6px 0; border-radius: 0; margin-bottom: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.ia-ctx-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ia-ctx-label { font-size: 9px; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.3px; }
.ia-ctx-value { font-size: 11px; font-weight: 600; color: var(--md-sys-color-on-surface); white-space: nowrap; }
.ia-ctx-value small { font-weight: 400; opacity: 0.7; }
.ia-ctx-range { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ia-ctx-range .ia-ctx-label { align-self: center; }
.ia-ctx-range-row { display: flex; align-items: center; gap: 4px; }
.ia-ctx-range-val { font-size: 10px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }
.ia-ctx-range-track { position: relative; width: 80px; height: 4px; background: var(--md-sys-color-outline-variant); border-radius: 2px; }
.ia-ctx-range-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--md-sys-color-primary); border-radius: 2px; }
.ia-ctx-range-dot { position: absolute; top: 50%; width: 8px; height: 8px; background: var(--md-sys-color-primary); border-radius: 50%; transform: translate(-50%, -50%); }
.ia-ctx-elevated { color: var(--md-sys-color-tertiary); }
.ia-ctx-positive { color: #22c55e; }
.ia-ctx-negative { color: #ef4444; }
.ia-ctx-iv-high { color: #22c55e; }
.ia-ctx-iv-mid { color: var(--md-sys-color-on-surface); }
.ia-ctx-iv-low { color: #ef4444; }

/* IV Rank badge — shared by Scanner column and Income Engine context bar */
.scanner-ivr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  min-width: 28px;
}
.scanner-ivr--very-high { background: #dcfce7; color: #166534; }
.scanner-ivr--high      { background: #fef9c3; color: #854d0e; }
.scanner-ivr--medium    { background: #ffedd5; color: #9a3412; }
.scanner-ivr--low       { background: #fee2e2; color: #991b1b; }
body:not(.theme-light) .scanner-ivr--very-high { background: #14532d; color: #86efac; }
body:not(.theme-light) .scanner-ivr--high      { background: #713f12; color: #fde047; }
body:not(.theme-light) .scanner-ivr--medium    { background: #7c2d12; color: #fdba74; }
body:not(.theme-light) .scanner-ivr--low       { background: #7f1d1d; color: #fca5a5; }
.scanner-ivr-iv {
  display: block;
  font-size: 0.7rem;
  color: var(--md-sys-color-on-surface-variant, #888);
  text-align: center;
  margin-top: 1px;
}
.ia-ctx-divider { width: 1px; height: 1.5rem; background: var(--md-sys-color-outline-variant); }

/* ── Cards ── */
.card {
  background: transparent;
  border: none; border-radius: 0;
  padding: 0; margin-bottom: 16px;
  box-shadow: none;
}
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card-subtitle { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

/* Stats cards */
.stats-card { margin-bottom: 12px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--md-sys-color-outline);
}
.stat-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px;
  background: transparent;
  border: none; border-radius: 0;
  border-right: 1px solid var(--md-sys-color-outline);
  transition: all 0.2s;
}
.stat-card:last-child { border-right: none; }
.stat-card__icon { font-size: 32px; color: var(--md-sys-color-primary); }
.stat-card__value { font-size: 28px; font-weight: 700; color: var(--md-sys-color-on-surface); line-height: 1.2; }
.stat-card__label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--md-sys-color-on-surface-variant); }
.stat-card:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 4%, transparent); }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--md-sys-color-on-surface-variant); }
.stat-value { font-size: 20px; font-weight: 700; color: var(--md-sys-color-on-surface); line-height: 1.2; }
.stat-change { font-size: 12px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); }
.stat-change.positive { color: #22c55e; }
.stat-change.negative { color: var(--md-sys-color-error); }

/* Settings grid */
.settings-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-top: 8px; }
@media (max-width: 1400px) { .settings-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .settings-grid { grid-template-columns: 1fr; } }

/* Section headers */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.toolbar--full-row { flex-basis: 100%; }
.section-header__left { flex: 1; min-width: 200px; }
.section-title-row { display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 18px; font-weight: 700; margin: 0; }
.sync-link { background: none; border: none; cursor: pointer; padding: 2px; color: var(--md-sys-color-primary); opacity: 0.6; transition: opacity 0.15s; display: none; align-items: center; }
.sync-link:hover { opacity: 1; }
.sync-link__icon { font-size: 18px; }
.pos-sync-interval {
  font-size: 11px; padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface-variant);
  cursor: pointer; margin-left: 4px; width: auto; max-width: 140px;
}
.sync-countdown {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant);
  margin-left: 4px; font-variant-numeric: tabular-nums;
}
.section-subtitle { color: var(--md-sys-color-on-surface-variant); margin: 4px 0 0; font-size: 13px; }

/* Settings form */
.settings-form { display: flex; flex-direction: column; gap: 20px; }
.settings-field { display: flex; flex-direction: column; gap: 4px; }
.settings-field label { min-height: auto; margin-bottom: 0; }
.settings-field input, .settings-field select { width: 100%; }
.settings-actions { display: flex; gap: 8px; padding-top: 4px; }
.field-hint { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin: 2px 0 0; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; font-family: inherit; }
thead { background: color-mix(in srgb, var(--md-sys-color-primary) 4%, var(--md-sys-color-surface-container)); }
th, td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--md-sys-color-outline); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th {
  font-weight: 700; color: var(--md-sys-color-on-surface-variant);
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--md-sys-color-primary); }
td { font-weight: 500; font-size: 12px; }
table.data-table td:not(:first-child),
table.data-table th:not(:first-child) { border-left: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 50%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent); }
tbody tr.row-fade-enter { animation: fadeRow .6s ease; }
@keyframes fadeRow { from { background: color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent); } to { background: transparent; } }
tbody tr.updated-highlight { animation: updatedFlash 1.2s ease; }
@keyframes updatedFlash { 0% { background: rgba(34,197,94,.25); } 100% { background: transparent; } }


/* Table group rows */
.group-row { cursor: pointer; }
.group-row td { font-weight: 700; }
.group-row:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent) !important; }
.subgroup-row { cursor: pointer; }
.subgroup-row td { font-weight: 700; }

/* Indent levels */
.indent-1 { padding-left: 10px !important; }
.indent-2 { padding-left: 26px !important; }
.indent-3 { padding-left: 42px !important; }

/* Collapse/expand chevron */
.row-chevron {
  display: inline-block; width: 14px; font-size: 11px; text-align: center;
  transition: transform .15s ease; vertical-align: middle; margin-right: 4px;
}
.row-chevron::before { content: "▾"; }
.row-chevron.collapsed::before { content: "▸"; }

/* Warning badges */
.warn-badge {
  display: inline-block; padding: 0px 4px; border-radius: 3px;
  font-size: 9px; font-weight: 700; vertical-align: middle; margin-left: 4px;
  letter-spacing: 0.02em; line-height: 16px;
}
.warn-badge--itm { background: #dc2626; color: #fff; }
.warn-badge--exp { background: #ea580c; color: #fff; }
.warn-badge--er { background: #7c3aed; color: #fff; }
.warn-badge--dte { background: #f59e0b; color: #fff; }
.warn-badge--profit { background: #22c55e; color: #fff; }
.warn-badge--profit-high { background: #16a34a; color: #fff; }
.warn-badge--stop { background: #dc2626; color: #fff; }

/* DTE badges */
.dte-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.dte-badge--red { background: rgba(220, 38, 38, 0.15); color: #ef4444; }
.dte-badge--orange { background: rgba(234, 88, 12, 0.15); color: #f97316; }
.dte-badge--gray { background: rgba(148, 163, 184, 0.15); color: var(--md-sys-color-on-surface-variant); }

/* Breakeven badge */
.be-price { font-size: 12px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }

/* Time Elapsed badges */
.te-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.te-badge--red { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.te-badge--orange { background: rgba(251, 146, 60, 0.15); color: #c2410c; }
.te-badge--gray { background: rgba(156, 163, 175, 0.18); color: #6b7280; }

/* Theta daily */
.theta-positive { color: #16a34a; font-weight: 600; font-size: 12px; white-space: nowrap; }
.theta-negative { color: #dc2626; font-weight: 600; font-size: 12px; white-space: nowrap; }

/* Delta colors */
.delta-long  { color: #16a34a; font-weight: 600; white-space: nowrap; }
.delta-short { color: #dc2626; font-weight: 600; white-space: nowrap; }
td .delta-long, td .delta-short { font-size: 12px; }
.stat-value.delta-long  { color: #16a34a; }
.stat-value.delta-short { color: #dc2626; }

/* Greeks health indicators (summary bar) */
.stat-value.greeks-safe   { color: #22c55e; }
.stat-value.greeks-warn   { color: #f59e0b; }
.stat-value.greeks-danger { color: #ef4444; }
.stat-change.greeks-warn   { color: #f59e0b; }
.stat-change.greeks-danger { color: #ef4444; }

/* Greeks help button */
.greeks-help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  font-size: 9px; font-weight: 700; cursor: pointer;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline);
  margin-left: 4px; vertical-align: middle;
  transition: background 0.15s;
}
.greeks-help-btn:hover { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

/* Greeks tooltip popover */
.greeks-tooltip {
  position: fixed; z-index: 200;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px; padding: 20px; width: 380px; max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  font-size: 13px; line-height: 1.6;
  color: var(--md-sys-color-on-surface);
}
.greeks-tooltip h4 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.greeks-tooltip .greek-item { margin-bottom: 14px; }
.greeks-tooltip .greek-item:last-child { margin-bottom: 0; }
.greeks-tooltip .greek-name { font-weight: 700; font-size: 13px; }
.greeks-tooltip .greek-desc { color: var(--md-sys-color-on-surface-variant); font-size: 12px; margin-top: 2px; }
.greeks-tooltip .greek-zones { font-size: 11px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.greeks-tooltip .zone { padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.greeks-tooltip .zone-safe { background: rgba(34,197,94,0.15); color: #22c55e; }
.greeks-tooltip .zone-warn { background: rgba(245,158,11,0.15); color: #f59e0b; }
.greeks-tooltip .zone-danger { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Action icons */
.actions-cell { display: flex; gap: 4px; justify-content: center; align-items: center; }
.action-icon { cursor: pointer; font-size: 14px; opacity: 0.7; transition: opacity .15s; }
.action-icon:hover { opacity: 1; }

/* Column toggle dropdown */
.col-toggle-wrap { position: relative; display: inline-block; }
.col-toggle-menu {
  display: none; position: absolute; top: 100%; right: 0; z-index: 50;
  background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); padding: 6px 0; min-width: 160px; margin-top: 4px;
}
.col-toggle-wrap.open .col-toggle-menu { display: block; }
.col-toggle-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.col-toggle-menu label:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); }
.col-hidden { display: none !important; }

.table-card { overflow: hidden; }
.table-responsive { overflow-x: auto; }
.scroll-card { max-height: 480px; overflow-y: auto; overflow-x: hidden; }

/* ── Text utilities ── */
.text-green { color: #22c55e; }
.text-red { color: #ef4444; }
.text-orange { color: #fb923c; }
.text-muted { color: var(--md-sys-color-on-surface-variant); }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }

/* ═══════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════ */

.hero-landing {
  position: relative;
  padding: 48px 32px 40px;
  margin: -24px -32px 32px;
  background:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, color-mix(in srgb, var(--md-sys-color-tertiary, var(--md-sys-color-primary)) 10%, transparent) 0%, transparent 50%),
    var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline);
  text-align: center;
}
.hero-title {
  font-size: 36px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 8px; line-height: 1.15;
  background: linear-gradient(135deg, var(--md-sys-color-on-surface), var(--md-sys-color-primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 16px; color: var(--md-sys-color-on-surface-variant);
  margin: 0; max-width: 520px; margin-inline: auto; line-height: 1.6;
}

.tools-showcase {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 780px; margin: 0 auto;
}
.showcase-card {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 28px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 16px;
  text-decoration: none; color: inherit;
  transition: all .2s ease;
  box-shadow: var(--md-shadow-1);
}
.showcase-card:hover {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
  transform: translateY(-2px);
}
.showcase-icon-wrap {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 14px; display: grid; place-items: center;
  font-size: 28px;
}
.showcase-icon--positions {
  background: color-mix(in srgb, #22c55e 12%, var(--md-sys-color-surface-container));
  color: #22c55e;
}
.showcase-icon--long {
  background: color-mix(in srgb, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface-container));
  color: var(--md-sys-color-primary);
}
.showcase-icon--short {
  background: color-mix(in srgb, #fb923c 12%, var(--md-sys-color-surface-container));
  color: #fb923c;
}
.showcase-body { flex: 1; min-width: 0; }
.showcase-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.showcase-desc { font-size: 14px; color: var(--md-sys-color-on-surface-variant); margin: 0; line-height: 1.55; }
.showcase-arrow {
  font-size: 22px; color: var(--md-sys-color-on-surface-variant);
  transition: all .2s; flex-shrink: 0;
}
.showcase-card:hover .showcase-arrow { color: var(--md-sys-color-primary); transform: translateX(4px); }

/* ── Dashboard ── */
.dash-onboarding {
  display: flex; justify-content: center; align-items: center;
  min-height: 60vh; padding: 40px 20px;
}
.dash-onboarding__card {
  text-align: center; max-width: 480px;
  padding: 48px 40px; border-radius: 16px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-shadow-1);
}
.dash-onboarding__icon {
  font-size: 48px; color: var(--md-sys-color-primary); margin-bottom: 12px;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.dash-onboarding__title {
  font-size: 24px; font-weight: 800; margin: 0 0 8px;
  color: var(--md-sys-color-on-surface);
}
.dash-onboarding__subtitle {
  font-size: 14px; color: var(--md-sys-color-on-surface-variant);
  margin: 0 0 20px;
}
.dash-onboarding__features {
  list-style: none; padding: 0; margin: 0 0 28px; text-align: left;
}
.dash-onboarding__features li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px; color: var(--md-sys-color-on-surface);
}
.dash-onboarding__features .material-symbols-outlined {
  font-size: 20px; color: var(--md-sys-color-primary);
}
.dash-onboarding__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px; border-radius: 12px;
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: opacity 0.15s;
}
.dash-onboarding__btn:hover { opacity: 0.9; }

/* ── Dashboard Briefing ── */
.dash-briefing-cta {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin-bottom: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--md-sys-color-tertiary);
  background: color-mix(in srgb, var(--md-sys-color-tertiary) 6%, var(--md-sys-color-surface-container));
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
}
.dash-briefing-cta__btn {
  margin-left: auto; white-space: nowrap; flex-shrink: 0;
  padding: 4px 14px; border-radius: 6px;
  background: var(--md-sys-color-tertiary); color: #fff;
  font-size: 12px; font-weight: 600; text-decoration: none;
}
.dash-briefing-cta__btn:hover { opacity: 0.9; }

.dash-briefing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;
}
@media (max-width: 900px) {
  .dash-briefing-grid { grid-template-columns: 1fr; }
}

.dash-briefing-section {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container);
  overflow: hidden;
}
.dash-briefing-section--full { margin-bottom: 12px; }

.dash-briefing-section__header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
}
.dash-briefing-section__header h3 {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; margin: 0;
  color: var(--md-sys-color-on-surface);
}
.dash-briefing-section__header h3 .material-symbols-outlined { font-size: 16px; color: var(--md-sys-color-primary); }
.dash-briefing-section__sub { font-size: 10px; color: var(--md-sys-color-on-surface-variant); }
.dash-briefing-section__link {
  margin-left: auto; font-size: 11px; color: var(--md-sys-color-primary);
  text-decoration: none; white-space: nowrap;
}
.dash-briefing-section__link:hover { text-decoration: underline; }

/* IV Scanner rows */
.dash-briefing-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 12px;
}
.dash-briefing-row:last-child { border-bottom: none; }
.dash-briefing-row__left { display: flex; align-items: center; gap: 10px; }
.dash-briefing-row__ticker { font-weight: 700; color: var(--md-sys-color-on-surface); width: 48px; }
.dash-briefing-row__price { color: var(--md-sys-color-on-surface-variant); font-size: 11px; }
.dash-briefing-row__change { font-size: 11px; }
.dash-briefing-row__right { display: flex; align-items: center; gap: 8px; }

/* IV Rank badge */
.dash-iv-badge {
  padding: 1px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; color: #fff;
}
.dash-iv-badge--high { background: #ef5350; }
.dash-iv-badge--mid { background: #ffa726; color: #000; }
.dash-iv-badge--low { background: #4caf50; }

.dash-briefing-row__action {
  font-size: 11px; color: var(--md-sys-color-primary);
  text-decoration: none; white-space: nowrap;
}
.dash-briefing-row__action:hover { text-decoration: underline; }

/* Earnings rows */
.dash-briefing-row__timing { color: var(--md-sys-color-on-surface-variant); font-size: 11px; }
.dash-briefing-row__em { font-size: 11px; color: var(--md-sys-color-tertiary); }

/* Positions attention rows */
.dash-briefing-row__desc { font-weight: 600; color: var(--md-sys-color-on-surface); }
.dash-briefing-row__context { color: var(--md-sys-color-on-surface-variant); font-size: 11px; margin-left: 6px; }
.dash-briefing-row__pnl { font-size: 11px; }
.dash-briefing-row__suggestion { font-size: 10px; color: var(--md-sys-color-on-surface-variant); margin-left: 6px; }

.dash-briefing-connected { margin-bottom: 12px; }

/* ── Trade of the Day ── */
.dash-trade-of-day {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-left: 3px solid var(--md-sys-color-primary);
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.dash-trade-of-day--empty {
  border-left-color: var(--md-sys-color-outline-variant);
}
.dash-trade-of-day__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.dash-trade-of-day__title {
  font-size: 13px; font-weight: 700; color: var(--md-sys-color-on-surface);
  display: flex; align-items: center; gap: 6px;
}
.dash-trade-of-day__link {
  font-size: 11px; color: var(--md-sys-color-primary);
  text-decoration: none; white-space: nowrap;
}
.dash-trade-of-day__link:hover { text-decoration: underline; }
.dash-trade-of-day__trade {
  font-size: 13px; color: var(--md-sys-color-on-surface);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.dash-trade-of-day__action {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.dash-trade-of-day__action--low { background: #4caf50; }
.dash-trade-of-day__action--moderate { background: #ffa726; color: #000; }
.dash-trade-of-day__action--high { background: #ef5350; }
.dash-trade-of-day__action--very-high { background: #b71c1c; }
.dash-trade-of-day__stats {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 8px;
}
.dash-trade-of-day__stat { white-space: nowrap; }
.dash-trade-of-day__stat strong { color: var(--md-sys-color-on-surface); font-weight: 600; }
.dash-trade-of-day__rationale {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
}
.dash-trade-of-day__empty-msg {
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
}
.dash-trade-of-day__empty-msg a {
  color: var(--md-sys-color-primary); text-decoration: none;
}
.dash-trade-of-day__empty-msg a:hover { text-decoration: underline; }

/* Dashboard market status bar */
.dash-market-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--md-sys-color-surface-container); border-radius: 8px; margin-bottom: 16px;
  font-size: 13px;
}
.dash-market-bar__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dash-market-bar__dot--open { background: #4caf50; box-shadow: 0 0 6px #4caf5088; }
.dash-market-bar__dot--pre { background: #ff9800; box-shadow: 0 0 6px #ff980088; }
.dash-market-bar__dot--after { background: #2196f3; box-shadow: 0 0 6px #2196f388; }
.dash-market-bar__dot--closed { background: #9e9e9e; }
.dash-market-bar__label { font-weight: 600; }
.dash-market-bar__time { color: var(--md-sys-color-on-surface-variant); margin-left: auto; }

/* Dashboard account breakdown */
.dash-accounts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px;
}
.dash-account-card {
  background: var(--md-sys-color-surface-container); border-radius: 10px; padding: 14px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
}
.dash-account-card__name {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--md-sys-color-on-surface-variant); margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-account-card__value {
  font-size: 20px; font-weight: 800; color: var(--md-sys-color-on-surface); margin-bottom: 4px;
}
.dash-account-card__row {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
}

/* Dashboard top movers */
.dash-movers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.dash-movers.dash-movers--3col { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) { .dash-movers, .dash-movers.dash-movers--3col { grid-template-columns: 1fr; } }
.dash-movers__header.neutral { color: var(--md-sys-color-on-surface); }
.dash-movers__col {
  background: var(--md-sys-color-surface-container); border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline-variant); overflow: hidden;
}
.dash-movers__header {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.dash-movers__header h3 { margin: 0; font-size: 13px; }
.dash-movers__header.positive { color: #4caf50; }
.dash-movers__header.negative { color: #f44336; }
.dash-movers__header .material-symbols-outlined { font-size: 18px; }
.dash-mover-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 13px; text-decoration: none; color: inherit;
}
.dash-mover-item:last-child { border-bottom: none; }
.dash-mover-item:hover { background: var(--md-sys-color-surface-container-high); }
.dash-mover-item__ticker { font-weight: 700; min-width: 60px; }
.dash-mover-item__desc { color: var(--md-sys-color-on-surface-variant); font-size: 11px; flex: 1; margin: 0 8px; }
.dash-mover-item__pnl { font-weight: 600; text-align: right; white-space: nowrap; }
.dash-mover-item__pct { font-size: 11px; color: var(--md-sys-color-on-surface-variant); text-align: right; min-width: 50px; }

/* Dashboard insights row (theta calendar + concentration) */
.dash-insights {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 768px) { .dash-insights { grid-template-columns: 1fr; } }
.dash-insight-card {
  background: var(--md-sys-color-surface-container); border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline-variant); overflow: hidden;
}
.dash-insight-card__header {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
}
.dash-insight-card__header h3 { margin: 0; font-size: 13px; }
.dash-insight-card__header .material-symbols-outlined { font-size: 18px; color: var(--md-sys-color-primary); }
.dash-insight-card__body { padding: 12px 14px; }

/* Theta calendar */
.dash-theta-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.dash-theta-day {
  text-align: center; padding: 8px 4px; border-radius: 8px;
  background: var(--md-sys-color-surface-container-high);
}
.dash-theta-day__label { font-size: 11px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); margin-bottom: 4px; }
.dash-theta-day__value { font-size: 16px; font-weight: 800; }
.dash-theta-day__count { font-size: 10px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

/* Concentration bars */
.dash-conc-item { margin-bottom: 10px; }
.dash-conc-item:last-child { margin-bottom: 0; }
.dash-conc-item__header {
  display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px;
}
.dash-conc-item__ticker { font-weight: 700; }
.dash-conc-item__pct { color: var(--md-sys-color-on-surface-variant); }
.dash-conc-bar {
  height: 8px; border-radius: 4px; background: var(--md-sys-color-surface-container-high); overflow: hidden;
}
.dash-conc-bar__fill {
  height: 100%; border-radius: 4px; background: var(--md-sys-color-primary); transition: width 0.3s ease;
}

/* Dashboard bottom tables row */
.dash-tables-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 0;
}
@media (max-width: 1024px) {
  .dash-tables-row { grid-template-columns: 1fr; }
}
/* Recent activity / pending orders table tweaks */
#dashRecentBody td, #dashPendingBody td { font-size: 12px; }

@media (max-width: 768px) {
  .hero-landing { padding: 32px 16px 28px; margin: -16px -14px 24px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
  .showcase-card { padding: 18px 20px; gap: 14px; }
  .showcase-icon-wrap { width: 46px; height: 46px; font-size: 24px; }
  .showcase-arrow { display: none; }
}

/* ── Slider helpers ── */
.slider-wrapper { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--md-sys-color-on-surface-variant); font-weight: 600; }
.slider { width: 140px; }
.header-controls .slider { position: relative; z-index: 0; }

/* ── Loading ── */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent); border-top-color: var(--md-sys-color-primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--md-sys-color-surface) 85%, transparent); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(4px); }
.loading-overlay.show { opacity: 1; pointer-events: auto; }
.loading-content { text-align: center; }
.loading-content .spinner { width: 40px; height: 40px; border-width: 3px; margin-bottom: 12px; }
.loading-text { color: var(--md-sys-color-on-surface-variant); font-size: 14px; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  border: none; border-radius: 12px; padding: 14px 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25); z-index: 10000;
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(10px);
  transition: all .3s; pointer-events: none; max-width: 400px;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.success { background: #16a34a; color: #fff; }
.toast.error { background: #dc2626; color: #fff; }
.toast.info { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.toast .icon { font-size: 18px; }
.toast .message { flex: 1; }
.toast.success .icon { color: #fff; }
.toast.error .icon { color: #fff; }
.toast.info .icon { color: var(--md-sys-color-on-primary); animation: refresh-spin 0.9s linear infinite; }
.toast .toast-action { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--md-sys-color-surface) 70%, rgba(0,0,0,.5));
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 10000; opacity: 0; transition: opacity .25s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal-content {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 18px; box-shadow: var(--md-shadow-2);
  max-width: 94vw; max-height: 85vh; width: 1100px;
  display: flex; flex-direction: column;
  transform: scale(0.96); transition: transform .25s ease;
}
.modal-content--narrow { width: 500px; }
.modal-overlay.show .modal-content { transform: scale(1); }
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--md-sys-color-outline);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.modal-close {
  background: none; border: none;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 28px; line-height: 1; cursor: pointer; padding: 0;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; transition: all 0.15s;
}
.modal-close:hover { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.card form label, .modal-body label { min-height: initial; align-items: baseline; margin-bottom: 6px; }

/* ── Account trigger button ── */
.account-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 3px; border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline);
  background: transparent; cursor: pointer;
  transition: all 0.15s ease; color: var(--md-sys-color-on-surface);
}
.account-trigger:hover { background: var(--md-sys-color-surface-variant); }
.account-trigger__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  font-weight: 700; font-size: 13px; line-height: 1;
}
.account-trigger__chevron { font-size: 18px; color: var(--md-sys-color-on-surface-variant); transition: transform 0.2s ease; }

/* ── Account dropdown menu ── */
.account-menu-wrapper { position: relative; }
.account-dropdown {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 0;
  min-width: 180px; padding: 6px 0; border-radius: 10px;
  background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.25); z-index: 300;
  opacity: 0; transform: translateY(4px); transition: opacity 0.15s ease, transform 0.15s ease;
}
.account-dropdown.show { display: block; opacity: 1; transform: translateY(0); }
.account-dropdown__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--md-sys-color-on-surface);
  transition: background 0.12s ease;
}
.account-dropdown__item .material-symbols-outlined { font-size: 18px; color: var(--md-sys-color-on-surface-variant); }
.account-dropdown__item:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); }
.account-dropdown__item--danger { color: var(--md-sys-color-error); }
.account-dropdown__item--danger .material-symbols-outlined { color: var(--md-sys-color-error); }
.account-dropdown__item--danger:hover { background: color-mix(in srgb, var(--md-sys-color-error) 8%, transparent); }
.account-dropdown__divider { height: 1px; margin: 4px 12px; background: var(--md-sys-color-outline); opacity: 0.5; }

/* ── Account settings modal sections ── */
.account-settings { display: flex; flex-direction: column; gap: 0; padding: 0 !important; }
.settings-section { padding: 16px 22px; border-bottom: 1px solid var(--md-sys-color-outline); }
.settings-section:last-child { border-bottom: none; }
.settings-section__header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.settings-section__icon { font-size: 20px; color: var(--md-sys-color-primary); opacity: 0.8; }
.settings-section__title { margin: 0; font-size: 14px; font-weight: 700; color: var(--md-sys-color-on-surface); letter-spacing: -0.01em; }
.settings-section__subtitle { margin: 2px 0 0; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.settings-section__body { display: flex; flex-direction: column; gap: 2px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; transition: background 0.12s ease;
}
.settings-row:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 4%, transparent); }
.settings-row__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-row__label { font-size: 13px; font-weight: 600; color: var(--md-sys-color-on-surface); }
.settings-row__value { font-size: 12px; color: var(--md-sys-color-on-surface-variant); overflow: hidden; text-overflow: ellipsis; }
.settings-row__actions { display: flex; gap: 8px; flex-shrink: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.status-dot--connected { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.status-dot--disconnected { background: var(--md-sys-color-on-surface-variant); opacity: 0.4; }
.status-dot--error { background: var(--md-sys-color-error); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.settings-section--danger { padding: 16px 22px; background: color-mix(in srgb, var(--md-sys-color-error) 3%, transparent); }
.settings-row--vertical {
  flex-direction: column; align-items: stretch; gap: 8px;
}
.settings-row--vertical:hover { background: transparent; }
.settings-textarea {
  width: 100%; resize: vertical; min-height: 80px; max-height: 200px;
  padding: 10px 12px; border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px; background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface); font-size: 13px; line-height: 1.5;
  font-family: inherit; transition: border-color 0.15s;
}
.settings-textarea:focus { outline: none; border-color: #6366f1; }
.settings-textarea::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 0.55; }
.settings-textarea__footer {
  display: flex; align-items: center; justify-content: space-between; margin-top: 2px;
}
.settings-textarea__count { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
/* AI Settings modal — tabbed layout */
.ai-settings-modal { max-width: 620px; width: 100%; }
.ai-settings-layout {
  display: flex; min-height: 360px;
}
.ai-settings-nav {
  width: 170px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 10px; border-right: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
}
.ai-settings-nav__item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: none; border-radius: 8px;
  background: none; color: var(--md-sys-color-on-surface-variant);
  font-size: 13px; font-weight: 500; cursor: pointer;
  text-align: left; transition: background 0.12s, color 0.12s;
}
.ai-settings-nav__item .material-symbols-outlined { font-size: 18px; }
.ai-settings-nav__item:hover { background: var(--md-sys-color-surface-container-high); }
.ai-settings-nav__item.active {
  background: rgba(99, 102, 241, 0.1); color: #6366f1; font-weight: 600;
}
.ai-settings-nav__item.active .material-symbols-outlined { color: #6366f1; }
.ai-settings-content {
  flex: 1; padding: 20px; overflow-y: auto; min-width: 0;
}
.ai-settings-tab { display: none; }
.ai-settings-tab.active { display: block; }
@media (max-width: 560px) {
  .ai-settings-layout { flex-direction: column; min-height: auto; }
  .ai-settings-nav {
    width: 100%; flex-direction: row; border-right: none;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    padding: 8px 10px; overflow-x: auto;
  }
  .ai-settings-nav__item { white-space: nowrap; padding: 6px 10px; font-size: 12px; }
  .ai-settings-content { padding: 16px; }
}

.ai-settings-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.ai-settings-field { display: flex; flex-direction: column; gap: 4px; }
.ai-settings-field label {
  font-size: 12px; font-weight: 600; color: var(--md-sys-color-on-surface);
}
.settings-select, .settings-input {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface); font-size: 13px; font-family: inherit;
  transition: border-color 0.15s;
}
.settings-select:focus, .settings-input:focus { outline: none; border-color: #6366f1; }
.settings-input::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 0.55; }
@media (max-width: 480px) {
  .settings-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .settings-row__actions { align-self: flex-end; }
}

/* ── Preferences toggle switch ── */
.pref-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.pref-toggle input { opacity: 0; width: 0; height: 0; }
.pref-toggle__track {
  position: absolute; inset: 0; cursor: pointer; border-radius: 24px;
  background: var(--md-sys-color-outline); transition: background 0.2s;
}
.pref-toggle__track::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform 0.2s;
}
.pref-toggle input:checked + .pref-toggle__track { background: var(--md-sys-color-primary); }
.pref-toggle input:checked + .pref-toggle__track::after { transform: translateX(20px); }

/* ── Segmented control (NAT/MID) ── */
.pref-segment { display: inline-flex; border: 1px solid var(--md-sys-color-outline); border-radius: 10px; overflow: hidden; }
.pref-segment__btn {
  padding: 6px 16px; font-size: 13px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; transition: all 0.15s;
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface-variant);
}
.pref-segment__btn.active {
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
}
.pref-segment__btn:not(.active):hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.pref-segment--inline { border-radius: 4px; }
.pref-segment--inline .pref-segment__btn { padding: 4px 8px; font-size: 11px; font-weight: 600; }
.pricing-mode-toggle { display: inline-flex; align-items: center; }

/* ── Preferences modal ── */
.prefs-modal { max-width: 480px; }
.prefs-group { margin-bottom: 20px; }
.prefs-group__title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--md-sys-color-on-surface-variant); margin-bottom: 8px; padding: 0 12px;
}

/* ── Footer ── */
footer {
  padding: 20px 32px; text-align: center;
  color: var(--md-sys-color-on-surface-variant); font-size: 13px;
  border-top: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container);
}

/* ── Auth pages ── */
.auth-shell {
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px 48px;
  background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent), transparent 40%),
              radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--md-sys-color-primary) 5%, transparent), transparent 35%),
              var(--md-sys-color-surface);
}
.auth-card {
  width: min(480px, 100%);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 18px; padding: 32px 36px;
  box-shadow: var(--md-shadow-2);
}
.auth-header { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.auth-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface-container));
  color: var(--md-sys-color-primary); font-size: 26px;
}
.auth-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.auth-subtitle { margin: 4px 0 0; color: var(--md-sys-color-on-surface-variant); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { min-height: auto; }
.auth-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.auth-status { font-size: 13px; min-height: 18px; }
.auth-hint { color: var(--md-sys-color-on-surface-variant); font-size: 12px; }
.auth-divider { text-align: center; margin: 20px 0; font-size: 13px; }
@media (max-width: 640px) {
  .auth-card { border-radius: 16px; padding: 24px 22px 28px; }
  .auth-actions { flex-direction: column; align-items: stretch; }
  .auth-actions .btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════
   VISUALIZER STYLES
   ═══════════════════════════════════════════════════════ */

.lv-hero {
  position: relative;
  display: grid; grid-template-columns: 1fr 0.8fr;
  gap: 8px; align-items: center; overflow: hidden;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface)),
    var(--md-sys-color-surface-container));
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 16px; padding: 10px 16px; margin-bottom: 16px;
  box-shadow: var(--md-shadow-1);
}
.lv-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent), transparent);
  opacity: 0.5;
}
.lv-hero > * { position: relative; z-index: 1; }
.lv-hero-copy .lv-eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: var(--md-sys-color-primary); font-weight: 700; margin-bottom: 4px; }
.lv-hero-title { margin: 0 0 2px 0; font-size: 17px; letter-spacing: -0.01em; line-height: 1.25; }
.lv-hero-subtitle { margin: 0; color: var(--md-sys-color-on-surface-variant); line-height: 1.35; }
.lv-hero-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface-container));
  color: var(--md-sys-color-primary); font-size: 24px;
}

.lv-form {
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 95%, transparent);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 12px; padding: 10px 12px;
  backdrop-filter: blur(3px);
}
.lv-form-grid { display: grid; grid-template-columns: 1.2fr 0.6fr; gap: 8px; align-items: end; }
.lv-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lv-field label { margin-bottom: 2px; }
.lv-field input { height: 36px; padding: 7px 12px; font-size: 14px; }
.lv-align-end { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; }
.lv-input-help small { color: var(--md-sys-color-on-surface-variant); font-size: 11px; }
.lv-form--sidebar { margin-bottom: 14px; }
.lv-form--sidebar .lv-form-grid { grid-template-columns: 1fr auto; gap: 8px; }
.lv-submit { width: 100%; height: 36px; line-height: 1; padding: 0 16px; }

.lv-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pill-soft { border-color: var(--md-sys-color-outline); background: color-mix(in srgb, var(--md-sys-color-surface-variant) 50%, transparent); color: var(--md-sys-color-on-surface-variant); }
.lv-pill-toggle { display: inline-flex; gap: 8px; }
.lv-pill-toggle .btn { min-width: 96px; height: 44px; border-radius: 12px; }
.lv-pill-toggle .btn-secondary { background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface-variant); border-color: var(--md-sys-color-outline); }
.lv-pill-toggle .btn-primary {
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-color: transparent;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}
.lv-toggle-small { display: inline-flex; gap: 4px; }
.lv-toggle-small .btn { min-width: 56px; height: 32px; border-radius: 8px; font-size: 12px; padding: 4px 10px; }
.lv-toggle-small .btn-primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-color: transparent; }
.lv-toggle-small .btn-secondary { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); border-color: var(--md-sys-color-outline); }

.lv-layout { position: relative; }
.lv-layout-inner { display: flex; gap: 16px; align-items: flex-start; }
.lv-filter-bar {
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding: 0 12px 10px; margin-bottom: 10px;
}
.lv-matrix-card > .lv-matrix-header { padding: 4px 20px 8px; margin-bottom: 8px; }
.lv-matrix-card > .lv-chip-row-controls { padding: 4px 20px 8px; }
.lv-matrix-card > .lv-table-wrapper { margin: 0 20px; width: auto; }
.lv-matrix-card > .lv-footnote { padding: 10px 20px 16px; margin-top: 0; }
.lv-header-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
}
.lv-header-right .lv-form {
  border: none; background: none; padding: 0; margin: 0;
  backdrop-filter: none; box-shadow: none;
}
.lv-header-right .lv-field label { display: none; }
.lv-header-right .lv-form-grid {
  display: flex; align-items: center; gap: 8px;
}
.lv-header-right .lv-form-grid .lv-field { flex: 0 0 auto; }
.lv-header-right .lv-form-grid .lv-field input { width: 100px; height: 36px; font-size: 13px; }
.lv-header-right .lv-submit { width: auto; padding: 0 16px; font-size: 13px; font-weight: 500; }
.lv-header-right .lv-align-end { align-self: auto; }
.lv-filter-bar .lv-filter-grid {
  grid-template-columns: repeat(8, 1fr); gap: 6px 14px;
}
.lv-filter-bar .lv-filter-control { padding: 4px 0 6px; display: flex; flex-direction: column; justify-content: flex-end; }
.lv-filter-bar .lv-filter-label { margin-bottom: 4px; font-size: 0.75rem; font-weight: 600; }
.lv-filter-bar .lv-input-range input { width: 50px; padding: 0 4px; height: 24px; font-size: 11px; border-radius: var(--radius-sm, 8px); }
.lv-filter-bar .lv-toggle-small .btn { min-width: 36px; padding: 1px 6px; font-size: 11px; height: 24px; }
.lv-filter-bar .lv-toggle-3 .btn { min-width: 44px; }
.lv-filter-bar .lv-filter-value { font-size: 12px; }
.lv-filter-select-sm { padding: 1px 4px; height: 24px; font-size: 11px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-family: 'Nunito', sans-serif; cursor: pointer; }
.lv-filter-bar .lv-filter-select-sm { width: 100%; box-sizing: border-box; }
.lv-filter-bar .lv-filter-inline { width: 100%; }
.lv-filter-bar .lv-filter-inline > *:last-child { width: 100%; }
.dte-filter { display: flex; align-items: center; width: 100%; }
.dte-filter .dte-basic { width: 100%; }
.dte-advanced { display: flex; align-items: center; gap: 3px; }
.dte-advanced input { height: 24px; font-size: 11px; padding: 1px 4px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-family: inherit; }
.dte-back-btn { cursor: pointer; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); border-radius: 6px; height: 24px; padding: 0 4px; font-size: 12px; }
.lv-filter-bar .lv-filter-control.lv-filter-control--actions { grid-column: 5 / -1; flex-direction: row; align-items: flex-end; justify-content: flex-end; gap: 3px; flex-wrap: nowrap; }
.lv-filter-control--actions .lv-preset-select { width: auto !important; min-width: 70px; }
.lv-action-btn { height: 24px; padding: 0 6px; font-size: 10px; min-width: 0; white-space: nowrap; }
.lv-preset-select { width: 64px; min-width: 0; }
.lv-preset-del { width: 18px; padding: 0; font-size: 10px; height: 24px; }
.lv-filter-toggle {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 6px 12px; border-radius: 10px;
  box-shadow: var(--md-shadow-1);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.lv-filter-toggle.is-collapsed { right: -6px; }
.lv-filter-panel {
  width: 320px; min-width: 280px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 16px; padding: 16px;
  transition: margin-left 0.3s ease;
  box-shadow: var(--md-shadow-1); position: relative;
}
.lv-panel-header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.lv-panel-title { margin: 0; font-size: 16px; }
.lv-panel-subtitle { margin: 2px 0 0 0; color: var(--md-sys-color-on-surface-variant); font-size: 12px; line-height: 1.5; }
.lv-preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.lv-preset-select { flex-direction: column; align-items: flex-start; gap: 6px; }
.lv-preset-inline { display: flex; gap: 8px; align-items: center; width: 100%; }
.lv-preset-inline select { flex: 1; min-width: 180px; padding: 8px 12px; }
.lv-preset-hint { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.lv-filter-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px 14px; }
.lv-filter-control { padding: 6px 0 10px; border: none; border-radius: 0; background: transparent; }
.lv-filter-bar .noUi-target { margin: 0 8px 6px; }
.lv-filter-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; margin-bottom: 8px; color: var(--md-sys-color-on-surface-variant); }
.lv-filter-value { font-weight: 600; color: var(--md-sys-color-primary); }
.lv-filter-select select { width: 100%; padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.lv-filter-inline { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.lv-input-range { display: flex; align-items: center; gap: 6px; }
.lv-input-range input { width: 80px; padding: 7px 8px; border-radius: 8px; font-size: 12px; }
.lv-input-range .range-sep { color: var(--md-sys-color-on-surface-variant); font-size: 12px; }
.lv-toggle-3 .btn { min-width: 54px; }
.lv-inline-hint { font-size: 11px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.lv-label-muted { color: transparent; }
.lv-reset { width: 100%; margin-top: 14px; padding: 8px 12px; font-size: 13px; border-radius: 10px; }

.lv-matrix-card { flex: 1; min-width: 0; }
.lv-matrix-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lv-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lv-matrix-title { margin: 0; }
.lv-title-row { display: flex; align-items: center; gap: 8px; }
.lv-title-row .sync-link { display: inline-flex; }
.lv-em-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  color: var(--md-sys-color-on-surface-variant); cursor: pointer; padding: 3px 8px;
  border: 1px solid var(--md-sys-color-outline); border-radius: 6px; user-select: none;
}
.lv-em-toggle input { accent-color: #3b82f6; cursor: pointer; }
.lv-em-toggle:has(input:checked) { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.08); }
.lv-iv-timing-banner {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; margin: 4px 0;
}
.lv-skew-popover {
  position: fixed; z-index: 500; width: 480px; max-width: 90vw;
  background: var(--md-sys-color-surface); border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); overflow: hidden;
}
.lv-skew-popover__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 14px; font-weight: 600;
}
.lv-skew-popover__close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant); padding: 2px 6px; border-radius: 4px;
}
.lv-skew-popover__close:hover { background: var(--md-sys-color-surface-container-high); }
.lv-skew-icon {
  cursor: pointer; font-size: 14px; vertical-align: middle;
  color: var(--md-sys-color-on-surface-variant); opacity: 0.6;
}
.lv-skew-icon:hover { opacity: 1; color: #3b82f6; }
.lv-iv-timing-banner--cheap { background: #dcfce7; color: #16a34a; }
.lv-iv-timing-banner--moderate { background: #fef9c3; color: #a16207; }
.lv-iv-timing-banner--expensive { background: #fee2e2; color: #dc2626; }
body:not(.theme-light) .lv-iv-timing-banner--cheap { background: #1b4332; color: #95d5b2; }
body:not(.theme-light) .lv-iv-timing-banner--moderate { background: #5c4a14; color: #ffd966; }
body:not(.theme-light) .lv-iv-timing-banner--expensive { background: #5c1a1a; color: #f5a3a3; }
.lv-subtle { color: var(--md-sys-color-on-surface-variant); font-size: 13px; }
.lv-mny-pct { font-size: 11px; font-weight: 400; margin-left: 4px; }
.lv-mny-above { color: var(--md-sys-color-on-surface-variant); }
.lv-mny-below { color: var(--md-sys-color-on-surface-variant); }
.lv-earnings-flag { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-size: 9px; font-weight: 700; color: #fff; background: #d32f2f; border-radius: 50%; margin-left: 4px; vertical-align: middle; cursor: help; }
.lv-ua-cell { position: relative; }
.lv-ua-cell::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent #f59e0b transparent transparent; }
.lv-ua-cell.lv-ua-high::after { border-color: transparent #d32f2f transparent transparent; }
.lv-table-wrapper { overflow-x: auto; border: 1px solid var(--md-sys-color-outline); border-radius: 14px; background: var(--md-sys-color-surface); }
.lv-footnote { margin-top: 14px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.lv-refresh { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.lv-refresh .btn { padding: 5px 12px; font-size: 12px; }
.lv-refresh-count, .lv-refresh-time {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-variant);
  border: 1px solid var(--md-sys-color-outline);
  padding: 4px 10px; border-radius: 999px;
}
.lv-table-controls { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.lv-display-toggle { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.lv-display-label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; font-weight: 600; }
.lv-display-toggle select { padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.lv-chip-row-controls { align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.lv-chip-row-controls > #filtersSummary { flex: 1; }
.compact-matrix td { font-weight: 500; }
.compact-matrix { font-size: 12px; }
.compact-matrix td:hover {
  outline: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 40%, transparent);
  filter: brightness(1.02); z-index: 1; position: relative;
}
.matrix-row-highlight,
.matrix-col-highlight { background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent) !important; }

.lv-placeholder {
  display: flex; align-items: center; gap: 14px;
  background: color-mix(in srgb, var(--md-sys-color-primary) 5%, var(--md-sys-color-surface-container));
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 14px; padding: 20px; position: relative; overflow: hidden;
}
.lv-placeholder::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 50% { transform: translateX(40%); } 100% { transform: translateX(120%); } }
.lv-placeholder-title { font-weight: 600; margin: 0 0 4px 0; }
.lv-placeholder-subtitle { margin: 0; color: var(--md-sys-color-on-surface-variant); }
.lv-placeholder .spinner { width: 22px; height: 22px; border-width: 3px; }
.lv-placeholder.lv-error { border-color: var(--md-sys-color-error); background: color-mix(in srgb, var(--md-sys-color-error) 6%, var(--md-sys-color-surface-container)); }
.lv-placeholder-icon { font-size: 20px; }

.lv-modal { background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline); box-shadow: var(--md-shadow-2); }
.lv-modal-header { background: color-mix(in srgb, var(--md-sys-color-primary) 6%, var(--md-sys-color-surface-container)); border-bottom: 1px solid var(--md-sys-color-outline); }
.lv-modal-body { background: var(--md-sys-color-surface-container); border-radius: 0 0 16px 16px; }
.lv-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.switch { position: relative; display: inline-block; width: 0; height: 0; vertical-align: middle; }
.lv-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.lv-tab-btn { border-radius: 8px; padding: 7px 14px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface); font-weight: 600; font-size: 12px; font-family: inherit; cursor: pointer; transition: all .15s; }
.lv-tab-btn.lv-tab-active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent); }
.pl-controls { display: flex; justify-content: space-between; align-items: end; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.pl-control-right { display: flex; align-items: center; gap: 6px; }
.pl-display-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--md-sys-color-on-surface-variant); }
.pl-control-group { display: flex; flex-direction: column; gap: 2px; }
.pl-control-group label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--md-sys-color-on-surface-variant); }
.pl-select { font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-family: inherit; cursor: pointer; }
.pl-table-wrapper { overflow: auto; max-height: 420px; border: 1px solid var(--md-sys-color-outline); border-radius: 10px; }
.pl-table-fit { border: 1px solid var(--md-sys-color-outline); border-radius: 10px; overflow: hidden; }
.pl-table-fixed { width: 100%; table-layout: fixed; border-collapse: collapse; }
.pl-table-fixed .pl-sticky-col { width: 80px; }
.pl-table th, .pl-table td { font-size: 11px; padding: 3px 2px; white-space: nowrap; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.pl-table th { background: var(--md-sys-color-surface-variant); font-weight: 600; }
.pl-month-row th { top: 0; text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant); border-bottom: 1px solid var(--md-sys-color-outline); padding: 3px 4px; }
.pl-month-header { border-right: 1px solid var(--md-sys-color-outline); }
.pl-date-row th { top: 22px; padding: 3px 4px; }
.pl-table td { font-weight: 600; }
.pl-sticky-col { background: var(--md-sys-color-surface); text-align: left !important; }
.pl-table thead .pl-sticky-col { background: var(--md-sys-color-surface-variant); }
.pl-price-cell { font-weight: 600; }
.pl-pct { font-size: 9px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); margin-left: 2px; }
.pl-current-row td { border-top: 1.5px dashed var(--md-sys-color-on-surface); border-bottom: 1.5px dashed var(--md-sys-color-on-surface); }
.pl-current-row .pl-sticky-col { font-weight: 700; }
.pl-expiry-col { background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent) !important; }
.pl-today-col { background: color-mix(in srgb, var(--md-sys-color-tertiary) 10%, transparent) !important; }
.pl-table thead .pl-today-col { font-weight: 700; }
.pl-table thead .pl-expiry-col { font-weight: 700; }

.lv-iv-badge {
  display: inline-block; margin-top: 2px; padding: 1px 5px; border-radius: 999px;
  font-size: 9px; line-height: 1.2; font-weight: 600; white-space: nowrap;
  text-overflow: ellipsis; overflow: hidden; max-width: 100%; text-align: center;
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface-container));
  color: var(--md-sys-color-on-surface);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 20%, var(--md-sys-color-outline));
}
.lv-iv-badge[data-tone="rich"], .lv-iv-badge[data-tone="favor"] { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #22c55e; }
.lv-iv-badge[data-tone="caution"] { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #ef4444; }
.theme-light .lv-iv-badge[data-tone="rich"], .theme-light .lv-iv-badge[data-tone="favor"] { color: #15803d; }
.theme-light .lv-iv-badge[data-tone="caution"] { color: #b91c1c; }

.lv-exp-days { font-size: 10px; color: inherit; font-weight: inherit; }
.lv-be-percent { font-size: 75%; font-weight: 600; color: inherit; margin-left: 4px; }
.tone-red { color: #ef4444; }
.tone-green { color: #22c55e; }
.tone-muted { color: var(--md-sys-color-on-surface-variant); }
.lv-stat-value.tone-green { color: #22c55e; }
.lv-stat-value.tone-red { color: #ef4444; }
.lv-stat-value.tone-primary { color: var(--md-sys-color-on-surface); }
.pill-green { border-color: rgba(34,197,94,0.35); color: #22c55e; }
.pill-red { border-color: rgba(239,68,68,0.4); color: #ef4444; }
.lv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; border: 1px solid var(--md-sys-color-outline); background: color-mix(in srgb, var(--md-sys-color-surface-variant) 50%, transparent); color: var(--md-sys-color-on-surface-variant); }

#lv-tooltip { min-width: 240px; max-width: 280px; border-radius: 14px; backdrop-filter: saturate(180%) blur(6px); }
#lv-tooltip .tv-title { font-weight: 700; margin-bottom: 4px; color: var(--md-sys-color-on-surface); white-space: nowrap; font-size: 13px; }
#lv-tooltip .tv-title .muted { color: var(--md-sys-color-on-surface-variant); font-weight: 500; }
#lv-tooltip .badge { display: inline-block; padding: 2px 6px; border-radius: 999px; font-size: 11px; border: 1px solid var(--md-sys-color-outline); margin-left: 6px; background: var(--md-sys-color-surface-variant); white-space: nowrap; color: var(--md-sys-color-on-surface-variant); }
#lv-tooltip .tv-warning { color: #fbbf24; font-size: 12px; margin: 2px 0 4px; font-weight: 600; }
#lv-tooltip .tv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
#lv-tooltip .tv-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
#lv-tooltip .label { color: var(--md-sys-color-on-surface-variant); font-size: 11px; }
#lv-tooltip .value { color: var(--md-sys-color-on-surface); font-weight: 500; }
#lv-tooltip .value-emphasis { font-weight: 700; }
#lv-tooltip .text-green { color: #22c55e; }
#lv-tooltip .text-red { color: #ef4444; }
#lv-tooltip .tv-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; margin-top: 2px; }
#lv-tooltip .tv-hint { font-size: 10px; color: var(--md-sys-color-on-surface-variant); margin-top: 6px; text-align: center; opacity: 0.7; }
.theme-light #lv-tooltip .tv-warning { color: #d97706; }
#lv-tooltip .tv-ua { font-size: 10px; margin-top: 4px; padding: 3px 6px; border-radius: 4px; background: rgba(245,158,11,0.15); color: #f59e0b; font-weight: 600; }
#lv-tooltip .tv-ua-high { background: rgba(211,47,47,0.15); color: #ef4444; }
.theme-light #lv-tooltip .tv-ua { color: #b45309; }
.theme-light #lv-tooltip .tv-ua-high { color: #b91c1c; }

/* Detail modal — redesigned layout */
.lv-modal-wide { width: min(920px, 95vw); max-width: 920px; }
.lv-modal-wide .modal-header { padding: 12px 18px; }
.lv-modal-wide .modal-title { font-size: 14px; font-weight: 600; }
.lv-modal-wide .modal-body { padding: 12px 16px; }
.lv-modal-wide .lv-tabs { margin-bottom: 10px; }
.lv-modal-wide .lv-tab-btn { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.lv-detail-row-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
@media (max-width: 600px) { .lv-detail-row-grid { grid-template-columns: 1fr; } }
.lv-detail-section { padding: 8px 10px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 10px; background: var(--md-sys-color-surface); }
.lv-detail-chart-section { flex: 1; padding: 8px 10px 2px; }
.lv-detail-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 4px; }
.lv-detail-grid { display: flex; flex-direction: column; gap: 0; }
.lv-detail-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 2px 0; line-height: 1.5; }
.lv-detail-label { color: var(--md-sys-color-on-surface-variant); font-size: 11px; }
.lv-detail-val { font-weight: 600; font-size: 12px; }
.lv-detail-val.tone-green { color: #22c55e; }
.lv-detail-val.tone-red { color: #ef4444; }
.lv-detail-summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (max-width: 700px) { .lv-detail-summary { grid-template-columns: repeat(3, 1fr); } }
.lv-summary-card { padding: 6px 8px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px; background: var(--md-sys-color-surface); text-align: center; }
.lv-summary-label { font-size: 10px; color: var(--md-sys-color-on-surface-variant); font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.lv-summary-value { font-size: 13px; font-weight: 700; margin-top: 2px; }
.lv-summary-value.tone-green { color: #22c55e; }
.lv-summary-value.tone-red { color: #ef4444; }
.lv-summary-sub { font-size: 10px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); }
.lv-chart-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 0; margin-top: -4px; font-size: 10px; color: var(--md-sys-color-on-surface-variant); }
.lv-chart-legend span { display: inline-flex; align-items: center; gap: 3px; }
.lv-legend-swatch { display: inline-block; width: 10px; height: 6px; border-radius: 1px; }
.lv-canvas-tooltip { position: absolute; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; pointer-events: none; z-index: 10; background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline); box-shadow: 0 4px 12px rgba(0,0,0,0.15); color: var(--md-sys-color-on-surface); white-space: nowrap; }

/* noUiSlider */
.noUi-target { background: var(--md-sys-color-outline); border: none; border-radius: 4px; box-shadow: none; height: 4px; }
.noUi-connects { border-radius: 4px; }
.noUi-connect { background: var(--md-sys-color-primary); border-radius: 4px; }
.noUi-handle {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer; top: -6px; right: -8px; outline: none;
}
.noUi-handle:before, .noUi-handle:after { display: none; }
.noUi-handle:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent); }
.noUi-handle:focus { outline: none; }
.noUi-tooltip {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
  border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 600;
}
.noUi-horizontal { height: 4px; }
.noUi-horizontal .noUi-handle { width: 16px; height: 16px; top: -6px; right: -8px; }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .lv-form-grid { grid-template-columns: 1fr 1fr; }
  .lv-align-end { grid-column: span 2; }
  .lv-hero { grid-template-columns: 1fr; }
  .lv-filter-bar .lv-filter-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 920px) {
  .lv-layout-inner { flex-direction: column; }
  .lv-filter-panel { width: 100%; margin-left: 0 !important; }
  .lv-filter-toggle { position: absolute; top: 8px; right: 8px; }
  .lv-filter-toggle.is-collapsed { right: 8px; }
  .toolbar { width: 100%; }
}
@media (max-width: 768px) {
  header, footer { padding-left: 14px; padding-right: 14px; }
  .tools-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: stretch; }
}
@media (max-width: 620px) {
  .lv-form-grid { grid-template-columns: 1fr; }
  .lv-align-end { grid-column: auto; }
  .lv-legend { justify-content: flex-start; }
}

/* ── Import page ── */
.container { max-width: 720px; }
.container h1 { font-size: 24px; font-weight: 700; margin-bottom: 18px; }
.form-group { margin-bottom: 18px; }
.form-group label { margin-bottom: 8px; }

/* ── Misc ── */
.local-storage-info {
  border: 2px solid #ff9800; border-radius: 2em;
  padding: 0.5em 2em; color: #fff;
  background: linear-gradient(90deg, #ff9800 60%, #ffc107 100%);
  font-size: 0.8em; margin: 1.5em auto 0 auto;
  text-align: center; max-width: 500px; font-weight: bold;
}
.leap-subline { margin-top: 3px; }

/* ── Import Page Alerts ── */
.import-danger-zone {
  margin-bottom: 20px; padding: 18px;
  background: var(--md-sys-color-surface-container);
  border-radius: 14px;
}
.import-danger-hint { margin: 10px 0 0; font-size: 14px; color: var(--md-sys-color-on-surface-variant); }
.import-result { margin-top: 20px; }
.import-alert { padding: 18px; border-radius: 14px; border: 1px solid var(--md-sys-color-outline); }
.import-alert h3 { margin-top: 0; }
.import-alert--success {
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface));
  border-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-surface);
}
.import-alert--error {
  background: color-mix(in srgb, var(--md-sys-color-error) 10%, var(--md-sys-color-surface));
  border-color: var(--md-sys-color-error); color: var(--md-sys-color-on-surface);
}

/* ── Opportunity Engine ── */
.opp-icon {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; font-size: 18px;
  vertical-align: middle; margin-left: 4px; transition: all 0.2s ease;
}
.opp-icon:first-child { margin-left: 0; }
.opp-icon:hover { transform: scale(1.15); }
.opp-icon--pulse {
  color: #f59e0b; animation: opp-pulse 1.5s ease-in-out infinite;
}
.opp-icon--solid {
  color: #3b82f6;
}
.opp-icon--dim {
  color: #9ca3af; opacity: 1;
}
@keyframes opp-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5)); }
}

/* Opportunity modal content */
.opp-header { padding: 0 0 12px; border-bottom: 1px solid var(--md-sys-color-outline-variant); margin-bottom: 12px; }
.opp-position-label { font-size: 15px; font-weight: 700; color: var(--md-sys-color-on-surface); display: flex; align-items: center; gap: 8px; }
.opp-refresh-btn { background: none; border: none; cursor: pointer; color: var(--md-sys-color-on-surface-variant); padding: 2px; border-radius: 6px; display: inline-flex; align-items: center; transition: color 0.15s, background 0.15s; }
.opp-refresh-btn:hover { color: var(--md-sys-color-primary); background: var(--md-sys-color-surface-container-high); }
.opp-refresh-btn .material-symbols-outlined { font-size: 18px; }
.opp-position-meta { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 4px; }
.opp-loading { display: flex; align-items: center; gap: 8px; padding: 24px; color: var(--md-sys-color-on-surface-variant); font-size: 13px; }

.opp-section { border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.opp-section.collapsed .opp-section-body { display: none; }
.opp-section.collapsed .opp-chevron { transform: rotate(-90deg); }
.opp-section-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer;
  background: color-mix(in srgb, var(--md-sys-color-surface-variant) 40%, var(--md-sys-color-surface));
  user-select: none; font-size: 13px; font-weight: 600;
}
.opp-section-header:hover { background: var(--md-sys-color-surface-variant); }
.opp-section-icon { font-size: 18px; }
.opp-section--warning .opp-section-icon { color: #f59e0b; }
.opp-section--close .opp-section-icon { color: #22c55e; }
.opp-section--roll .opp-section-icon { color: #3b82f6; }
.opp-section--convert .opp-section-icon { color: #8b5cf6; }
.opp-section-count {
  background: var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface-variant);
  border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; margin-left: auto;
}
.opp-chevron { font-size: 18px; transition: transform 0.2s; color: var(--md-sys-color-on-surface-variant); }
.opp-section-body { padding: 0 14px 10px; }

.opp-card { padding: 10px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.opp-card:last-child { border-bottom: none; }
.opp-card-header { margin-bottom: 6px; }
.opp-card-header strong { font-size: 13px; }
.opp-card-desc { display: block; font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.opp-card-body { font-size: 13px; line-height: 1.5; }
.opp-card-body p { margin: 4px 0; }

.opp-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0;
  border: 1px solid var(--md-sys-color-outline-variant);
}
.opp-table th {
  text-align: right; padding: 6px 10px; font-weight: 600; font-size: 11px; text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: color-mix(in srgb, var(--md-sys-color-surface-variant) 40%, var(--md-sys-color-surface));
}
.opp-table th:first-child { text-align: left; }
.opp-table td {
  padding: 6px 10px; text-align: right;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 70%, transparent);
}
.opp-table td:first-child { text-align: left; }
.opp-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.opp-sortable:hover { color: var(--md-sys-color-primary); }
.opp-sort-arrow { font-size: 10px; margin-left: 2px; opacity: 0.3; }
.opp-sort-arrow::after { content: '⇅'; }
.opp-sortable.sort-asc .opp-sort-arrow { opacity: 1; }
.opp-sortable.sort-asc .opp-sort-arrow::after { content: '↑'; }
.opp-sortable.sort-desc .opp-sort-arrow { opacity: 1; }
.opp-sortable.sort-desc .opp-sort-arrow::after { content: '↓'; }
.opp-positive { color: #16a34a; font-weight: 600; }
.opp-negative { color: #dc2626; font-weight: 600; }
.opp-hint { font-size: 11px; color: var(--md-sys-color-on-surface-variant); margin-top: 6px; font-style: italic; }
.opp-tos-copy {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  border: 1px solid var(--md-sys-color-primary);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.opp-tos-copy:hover {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

/* Trade button (next to TOS copy) */
/* Expiry type tags (W = weekly, D/Mon/Tue… = daily) */
.opp-expiry-tag { display: inline-block; font-size: 9px; font-weight: 700; padding: 0 4px; border-radius: 3px; margin-left: 4px; vertical-align: middle; line-height: 16px; }
.opp-expiry-w { background: color-mix(in srgb, #2196f3 15%, transparent); color: #2196f3; }
.opp-expiry-d { background: color-mix(in srgb, var(--md-sys-color-outline) 15%, transparent); color: var(--md-sys-color-on-surface-variant); }

.opp-trade-btn {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  color: #4caf50;
  border: 1px solid #4caf50;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  margin-left: 4px;
}
.opp-trade-btn:hover {
  background: #4caf50;
  color: #fff;
}

/* Trade instruction badges */
.opp-trade-instr { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.opp-trade-instr--buy { background: color-mix(in srgb, #4caf50 15%, transparent); color: #4caf50; }
.opp-trade-instr--sell { background: color-mix(in srgb, #f44336 15%, transparent); color: #f44336; }

/* Trade Drawer — slide-in panel */
.trade-drawer-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 10001;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.trade-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.trade-drawer {
  position: fixed; top: 0; right: -420px; width: 420px; height: 100vh;
  background: var(--md-sys-color-surface-container);
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  z-index: 10002; transition: right 0.3s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.trade-drawer.open { right: 0; }

.trade-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
}
.trade-drawer__header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.trade-drawer__close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant); padding: 4px 8px; border-radius: 6px;
}
.trade-drawer__close:hover { background: var(--md-sys-color-surface-container-high); }

.trade-drawer__body { padding: 16px 20px; flex: 1; }

.trade-drawer__section { margin-bottom: 16px; }
.trade-drawer__ticker { font-size: 18px; font-weight: 700; }
.trade-drawer__account { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.trade-drawer__buying-power { font-size: 11px; color: var(--md-sys-color-primary); margin-top: 4px; font-weight: 600; min-height: 16px; }
.trade-drawer__over-budget { font-size: 11px; color: #e65100; background: #fff3e0; padding: 6px 10px; border-radius: 6px; margin-top: 8px; font-weight: 500; }
body:not(.theme-light) .trade-drawer__over-budget { background: #4a2600; color: #ffb380; }
.trade-drawer__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 6px; }

.trade-drawer__legs { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 4px; }
.trade-drawer__legs th { text-align: left; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant); padding: 4px 6px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.trade-drawer__legs td { padding: 6px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }

.trade-drawer__form { display: flex; flex-direction: column; gap: 12px; }
.trade-drawer__row { display: flex; align-items: center; gap: 10px; }
.trade-drawer__row label { font-size: 12px; font-weight: 600; min-width: 80px; color: var(--md-sys-color-on-surface-variant); }
.trade-drawer__row select,
.trade-drawer__row input[type="number"] {
  flex: 1; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font-size: 13px; font-family: inherit;
}

.trade-drawer__leg-quote { font-size: 11px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

.trade-drawer__net-quote { padding: 10px 0; margin-bottom: 8px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.trade-drawer__quote-row { display: flex; gap: 16px; font-size: 13px; margin-top: 4px; }
.trade-drawer__quote-row strong { font-weight: 700; }
.trade-drawer__quote-click { cursor: pointer; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline-variant); transition: background 0.15s, border-color 0.15s; }
.trade-drawer__quote-click:hover { background: var(--md-sys-color-surface-container-high); border-color: var(--md-sys-color-primary); }
.trade-drawer__quote-static { padding: 2px 8px; border-radius: 6px; border: 1px solid transparent; }

.trade-drawer__header-actions { display: flex; align-items: center; gap: 4px; }
.trade-drawer__refresh { background: none; border: none; cursor: pointer; color: var(--md-sys-color-on-surface-variant); padding: 4px; border-radius: 6px; display: flex; align-items: center; }
.trade-drawer__refresh:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-primary); }

.trade-drawer__fees { border-top: 1px solid var(--md-sys-color-outline-variant); padding-top: 10px; margin-top: 8px; }
.trade-drawer__fee-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--md-sys-color-on-surface-variant); padding: 3px 0; }
.trade-drawer__fee-total { font-size: 13px; color: var(--md-sys-color-on-surface); padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.trade-drawer__fee-total strong { font-size: 15px; }

.trade-drawer__error {
  font-size: 12px; color: var(--md-sys-color-error, #f44336);
  background: color-mix(in srgb, var(--md-sys-color-error, #f44336) 10%, transparent);
  padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; display: none;
}
.trade-drawer__error.visible { display: block; }

.trade-drawer__actions { display: flex; gap: 10px; margin-top: 8px; }
.trade-drawer__actions .btn { flex: 1; padding: 10px; font-size: 13px; font-weight: 600; border-radius: 8px; cursor: pointer; border: none; }
.trade-drawer__place-btn {
  background: #4caf50; color: #fff; transition: background 0.15s;
}
.trade-drawer__place-btn:hover { background: #43a047; }
.trade-drawer__place-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.opp-pow-filter { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--md-sys-color-on-surface-variant); font-weight: 600; }
.opp-pow-filter label { white-space: nowrap; }
.opp-pow-slider { width: 140px; cursor: pointer; }
.opp-pow-value { min-width: 32px; text-align: right; color: var(--md-sys-color-primary); font-weight: 700; font-size: 12px; }
.opp-strike-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); font-weight: 600; }
.opp-strike-filter select { font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); cursor: pointer; width: auto; max-width: 200px; }
.opp-strike-warn { color: var(--md-sys-color-error, #d32f2f); font-weight: 600; cursor: help; }

/* Portfolio Alerts */
.portfolio-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.portfolio-alert { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.portfolio-alert .alert-icon { font-size: 16px; flex-shrink: 0; }
.portfolio-alert .alert-title { font-weight: 600; margin-right: 6px; }
.portfolio-alert .alert-dismiss { margin-left: auto; background: none; border: none; cursor: pointer; opacity: 0.6; font-size: 16px; padding: 2px 6px; color: inherit; }
.portfolio-alert .alert-dismiss:hover { opacity: 1; }
.portfolio-alert--moderate { background: var(--md-sys-color-secondary-container, #e8def8); color: var(--md-sys-color-on-secondary-container, #1d192b); }
.portfolio-alert--high { background: var(--md-sys-color-error-container, #f9dedc); color: var(--md-sys-color-on-error-container, #410e0b); }
.opp-recomputing { display: flex; align-items: center; gap: 8px; padding: 16px; color: var(--md-sys-color-on-surface-variant); font-size: 13px; }
.opp-recomputing .spinner { width: 14px; height: 14px; }

/* ── AI Insights ── */

/* AI action icon in Act column */
.ai-action-icon {
  font-size: 18px; cursor: pointer; color: #6366f1; opacity: 0.6;
  transition: opacity 0.15s; vertical-align: middle;
}
.ai-action-icon:hover { opacity: 1; }

/* AI Position drawer (slide from right) */
.ai-drawer {
  position: fixed; top: 0; right: -440px; width: 440px; height: 100vh;
  background: var(--md-sys-color-surface, #fff);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 1100; transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.ai-drawer.open { right: 0; }

.ai-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.ai-drawer__header h3 {
  margin: 0; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-drawer__header h3 .material-symbols-outlined { color: #6366f1; font-size: 20px; flex-shrink: 0; }
.ai-drawer__close {
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 6px; color: var(--md-sys-color-on-surface-variant); flex-shrink: 0;
}
.ai-drawer__close:hover { background: var(--md-sys-color-surface-container-high); }

.ai-drawer__body {
  flex: 1; overflow-y: auto; padding: 20px;
}

.ai-drawer__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 1099; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.ai-drawer__backdrop.open { opacity: 1; pointer-events: auto; }

.ai-insight-card {
  padding: 12px 14px;
}
.ai-generate-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px; background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: background 0.15s;
}
.ai-generate-btn:hover { background: var(--md-sys-color-surface-container-high); }
.ai-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-generate-btn .material-symbols-outlined { font-size: 16px; color: #6366f1; }

.ai-loading {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; color: var(--md-sys-color-on-surface-variant); font-size: 13px;
}

.ai-insight-text {
  border-left: 3px solid #6366f1; padding: 10px 14px; margin: 8px 0;
  background: rgba(99, 102, 241, 0.05); border-radius: 0 8px 8px 0;
  font-size: 13px; line-height: 1.6; color: var(--md-sys-color-on-surface);
  white-space: pre-wrap;
}
.ai-insight-text p { margin: 0 0 8px; }
.ai-insight-text p:last-child { margin-bottom: 0; }

.ai-insight-footer {
  display: flex; align-items: center; gap: 12px; padding: 6px 0 2px;
}
.ai-usage-bar { margin-top: 12px; }
.ai-usage-bar__track {
  height: 4px; border-radius: 2px; background: var(--md-sys-color-surface-container-high);
  overflow: hidden;
}
.ai-usage-bar__fill {
  height: 100%; border-radius: 2px; background: #6366f1;
  transition: width 0.3s ease;
}
.ai-usage-bar__text {
  display: block; margin-top: 4px;
  font-size: 11px; color: var(--md-sys-color-on-surface-variant);
}

/* AI History */
.ai-history-list { max-height: 400px; overflow-y: auto; }
.ai-history-empty {
  padding: 16px 0; text-align: center;
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
}
.ai-history-loading { padding: 12px 0; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.ai-history-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--md-sys-color-outline-variant);
  margin-bottom: 6px; transition: background 0.12s;
}
.ai-history-item:last-child { margin-bottom: 0; }
.ai-history-item:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 4%, transparent); }
.ai-history-item.expanded { background: var(--md-sys-color-surface-container); }
.ai-history-item__header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ai-history-item__label {
  font-size: 13px; font-weight: 600; color: var(--md-sys-color-on-surface);
}
.ai-history-item__meta {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap;
}
.ai-history-item__preview {
  margin-top: 4px; font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-history-item__full {
  margin-top: 8px; font-size: 12px; line-height: 1.6;
  color: var(--md-sys-color-on-surface); white-space: pre-wrap;
  border-left: 3px solid #6366f1; padding: 8px 12px;
  background: rgba(99, 102, 241, 0.04); border-radius: 0 6px 6px 0;
}
.ai-history-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 0 0; margin-top: 8px;
}
.ai-history-pager__info { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
.ai-insight-time { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
.ai-regenerate-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 6px; background: none; color: var(--md-sys-color-on-surface-variant);
  cursor: pointer; font-size: 11px; transition: background 0.15s;
}
.ai-regenerate-btn:hover { background: var(--md-sys-color-surface-container); }
.ai-regenerate-btn .material-symbols-outlined { font-size: 14px; }

.ai-error {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--md-sys-color-error-container, #f9dedc);
  color: var(--md-sys-color-on-error-container, #410e0b);
  border-radius: 8px; font-size: 13px;
}
.ai-error .material-symbols-outlined { font-size: 18px; }

/* AI Portfolio button (inline in section title row) */
.ai-portfolio-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border: 1px solid #6366f1;
  border-radius: 6px; background: rgba(99, 102, 241, 0.08);
  color: #6366f1; cursor: pointer; margin-left: auto;
  font-size: 12px; font-weight: 600; transition: background 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.ai-portfolio-btn:hover { background: rgba(99, 102, 241, 0.16); }
.ai-portfolio-btn .material-symbols-outlined { font-size: 16px; }

/* AI Portfolio slide-out panel */
.ai-portfolio-panel {
  position: fixed; top: 0; right: -420px; width: 420px; height: 100vh;
  background: var(--md-sys-color-surface, #fff);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 1100; transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.ai-portfolio-panel.open { right: 0; }

.ai-portfolio-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.ai-portfolio-panel__header h3 {
  margin: 0; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.ai-portfolio-panel__header h3 .material-symbols-outlined { color: #6366f1; font-size: 20px; }
.ai-portfolio-panel__close {
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 6px; color: var(--md-sys-color-on-surface-variant);
}
.ai-portfolio-panel__close:hover { background: var(--md-sys-color-surface-container-high); }

.ai-portfolio-panel__body {
  flex: 1; overflow-y: auto; padding: 20px;
}
.ai-portfolio-panel__body .ai-insight-text { white-space: pre-wrap; }

.ai-portfolio-panel__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 1099; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.ai-portfolio-panel__backdrop.open { opacity: 1; pointer-events: auto; }

/* ── Alert Action Panel ──────────────────────────────── */
.alert-action-panel {
  position: fixed; top: 0; right: -520px; width: 520px; max-width: calc(100vw - 48px);
  height: 100vh; background: var(--md-sys-color-surface, #fff);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 1100; transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.alert-action-panel.open { right: 0; }

.alert-action-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.alert-action-panel__header h3 {
  margin: 0; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.alert-action-panel__header h3 .material-symbols-outlined { color: var(--md-sys-color-error); font-size: 20px; }
.alert-action-panel__close {
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 6px; color: var(--md-sys-color-on-surface-variant);
}
.alert-action-panel__close:hover { background: var(--md-sys-color-surface-container-high); }

.alert-action-panel__body {
  flex: 1; overflow-y: auto; padding: 20px;
}

.alert-action-panel__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 1099; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.alert-action-panel__backdrop.open { opacity: 1; pointer-events: auto; }

/* ── Roll Center Panel ──────────────────────────────── */

/* Design tokens */
.roll-center-panel {
  --roll-panel-width: 680px;
  --roll-panel-bg: var(--md-sys-color-surface);
  --roll-header-bg: color-mix(in srgb, var(--md-sys-color-surface-container) 80%, var(--md-sys-color-primary) 5%);
  --roll-card-bg: var(--md-sys-color-surface-container);
  --roll-card-border: var(--md-sys-color-outline-variant);
  --roll-card-hover-shadow: 0 4px 16px rgba(0,0,0,0.12);
  --roll-card-selected-border: var(--md-sys-color-primary);
  --roll-metric-label: var(--md-sys-color-on-surface-variant);
  --roll-metric-value: var(--md-sys-color-on-surface);
  --roll-credit: #22c55e;
  --roll-debit: #ef4444;
  --roll-improved-bg: rgba(34, 197, 94, 0.12);
  --roll-improved-text: #22c55e;
  --roll-worsened-bg: rgba(239, 68, 68, 0.12);
  --roll-worsened-text: #ef4444;
}

/* Panel shell */
.roll-center-panel {
  position: fixed; top: 0; right: calc(var(--roll-panel-width) * -1); width: var(--roll-panel-width);
  max-width: calc(100vw - 48px); height: 100vh;
  background: var(--roll-panel-bg);
  border-left: none;
  box-shadow: -6px 0 32px rgba(0,0,0,0.18);
  z-index: 1100; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.roll-center-panel.open { right: 0; }

/* Header */
.roll-center-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: var(--roll-header-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent);
}
.roll-center-panel__header h3 {
  margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.roll-center-panel__header h3 .material-symbols-outlined {
  color: var(--md-sys-color-primary); font-size: 24px; font-weight: 400;
}
.roll-center-panel__header-actions { display: flex; align-items: center; gap: 2px; }
.roll-center-panel__header-btn {
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 6px; color: var(--md-sys-color-on-surface-variant);
  transition: background 0.15s, color 0.15s;
}
.roll-center-panel__header-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.roll-center-panel__close {
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 6px; color: var(--md-sys-color-on-surface-variant);
  transition: background 0.15s;
}
.roll-center-panel__close:hover { background: var(--md-sys-color-surface-container-high); }

/* Toolbar / Filters */
.roll-center-panel__toolbar {
  display: flex; align-items: center; gap: 4px 10px; padding: 8px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
  flex-wrap: wrap;
}
.roll-toolbar__field { display: flex; align-items: center; gap: 4px; }
.roll-toolbar__label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--roll-metric-label); white-space: nowrap;
}
.roll-center-panel__toolbar .toolbar-select {
  height: 28px; font-size: 11px; min-width: 0; width: auto; padding: 0 22px 0 7px;
}

/* Preset bar */
.roll-center-panel__preset-bar {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
}
.roll-center-panel__preset-bar .toolbar-select { min-width: 160px; }
.roll-preset-wrapper { display: flex; align-items: center; gap: 3px; }
.roll-preset-save-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--roll-card-border); border-radius: 6px;
  background: var(--roll-panel-bg); color: var(--roll-metric-label);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.roll-preset-save-btn:hover {
  background: var(--md-sys-color-primary); color: #fff;
  border-color: var(--md-sys-color-primary);
}
.roll-reset-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 0 10px; height: 28px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 6px; background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface-variant); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.roll-reset-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

/* Summary stats */
.roll-center-panel__summary {
  display: flex; align-items: stretch; gap: 0; padding: 0;
  background: var(--roll-header-bg); font-size: 13px;
  border-bottom: 1px solid var(--roll-card-border);
  flex-wrap: wrap;
}
.roll-summary__stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px;
  border-right: 1px solid color-mix(in srgb, var(--roll-card-border) 50%, transparent);
}
.roll-summary__stat:last-of-type { border-right: none; }
.roll-summary__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--roll-metric-label); font-weight: 700;
}
.roll-summary__value {
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.roll-summary__divider { display: none; }

/* Body */
.roll-center-panel__body {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}

/* Backdrop */
.roll-center-panel__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 1099; opacity: 0; pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.roll-center-panel__backdrop.open { opacity: 1; pointer-events: auto; }

/* Roll Center trigger button */
.roll-center-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-primary);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s; flex-shrink: 0; margin-left: 4px;
}
.roll-center-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}
.roll-center-btn .material-symbols-outlined { font-size: 16px; }

/* Split legs toggle */
.roll-split-toggle {
  min-width: 72px; text-align: center; height: 28px; padding: 0 12px;
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.roll-split-toggle.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

/* ── Roll Cards ─────────────────────────────────────── */
.roll-card {
  border: 1px solid var(--roll-card-border);
  border-radius: 10px; padding: 14px 16px;
  background: var(--roll-card-bg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.roll-card:hover { box-shadow: var(--roll-card-hover-shadow); }

/* Card header */
.roll-card__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px;
}
.roll-card__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: -0.01em;
  min-width: 0;
}
.roll-card__urgency {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 20%, transparent);
}
.roll-card__urgency--red { background: #ef4444; color: #ef4444; }
.roll-card__urgency--yellow { background: #f59e0b; color: #f59e0b; }
.roll-card__urgency--green { background: #22c55e; color: #22c55e; }
.roll-card__stock-price {
  font-size: 12px; font-weight: 500; color: var(--roll-metric-label);
  margin-left: 2px; font-variant-numeric: tabular-nums;
}

/* Refresh button */
.roll-refresh-btn { display: inline-flex; align-items: center; justify-content: center; }
.roll-refresh-btn--spinning .material-symbols-outlined { animation: roll-spin 0.8s linear infinite; }
@keyframes roll-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Badges */
.roll-card__badges { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.roll-card__dte, .roll-card__pnl {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px;
  background: var(--md-sys-color-surface-container-high);
  white-space: nowrap; font-variant-numeric: tabular-nums;
  border: 1px solid color-mix(in srgb, var(--roll-card-border) 60%, transparent);
}
.roll-card__dte { color: var(--roll-metric-label); }
.roll-card__pnl { font-size: 11px; }

/* Legs container */
.roll-card__legs {
  border: 1px solid var(--roll-card-border);
  border-radius: 8px; margin-bottom: 10px; overflow: hidden;
  font-size: 12px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--roll-panel-bg) 50%, var(--roll-card-bg) 50%);
}

/* Leg — new stacked layout */
.roll-card__leg {
  display: flex; flex-direction: column; gap: 0;
  padding: 0;
}
.roll-card__leg + .roll-card__leg { border-top: 1px solid var(--roll-card-border); }

/* Row 1: description + P&L */
.roll-card__leg-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; gap: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--roll-card-border) 40%, transparent);
}
.roll-card__leg-desc {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; font-weight: 600; font-size: 12px;
  color: var(--roll-metric-value);
}
.roll-card__leg-pnl {
  white-space: nowrap; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

/* Row 2: metrics grid */
.roll-card__leg-metrics {
  display: flex; align-items: stretch; gap: 0;
  padding: 0;
}
.roll-card__leg-metric {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; padding: 6px 8px;
  border-right: 1px solid color-mix(in srgb, var(--roll-card-border) 40%, transparent);
}
.roll-card__leg-metric:last-child { border-right: none; }
.roll-card__leg-metric-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--roll-metric-label);
  line-height: 1;
}

/* Strike selector inside metric */
.roll-card__strike-select {
  font-size: 12px; font-weight: 700; margin: 0;
  padding: 1px 4px; border: 1px solid var(--roll-card-border);
  border-radius: 4px; background: var(--roll-panel-bg); cursor: pointer;
  color: var(--md-sys-color-primary); width: 64px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.roll-card__expiry-select { width: 110px; }
.roll-card__strike-select:focus {
  outline: none; border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent);
}
.roll-card__strike-fixed {
  font-size: 12px; font-weight: 700; color: var(--roll-metric-label);
  text-align: center; font-variant-numeric: tabular-nums;
}

/* Credit/quote display inside metric */
.roll-card__leg-quote {
  white-space: nowrap; font-weight: 700; font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Greeks row — hidden in old grid, kept for backward compat */
.roll-card__leg-greeks {
  white-space: nowrap; color: var(--roll-metric-label);
  font-size: 11px; text-align: right;
}

/* Greeks change — promoted section */
.roll-card__greeks-change {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 7px 12px;
  font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--roll-metric-value);
  border-top: 1px solid color-mix(in srgb, var(--roll-card-border) 40%, transparent);
  background: color-mix(in srgb, var(--roll-card-bg) 80%, var(--roll-panel-bg) 20%);
}

/* Metric pills (good/bad indicators) */
.roll-card__metric-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.roll-card__metric-pill--good {
  background: var(--roll-improved-bg); color: var(--roll-improved-text);
}
.roll-card__metric-pill--bad {
  background: var(--roll-worsened-bg); color: var(--roll-worsened-text);
}

/* Breakeven row */
.roll-card__breakeven {
  font-size: 12px; padding: 6px 12px;
  font-variant-numeric: tabular-nums;
  color: var(--roll-metric-value);
  border-top: 1px solid color-mix(in srgb, var(--roll-card-border) 40%, transparent);
}
.roll-card__leg-be {
  font-size: 12px; padding: 6px 12px;
  font-variant-numeric: tabular-nums;
  color: var(--roll-metric-value);
  border-top: 1px solid color-mix(in srgb, var(--roll-card-border) 40%, transparent);
}

/* Card footer */
.roll-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 6px; gap: 8px;
}

/* Net credit/debit — prominent */
.roll-card__net {
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.roll-card__net--credit { color: var(--roll-credit); }
.roll-card__net--debit { color: var(--roll-debit); }

/* Warnings */
.roll-card__strike-warning {
  font-size: 11px; color: #f59e0b;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin-top: 4px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 6px; border: 1px solid rgba(245, 158, 11, 0.15);
}
.roll-card__earnings-warning {
  font-size: 11px; color: #f59e0b;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin-top: 4px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 6px; border: 1px solid rgba(245, 158, 11, 0.15);
}

/* Actions */
.roll-card__actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

/* Loading state */
.roll-card__loading {
  font-size: 11px; color: var(--roll-metric-label);
  font-style: italic; padding: 4px 0;
}

/* Skeleton card */
.roll-card--skeleton {
  border: 1px solid var(--roll-card-border);
  border-radius: 10px; padding: 14px 16px; height: 100px;
  background: var(--roll-card-bg);
  animation: roll-skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes roll-skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

/* Empty state */
.roll-empty {
  text-align: center; padding: 48px 24px;
  color: var(--roll-metric-label); font-size: 14px;
}

/* Checkbox & selection */
.roll-card__checkbox {
  width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;
  accent-color: var(--md-sys-color-primary);
}
.roll-card--selected {
  border-color: var(--roll-card-selected-border);
  background: color-mix(in srgb, var(--md-sys-color-primary) 5%, var(--roll-card-bg));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}

/* Summary row layout */
.roll-summary__row { display: flex; align-items: center; gap: 0; width: 100%; padding-left: 12px; }
.roll-summary__selected-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 16px;
  border-top: 1px solid var(--roll-card-border);
}
.roll-summary__sel-count {
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.roll-bulk-action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--md-sys-color-primary); color: #fff;
  border-radius: 6px; background: var(--md-sys-color-primary); cursor: pointer;
  transition: opacity 0.15s;
}
.roll-bulk-action-btn:hover { opacity: 0.88; }

/* Roll confirmation view */
.roll-confirm { display: flex; flex-direction: column; gap: 14px; }
.roll-confirm__title { font-size: 15px; font-weight: 800; }
.roll-confirm__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.roll-confirm__th {
  padding: 8px 10px; font-weight: 700; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--roll-metric-label);
  border-bottom: 2px solid var(--roll-card-border);
}
.roll-confirm__cell {
  padding: 8px 10px; border-bottom: 1px solid var(--roll-card-border);
  font-variant-numeric: tabular-nums; font-size: 12px;
}
.roll-confirm__status { width: 50px; }
.roll-confirm__error {
  font-size: 13px; color: var(--roll-debit); padding: 10px 12px;
  background: var(--roll-worsened-bg); border-radius: 8px;
}
body:not(.theme-light) .roll-confirm__error { background: #3b1114; color: #f2b8b5; }
.roll-confirm__actions {
  display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px;
  border-top: 1px solid var(--roll-card-border);
}

/* ── Close Winning panel ────────────────────────────── */
.cw-panel {
  position: fixed; top: 0; right: -520px; width: 500px; max-width: 95vw; height: 100vh;
  background: var(--md-sys-color-surface); border-left: 1px solid var(--md-sys-color-outline-variant);
  z-index: 200; transition: right 0.25s ease; display: flex; flex-direction: column; box-shadow: -2px 0 16px rgba(0,0,0,0.15);
}
.cw-panel.open { right: 0; }

.cw-panel__header {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.cw-panel__header h3 {
  margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.cw-panel__header h3 .material-symbols-outlined { color: #4caf50; font-size: 22px; }
.cw-panel__header-actions { display: flex; align-items: center; gap: 4px; }
.cw-panel__header-btn {
  background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px;
  color: var(--md-sys-color-on-surface-variant); display: flex; align-items: center;
}
.cw-panel__header-btn:hover { background: var(--md-sys-color-surface-container-high); }
.cw-panel__close {
  background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px;
  color: var(--md-sys-color-on-surface-variant); display: flex; align-items: center;
}
.cw-panel__close:hover { background: var(--md-sys-color-surface-container-high); }

.cw-panel__toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.cw-toolbar__field { display: flex; align-items: center; gap: 5px; }
.cw-toolbar__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }
.cw-panel__toolbar .toolbar-select { height: 30px; font-size: 12px; min-width: 0; width: auto; padding: 0 24px 0 8px; }

.cw-gain-slider { display: flex; align-items: center; gap: 8px; }
.cw-gain-slider__input { width: 100px; accent-color: #4caf50; }
.cw-gain-slider__value { font-size: 13px; font-weight: 600; color: #4caf50; min-width: 32px; }

.cw-panel__summary {
  padding: 10px 16px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex; flex-direction: column; gap: 6px;
}
.cw-summary__row { display: flex; align-items: center; gap: 16px; width: 100%; }
.cw-summary__stat { display: flex; flex-direction: column; gap: 3px; }
.cw-summary__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant); font-weight: 600; }
.cw-summary__value { font-size: 15px; font-weight: 700; }
.cw-summary__divider { width: 1px; height: 28px; background: var(--md-sys-color-outline-variant); }
.cw-summary__selected-row {
  display: flex; justify-content: space-between; align-items: center; padding-top: 6px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.cw-summary__sel-count { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.cw-panel__body {
  flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px;
}

.cw-panel__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 199;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.cw-panel__backdrop.open { opacity: 1; pointer-events: auto; }

.cw-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: color-mix(in srgb, #4caf50 12%, var(--md-sys-color-surface));
  color: #4caf50; border: 1px solid color-mix(in srgb, #4caf50 25%, transparent);
  flex-shrink: 0; margin-left: 4px;
}
.cw-btn:hover {
  background: color-mix(in srgb, #4caf50 20%, var(--md-sys-color-surface));
  border-color: #4caf50;
}
.cw-btn .material-symbols-outlined { font-size: 16px; }

.cw-card {
  background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.cw-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.cw-card--selected { border-color: var(--md-sys-color-primary); background: color-mix(in srgb, var(--md-sys-color-primary) 4%, var(--md-sys-color-surface-container)); }
.cw-card--error { opacity: 0.5; }

.cw-card__header { display: flex; justify-content: space-between; align-items: center; }
.cw-card__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.cw-card__checkbox { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: var(--md-sys-color-primary); }
.cw-card__badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.cw-card__badge--strategy { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.cw-card__badge--gain { background: color-mix(in srgb, #4caf50 15%, transparent); color: #4caf50; }

.cw-card__pnl { text-align: right; }
.cw-card__pnl-value { font-size: 13px; font-weight: 600; color: #4caf50; }
.cw-card__close-cost { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }

.cw-card__legs {
  display: flex; flex-direction: column; border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 6px; overflow: hidden; font-size: 12px;
}
.cw-card__leg {
  display: flex; gap: 12px; padding: 5px 10px; align-items: center;
  color: var(--md-sys-color-on-surface-variant);
}
.cw-card__leg + .cw-card__leg { border-top: 1px solid var(--md-sys-color-outline-variant); }

.cw-card__details { display: flex; gap: 16px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); flex-wrap: wrap; }

.cw-card--skeleton {
  height: 80px; border-radius: 10px; background: linear-gradient(90deg, var(--md-sys-color-surface-container) 25%, var(--md-sys-color-surface-container-high) 50%, var(--md-sys-color-surface-container) 75%);
  background-size: 200% 100%; animation: roll-spin 1.5s ease-in-out infinite;
}

.cw-confirm { display: flex; flex-direction: column; gap: 14px; }
.cw-confirm__title { font-size: 15px; font-weight: 700; }
.cw-confirm__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cw-confirm__th {
  text-align: left; padding: 6px 8px; font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.cw-confirm__cell {
  padding: 8px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  vertical-align: middle;
}
.cw-confirm__status { width: 50px; }
.cw-confirm__error {
  background: color-mix(in srgb, #f44336 10%, var(--md-sys-color-surface));
  color: #f44336; padding: 8px 12px; border-radius: 6px; font-size: 13px;
}
.cw-confirm__actions {
  display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px;
}

.cw-bulk-action-btn {
  background: #4caf50; color: #fff; font-weight: 600; font-size: 12px; border: none;
  padding: 6px 16px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.cw-bulk-action-btn:hover { opacity: 0.9; }

.cw-empty { text-align: center; padding: 40px 16px; color: var(--md-sys-color-on-surface-variant); }
.cw-empty__icon { font-size: 48px; color: #4caf50; opacity: 0.5; }
.cw-empty__text { font-size: 14px; margin-top: 8px; }

@keyframes cw-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.cw-refresh-btn--spinning .material-symbols-outlined { animation: cw-spin 0.8s linear infinite; }

/* Alert panel summary */
.alert-panel__summary {
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 16px; line-height: 1.5;
}
.alert-panel__target {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);
}

/* Alert panel progress bar */
.alert-panel__progress {
  margin-bottom: 20px; padding: 12px; border-radius: 8px;
  background: var(--md-sys-color-surface-container);
}
.alert-panel__progress-labels {
  display: flex; justify-content: space-between; font-size: 12px; font-weight: 600;
  margin-bottom: 6px; color: var(--md-sys-color-on-surface-variant);
}
.alert-panel__progress-bar {
  height: 6px; border-radius: 3px; background: var(--md-sys-color-surface-variant); position: relative;
}
.alert-panel__progress-fill {
  height: 100%; border-radius: 3px; transition: width 0.3s;
}
.alert-panel__progress-fill--danger { background: var(--md-sys-color-error); }
.alert-panel__progress-fill--warning { background: #f59e0b; }
.alert-panel__progress-fill--ok { background: var(--md-sys-color-primary); }

/* Alert panel section headings */
.alert-panel__section-heading {
  font-size: 14px; font-weight: 700; margin: 20px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.alert-panel__section-sub {
  font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 10px;
}

/* Alert panel diagnosis table */
.alert-panel__table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px;
}
.alert-panel__table th {
  text-align: left; padding: 6px 8px; font-weight: 600; font-size: 11px;
  color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
}
.alert-panel__table td {
  padding: 6px 8px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.alert-panel__table tr.highlight { background: rgba(239, 68, 68, 0.06); }
.alert-panel__table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Alert panel recommendation cards */
.alert-panel__rec {
  padding: 12px; margin-bottom: 8px; border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
}
.alert-panel__rec-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px;
}
.alert-panel__rec-desc { font-size: 13px; font-weight: 600; }
.alert-panel__rec-impact {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; font-weight: 600;
  background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);
}
.alert-panel__rec-after {
  font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 8px;
}
.alert-panel__rec-actions {
  display: flex; gap: 8px; align-items: center;
}
.alert-panel__rec-divider {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--md-sys-color-on-surface-variant);
  margin: 16px 0 8px; padding-top: 16px; border-top: 1px dashed var(--md-sys-color-outline-variant);
}
.alert-panel__note {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant); font-style: italic; margin-top: 8px;
}

/* Make alert bars clickable */
.portfolio-alert { cursor: pointer; transition: background 0.15s; }
.portfolio-alert:hover { filter: brightness(0.97); }

/* AI Trade Suggestion Cards */
.ai-trades-section {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.ai-trades-header {
  font-size: 13px; font-weight: 700; color: #6366f1;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.ai-trades-header .material-symbols-outlined { font-size: 16px; }

.ai-trade-card {
  background: var(--md-sys-color-surface-container-low, #f8f8fa);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-left: 3px solid #6366f1;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
}
.ai-trade-card:last-child { margin-bottom: 0; }

.ai-trade-label {
  font-size: 13px; font-weight: 700; color: var(--md-sys-color-on-surface);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px;
}
.ai-trade-reason {
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 8px; line-height: 1.4;
}
.ai-trade-details {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px;
}
.ai-trade-leg {
  font-size: 12px; color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums; padding: 3px 6px;
  background: var(--md-sys-color-surface-container, #eee);
  border-radius: 4px; display: inline-block;
}
.ai-trade-price {
  font-size: 13px; font-weight: 700; margin: 6px 0 8px;
  padding: 4px 10px; border-radius: 4px; display: inline-block;
}
.ai-trade-price.credit {
  color: #16a34a; background: rgba(22, 163, 74, 0.08);
}
.ai-trade-price.debit {
  color: #dc2626; background: rgba(220, 38, 38, 0.08);
}
.ai-trade-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* Impersonation banner */
.impersonation-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-warning, #f59e0b);
  color: #000;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1000;
}

.impersonation-banner .btn-danger {
  margin-left: auto;
}

/* Inline filter row */
.form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-row__input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--md-outline, #ccc);
  border-radius: var(--radius-sm, 0.375rem);
  font-size: 0.85rem;
  background: var(--md-surface, #fff);
  color: var(--md-on-surface, #1c1b1f);
  min-width: 0;
  flex: 1 1 120px;
}

.form-row__input--sm {
  flex: 0 0 70px;
  max-width: 70px;
}

/* ═══════════════════════════════════════════════════════
   Watchlists (wl-) — monitoring hub
   ═══════════════════════════════════════════════════════ */

/* Tab bar */
.wl-tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  scrollbar-width: none;
}
.wl-tab-bar::-webkit-scrollbar { display: none; }

.wl-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.wl-tabs::-webkit-scrollbar { display: none; }

.wl-tab {
  background: none;
  border: none;
  padding: 0.625rem 1.25rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.wl-tab:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container);
}
.wl-tab.wl-tab-active {
  color: var(--md-sys-color-primary);
  border-bottom-color: var(--md-sys-color-primary);
  font-weight: 600;
}

.wl-tab-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
.wl-tab-new {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  padding: 0.625rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  white-space: nowrap;
}
.wl-tab-new:hover { background: var(--md-sys-color-surface-container); }
.wl-tab-new .material-symbols-outlined { font-size: 1.1rem; }

.wl-system-badge {
  font-size: 0.65rem;
  padding: 1px 5px;
  margin-left: 6px;
  border-radius: 3px;
  background: var(--surface-3, #334155);
  color: var(--text-muted, #94a3b8);
  vertical-align: middle;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.wl-positions-badge {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  background: var(--color-success-bg, #e6f9ee);
  color: var(--color-success, #1a7f43);
}

/* Controls bar */
.wl-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.wl-controls-left, .wl-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.wl-btn:hover { background: var(--md-sys-color-surface-container); }
.wl-btn:disabled { opacity: 0.4; cursor: default; }
.wl-btn .material-symbols-outlined { font-size: 1rem; }

.wl-btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
}
.wl-btn-primary:hover { filter: brightness(1.1); background: var(--md-sys-color-primary); }

.wl-btn-danger {
  color: var(--md-sys-color-error);
  border-color: var(--md-sys-color-error);
}
.wl-btn-danger:hover { background: color-mix(in srgb, var(--md-sys-color-error) 8%, transparent); }

.wl-btn-sm {
  height: 28px;
  padding: 0 8px;
  font-size: 0.75rem;
}
.wl-btn-sm .material-symbols-outlined { font-size: 0.9rem; }

/* Sync / Refresh */
.wl-sync-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.wl-sync-label {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
}
.wl-sync-select {
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 0.8rem;
}

.wl-refresh-btn { position: relative; }
.wl-countdown {
  font-size: 0.65rem;
  color: var(--md-sys-color-on-surface-variant);
  min-width: 22px;
  text-align: center;
}

/* Column toggle dropdown */
.wl-col-toggle-wrap { position: relative; }
.wl-chevron {
  font-size: 1rem !important;
  transition: transform 0.2s;
}
.wl-col-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 500;
  background: var(--md-sys-color-surface-container, #2b2b2b);
  border: 1px solid var(--md-sys-color-outline-variant, #444);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  padding: 0.5rem;
  min-width: 200px;
  margin-top: 4px;
}
.wl-col-panel.wl-col-panel-open { display: block; }

.wl-col-option[draggable] {
  cursor: grab;
}
.wl-col-option {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--md-sys-color-on-surface);
}
.wl-col-option:hover { background: var(--md-sys-color-surface-container-highest); }
.wl-col-drag-handle {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.4;
  cursor: grab;
}
.wl-col-option:hover .wl-col-drag-handle { opacity: 0.8; }
.wl-col-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  cursor: pointer;
}
.wl-col-label input[type="checkbox"] {
  accent-color: var(--md-sys-color-primary);
}
.wl-col-dragging { opacity: 0.4; }
.wl-col-drop-above { border-top: 2px solid var(--md-sys-color-primary); }

/* Loading / Error / Empty states */
.wl-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--md-sys-color-on-surface-variant);
}
.wl-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  color: var(--md-sys-color-error);
  flex-wrap: wrap;
}
.wl-error .material-symbols-outlined { font-size: 1.5rem; }
.wl-error-msg { flex: 1; margin: 0; }

.wl-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--md-sys-color-on-surface-variant);
}
.wl-empty-icon {
  font-size: 3rem;
  color: var(--md-sys-color-outline);
  margin-bottom: 0.5rem;
  display: block;
}
.wl-empty h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--md-sys-color-on-surface);
}
.wl-empty p {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

/* Data table */
.wl-table-wrap {
  overflow-x: auto;
  margin-top: 0.25rem;
}

.wl-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow: visible;  /* override material.css table { overflow: hidden } for sticky support */
}

.wl-data-table th {
  text-align: left;
  padding: 4px 8px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  border-right: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
  background: color-mix(in srgb, var(--md-sys-color-surface-variant) 40%, var(--md-sys-color-surface));
  white-space: nowrap;
  user-select: none;
}

/* Group header row */
.wl-group-header {
  text-align: center !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--md-sys-color-primary);
  padding: 3px 10px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.wl-cell-rowspan {
  border-bottom: none;
}

.wl-data-table th.wl-sortable { cursor: pointer; }
.wl-data-table th.wl-sortable:hover { color: var(--md-sys-color-on-surface); }
.wl-data-table th.wl-sortable::after { content: '\21C5'; margin-left: 3px; opacity: 0.3; font-size: 0.65rem; }
.wl-data-table th.wl-sort-asc::after { content: '\2191'; opacity: 1; }
.wl-data-table th.wl-sort-desc::after { content: '\2193'; opacity: 1; }
.wl-data-table th.wl-sort-asc,
.wl-data-table th.wl-sort-desc { color: var(--md-sys-color-primary); }

.wl-data-table td {
  padding: 2px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 30%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}
.wl-data-table tr[data-symbol] { cursor: pointer; }
.wl-data-table tr:hover td {
  background: var(--md-sys-color-surface-container);
}

/* Ticker cell — frozen on horizontal scroll */
.wl-data-table td.wl-cell-ticker,
.wl-data-table th.wl-cell-ticker {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  padding-right: 24px !important;
}
.wl-data-table td.wl-cell-ticker {
  z-index: 2;
  background: var(--md-sys-color-surface);
  overflow: visible;
}
.wl-data-table th.wl-cell-ticker {
  z-index: 3;
  background: color-mix(in srgb, var(--md-sys-color-surface-variant) 40%, var(--md-sys-color-surface));
}
.wl-data-table tr:hover td.wl-cell-ticker {
  background: var(--md-sys-color-surface-container);
}
.wl-ticker-symbol {
  font-weight: 700;
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
}
.wl-ticker-name {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-quick-remove {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--md-sys-color-outline);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.wl-data-table tr:hover .wl-quick-remove { opacity: 1; }
.wl-quick-remove:hover { color: var(--md-sys-color-error); }

/* Color coding */
.wl-positive { color: #16a34a; }
.wl-negative { color: #dc2626; }
.theme-light .wl-positive { color: #15803d; }
.theme-light .wl-negative { color: #b91c1c; }

/* Extended hours badge */
.wl-ext-badge { font-size: 0.7rem; font-weight: 600; padding: 1px 5px; border-radius: 3px; }
.wl-ext-ah { background: #1e3a5f; color: #60a5fa; }
.wl-ext-pm { background: #3b1f5e; color: #c084fc; }
.theme-light .wl-ext-ah { background: #dbeafe; color: #1d4ed8; }
.theme-light .wl-ext-pm { background: #f3e8ff; color: #7c3aed; }

/* IV rank badge (matches scanner style) */
.wl-ivr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  min-width: 28px;
}
.wl-ivr-very-high { background: #dcfce7; color: #166534; }
.wl-ivr-high { background: #fef9c3; color: #854d0e; }
.wl-ivr-moderate { background: #ffedd5; color: #9a3412; }
.wl-ivr-low { background: #fee2e2; color: #991b1b; }
body:not(.theme-light) .wl-ivr-very-high { background: #14532d; color: #86efac; }
body:not(.theme-light) .wl-ivr-high { background: #713f12; color: #fde047; }
body:not(.theme-light) .wl-ivr-moderate { background: #7c2d12; color: #fdba74; }
body:not(.theme-light) .wl-ivr-low { background: #7f1d1d; color: #fca5a5; }
.wl-ivr-iv {
  font-size: 9px;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: 4px;
}
.theme-light .wl-col-panel { background: var(--md-sys-color-surface-container, #f5f5f5); border-color: var(--md-sys-color-outline-variant, #ccc); }

/* Earnings highlighting */
.wl-earnings-soon td { background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 20%, transparent); }
.wl-earnings-highlight { font-weight: 600; color: var(--md-sys-color-tertiary); }

/* Earnings icon on ticker */
.wl-earnings-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--md-sys-color-tertiary, #7c4dff);
  border-radius: 3px;
  padding: 0 3px;
  vertical-align: middle;
  line-height: 14px;
}

/* Days-until badges */
.wl-days-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.wl-days-red { background: color-mix(in srgb, #dc2626 15%, transparent); color: #dc2626; }
.wl-days-yellow { background: color-mix(in srgb, #d97706 15%, transparent); color: #d97706; }
.wl-days-green { background: color-mix(in srgb, #16a34a 15%, transparent); color: #16a34a; }

/* Quick filter */
.wl-filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm, 6px);
  background: var(--md-sys-color-surface);
  flex: 0 1 180px;
}
.wl-filter-icon {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.4;
}
.wl-filter-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  color: var(--md-sys-color-on-surface);
  width: 100%;
  min-width: 0;
}
.wl-filter-bar input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.5;
}

/* Consensus badges */
.wl-consensus-buy,
.wl-consensus-strongbuy { color: #16a34a; font-weight: 600; }
.wl-consensus-sell,
.wl-consensus-strongsell { color: #dc2626; font-weight: 600; }
.wl-consensus-hold { color: var(--md-sys-color-on-surface-variant); }

/* Relative volume */
.wl-rvol-elevated { color: #d97706; font-weight: 600; }
.wl-rvol-high { color: #dc2626; font-weight: 700; }

/* Sparkline */
.wl-sparkline { display: block; }

/* Day range bar */
.wl-day-range {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  font-size: 10px;
  min-width: 120px;
}
.wl-range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--md-sys-color-on-surface-variant);
}
.wl-range-bar {
  width: 100%;
  height: 2px;
  background: var(--md-sys-color-outline-variant);
  position: relative;
  margin-top: 6px;
}
.wl-range-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--md-sys-color-primary);
}
.wl-range-pointer {
  position: absolute;
  top: -4px;
  width: 6px;
  height: 6px;
  background: var(--md-sys-color-primary);
  border-radius: 50%;
  transform: translateX(-3px);
}

/* Action buttons */
.wl-actions-cell { white-space: nowrap; }
.wl-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.wl-action-link:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-primary);
}
.wl-action-link .material-symbols-outlined { font-size: 1rem; }

/* ── Modals ── */
.wl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.wl-modal-overlay.wl-modal-open {
  opacity: 1;
  pointer-events: auto;
}

.wl-modal {
  background: var(--md-sys-color-surface);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.wl-modal-open .wl-modal { transform: scale(1); }
.wl-modal-add { max-width: 520px; }
.wl-modal-manage { max-width: 480px; }

.wl-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.wl-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 600; flex: 1; }
.wl-ticker-count {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
}
.wl-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  padding: 0 4px;
}
.wl-modal-close:hover { color: var(--md-sys-color-on-surface); }

.wl-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* Search input */
.wl-search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}
.wl-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  pointer-events: none;
  color: var(--md-sys-color-outline);
}
.wl-search-wrap .wl-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 40px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 0.875rem;
}
.wl-search-wrap .wl-search-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent);
}

/* Search results */
.wl-search-results {
  max-height: 300px;
  overflow-y: auto;
}
.wl-search-hint {
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.8rem;
  padding: 1rem;
  margin: 0;
}
.wl-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--md-sys-color-surface-container);
}
.wl-search-item:last-child { border-bottom: none; }
.wl-search-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}
.wl-search-symbol {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface);
  flex-shrink: 0;
}
.wl-search-name {
  font-size: 0.8rem;
  color: var(--md-sys-color-on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-search-exchange {
  font-size: 0.7rem;
  color: var(--md-sys-color-outline);
  flex-shrink: 0;
}
.wl-add-result-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Management modal */
.wl-manage-section {
  margin-bottom: 1.25rem;
}
.wl-manage-section:last-child { margin-bottom: 0; }
.wl-manage-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}
.wl-manage-row {
  display: flex;
  gap: 0.5rem;
}
.wl-manage-input {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 0.875rem;
}
.wl-manage-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wl-manage-tickers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.wl-manage-tickers-header .wl-manage-label { margin-bottom: 0; }

.wl-manage-tickers {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
}
.wl-manage-ticker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--md-sys-color-surface-container);
}
.wl-manage-ticker-row:last-child { border-bottom: none; }
.wl-manage-ticker-row:hover { background: var(--md-sys-color-surface-container); }

.wl-manage-checkbox-wrap { display: flex; align-items: center; }
.wl-manage-check { accent-color: var(--md-sys-color-primary); }

.wl-manage-ticker-symbol {
  flex: 1;
  font-weight: 600;
  font-size: 0.85rem;
}
.wl-manage-ticker-actions {
  display: flex;
  gap: 0.125rem;
}
.wl-manage-move {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  padding: 2px;
  border-radius: var(--radius-sm);
}
.wl-manage-move:hover { background: var(--md-sys-color-surface-container-highest); }
.wl-manage-move:disabled { opacity: 0.3; cursor: default; }
.wl-manage-move .material-symbols-outlined { font-size: 1rem; }

.wl-manage-empty {
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.8rem;
  padding: 1rem;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .wl-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .wl-controls-left, .wl-controls-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .wl-data-table { display: block; overflow-x: auto; }
  .wl-modal { width: 95%; max-height: 85vh; }
  .wl-day-range { min-width: 80px; }
}

/* ── Watchlist Drawer ── */
.wl-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px); z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.wl-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.wl-drawer {
  position: fixed; top: 0; right: -440px; width: 420px; max-width: 92vw;
  height: 100vh; background: var(--md-sys-color-surface);
  box-shadow: -6px 0 28px rgba(0,0,0,0.4); z-index: 100;
  display: flex; flex-direction: column;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.wl-drawer.open { right: 0; }

.wl-drawer__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface);
  position: sticky; top: 0; z-index: 2;
}
.wl-drawer__ticker-block { flex: 1; min-width: 0; }
.wl-drawer__symbol {
  font-family: 'JetBrains Mono', monospace; font-size: 20px;
  font-weight: 700; letter-spacing: 0.5px;
}
.wl-drawer__company {
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-drawer__price-block { text-align: right; margin-left: 16px; flex-shrink: 0; }
.wl-drawer__price {
  font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 600;
}
.wl-drawer__change { font-size: 12px; font-weight: 500; margin-top: 1px; }
.wl-drawer__close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  padding: 4px 8px; border-radius: 8px; margin: -4px -8px 0 8px;
  transition: background 0.12s; line-height: 1;
}
.wl-drawer__close:hover { background: var(--md-sys-color-surface-container-high); }

.wl-drawer__body { flex: 1; overflow-y: auto; padding: 0; }

.wl-drawer__section {
  padding: 16px 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 50%, transparent);
}
.wl-drawer__section:last-child { border-bottom: none; }
.wl-drawer__section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--md-sys-color-secondary);
  margin-bottom: 10px;
}

/* Drawer chart card */
.wl-drawer__chart {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--radius-sm); padding: 14px 16px 10px;
}
.wl-drawer__chart-label {
  font-size: 10px; color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center;
}
.wl-drawer__chart-label span:last-child {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
}

/* Drawer range bars */
.wl-drawer__ranges { display: flex; flex-direction: column; gap: 14px; }
.wl-drawer__range-item label {
  font-size: 11px; font-weight: 500; color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 5px; display: block;
}
.wl-drawer__range-bar-wrap {
  position: relative; height: 5px;
  background: var(--md-sys-color-outline-variant); border-radius: 3px;
}
.wl-drawer__range-fill {
  position: absolute; top: 0; height: 100%;
  background: var(--md-sys-color-primary); opacity: 0.4; border-radius: 3px;
}
.wl-drawer__range-pointer {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--md-sys-color-primary);
  border: 2px solid var(--md-sys-color-on-primary); z-index: 1;
}
.wl-drawer__range-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--md-sys-color-on-surface-variant);
  margin-top: 4px; font-family: 'JetBrains Mono', monospace;
}

/* IV hero */
.wl-drawer__iv-hero { display: flex; align-items: center; gap: 14px; }
.wl-drawer__iv-rank-big {
  font-size: 28px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 14px; border-radius: 8px; line-height: 1;
}
.wl-drawer__iv-details {
  flex: 1; font-size: 12px; color: var(--md-sys-color-on-surface-variant); line-height: 1.7;
}
.wl-drawer__iv-details strong { color: var(--md-sys-color-on-surface); font-weight: 600; }

/* Metrics grid */
.wl-drawer__metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: color-mix(in srgb, var(--md-sys-color-outline) 40%, transparent);
  border-radius: var(--radius-sm); overflow: hidden;
}
.wl-drawer__metric { background: var(--md-sys-color-surface-container); padding: 10px 14px; }
.wl-drawer__metric-label {
  font-size: 10px; color: var(--md-sys-color-secondary);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px;
}
.wl-drawer__metric-value {
  font-size: 15px; font-weight: 600; margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* Earnings row */
.wl-drawer__earnings-row { display: flex; align-items: center; gap: 12px; }
.wl-drawer__earnings-date {
  font-size: 15px; font-weight: 600; font-family: 'JetBrains Mono', monospace;
}
.wl-drawer__earnings-countdown {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.wl-drawer__countdown-urgent { background: #7f1d1d; color: #fca5a5; }
.wl-drawer__countdown-soon { background: #713f12; color: #fde047; }
.wl-drawer__countdown-normal {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}
.theme-light .wl-drawer__countdown-urgent { background: #fee2e2; color: #991b1b; }
.theme-light .wl-drawer__countdown-soon { background: #fef9c3; color: #854d0e; }

/* Performance pills */
.wl-drawer__perf-row { display: flex; gap: 8px; }
.wl-drawer__perf-pill {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 8px;
  background: var(--md-sys-color-surface-container);
}
.wl-drawer__perf-pill-label {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--md-sys-color-secondary);
}
.wl-drawer__perf-pill-value {
  font-size: 14px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; margin-top: 2px;
}

/* Action buttons */
.wl-drawer__actions {
  padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface);
  position: sticky; bottom: 0;
}
.wl-drawer__action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.12s; text-decoration: none;
}
.wl-drawer__action-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
}
.wl-drawer__action-btn .action-icon { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.wl-drawer__action-btn .action-arrow { margin-left: auto; font-size: 14px; color: var(--md-sys-color-secondary); }
.wl-drawer__action-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
}
.wl-drawer__action-primary:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 85%, black);
  color: var(--md-sys-color-on-primary);
}

/* Active row highlight */
.wl-drawer-active { background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent) !important; }

/* Staggered section animation */
@keyframes wlDrawerFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.wl-drawer.open .wl-drawer__section {
  animation: wlDrawerFadeUp 0.25s ease both;
}
.wl-drawer.open .wl-drawer__section:nth-child(1) { animation-delay: 0.06s; }
.wl-drawer.open .wl-drawer__section:nth-child(2) { animation-delay: 0.10s; }
.wl-drawer.open .wl-drawer__section:nth-child(3) { animation-delay: 0.14s; }
.wl-drawer.open .wl-drawer__section:nth-child(4) { animation-delay: 0.18s; }
.wl-drawer.open .wl-drawer__section:nth-child(5) { animation-delay: 0.22s; }
.wl-drawer.open .wl-drawer__section:nth-child(6) { animation-delay: 0.26s; }
.wl-drawer.open .wl-drawer__section:nth-child(7) { animation-delay: 0.30s; }

/* Drawer responsive */
@media (max-width: 768px) {
  .wl-drawer { width: 100%; right: -100%; }
}

/* Straddle yield badge */
.wl-straddle-badge {
  display: inline-block; min-width: 36px; text-align: center;
  padding: 2px 6px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.wl-straddle-high { background: #14532d; color: #86efac; }
.wl-straddle-mid { color: var(--md-sys-color-on-surface); }
.wl-straddle-low { color: var(--md-sys-color-on-surface-variant); opacity: 0.6; }
.theme-light .wl-straddle-high { background: #dcfce7; color: #166534; }
.wl-straddle-dte {
  font-size: 9px; color: var(--md-sys-color-on-surface-variant);
  margin-left: 4px;
}
.wl-drawer__metric-sub {
  font-size: 10px; color: var(--md-sys-color-on-surface-variant); margin-top: 1px;
}

/* Signal badges */
.wl-signal-row { display: flex; flex-wrap: wrap; gap: 3px; }
.wl-signal {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 9px; font-weight: 700; white-space: nowrap;
  letter-spacing: 0.3px;
}
.wl-signal-hiiv { background: #14532d; color: #86efac; }
.wl-signal-earn { background: #3b0764; color: #d8b4fe; }
.wl-signal-52h  { background: #1e3a5f; color: #93c5fd; }
.wl-signal-52l  { background: #7f1d1d; color: #fca5a5; }
.wl-signal-ivhv { background: #713f12; color: #fde047; }
.theme-light .wl-signal-hiiv { background: #dcfce7; color: #166534; }
.theme-light .wl-signal-earn { background: #f3e8ff; color: #6b21a8; }
.theme-light .wl-signal-52h  { background: #dbeafe; color: #1e40af; }
.theme-light .wl-signal-52l  { background: #fee2e2; color: #991b1b; }
.theme-light .wl-signal-ivhv { background: #fef9c3; color: #854d0e; }

/* Drawer signals */
.wl-drawer__signal-list { display: flex; flex-direction: column; gap: 8px; }
.wl-drawer__signal-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.wl-drawer__signal-item .wl-signal { font-size: 10px; padding: 2px 6px; flex-shrink: 0; }
.wl-drawer__signal-desc { color: var(--md-sys-color-on-surface-variant); }

/* ── Watchlist Heatmap ── */
.wl-view-toggle {
  display: inline-flex; gap: 1px;
  background: var(--md-sys-color-surface-container); border-radius: 8px; padding: 2px;
}
.wl-view-btn {
  padding: 4px 8px; border: none; border-radius: 6px;
  background: transparent; color: var(--md-sys-color-on-surface-variant);
  cursor: pointer; transition: all 0.12s; display: flex; align-items: center;
}
.wl-view-btn .material-symbols-outlined { font-size: 18px; }
.wl-view-btn.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.wl-view-btn:hover:not(.active) { background: var(--md-sys-color-surface-container-high); }
.wl-select-sm {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface); padding: 4px 8px;
  border-radius: 6px; font-family: inherit; font-size: 12px;
}
.wl-heatmap-controls { display: flex; align-items: center; gap: 8px; }

/* Heatmap grid */
.wl-heatmap { padding: 0 0 16px; }
.wl-heatmap--treemap {
  display: grid; gap: 2px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-auto-rows: minmax(80px, auto);
}
.wl-heatmap--grid {
  display: grid; gap: 2px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Tile */
.wl-hm-tile {
  position: relative; border-radius: 6px; padding: 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.12s, box-shadow 0.12s;
  overflow: hidden; min-height: 80px;
  animation: wlHmAppear 0.3s ease both;
}
.wl-hm-tile:hover { transform: scale(1.02); box-shadow: 0 4px 20px rgba(0,0,0,0.4); z-index: 2; }
@keyframes wlHmAppear {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Size classes */
.wl-hm-xl { grid-column: span 2; grid-row: span 2; min-height: 170px; }
.wl-hm-lg { grid-column: span 2; min-height: 90px; }
.wl-hm-sm { min-height: 70px; }

/* Tile content */
.wl-hm-tile__symbol {
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; letter-spacing: 0.5px;
}
.wl-hm-xl .wl-hm-tile__symbol { font-size: 22px; }
.wl-hm-lg .wl-hm-tile__symbol { font-size: 17px; }
.wl-hm-tile__name {
  font-size: 10px; opacity: 0.7; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-hm-sm .wl-hm-tile__name { display: none; }
.wl-hm-tile__bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.wl-hm-tile__price {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; opacity: 0.9;
}
.wl-hm-xl .wl-hm-tile__price { font-size: 18px; }
.wl-hm-tile__metric {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; opacity: 0.95;
}
.wl-hm-xl .wl-hm-tile__metric { font-size: 16px; }
.wl-hm-tile__signals { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.wl-hm-tile__signal {
  font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: 2px;
  background: rgba(0,0,0,0.35); color: rgba(255,255,255,0.85); letter-spacing: 0.3px;
}

/* Color scales — Daily Change */
.wl-hm-gain-5 { background: #14532d; color: #dcfce7; }
.wl-hm-gain-4 { background: #166534; color: #dcfce7; }
.wl-hm-gain-3 { background: #15803d; color: #dcfce7; }
.wl-hm-gain-2 { background: #16a34a; color: #f0fdf4; }
.wl-hm-gain-1 { background: #22c55e; color: #052e16; }
.wl-hm-flat   { background: #1e293b; color: #94a3b8; }
.wl-hm-loss-1 { background: #ef4444; color: #450a0a; }
.wl-hm-loss-2 { background: #dc2626; color: #fef2f2; }
.wl-hm-loss-3 { background: #b91c1c; color: #fef2f2; }
.wl-hm-loss-4 { background: #991b1b; color: #fecaca; }
.wl-hm-loss-5 { background: #7f1d1d; color: #fca5a5; }

/* Color scales — IV Rank */
.wl-hm-iv-5 { background: #14532d; color: #dcfce7; }
.wl-hm-iv-4 { background: #3f6212; color: #ecfccb; }
.wl-hm-iv-3 { background: #854d0e; color: #fef9c3; }
.wl-hm-iv-2 { background: #9a3412; color: #ffedd5; }
.wl-hm-iv-1 { background: #7f1d1d; color: #fca5a5; }

/* Color scales — Straddle Yield */
.wl-hm-str-5 { background: #14532d; color: #dcfce7; }
.wl-hm-str-4 { background: #166534; color: #dcfce7; }
.wl-hm-str-3 { background: #854d0e; color: #fef9c3; }
.wl-hm-str-2 { background: #78350f; color: #fef3c7; }
.wl-hm-str-1 { background: #1e293b; color: #94a3b8; }

/* Light theme overrides */
.theme-light .wl-hm-gain-5 { background: #166534; color: #f0fdf4; }
.theme-light .wl-hm-gain-4 { background: #15803d; color: #f0fdf4; }
.theme-light .wl-hm-gain-3 { background: #22c55e; color: #052e16; }
.theme-light .wl-hm-gain-2 { background: #86efac; color: #052e16; }
.theme-light .wl-hm-gain-1 { background: #bbf7d0; color: #14532d; }
.theme-light .wl-hm-flat   { background: #e2e8f0; color: #475569; }
.theme-light .wl-hm-loss-1 { background: #fca5a5; color: #7f1d1d; }
.theme-light .wl-hm-loss-2 { background: #f87171; color: #450a0a; }
.theme-light .wl-hm-loss-3 { background: #ef4444; color: #fef2f2; }
.theme-light .wl-hm-loss-4 { background: #dc2626; color: #fef2f2; }
.theme-light .wl-hm-loss-5 { background: #991b1b; color: #fecaca; }
.theme-light .wl-hm-iv-5 { background: #22c55e; color: #052e16; }
.theme-light .wl-hm-iv-4 { background: #84cc16; color: #1a2e05; }
.theme-light .wl-hm-iv-3 { background: #f59e0b; color: #451a03; }
.theme-light .wl-hm-iv-2 { background: #f97316; color: #431407; }
.theme-light .wl-hm-iv-1 { background: #ef4444; color: #fef2f2; }
.theme-light .wl-hm-str-5 { background: #22c55e; color: #052e16; }
.theme-light .wl-hm-str-4 { background: #4ade80; color: #052e16; }
.theme-light .wl-hm-str-3 { background: #f59e0b; color: #451a03; }
.theme-light .wl-hm-str-2 { background: #fbbf24; color: #451a03; }
.theme-light .wl-hm-str-1 { background: #e2e8f0; color: #475569; }

/* Legend */
.wl-hm-legend { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 12px; }
.wl-hm-legend-label { font-size: 10px; color: var(--md-sys-color-secondary); font-weight: 500; }
.wl-hm-legend-bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; width: 200px; }
.wl-hm-legend-bar > div { flex: 1; }

/* Responsive */
@media (max-width: 768px) {
  .wl-heatmap--treemap { grid-template-columns: 1fr; }
  .wl-hm-xl, .wl-hm-lg { grid-column: span 1; }
  .wl-heatmap--grid { grid-template-columns: repeat(2, 1fr); }
}

/* SSE connection status dot */
.wl-sse-status {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-left: 8px; vertical-align: middle;
  transition: background 0.3s;
  background: var(--md-sys-color-outline);
}
.wl-sse-connected { background: #16a34a; box-shadow: 0 0 4px #16a34a; }
.wl-sse-disconnected { background: var(--md-sys-color-outline); }

/* ═══════════════════════════════════════════════════════
   IV Analysis
   ═══════════════════════════════════════════════════════ */
.iv-page { display: flex; flex-direction: column; gap: 12px; }

/* Input card */
.iv-input-card { padding: 12px 16px; display: inline-flex; }
.iv-input-bar { display: flex; gap: 8px; align-items: center; }
.iv-ticker-input {
  padding: 8px 12px; border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px; background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface); font-size: 14px;
  text-transform: uppercase; width: 200px;
}
.iv-ticker-input:focus { outline: none; border-color: var(--md-sys-color-primary); }

/* Buttons */
.iv-btn {
  padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 4px;
  background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface);
}
.iv-btn:hover { background: var(--md-sys-color-surface-container-highest); }
.iv-btn-primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.iv-btn-primary:hover { background: var(--md-sys-color-primary); filter: brightness(1.1); }

/* Toggle group */
.iv-toggle-group { display: flex; gap: 2px; background: var(--md-sys-color-surface-container); border-radius: 6px; padding: 2px; }
.iv-toggle {
  padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer;
  font-size: 0.75rem; font-weight: 600; background: transparent;
  color: var(--md-sys-color-on-surface-variant);
}
.iv-toggle-active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

/* Select */
.iv-select {
  padding: 4px 8px; border: 1px solid var(--md-sys-color-outline);
  border-radius: 4px; background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface); font-size: 0.8rem;
}

/* Loading / Error */
.iv-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--md-sys-color-on-surface-variant); }
.iv-error { padding: 16px; color: #dc2626; text-align: center; }

/* Context bar */
.iv-context-bar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--md-sys-color-surface-container); border-radius: 8px;
  font-size: 0.85rem; flex-wrap: wrap;
}
.iv-ctx-item { display: flex; flex-direction: column; gap: 2px; }
.iv-ctx-label { font-size: 0.65rem; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.5px; }
.iv-ctx-value { font-weight: 600; color: var(--md-sys-color-on-surface); }
.iv-ctx-divider { width: 1px; height: 28px; background: var(--md-sys-color-outline-variant); }

/* Overview card */
.iv-overview-card { padding: 0; border-radius: 8px; overflow: hidden; }
.iv-overview-metrics {
  display: flex; align-items: center; gap: 20px; padding: 14px 16px; flex-wrap: wrap;
}
.iv-metric { display: flex; flex-direction: column; gap: 2px; }
.iv-metric-label { font-size: 0.7rem; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.5px; }
.iv-metric-value { font-size: 1.1rem; font-weight: 700; color: var(--md-sys-color-on-surface); }
.iv-metric-divider { width: 1px; height: 28px; background: var(--md-sys-color-outline-variant); }

/* Gauge bar */
.iv-gauge { height: 6px; background: var(--md-sys-color-surface-container-highest); border-radius: 3px; margin-top: 4px; width: 80px; overflow: hidden; }
.iv-gauge-fill { height: 100%; border-radius: 3px; }

/* Signal banner */
.iv-signal-banner { padding: 10px 16px; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.iv-signal-banner strong { margin-right: 4px; }
.iv-signal-low { background: #16a34a18; border-top: 1px solid #16a34a33; color: #16a34a; }
.iv-signal-moderate-low { background: #84cc1618; border-top: 1px solid #84cc1633; color: #84cc16; }
.iv-signal-moderate-high { background: #f9731618; border-top: 1px solid #f9731633; color: #f97316; }
.iv-signal-high { background: #dc262618; border-top: 1px solid #dc262633; color: #dc2626; }
.iv-signal-unknown { background: #64748b18; border-top: 1px solid #64748b33; color: #64748b; }
.iv-signal-detail { color: var(--md-sys-color-on-surface-variant); }
.iv-signal-link { margin-left: auto; font-size: 0.8rem; font-weight: 600; text-decoration: none; }

/* Charts grid */
.iv-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .iv-charts-grid { grid-template-columns: 1fr; } }

/* Chart card */
.iv-chart-card { padding: 0; border-radius: 8px; overflow: hidden; }
.iv-chart-header {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant); gap: 8px; flex-wrap: wrap;
}
.iv-chart-title { margin: 0; font-size: 0.9rem; font-weight: 600; }
.iv-chart-subtitle { margin: 2px 0 0; font-size: 0.75rem; color: var(--md-sys-color-on-surface-variant); }
.iv-chart-controls { display: flex; gap: 8px; align-items: center; }

/* ECharts container */
.iv-echarts-container { height: 280px; padding: 8px 4px; min-width: 0; }

/* HV signal sub-banner */
.iv-hv-signal { padding: 8px 16px; font-size: 0.8rem; border-top: 1px solid var(--md-sys-color-outline-variant); }
.iv-hv-signal-rich { color: #f97316; }
.iv-hv-signal-cheap { color: #16a34a; }
.iv-hv-signal-fair { color: var(--md-sys-color-on-surface-variant); }

/* Theme-specific */
.theme-light .iv-signal-low { background: #16a34a12; color: #15803d; }
.theme-light .iv-signal-high { background: #dc262612; color: #b91c1c; }

/* Expected Move card — no extra styles needed, uses iv-chart-card + iv-echarts-container */

/* ═══════════════════════════════════════════════════════════
   EARNINGS CALENDAR
   ═══════════════════════════════════════════════════════════ */
.ec-page { display: flex; flex-direction: column; gap: 12px; }
.ec-controls { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
.ec-controls-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ec-controls-right { display: flex; align-items: center; gap: 12px; }
.ec-select { padding: 6px 10px; border: 1px solid var(--md-sys-color-outline); border-radius: 8px; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-size: 13px; cursor: pointer; height: 34px; box-sizing: border-box; }
.ec-add-ticker { display: flex; gap: 4px; align-items: center; }
.ec-ticker-input { padding: 6px 10px; border: 1px solid var(--md-sys-color-outline); border-radius: 8px; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-size: 13px; text-transform: uppercase; width: 120px; height: 34px; box-sizing: border-box; }
.ec-btn { padding: 6px 12px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; height: 34px; box-sizing: border-box; }
.ec-btn-outline { background: transparent; border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface); }
.ec-btn-outline:hover { background: var(--md-sys-color-surface-container-high); }
.ec-extra-tickers { display: flex; gap: 4px; flex-wrap: wrap; }
.ec-extra-tag { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 12px; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-size: 11px; font-weight: 600; }
.ec-extra-tag-remove { cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.7; }
.ec-extra-tag-remove:hover { opacity: 1; }
.ec-count-badge { font-size: 12px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }
.ec-view-toggle { display: flex; border: 1px solid var(--md-sys-color-outline); border-radius: 8px; overflow: hidden; }
.ec-toggle { padding: 4px 10px; border: none; background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; display: flex; align-items: center; }
.ec-toggle:hover { background: var(--md-sys-color-surface-container-high); }
.ec-toggle-active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.ec-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 48px 0; color: var(--md-sys-color-on-surface-variant); }
.ec-error { padding: 16px; background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); border-radius: 12px; }
.ec-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 0; color: var(--md-sys-color-on-surface-variant); }
.ec-table-wrap { overflow-x: auto; }
.ec-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ec-table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-primary); border-bottom: 1px solid var(--md-sys-color-outline-variant); cursor: pointer; white-space: nowrap; user-select: none; }
.ec-table th:hover { color: var(--md-sys-color-on-surface); }
.ec-table td { padding: 8px 12px; border-bottom: 1px solid var(--md-sys-color-surface-container-high); white-space: nowrap; }
.ec-table tr:hover td { background: var(--md-sys-color-surface-container); }
.ec-sort-asc::after { content: ' ↑'; }
.ec-sort-desc::after { content: ' ↓'; }
.ec-days-urgent { color: var(--md-sys-color-error); font-weight: 600; }
.ec-days-soon { color: #f59e0b; font-weight: 600; }
.ec-hist-badges { display: flex; gap: 6px; }
.ec-hist-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ec-hist-label { font-size: 9px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.3px; }
.ec-hist-badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.ec-hist-up { background: rgba(16,185,129,0.15); color: var(--md-sys-color-success); }
.ec-hist-down { background: rgba(239,68,68,0.15); color: #ef4444; }
.ec-signal { font-size: 11px; font-weight: 500; max-width: 140px; white-space: normal; line-height: 1.3; }
/* #1 Urgency borders */
.ec-row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--md-sys-color-error); }
.ec-row-soon td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.ec-clickable-row { cursor: pointer; }
.ec-expand-icon { color: var(--md-sys-color-on-surface-variant); }
/* #2 vs-avg indicator */
.ec-vs-avg { font-size: 10px; font-weight: 600; margin-top: 2px; }
/* #3 Detail row */
.ec-detail-row td { padding: 0 !important; background: var(--md-sys-color-surface-container) !important; }
.ec-detail-panel { padding: 12px 16px; }
.ec-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ec-detail-section { }
.ec-detail-title { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--md-sys-color-primary); margin-bottom: 8px; letter-spacing: 0.5px; }
.ec-detail-metrics { display: flex; flex-direction: column; gap: 4px; }
.ec-detail-metric { display: flex; justify-content: space-between; font-size: 13px; }
.ec-detail-label { color: var(--md-sys-color-on-surface-variant); }
.ec-detail-value { font-weight: 600; }
.ec-detail-signal { font-size: 13px; }
/* #4 Density alert */
.ec-density-alert { display: none; padding: 8px 16px; background: #fef3c7; color: #92400e; border-radius: 8px; font-size: 13px; }
body:not(.theme-light) .ec-density-alert { background: #5c4a14; color: #ffd966; }
.ec-gauge { display: inline-flex; align-items: center; gap: 6px; }
.ec-gauge-bar { width: 40px; height: 6px; border-radius: 3px; background: var(--md-sys-color-surface-container-high); overflow: hidden; }
.ec-gauge-fill { height: 100%; border-radius: 3px; display: block; }
.ec-table th:last-child, .ec-table td:last-child { position: sticky; right: 0; background: var(--md-sys-color-surface); z-index: 1; box-shadow: -2px 0 4px rgba(0,0,0,0.05); }
.ec-table tr:hover td:last-child { background: var(--md-sys-color-surface-container); }
.ec-actions { display: flex; gap: 4px; }
.ec-action-btn { padding: 4px; border: none; background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; border-radius: 4px; display: flex; align-items: center; text-decoration: none; }
.ec-action-btn:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-primary); }
.ec-calendar-wrap { padding: 16px; }
.ec-cal-header { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.ec-cal-title { font-size: 16px; font-weight: 600; color: var(--md-sys-color-on-surface); }
.ec-cal-nav { border: none; background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; padding: 4px; border-radius: 50%; display: flex; }
.ec-cal-nav:hover { background: var(--md-sys-color-surface-container-high); }
.ec-cal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; background: transparent; }
.ec-cal-month { border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px; overflow: hidden; }
.ec-cal-month-title { padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--md-sys-color-on-surface); background: var(--md-sys-color-surface-container); text-align: center; }
.ec-cal-month-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--md-sys-color-outline-variant); }
.ec-cal-day-header { padding: 4px; text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface); }
.ec-cal-cell { min-height: 60px; padding: 4px 6px; background: var(--md-sys-color-surface); }
.ec-cal-cell-today { background: var(--md-sys-color-primary-container); }
.ec-cal-cell-outside { background: var(--md-sys-color-surface-container); opacity: 0.3; min-height: 30px; }
.ec-cal-date { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 4px; }
.ec-cal-ticker { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; margin-bottom: 3px; cursor: pointer; font-size: 12px; }
.ec-cal-ticker:hover { filter: brightness(1.1); }
.ec-cal-ticker-symbol { font-weight: 700; }
.ec-cal-ticker-move { font-size: 11px; opacity: 0.8; }
@media (max-width: 768px) {
  .ec-controls { flex-direction: column; align-items: flex-start; }
  .ec-cal-grid { grid-template-columns: 1fr; }
  .ec-cal-day-header { display: none; }
  .ec-cal-cell { min-height: auto; }
}

/* ═══════════════════════════════════════════════════════════
   INCOME ENGINE — PAGE LAYOUT & INPUTS
   ═══════════════════════════════════════════════════════════ */
.ia-col-hidden { display: none !important; }
.ia-results-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ia-results-toolbar-actions { display: flex; align-items: center; gap: 4px; }
.ia-expand-all-btn { background: none; border: none; color: var(--md-sys-color-primary); cursor: pointer; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 4px; white-space: nowrap; }
.ia-expand-all-btn:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); }
#iaStrategySections { transition: opacity 0.15s ease; }
.ia-page { max-width: 100%; margin: 0; padding: 0; }
.ia-input-card { padding: 12px 0; border-radius: 0; margin-bottom: 0; }
.ia-input-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.ia-input-group { display: flex; flex-direction: column; gap: 0.25rem; }
.ia-input-group label { font-size: 0.75rem; color: var(--md-sys-color-on-surface-variant); font-weight: 600; line-height: 18px; }
.ia-input-group label[data-tip] { text-decoration: underline dotted var(--md-sys-color-outline); text-underline-offset: 3px; cursor: default; position: relative; }
.ia-input-group label[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: 100%; margin-bottom: 6px; z-index: 1000;
  background: #f0f0f5; color: #1a1a2e;
  font-size: 11px; font-weight: 400; line-height: 1.4; padding: 8px 12px;
  border-radius: 8px; white-space: normal; width: max-content; max-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.theme-light .ia-input-group label[data-tip]::after { background: #2d2d3f; color: #f0f0f5; }
.ia-input-group label[data-tip]:hover::after { opacity: 1; }
.ia-input-group input, .ia-input-group select { height: 32px; padding: 0 8px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 6px; background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface); font-size: 12px; font-family: inherit; }
.ia-input-group input[type="number"] { width: 70px; }
.ia-input-group input[type="text"] { width: 100px; }
.ia-dte-group { min-width: 200px; }
.ia-dte-group { min-width: 170px; }
.ia-dte-group > label { position: relative; padding-right: 105px; }
.ia-dte-group select, .ia-dte-group .ia-expiry-dropdown { width: 100%; }
.ia-dte-group #iaDteCustom { display: flex; align-items: center; gap: 4px; }
.ia-dte-group #iaDteCustom input { flex: 1; min-width: 0; }
.ia-dte-tabs { position: absolute; right: 0; bottom: 0; display: inline-flex; gap: 1px; background: var(--md-sys-color-outline-variant); border-radius: 3px; overflow: hidden; border: 1px solid var(--md-sys-color-outline-variant); }
.ia-dte-tab { padding: 0 5px; font-size: 9px; font-weight: 600; border: none; cursor: pointer; background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface-variant); transition: background 0.15s, color 0.15s; white-space: nowrap; line-height: 16px; }
.ia-dte-tab--active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.ia-dte-tab--disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* Expiry custom dropdown */
.ia-expiry-dropdown { position: relative; }
.ia-expiry-toggle {
  height: 28px; padding: 2px 28px 2px 8px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 6px;
  background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface);
  font-size: 12px; font-family: inherit; cursor: pointer; white-space: nowrap; text-align: left; width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%239ca3af'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 16px;
}
.ia-expiry-toggle:disabled { opacity: 0.5; cursor: default; }
.ia-expiry-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 120;
  min-width: 220px; max-height: 300px; overflow-y: auto;
  background: var(--md-sys-color-surface-container); border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); padding: 4px 0; margin-top: 2px;
}
.ia-expiry-dropdown.open .ia-expiry-menu { display: block; }
.ia-expiry-item {
  padding: 6px 12px; cursor: pointer; font-size: 12px; color: var(--md-sys-color-on-surface); white-space: nowrap;
}
.ia-expiry-item:hover { background: var(--md-sys-color-surface-container-high); }
.ia-expiry-item--active { background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); font-weight: 600; }
.ia-expiry-dte { color: var(--md-sys-color-on-surface-variant); font-size: 11px; }
.ia-expiry-divider {
  padding: 4px 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--md-sys-color-error); border-top: 1.5px dashed var(--md-sys-color-error);
  margin: 4px 8px; pointer-events: none; user-select: none;
}

.ia-generate-btn { display: flex; align-items: center; gap: 0.375rem; height: 32px; padding: 0 16px; background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; align-self: flex-end; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.ia-generate-btn:hover { filter: brightness(1.1); }
.ia-generate-btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* Multi-select dropdown */
.ia-multiselect-btn { display: flex; align-items: center; gap: 0.5rem; height: 28px; padding: 0 8px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 6px; background: var(--md-sys-color-surface-container); cursor: pointer; font-size: 12px; color: var(--md-sys-color-on-surface); min-width: 140px; }
.ia-ms-badge { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; }
.ia-multiselect-panel { display: none; position: fixed; z-index: 1000; background-color: var(--md-sys-color-surface-container-high, #fff); border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,0.15); padding: 0.5rem; min-width: 260px; max-height: 350px; overflow-y: auto; }
.ia-multiselect-panel.ia-ms-open { display: block; }
#iaMsWrap { position: relative; }
.ia-ms-actions { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.ia-ms-action { background: none; border: none; color: var(--md-sys-color-primary); cursor: pointer; font-size: 0.75rem; padding: 0.25rem 0.5rem; }
.ia-ms-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem; cursor: pointer; border-radius: var(--radius-sm); font-size: 0.8rem; }
.ia-ms-item:hover { background: var(--md-sys-color-surface-container-highest); }
.ia-ms-check { font-size: 1.1rem; color: var(--md-sys-color-outline); }
.ia-ms-item.ia-ms-checked .ia-ms-check { color: var(--md-sys-color-primary); }

/* Preset bar */
.ia-preset-bar { display: flex; align-items: center; gap: 6px; padding: 4px 0 6px; margin-top: 4px; border-top: 1px solid var(--md-sys-color-outline-variant); border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.ia-preset-select { padding: 0 8px; height: 32px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 6px; background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface); font-size: 12px; font-family: inherit; width: auto; max-width: 180px; cursor: pointer; }
.ia-preset-select:focus { outline: none; border-color: var(--md-sys-color-primary); }
.ia-preset-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 6px; background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface-variant); cursor: pointer; padding: 0; }
.ia-preset-btn .material-symbols-outlined { font-size: 16px; }
.ia-preset-btn:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }
.ia-preset-btn--danger:hover { color: var(--md-sys-color-error); }

/* Welcome state */
.ia-welcome { text-align: center; padding: 3rem 1rem; max-width: 480px; margin: 0 auto; }
.ia-welcome__icon { font-size: 40px; color: var(--md-sys-color-primary); margin-bottom: 8px; }
.ia-welcome__title { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: var(--md-sys-color-on-surface); }
.ia-welcome__desc { font-size: 13px; color: var(--md-sys-color-on-surface-variant); line-height: 1.5; margin: 0 0 20px; }
.ia-welcome__quick { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ia-welcome__quick-label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.ia-welcome__ticker { padding: 4px 14px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 16px; background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface); font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.ia-welcome__ticker:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent); border-color: var(--md-sys-color-primary); color: var(--md-sys-color-primary); }

/* Loading / Error */
.ia-loading { text-align: center; padding: 3rem 1rem; color: var(--md-sys-color-on-surface-variant); }
.ia-error { display: flex; align-items: center; gap: 0.5rem; padding: 1rem; color: var(--md-sys-color-error); }

/* Earnings banner (inline in toolbar row) */
.ia-earnings-banner-inline { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }
.ia-earnings-banner-inline .material-symbols-outlined { font-size: 14px; color: var(--md-sys-color-tertiary); }
.ia-earnings-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; margin-left: 8px; }
.ia-earnings-toggle input { accent-color: var(--md-sys-color-primary); }

/* Strategy sections */
.ia-strategy-section { border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 8px; }
.ia-strategy-header { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--md-sys-color-surface-container-high); border-bottom: 1px solid var(--md-sys-color-outline-variant); cursor: pointer; user-select: none; }
.ia-strategy-header:hover { background: var(--md-sys-color-surface-container-highest); }
.ia-strategy-header > .material-symbols-outlined:first-child { font-size: 16px; color: var(--md-sys-color-on-surface-variant); }
.ia-strategy-header .ia-chevron { font-size: 18px; color: var(--md-sys-color-on-surface-variant); transition: transform 0.2s; }
.ia-strategy-header.ia-collapsed .ia-chevron { transform: rotate(-90deg); }
.ia-strategy-header.ia-collapsed + .ia-strategy-body { display: none; }
.ia-strategy-name { font-weight: 700; font-size: 13px; }
.ia-strategy-count { font-weight: 400; font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
.ia-strategy-body { overflow-x: auto; }
.ia-strategy-body.ia-section-hidden { display: none; }

/* Data tables */
.ia-data-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; border: 1px solid var(--md-sys-color-outline-variant); }
.ia-strategy-body .ia-data-table { margin: 0; border: none; }
.ia-data-table th { text-align: left; padding: 4px 8px; color: var(--md-sys-color-on-surface-variant); font-weight: 600; font-size: 11px; text-transform: uppercase; border: 1px solid var(--md-sys-color-outline-variant); background: color-mix(in srgb, var(--md-sys-color-surface-variant) 40%, var(--md-sys-color-surface)); white-space: nowrap; user-select: none; }
.ia-data-table th[title] { text-decoration: underline dotted var(--md-sys-color-outline-variant); text-underline-offset: 3px; }
.ia-data-table th.ia-sortable { cursor: pointer; }
.ia-data-table th.ia-sortable:hover { color: var(--md-sys-color-on-surface); }
.ia-data-table th.ia-sortable::after { content: '⇅'; margin-left: 2px; opacity: 0.3; font-size: 0.65rem; }
.ia-data-table th.ia-sort-asc::after { content: '↑'; opacity: 1; }
.ia-data-table th.ia-sort-desc::after { content: '↓'; opacity: 1; }
.ia-data-table th.ia-sort-asc, .ia-data-table th.ia-sort-desc { color: var(--md-sys-color-primary); }
.ia-data-table td { padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 70%, transparent); vertical-align: middle; white-space: nowrap; font-size: 11.5px; line-height: 1.3; }
.ia-data-table tbody tr:nth-child(even) { background: transparent !important; }
.ia-data-table tr:hover td { background: var(--md-sys-color-surface-container); }
.ia-data-table tr.ia-clickable-row { cursor: pointer; }
.ia-data-table tr.ia-earnings-row td { background: #fff3e0 !important; }
body:not(.theme-light) .ia-data-table tr.ia-earnings-row td { background: #3e2723 !important; }
.ia-expiry-cell { position: relative; }
.ia-em-cell { white-space: nowrap; line-height: 1.3; }
.ia-em-range { display: block; font-size: 10px; color: var(--md-sys-color-on-surface-variant); }
.ia-em-cell.scanner-em-cell { min-width: 120px; padding-top: 8px; padding-bottom: 4px; }
.ia-iv-cell { text-align: center; white-space: nowrap; }
.ia-col-earn { text-align: center; }
.ia-col-score { text-align: center; }

/* Earnings cell — shared by Scanner column and Income Engine column */
.scanner-earn-cell {
  text-align: center;
  white-space: nowrap;
}
.scanner-earn-days {
  display: block;
  font-size: 0.7rem;
  color: var(--md-sys-color-on-surface-variant, #888);
}
.scanner-earn--soon {
  color: var(--md-sys-color-error, #d93025);
  font-weight: 600;
}

/* Composite score breakdown tooltip — shared by Scanner and Income Engine */
.score-tip-wrap { cursor: default; position: relative; }
.score-tip {
  display: none;
  position: fixed;
  z-index: 10000;
  background: var(--md-sys-color-surface-container, #fff);
  border: 1px solid var(--md-sys-color-outline-variant, #ddd);
  border-radius: 10px;
  padding: 12px 14px;
  width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: none;
}
.score-tip-row {
  display: grid;
  grid-template-columns: 72px 24px 1fr 24px;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.score-tip-row:last-of-type { margin-bottom: 0; }
.score-tip-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface, #222);
  white-space: nowrap;
}
.score-tip-weight {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant, #888);
  text-align: right;
}
.score-tip-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--md-sys-color-surface-container-highest, #eee);
  overflow: hidden;
}
.score-tip-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s;
}
.score-tip-val {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: right;
  color: var(--md-sys-color-on-surface, #222);
}
.score-tip-penalty {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--md-sys-color-outline-variant, #ddd);
  font-size: 0.65rem;
  font-weight: 600;
  color: #dc2626;
}

/* ─── Shared trade preview drawer (Scanner + Income Engine).
   Uses .tp-drawer* prefix to avoid colliding with the order-placement
   .trade-drawer* used by /js/trade-utils.js. ────────────────────────── */
.tp-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
  z-index: 99; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.tp-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.tp-drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 90vw;
  height: 100vh; background: var(--md-sys-color-surface, #fff);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15); z-index: 100;
  display: flex; flex-direction: column; transition: right 0.25s ease;
  overflow-y: auto;
}
.tp-drawer.open { right: 0; }

.tp-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant, #ddd);
  position: sticky; top: 0; background: var(--md-sys-color-surface, #fff); z-index: 1;
}
.tp-drawer__header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.tp-drawer__close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant, #666); padding: 4px 8px; border-radius: 6px;
}
.tp-drawer__close:hover { background: var(--md-sys-color-surface-container-high, #eee); }
.tp-drawer__body { padding: 0; flex: 1; }

.tp-drawer__tabs {
  display: flex;
  border-bottom: 2px solid var(--md-sys-color-outline-variant, #e0e0e0);
  padding: 0 20px;
  background: var(--md-sys-color-surface, #fff);
}
.tp-drawer__tab {
  padding: 10px 16px;
  border: none; background: none;
  font-size: 13px; font-weight: 600;
  color: var(--md-sys-color-on-surface-variant, #666);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tp-drawer__tab:hover { color: var(--md-sys-color-on-surface, #222); }
.tp-drawer__tab--active {
  color: var(--md-sys-color-primary, #1a73e8);
  border-bottom-color: var(--md-sys-color-primary, #1a73e8);
}
.tp-drawer__tab-panel { display: none; }
.tp-drawer__tab-panel--active { display: block; }

.drawer-hero {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px;
}
.drawer-hero__card { padding: 10px; border-radius: 8px; text-align: center; }
.drawer-hero__label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; opacity: 0.8;
}
.drawer-hero__value { font-size: 18px; font-weight: 700; margin-top: 2px; }
.drawer-hero--credit { background: #dcfce7; color: #166534; }
.drawer-hero--profit { background: #e0f2fe; color: #0c4a6e; }
.drawer-hero--loss   { background: #fee2e2; color: #991b1b; }
body:not(.theme-light) .drawer-hero--credit { background: #14532d; color: #86efac; }
body:not(.theme-light) .drawer-hero--profit { background: #0c4a6e; color: #7dd3fc; }
body:not(.theme-light) .drawer-hero--loss   { background: #7f1d1d; color: #fca5a5; }

.drawer-metrics {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; margin-bottom: 16px;
}
.drawer-metric { text-align: center; padding: 6px 4px; }
.drawer-metric__label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--md-sys-color-on-surface-variant, #888);
}
.drawer-metric__value { font-size: 13px; font-weight: 600; margin-top: 1px; }

.drawer-section-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--md-sys-color-on-surface-variant, #888); font-weight: 600; margin-bottom: 6px;
}

.drawer-legs {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12px; margin-bottom: 16px;
  border: 1px solid var(--md-sys-color-outline-variant, #e0e0e0); border-radius: 6px; overflow: hidden;
}
.drawer-legs th {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--md-sys-color-on-surface-variant, #888);
  padding: 4px 6px; text-align: left;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #e0e0e0); font-weight: 600;
}
.drawer-legs td { padding: 6px; border-bottom: 1px solid var(--md-sys-color-outline-variant, #eee); }
.drawer-legs .leg-badge { padding: 2px 8px; border-radius: 0; font-size: 10px; font-weight: 700; }
.drawer-legs .leg-badge--sell { background: #dcfce7; color: #166534; }
.drawer-legs .leg-badge--buy  { background: #fee2e2; color: #991b1b; }
body:not(.theme-light) .drawer-legs .leg-badge--sell { background: #14532d; color: #86efac; }
body:not(.theme-light) .drawer-legs .leg-badge--buy  { background: #7f1d1d; color: #fca5a5; }

.drawer-pl-chart {
  width: 100%; height: 160px; margin-bottom: 16px;
  border-radius: 8px; border: 1px solid var(--md-sys-color-outline-variant, #e0e0e0); overflow: hidden;
}
.drawer-em { margin-bottom: 16px; }

.drawer-actions {
  display: flex; gap: 8px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--md-sys-color-outline-variant, #e0e0e0);
  align-items: stretch;
}
.drawer-actions > * {
  padding: 10px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.drawer-actions .scanner-btn--primary {
  flex: 1; background: var(--md-sys-color-primary, #1a73e8); color: var(--md-sys-color-on-primary, #fff);
}
.drawer-actions .opp-tos-copy { background: var(--md-sys-color-surface-variant, #e8e8e8); color: var(--md-sys-color-on-surface, #333); }
.drawer-actions .opp-trade-btn { background: #16a34a; color: #fff; }

.drawer-range-bar { margin-bottom: 14px; }
.drawer-range-bar__label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--md-sys-color-on-surface-variant, #888); font-weight: 600; margin-bottom: 4px;
}
.drawer-range-bar__track {
  position: relative; height: 6px;
  background: var(--md-sys-color-outline-variant, #e0e0e0); border-radius: 3px; margin-bottom: 2px;
}
.drawer-range-bar__fill {
  position: absolute; top: 0; height: 100%;
  background: var(--md-sys-color-primary, #1a73e8); border-radius: 3px; opacity: 0.4;
}
.drawer-range-bar__dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: var(--md-sys-color-primary, #1a73e8); border: 2px solid #fff; border-radius: 50%; z-index: 1;
}
.drawer-range-bar__labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--md-sys-color-on-surface-variant, #999);
}

.drawer-price {
  text-align: center; margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #eee);
}
.drawer-price__value { font-size: 28px; font-weight: 700; }
.drawer-price__change { font-size: 14px; font-weight: 600; margin-left: 8px; }

.drawer-vol-row { display: flex; gap: 12px; margin-bottom: 16px; justify-content: center; }
.drawer-vol-item { text-align: center; }
.drawer-vol-item__label { font-size: 9px; text-transform: uppercase; color: var(--md-sys-color-on-surface-variant, #888); }
.drawer-vol-item__value { font-size: 14px; font-weight: 600; }

.drawer-fundamentals {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px;
}

.drawer-links { display: flex; gap: 12px; margin-top: 16px; }
.drawer-links a { font-size: 12px; color: var(--md-sys-color-primary, #1a73e8); text-decoration: none; font-weight: 500; }
.drawer-links a:hover { text-decoration: underline; }

/* Spread % inline below Mid/Credit — color-coded. Shared by Scanner and Income Engine. */
.scanner-spread-pct {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant, #888);
}
.scanner-spread-pct.ia-spread-good { color: #16a34a; }
.scanner-spread-pct.ia-spread-ok   { color: #d97706; }
.scanner-spread-pct.ia-spread-wide { color: #dc2626; }

/* Shared between Scanner and Income Engine */
.scanner-moneyness,
.scanner-dte-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--md-sys-color-on-surface-variant, #888);
}

/* Expected Move visual bar — shared by Scanner and Income Engine */
.scanner-em-bar-wrap {
  position: relative;
  height: 6px;
  background: var(--md-sys-color-outline-variant, #e0e0e0);
  border-radius: 3px;
  margin-bottom: 2px;
}
.scanner-em-bar {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--md-sys-color-primary, #1a73e8);
  border-radius: 3px;
  opacity: 0.6;
}
.scanner-em-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  z-index: 1;
}
.scanner-em-dot--inside { background: var(--md-sys-color-primary, #1a73e8); }
.scanner-em-dot--outside { background: #10b981; }
.scanner-em-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--md-sys-color-on-surface-variant, #999);
  line-height: 1;
}
.ia-strike-cell { white-space: nowrap; line-height: 1.3; }
.ia-moneyness { display: block; font-size: 10px; color: var(--md-sys-color-on-surface-variant); }
.ia-earnings-icon { font-size: 14px; color: #e65100; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* Roll Tracker */
.rt-chain-row { cursor: pointer; }
.rt-chain-row:hover { background: var(--md-sys-color-surface-variant); }
.rt-detail-row { display: none; }
.rt-detail-row.rt-detail-visible { display: table-row; }
.rt-expanded .ia-expand-chevron { transform: rotate(90deg); }
.rt-legs-table { width: 100%; font-size: 0.75rem; margin: 0.25rem 0; }
.rt-legs-table th, .rt-legs-table td { padding: 0.25rem 0.5rem; }
.rt-legs-table th { color: var(--md-sys-color-on-surface-variant); font-weight: 600; }

/* Pagination */
.ia-pager { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.75rem 0; }
.ia-pager-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--radius-sm); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); cursor: pointer; }
.ia-pager-btn:hover:not(:disabled) { background: var(--md-sys-color-surface-container); }
.ia-pager-btn:disabled { opacity: 0.35; cursor: default; }
.ia-pager-btn .material-symbols-outlined { font-size: 1.1rem; }
.ia-pager-info { font-size: 0.8rem; color: var(--md-sys-color-on-surface-variant); }

/* Risk badges */
.ia-risk-badge { padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.ia-risk-low { background: #d4edda; color: #155724; }
.ia-risk-moderate { background: #fff3cd; color: #856404; }
.ia-risk-high { background: #ffe0cc; color: #c44900; }
.ia-risk-veryhigh { background: #f8d7da; color: #721c24; }
body:not(.theme-light) .ia-risk-low { background: #1b4332; color: #95d5b2; }
body:not(.theme-light) .ia-risk-moderate { background: #5c4a14; color: #ffd966; }
body:not(.theme-light) .ia-risk-high { background: #6b2e00; color: #ffb380; }
body:not(.theme-light) .ia-risk-veryhigh { background: #5c1a1a; color: #f5a3a3; }

/* Spread quality */
.ia-spread-good { color: var(--md-sys-color-primary); }
.ia-spread-ok { color: var(--md-sys-color-tertiary); }
.ia-spread-wide { color: var(--md-sys-color-error); }

/* Spotlight drawer */
.ia-spotlight-btn { display: inline-flex; align-items: center; gap: 0.25rem; height: 30px; padding: 0 10px; border: 1px solid var(--md-sys-color-primary); border-radius: var(--radius-sm); background: transparent; color: var(--md-sys-color-primary); cursor: pointer; font-size: 12px; font-weight: 600; margin-left: auto; }
.ia-spotlight-btn .material-symbols-outlined { font-size: 18px; }
.ia-spotlight-btn:hover { background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); }
.ia-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 999; display: none; }
.ia-drawer-overlay.ia-drawer--open { display: block; }
.ia-drawer { position: fixed; top: 0; right: -400px; width: 400px; height: 100vh; background: var(--md-sys-color-surface); box-shadow: -4px 0 16px rgba(0,0,0,0.15); z-index: 1000; display: flex; flex-direction: column; transition: right 0.25s ease; }
.ia-drawer.ia-drawer--open { right: 0; }
.ia-drawer-header { display: flex; align-items: center; gap: 0.5rem; padding: 16px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.ia-drawer-title { font-weight: 600; font-size: 15px; flex: 1; }
.ia-drawer-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--md-sys-color-on-surface-variant); padding: 0 4px; }
.ia-drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.ia-spotlight-pick { padding: 12px 0; border-bottom: 1px solid var(--md-sys-color-surface-container); }
.ia-spotlight-pick:last-child { border-bottom: none; }
.ia-spotlight-pick-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.ia-spotlight-pick-rationale { font-size: 12px; color: var(--md-sys-color-on-surface-variant); line-height: 1.4; }
.ia-spotlight-disclaimer { font-size: 11px; color: var(--md-sys-color-on-surface-variant); padding: 12px 16px; font-style: italic; border-top: 1px solid var(--md-sys-color-outline-variant); }
.ia-spotlight-scoring-info { font-size: 13px; color: var(--md-sys-color-on-surface-variant); cursor: help; margin-left: 4px; opacity: 0.6; position: relative; }
.ia-spotlight-scoring-info[data-tip]::after {
  content: attr(data-tip);
  position: absolute; right: 0; top: 100%; margin-top: 6px; z-index: 1000;
  background: #f0f0f5; color: #1a1a2e;
  font-size: 11px; font-weight: 400; line-height: 1.4; padding: 8px 12px;
  border-radius: 8px; white-space: normal; width: max-content; max-width: 300px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.ia-spotlight-scoring-info[data-tip]:hover::after { opacity: 1; }
.theme-light .ia-spotlight-scoring-info[data-tip]::after { background: #2d2d3f; color: #f0f0f5; }

/* Actions column */
.ia-actions-cell { white-space: nowrap; }
.ia-actions-cell button { margin-right: 0.25rem; }

/* Empty state */
.ia-empty { text-align: center; padding: 2rem; color: var(--md-sys-color-on-surface-variant); }

/* Mobile */
@media (max-width: 768px) {
  .ia-input-bar { flex-direction: column; }
  .ia-input-group { width: 100%; }
  .ia-input-group input[type="number"], .ia-input-group input[type="text"], .ia-input-group select { width: 100%; }
  .ia-context-bar { flex-direction: column; gap: 0.5rem; }
  .ia-ctx-divider { display: none; }
  .ia-data-table { display: block; overflow-x: auto; }
  .ia-multiselect-panel { width: calc(100vw - 3rem); left: 0; }
  .ia-preset-bar { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════
   INCOME ENGINE — STRATEGY COMPARISON
   ═══════════════════════════════════════════════════════════ */
.ia-compare-cb { width: 16px; height: 16px; cursor: pointer; accent-color: var(--md-sys-color-primary); }
.ia-compare-cb-cell { width: 30px; padding: 8px 4px 8px 12px !important; }
.ia-compare-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 900; background: var(--md-sys-color-surface-container); border-top: 1px solid var(--md-sys-color-outline-variant); padding: 10px 24px; display: none; align-items: center; justify-content: space-between; box-shadow: 0 -2px 8px rgba(0,0,0,0.1); transition: height 0.3s ease; }
.ia-compare-bar--visible { display: flex; }
.ia-compare-bar-left { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: var(--md-sys-color-on-surface); }
.ia-compare-bar-right { display: flex; gap: 8px; }
.ia-compare-bar-btn { padding: 6px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.ia-compare-bar-btn--primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.ia-compare-bar-btn--primary:hover { filter: brightness(1.1); }
.ia-compare-bar-btn--outline { background: transparent; border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface); }
.ia-compare-bar-btn--outline:hover { background: var(--md-sys-color-surface-container-high); }
.ia-compare-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(2px); z-index: 900; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.ia-compare-overlay.open { opacity: 1; pointer-events: auto; }
.ia-compare-panel { position: fixed; bottom: 0; left: 0; right: 0; z-index: 901; background: var(--md-sys-color-surface); border-top: 2px solid var(--md-sys-color-primary); display: none; flex-direction: column; max-height: 70vh; box-shadow: 0 -4px 16px rgba(0,0,0,0.15); overscroll-behavior: contain; }
.ia-compare-panel--open { display: flex; }
.ia-compare-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--md-sys-color-outline-variant); flex-shrink: 0; }
.ia-compare-panel-title { font-size: 16px; font-weight: 600; color: var(--md-sys-color-on-surface); }
.ia-compare-panel-close { border: none; background: transparent; cursor: pointer; color: var(--md-sys-color-on-surface-variant); font-size: 20px; padding: 4px; }
.ia-compare-panel-body { display: grid; gap: 16px; padding: 16px 24px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.ia-compare-panel-body--cols-2 { grid-template-columns: 1fr 1fr; }
.ia-compare-panel-body--cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.ia-compare-card { border: 1px solid var(--md-sys-color-outline-variant); border-radius: 12px; overflow: hidden; }
.ia-compare-card-header { padding: 10px 14px; background: var(--md-sys-color-surface-container); font-weight: 600; font-size: 13px; }
.ia-compare-card-body { padding: 0; }
.ia-compare-row { display: flex; justify-content: space-between; padding: 6px 14px; font-size: 13px; border-bottom: 1px solid var(--md-sys-color-surface-container-high); }
.ia-compare-row:last-child { border-bottom: none; }
.ia-compare-label { color: var(--md-sys-color-on-surface-variant); }
.ia-compare-value { font-weight: 600; }
.ia-compare-winner { background: rgba(16,185,129,0.1); }
.ia-compare-sizing-section { border-top: 2px solid var(--md-sys-color-outline-variant); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   INCOME ENGINE — POSITION SIZING
   ═══════════════════════════════════════════════════════════ */
.ia-input-group input.ia-sizing-input[type="number"] { width: 120px; }
.ia-sizing-input::placeholder { font-size: 11px; }
.ia-qty-cell { text-align: center; white-space: nowrap; line-height: 1.3; }
.ia-qty-value { font-weight: 600; font-size: 12px; }
.ia-qty-total { display: block; font-size: 10px; color: var(--md-sys-color-on-surface-variant); }

/* ===== WHEEL PLANNER ===== */
.wp-page { display: flex; flex-direction: column; gap: 12px; }

/* Stats bar */
.wp-stats { display: flex; gap: 32px; padding: 14px 20px; flex-wrap: wrap; min-height: 48px; align-items: center; }
.wp-stat-item { display: flex; flex-direction: column; gap: 2px; }
.wp-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--md-sys-color-on-surface-variant); letter-spacing: 0.5px; }
.wp-stat-value { font-size: 18px; font-weight: 700; color: var(--md-sys-color-on-surface); }

/* Controls */
.wp-controls { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
.wp-controls-left { display: flex; align-items: center; gap: 12px; }
.wp-search-input {
  padding: 0 12px; border: 1px solid var(--md-sys-color-outline); border-radius: 8px;
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font-size: 13px; width: 140px; max-width: 140px; text-transform: uppercase;
  height: 32px; box-sizing: border-box;
}
.wp-sort-select {
  padding: 0 12px; border: 1px solid var(--md-sys-color-outline); border-radius: 8px;
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font-size: 13px; cursor: pointer; width: 130px; max-width: 130px;
  height: 32px; box-sizing: border-box;
}
.wp-controls-right { display: flex; align-items: center; gap: 8px; }
.wp-tab-toggle { display: flex; border: 1px solid var(--md-sys-color-outline); border-radius: 8px; overflow: hidden; }
.wp-tab { padding: 6px 16px; border: none; background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; font-size: 13px; font-weight: 500; }
.wp-tab:hover { background: var(--md-sys-color-surface-container-high); }
.wp-tab-active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.wp-tab-active:hover { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); filter: brightness(1.1); }

/* Buttons */
.wp-btn { padding: 6px 14px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.wp-btn-primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.wp-btn-primary:hover { filter: brightness(1.1); }
.wp-btn-outline { background: transparent; border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface); }
.wp-btn-outline:hover { background: var(--md-sys-color-surface-container-high); }
.wp-btn-sm { padding: 4px 10px; font-size: 11px; }

/* Card grid */
.wp-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1024px) { .wp-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .wp-card-grid { grid-template-columns: 1fr; } }

/* Cards */
.wp-card { border: 1px solid var(--md-sys-color-outline-variant); border-radius: 12px; background: var(--md-sys-color-surface); overflow: hidden; }
.wp-card-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--md-sys-color-surface-container-high); }
.wp-card-ticker { font-weight: 700; font-size: 16px; }
.wp-card-body { padding: 10px 14px; font-size: 13px; }
.wp-card-detail { color: var(--md-sys-color-on-surface-variant); margin-bottom: 6px; }
.wp-card-premium { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; }
.wp-card-premium-label { color: var(--md-sys-color-on-surface-variant); }
.wp-card-premium-value { font-weight: 600; color: var(--md-sys-color-success); }
.wp-card-actions { display: flex; gap: 4px; padding: 8px 14px; border-top: 1px solid var(--md-sys-color-surface-container-high); flex-wrap: wrap; }

/* Phase badges */
.wp-phase-badge { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.wp-phase-csp { background: #dcfce7; color: #16a34a; }
.wp-phase-shares { background: #dbeafe; color: #1d4ed8; }
.wp-phase-cc { background: #fef3c7; color: #92400e; }
body:not(.theme-light) .wp-phase-csp { background: #1b4332; color: #95d5b2; }
body:not(.theme-light) .wp-phase-shares { background: #1e2d4a; color: #93b4f5; }
body:not(.theme-light) .wp-phase-cc { background: #5c4a14; color: #ffd966; }

/* States */
.wp-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 48px 0; color: var(--md-sys-color-on-surface-variant); }
.wp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 0; color: var(--md-sys-color-on-surface-variant); }

/* Completed table */
.wp-completed-wrap { overflow-x: auto; }
.wp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wp-table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--md-sys-color-primary); border-bottom: 1px solid var(--md-sys-color-outline-variant); cursor: pointer; white-space: nowrap; user-select: none; }
.wp-table td { padding: 8px 12px; border-bottom: 1px solid var(--md-sys-color-surface-container-high); white-space: nowrap; }
.wp-table tr:hover td { background: var(--md-sys-color-surface-container); }

/* Modals */
.wp-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.wp-modal { background: var(--md-sys-color-surface); border-radius: 16px; width: 420px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.wp-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.wp-modal-title { font-size: 16px; font-weight: 600; }
.wp-modal-close { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--md-sys-color-on-surface-variant); padding: 4px; }
.wp-modal-body { padding: 16px 20px; }
.wp-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--md-sys-color-outline-variant); }

/* Form groups */
.wp-form-group { margin-bottom: 12px; }
.wp-form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.wp-form-group input { width: 100%; padding: 8px 10px; border: 1px solid var(--md-sys-color-outline); border-radius: 8px; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-size: 13px; box-sizing: border-box; }

/* Import candidates */
.wp-import-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--md-sys-color-surface-container-high); }
.wp-import-item:last-child { border-bottom: none; }
.wp-import-cb { width: 16px; height: 16px; accent-color: var(--md-sys-color-primary); }
.wp-import-info { flex: 1; font-size: 13px; }
.wp-import-ticker { font-weight: 600; }
.wp-import-detail { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
.wp-import-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.wp-import-search { width: 100%; padding: 8px 10px; border: 1px solid var(--md-sys-color-outline); border-radius: 8px; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-size: 13px; box-sizing: border-box; }
.wp-import-actions { display: flex; align-items: center; gap: 8px; }
.wp-import-count { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-left: auto; }

/* Journey Drawer */
.wp-journey-panel {
  position: fixed; top: 0; right: -500px; width: 500px; max-width: 95vw; height: 100vh;
  background: var(--md-sys-color-surface); border-left: 1px solid var(--md-sys-color-outline-variant);
  z-index: 200; transition: right 0.25s ease; display: flex; flex-direction: column;
  box-shadow: -2px 0 16px rgba(0,0,0,0.15);
}
.wp-journey-panel.open { right: 0; }
.wp-journey-panel__header {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.wp-journey-panel__header h3 {
  margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.wp-journey-panel__close {
  background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px;
  color: var(--md-sys-color-on-surface-variant);
}
.wp-journey-panel__close:hover { background: var(--md-sys-color-surface-container-high); }
.wp-journey-panel__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.wp-journey-panel__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 199;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.wp-journey-panel__backdrop.open { opacity: 1; pointer-events: auto; }

/* Journey Summary */
.wp-journey-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 12px; background: var(--md-sys-color-surface-container); border-radius: 12px;
  margin-bottom: 20px;
}
.wp-journey-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--md-sys-color-on-surface-variant); }
.wp-journey-stat-value { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* Timeline */
.wp-timeline { position: relative; padding-left: 24px; }
.wp-timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: var(--md-sys-color-outline-variant);
}
.wp-timeline-item { position: relative; padding-bottom: 20px; }
.wp-timeline-item:last-child { padding-bottom: 0; }
.wp-timeline-dot {
  position: absolute; left: -20px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface);
}
.wp-timeline-dot--csp { border-color: #16a34a; background: #dcfce7; }
.wp-timeline-dot--assignment { border-color: #2563eb; background: #dbeafe; }
.wp-timeline-dot--cc { border-color: #d97706; background: #fef3c7; }
.wp-timeline-dot--close { border-color: #6b7280; background: #f3f4f6; }
body:not(.theme-light) .wp-timeline-dot--csp { background: #1b4332; }
body:not(.theme-light) .wp-timeline-dot--assignment { background: #1e2d4a; }
body:not(.theme-light) .wp-timeline-dot--cc { background: #5c4a14; }
body:not(.theme-light) .wp-timeline-dot--close { background: #2a2f38; }
.wp-timeline-dot--active { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary); }
.wp-timeline-phase-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.wp-timeline-phase-label--csp { color: #16a34a; }
.wp-timeline-phase-label--assignment { color: #2563eb; }
.wp-timeline-phase-label--cc { color: #d97706; }
.wp-timeline-phase-label--close { color: #6b7280; }
.wp-timeline-details { font-size: 13px; color: var(--md-sys-color-on-surface); line-height: 1.5; }
.wp-timeline-details span { color: var(--md-sys-color-on-surface-variant); }
.wp-timeline-premium { font-weight: 600; color: var(--md-sys-color-success); }
.wp-timeline-pnl { margin-top: 4px; padding: 6px 8px; background: var(--md-sys-color-surface-container); border-radius: 6px; }

/* Wheel planner mobile responsive */
@media (max-width: 768px) {
  .wp-card-grid { grid-template-columns: 1fr; }
  .wp-controls { flex-direction: column; align-items: stretch; }
  .wp-controls-left { flex-wrap: wrap; }
  .wp-controls-right { flex-wrap: wrap; justify-content: flex-start; }
  .wp-search-input { width: 100%; }
  .wp-card { width: 100%; }
  .wp-stats { gap: 16px; padding: 12px 16px; }
  .wp-modal { width: 95vw; }
}

/* ── Topbar Buttons & Help Drawer ── */
.topbar-btn {
  background: none; border: none; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
:not(.topbar-btn) + .topbar-btn { margin-left: auto; }
.topbar-btn + .topbar-btn { margin-left: 4px; }
.topbar-btn:hover { background: var(--md-sys-color-surface-container-high); }
.topbar-btn .material-symbols-outlined { font-size: 20px; }

.topbar-btn--pulse {
  animation: help-pulse 1.5s ease-in-out 3;
}
@keyframes help-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(138, 180, 248, 0); }
  50% { box-shadow: 0 0 0 6px rgba(138, 180, 248, 0.3); }
}

.help-drawer {
  position: fixed; top: 0; right: 0;
  width: 400px; height: 100vh;
  background: var(--md-sys-color-surface, #fff);
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 1100; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.help-drawer.open { transform: translateX(0); }

.help-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
}
.help-drawer__header h3 {
  margin: 0; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.help-drawer__header h3 .material-symbols-outlined {
  color: var(--md-sys-color-primary); font-size: 20px;
}
.help-drawer__close {
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 6px; color: var(--md-sys-color-on-surface-variant);
}
.help-drawer__close:hover { background: var(--md-sys-color-surface-container-high); }

.help-drawer__body {
  flex: 1; overflow-y: auto; padding: 20px;
}

.help-drawer__toc {
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.help-drawer__toc-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 8px;
}
.help-drawer__toc ul { list-style: none; padding: 0; margin: 0; }
.help-drawer__toc li a {
  display: block; padding: 4px 0;
  color: var(--md-sys-color-primary); text-decoration: none; font-size: 13px;
}
.help-drawer__toc li a:hover { text-decoration: underline; }

.help-drawer__overview {
  margin-bottom: 16px;
}
.help-drawer__overview p {
  font-size: 13px; line-height: 1.6;
  color: var(--md-sys-color-on-surface-variant); margin: 0;
  white-space: pre-line;
}

.help-drawer__section h4 {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--md-sys-color-on-surface);
  margin: 24px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.help-drawer__section-desc {
  font-size: 13px; line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant); margin: 0 0 8px;
  white-space: pre-line;
}

.help-drawer__fields { margin: 0; }
.help-drawer__fields dt {
  font-weight: 600; font-size: 13px;
  color: var(--md-sys-color-on-surface); margin-top: 10px;
}
.help-drawer__fields dd {
  margin: 2px 0 0 0; font-size: 13px;
  color: var(--md-sys-color-on-surface-variant); line-height: 1.5;
}

.help-drawer__backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 1099; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.help-drawer__backdrop.open { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
  .help-drawer { width: 100vw; }
}

/* ── Contextual Tooltips ─────────────────────────────── */
.ctx-tooltip {
  position: fixed;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 280px;
  line-height: 1.4;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  box-shadow: var(--md-shadow-1);
}
.ctx-tooltip--visible { opacity: 1; }

/* ── Position Health Dots ────────────────────────────── */
.health-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.health-dot--red { background-color: #e74c3c; }
.health-dot--yellow { background-color: #f39c12; }
.health-dot--green { background-color: #27ae60; }

/* ── Strategy Explainer Popover ──────────────────────── */
.strat-popover {
  position: fixed;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  padding: 16px;
  max-width: 360px;
  z-index: 10001;
  box-shadow: var(--md-shadow-2, var(--md-shadow-1));
  opacity: 0;
  transition: opacity 150ms ease;
}
.strat-popover--visible { opacity: 1; }

.strat-popover__header {
  font-size: 15px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 6px;
}
.strat-popover__desc {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 10px;
  line-height: 1.4;
}
.strat-popover__diagram {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 10px;
}
.strat-popover__diagram svg {
  width: 100%;
  height: auto;
}
.strat-popover__stats {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
}
.strat-popover__stats li { margin-bottom: 2px; }
.strat-popover__stats strong { color: var(--md-sys-color-on-surface-variant); }
.strat-popover__context {
  font-size: 12px;
  padding: 8px;
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
  border-radius: 6px;
  color: var(--md-sys-color-on-surface);
  line-height: 1.4;
}

/* Clickable strategy name */
.strat-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.strat-link:hover {
  text-decoration-style: solid;
  color: var(--md-sys-color-primary);
}

/* ── Simplified Dashboard Mode ───────────────────────── */
.dash-view-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.dash-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms;
}
.dash-view-toggle__btn:hover {
  background: var(--md-sys-color-surface-container-high);
}
.dash-view-toggle__btn .material-symbols-outlined { font-size: 16px; }

/* Simple view sections */
.dash-simple-actions { /* now embedded in dash-movers grid */ }
.dash-simple-link {
  font-size: 13px;
  color: var(--md-sys-color-primary);
  text-decoration: none;
}
.dash-simple-link:hover { text-decoration: underline; }

/* Action item row */
.dash-simple-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 13px;
}
.dash-simple-action-item:last-child { border-bottom: none; }
.dash-simple-action-item__ticker {
  font-weight: 700;
  min-width: 50px;
}
.dash-simple-action-item__msg {
  flex: 1;
  color: var(--md-sys-color-on-surface-variant);
}

/* Quick links grid */
.dash-quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.dash-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 150ms;
}
.dash-quick-link:hover {
  background: var(--md-sys-color-surface-container-high);
}
.dash-quick-link .material-symbols-outlined {
  font-size: 28px;
  color: var(--md-sys-color-primary);
}

/* Section visibility transitions */
[data-dash-section] {
  transition: opacity 200ms ease;
}

@media (max-width: 600px) {
  .dash-quick-links { grid-template-columns: repeat(2, 1fr); }
}

/* ── Beta-Weighted Delta Breakdown ───────────────────── */
.rk-delta-breakdown { margin-top: 12px; }
.rk-delta-breakdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.rk-delta-breakdown__header:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 4%, transparent);
}
.rk-delta-table { width: 100%; border-collapse: collapse; }
.rk-delta-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.rk-delta-table td { font-size: 13px; font-variant-numeric: tabular-nums; }
.rk-delta-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--md-sys-color-outline);
}

/* (Roll Center Greeks Change — moved to main roll CSS block above) */

/* ── Options Flow ── */
.of-page { max-width: 1200px; margin: 0 auto; }

.of-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.of-header__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-md); border: none;
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s;
}
.of-header__btn:hover { opacity: 0.9; }
.of-header__btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Filter bar */
.of-filters {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container);
  padding: 12px 16px; margin-bottom: 12px;
}
.of-filters__row {
  display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap;
}
.of-filter { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.of-filter__label {
  font-size: 0.75rem; font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}
.of-filter__select {
  height: 28px; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface);
  min-width: 90px;
}
.of-filter__select--wide { min-width: 130px; }
.of-filters__sep {
  width: 1px; height: 28px; align-self: center;
  background: var(--md-sys-color-outline-variant);
}
.of-filter__reset {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 2px 12px; border-radius: 6px; box-sizing: border-box;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface-variant);
  font-size: 12px; cursor: pointer; align-self: flex-end;
}
.of-filter__reset:hover { background: var(--md-sys-color-surface-container-high); }
.of-filter__expand {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: auto; height: 28px; padding: 2px 12px; border-radius: 6px; box-sizing: border-box;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface-variant);
  font-size: 12px; cursor: pointer; align-self: flex-end;
}
.of-filter__expand:hover { background: var(--md-sys-color-surface-container-high); }
@media (max-width: 768px) {
  .of-filters__row { gap: 10px; }
  .of-filter__select { min-width: 70px; }
  .of-filters__sep { display: none; }
}

/* Stats bar */
.of-stats-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container-high);
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
}
.of-stats-bar__sep { color: var(--md-sys-color-outline); }

.of-loading {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 0; gap: 12px;
}
.of-loading__text { font-size: 13px; color: var(--md-sys-color-on-surface-variant); }

.of-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 0; gap: 8px; text-align: center;
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
}

/* Ticker groups */
.of-ticker {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  background: var(--md-sys-color-surface-container);
  margin-bottom: 8px; overflow: hidden;
}
.of-ticker__header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  background: var(--md-sys-color-surface-container-high);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  user-select: none;
}
.of-ticker__header:hover { background: var(--md-sys-color-surface-container-highest); }
.of-ticker__chevron {
  font-size: 18px; color: var(--md-sys-color-on-surface-variant);
  transition: transform 0.2s;
}
.of-ticker--collapsed .of-ticker__chevron { transform: rotate(-90deg); }
.of-ticker--collapsed .of-ticker__body { display: none; }
.of-ticker__symbol { font-weight: 700; font-size: 14px; color: var(--md-sys-color-on-surface); }
.of-ticker__price { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.of-ticker__change { font-size: 12px; }
.of-ticker__hits { margin-left: auto; font-size: 11px; color: var(--md-sys-color-on-surface-variant); }

/* Hits table */
.of-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.of-table th {
  padding: 6px 10px; text-align: left; font-weight: 600; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--md-sys-color-on-surface-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
}
.of-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
}
.of-table td:not(:first-child),
.of-table th:not(:first-child) { border-left: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 50%, transparent); }
.of-table tr:last-child td { border-bottom: none; }
.of-table tr.of-row--strong { background: color-mix(in srgb, var(--md-sys-color-error) 6%, transparent); }

/* Sortable column headers */
.of-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.of-th-sort:hover { color: var(--md-sys-color-primary); }
.of-sort-arrow { font-size: 10px; margin-left: 2px; opacity: 0.3; }
.of-sort-arrow::after { content: '⇅'; }
.of-th-sort.sort-asc .of-sort-arrow { opacity: 1; }
.of-th-sort.sort-asc .of-sort-arrow::after { content: '↑'; }
.of-th-sort.sort-desc .of-sort-arrow { opacity: 1; }
.of-th-sort.sort-desc .of-sort-arrow::after { content: '↓'; }

/* Signal pills */
.of-signal {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700;
}
.of-signal--bullish { background: #4caf50; color: #fff; }
.of-signal--bearish { background: #ef5350; color: #fff; }

/* Vol/OI ratio */
.of-voi { font-weight: 700; }
.of-voi--flag { color: #ffa726; }
.of-voi--strong { color: #ef5350; }

/* Type badge */
.of-type { font-weight: 600; }
.of-type--call { color: #4caf50; }
.of-type--put { color: #ef5350; }

/* Action links */
.of-action {
  font-size: 11px; color: var(--md-sys-color-primary);
  text-decoration: none; white-space: nowrap;
}
.of-action:hover { text-decoration: underline; }

/* No activity footer */
.of-no-activity {
  padding: 12px 14px; font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
}

@media (max-width: 768px) {
  .of-table { font-size: 11px; }
  .of-table th, .of-table td { padding: 5px 6px; }
}

/* ── Ticker Autocomplete ─────────────────────────────────── */
.ta-dropdown {
  position: fixed;
  z-index: 9999;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
  max-height: 240px;
  overflow-y: auto;
  min-width: 240px;
  font-family: inherit;
}
.ta-item {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface);
  user-select: none;
}
.ta-item:hover {
  background: var(--md-sys-color-surface-container-high);
}
.ta-item--active {
  background: color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent);
  box-shadow: inset 3px 0 0 var(--md-sys-color-primary);
}
.ta-item__symbol {
  font-weight: 600;
  min-width: 60px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}
.ta-item__name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--md-sys-color-on-surface-variant);
}
.ta-empty,
.ta-error {
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
  cursor: default;
  text-align: center;
}
.ta-error {
  color: var(--md-sys-color-error);
}
