:root {
  color-scheme: light;
  --background: #eeeeee;
  --foreground: #323232;
  --card: #ffffff;
  --card-foreground: #323232;
  --popover: #ffffff;
  --popover-foreground: #323232;
  --primary: #1a8dff;
  --primary-foreground: #ffffff;
  --primary-strong: #034eef;
  --secondary: #efefef;
  --secondary-foreground: #323232;
  --muted: #f4f5f7;
  --muted-foreground: #757575;
  --accent: #323232;
  --accent-foreground: #ffffff;
  --destructive: #ed1c24;
  --destructive-foreground: #ffffff;
  --border: #e0e0e0;
  --input: #cccccc;
  --ring: #1a8dff;
  --chart-1: #1a8dff;
  --chart-2: #cddcfc;
  --chart-3: #a3d1ff;
  --chart-4: #f3f8ff;
  --chart-5: #034eef;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --value-md: 18px;
  --value-lg: 22px;
  /* Two-level surface system: compact controls, then calmer card containers. */
  --radius: 8px;
  --control-radius: 4px;
  --shadow-sm: none;
  --shadow-md: 0 4px 12px hsl(0 0% 20% / 0.08);
  --shadow-lg: 0 8px 24px hsl(0 0% 20% / 0.12);
  --success: #287f34;
  --success-soft: #d7f0db;
  --destructive-soft: #fbd2d3;
  --warning: #facc15;
  --warning-soft: #fff1d0;
  --surface-subtle: #f8f9fa;
  --surface-panel: #ffffff;
  --page-gutter: 28px;
}

* {
  box-sizing: border-box;
  border-color: var(--border);
  outline-color: color-mix(in srgb, var(--ring), transparent 50%);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

body:not(.landingBody) {
  display: flex;
  flex-direction: column;
}

.landingBody { overflow: hidden; background: #ffffff; }
.landing { min-height: 100vh; width: 100%; margin: 0; padding: 0; background: #ffffff url("/assets/login-geometric-background.svg?v=20260713-soft-lines") center 64px / cover no-repeat; }
.landingCompact { height: 100vh; }
.landingNav { display: flex; align-items: center; justify-content: space-between; }
.landingNav { height: 64px; padding: 0 40px; background: #ffffff; border-bottom: 1px solid var(--border); }
.brand { color: var(--foreground); font-size: 22px; font-weight: 600; line-height: 28px; text-decoration: none; }
.landingNavNote { color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.landingHero { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr); align-items: center; gap: 88px; width: min(1260px, calc(100vw - 80px)); height: calc(100vh - 96px); margin: 0 auto; padding: 44px 56px 40px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: .03em; text-transform: uppercase; }
.landingCopy { max-width: 650px; }
.landingCopy h1 { margin-top: 18px; max-width: 620px; color: #202020; font-size: clamp(42px, 4vw, 56px); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; white-space: normal; }
.landingLead { max-width: 590px; margin-top: 24px; color: var(--muted-foreground); font-size: 18px; line-height: 28px; }
.syntheticBadge { display: inline-block; margin-left: 5px; padding: 2px 6px; color: #0d5e9d; background: #e5f4ff; border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.syntheticBadge[hidden] { display: none; }
.headerDemoBadge { margin-left: 0; }
.benefitList { display: grid; gap: 14px; margin: 34px 0 0; padding: 0; color: var(--foreground); font-size: 16px; line-height: 22px; list-style: none; }.benefitList span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; color: #fff; background: var(--primary); border-radius: 50%; font-size: 12px; font-weight: 600; }
.googleButton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 230px; min-height: 44px; margin-top: 28px; padding: 0 16px; color: var(--foreground); background: var(--card); border: 1px solid var(--input); border-radius: var(--control-radius); box-shadow: none; font-size: 15px; font-weight: 500; line-height: 20px; text-decoration: none; }
.googleButton:hover { background: var(--surface-subtle); border-color: var(--primary); }
.googleMark { display: block; width: 18px; height: 18px; object-fit: contain; }
.googleSignInSlot { width: 100%; min-height: 44px; margin-top: 28px; display: flex; align-items: center; justify-content: center; }
.googleSignInSlot > div { width: 100% !important; }
.googleSignInStatus { min-height: 20px; margin: 8px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.loginPanel { width: 100%; max-width: 420px; justify-self: end; padding: 32px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(50, 50, 50, .06); }.loginPanel h2 { margin-top: 18px; font-size: 30px; font-weight: 600; line-height: 36px; }.loginPanel > p { margin-top: 12px; color: var(--muted-foreground); font-size: 15px; line-height: 22px; }.loginPanel .googleButton { width: 100%; }.loginIcon { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 9px; }
.prototypeFooter { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 32px; padding: 7px 24px; overflow: hidden; color: #686868; background: #e5e5e5; border-top: 1px solid #d0d0d0; font-size: var(--text-xs); line-height: 16px; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.landingBody .prototypeFooter { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; }
.previewTopline, .previewFooter { display: flex; justify-content: space-between; color: #dbeafe; font-size: 13px; }
.previewLive { padding: 3px 8px; color: #d1fadf; background: rgba(22,163,74,.22); border-radius: 999px; font-size: 11px; font-weight: 700; }
.previewMetric { display: flex; align-items: baseline; justify-content: space-between; padding: 23px 0 16px; border-bottom: 1px solid rgba(255,255,255,.16); }
.previewMetric span { color: #b7cdf4; font-size: 14px; }
.previewMetric strong { font-size: 24px; letter-spacing: -.03em; }
.previewChart { display: flex; align-items: end; gap: 10px; height: 124px; padding: 24px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.previewChart i { flex: 1; display: block; background: linear-gradient(#91caff, #fff); border-radius: 4px 4px 1px 1px; opacity: .9; }
.previewChart i:nth-child(1) { height: 22%; }.previewChart i:nth-child(2) { height: 45%; }.previewChart i:nth-child(3) { height: 38%; }.previewChart i:nth-child(4) { height: 72%; }.previewChart i:nth-child(5) { height: 58%; }.previewChart i:nth-child(6) { height: 100%; }
.previewFooter { padding-top: 19px; }.previewFooter b { color: #fff; }
@media (max-width: 1100px) and (min-width: 781px) {
  .landingHero {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 40px;
    width: calc(100vw - 48px);
    padding: 36px 24px 56px;
  }

  .landingCopy h1 {
    font-size: 44px;
  }

  .landingLead {
    margin-top: 20px;
    font-size: 16px;
    line-height: 24px;
  }

  .benefitList {
    gap: 11px;
    margin-top: 26px;
    font-size: 14px;
    line-height: 20px;
  }

  .loginPanel {
    max-width: 360px;
    padding: 28px;
  }
}
@media (max-width: 780px) { .landingBody { overflow: auto; }.landingCompact { height: auto; min-height: 100vh; }.landing { background-position: 34% 64px; background-size: auto 100%; }.landingNav { padding: 0 18px; }.landingHero { grid-template-columns: 1fr; gap: 32px; width: 100%; height: auto; min-height: calc(100vh - 64px); padding: 42px 18px; }.landingCopy h1 { font-size: 36px; }.landingLead { font-size: 16px; line-height: 24px; }.benefitList { margin-top: 24px; font-size: 14px; gap: 10px; }.loginPanel { justify-self: stretch; max-width: none; padding: 24px; }.landingBody .prototypeFooter { position: static; }.prototypeFooter { padding-right: 12px; padding-left: 12px; font-size: 10px; } }

button,
input,
select,
textarea {
  font: inherit;
}

.dashboard {
  flex: 1 0 auto;
  width: 100%;
  margin: 0;
  padding: 0 0 28px;
}

.summaryCard,
.positionCards,
.quotePanel,
.chartPanel,
.analysisPanel,
.pastTradesPanel {
  width: min(1280px, calc(100vw - 28px));
  margin-left: auto;
  margin-right: auto;
}

.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.hero {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin: 0 0 18px;
  padding: 16px max(18px, calc((100vw - 1280px) / 2 + 18px)) 16px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

.heroActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profileMenu {
  position: relative;
  display: inline-flex;
}

.profileButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid rgba(26, 141, 255, .32);
  border-radius: 999px;
  box-shadow: none;
}

.profileButton:hover,
.profileButton[aria-expanded="true"] {
  background: #0879e6;
  box-shadow: 0 0 0 3px rgba(26, 141, 255, .16);
}

.profileAvatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profileInitials {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.profileDropdown {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 150;
  width: min(260px, calc(100vw - 32px));
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.profileName,
.profileEmail {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profileName {
  color: var(--card-foreground);
  font-size: 14px;
  font-weight: 600;
}

.profileEmail {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.signOutButton {
  width: 100%;
  margin-top: 12px;
  min-height: 32px;
  padding: 0 8px;
  color: #ba1a1a;
  background: #fff7f7;
  border: 1px solid #f3cccc;
  border-radius: var(--control-radius);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
}

.signOutButton:hover {
  background: #ffeded;
}

.heroTitleBlock {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.titleRefreshButton {
  align-self: center;
}

.titleRow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.past-trades-view .dashboard > :not(.pastTradesPage) {
  display: none;
}

.pastTradesPage {
  display: none;
}

body.past-trades-view .pastTradesPage {
  display: block;
}

.kicker {
  flex: 0 0 auto;
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: .01em;
  text-transform: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--card-foreground);
  max-width: none;
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  white-space: nowrap;
}

h2 {
  color: var(--card-foreground);
  font-size: 17px;
  font-weight: 500;
  line-height: 23px;
}

.subcopy,
.panelHeader p,
small {
  color: var(--muted-foreground);
}

.subcopy {
  width: 100%;
  max-width: none;
  display: none;
  margin-top: 8px;
  font-size: var(--text-md);
  line-height: 1.65;
}

button {
  border: 1px solid transparent;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--control-radius);
  color: var(--primary-foreground);
  background: var(--primary);
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  box-shadow: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}

button:hover {
  background: var(--primary-strong);
  transform: none;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ring), transparent 74%);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: .68;
  transform: none;
}

.refreshButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.refreshButton svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refreshButton.loading svg {
  animation: refresh-spin .9s linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .refreshButton.loading svg {
    animation: none;
  }
}

.summaryCard {
  display: grid;
  grid-template-columns: .72fr .92fr 1.02fr .85fr 1.28fr 1.28fr .74fr;
  gap: 0;
  overflow: hidden;
  margin-bottom: 8px;
}

.summaryItem {
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border-right: 1px solid var(--border);
  background: var(--card);
}

.summaryItem:last-child {
  border-right: 0;
}

.summaryItem span,
.metric span {
  display: block;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0;
  text-transform: none;
}

th {
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
  outline: none;
  z-index: 4;
}

.tooltip::after {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1px solid var(--input);
  border-radius: 50%;
  color: var(--muted-foreground);
  font-size: 9px;
  line-height: 1;
  text-transform: none;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 500;
  display: none;
  left: 50%;
  top: calc(100% + 10px);
  width: min(260px, 72vw);
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--foreground);
  color: var(--card);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity .15s ease, transform .15s ease;
}

.tooltip:hover::before,
.tooltip:focus-visible::before {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
}

th:first-child .tooltip::before {
  left: 0;
  transform: translate(0, -4px);
}

th:first-child .tooltip:hover::before,
th:first-child .tooltip:focus-visible::before {
  transform: translate(0, 0);
}

th:last-child .tooltip::before {
  right: 0;
  left: auto;
  transform: translate(0, -4px);
}

th:last-child .tooltip:hover::before,
th:last-child .tooltip:focus-visible::before {
  transform: translate(0, 0);
}

.summaryItem b {
  display: block;
  margin-top: 4px;
  color: var(--card-foreground);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  overflow-wrap: normal;
  white-space: nowrap;
}

#underlyingPrice {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.variationPill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 2px 7px 2px 4px;
  border-radius: 999px;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.variationPillIcon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Summary labels use a broad descendant selector; restore the compact pill layout. */
.summaryItem .variationPill,
.metric .variationPill {
  display: inline-flex !important;
}

.metric .variationPill {
  font-size: var(--text-md) !important;
  line-height: 18px !important;
}

.summaryItem .variationPillIcon,
.metric .variationPillIcon {
  display: inline-grid !important;
  color: #fff !important;
}

.summaryItem .variationPill > span:last-child,
.metric .variationPill > span:last-child {
  display: inline !important;
  color: inherit !important;
  font: inherit !important;
  line-height: inherit !important;
}

.summaryItem .priceValue {
  display: inline;
  color: var(--card-foreground);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

#underlyingPrice .variationPill {
  font-size: 15px;
  line-height: 20px;
}

#underlyingPrice .variationPillIcon {
  width: 20px;
  height: 20px;
  font-size: 14px;
}

.variationPill--up {
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 86%);
}

.variationPill--up .variationPillIcon { background: var(--success); }

.variationPill--down {
  color: var(--destructive);
  background: color-mix(in srgb, var(--destructive), transparent 86%);
}

.variationPill--down .variationPillIcon { background: var(--destructive); }

.variationPill--flat {
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--muted-foreground), transparent 88%);
  font-weight: 400;
}

.variationPill--flat .variationPillIcon { background: var(--muted-foreground); }

.marketRiskVariation,
.pnlVariation {
  color: inherit !important;
}

.symbolSelect {
  display: block;
  width: 100%;
  min-width: 0;
  height: 30px;
  margin-top: 5px;
  border: 1px solid var(--input);
  border-radius: var(--control-radius);
  padding: 0 9px;
  color: var(--card-foreground);
  background: var(--card);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 18px;
}

.symbolSelect option.heldOption {
  font-weight: 500;
}

#strikeDiff {
  font-size: 15px;
}

.positionCards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.metric {
  min-height: 80px;
  padding: 11px 14px;
  transition: border-color .18s ease;
}

.metricTopline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.positionMetricBody {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.positionMetricBody > div {
  min-width: 0;
}

.positionMetricBody .iconButton {
  align-self: center;
}

.metric:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--primary), transparent 58%);
  box-shadow: none;
}

.metric strong {
  display: block;
  margin: 7px 0 3px;
  color: var(--card-foreground);
  font-size: var(--value-md);
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
}

.metric small {
  font-size: var(--text-sm);
  line-height: 18px;
}

.iconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  color: var(--muted-foreground);
  background: var(--card);
  box-shadow: none;
}

.iconButton:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #ffffff;
  transform: none;
  box-shadow: none;
}

.iconButton svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondaryIcon {
  width: 32px;
  height: 32px;
  min-height: 32px;
}

.pnlMetric {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-color: color-mix(in srgb, var(--destructive), transparent 70%);
}

.pnlMetric.profit {
  background: var(--card);
  border-color: color-mix(in srgb, var(--success), transparent 70%);
}

.pnlMetric.empty {
  background: var(--card);
  border-color: var(--border);
}

.pnlMetric.performancePositive {
  border-color: color-mix(in srgb, var(--success), transparent 54%);
  background: linear-gradient(180deg, rgba(40, 127, 52, .1), rgba(40, 127, 52, .035));
}

.pnlMetric.performanceNegative {
  border-color: color-mix(in srgb, var(--destructive), transparent 52%);
  background: linear-gradient(180deg, rgba(237, 28, 36, .105), rgba(237, 28, 36, .035));
}

.pnlMetric.performanceNeutral {
  border-color: color-mix(in srgb, var(--primary), transparent 62%);
  background: var(--chart-4);
}

.quotePanel,
.chartPanel,
.analysisPanel {
  padding: 12px;
  margin-bottom: 10px;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.statusBar {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--surface-subtle);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  line-height: 18px;
}

.statusBar[data-state="loading"] {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 62%);
  background: var(--chart-4);
}

.statusBar[data-state="error"] {
  color: var(--destructive);
  border-color: color-mix(in srgb, var(--destructive), transparent 72%);
  background: var(--destructive-soft);
}

.statusBar[data-state="success"] {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success), transparent 72%);
  background: var(--success-soft);
}

.statusBar a {
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.statusPill {
  flex: 0 1 auto;
  max-width: 100%;
  margin: 0;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--surface-subtle);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusPill[data-state="loading"] {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 62%);
  background: var(--chart-4);
}

.statusPill[data-state="error"] {
  color: var(--destructive);
  border-color: color-mix(in srgb, var(--destructive), transparent 72%);
  background: var(--destructive-soft);
}

.statusPill[data-state="success"] {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success), transparent 72%);
  background: var(--success-soft);
}

.statusPill a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.marketDataRecovery {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.marketDataRecoveryCopy > strong {
  display: none;
}

.marketDataRecovery.is-actionable {
  align-items: center;
  max-width: 560px;
  padding: 9px 10px 9px 12px;
  border: 1px solid color-mix(in srgb, var(--destructive), transparent 66%);
  border-radius: var(--control-radius);
  background: var(--destructive-soft);
}

.marketDataRecovery.is-actionable .marketDataRecoveryCopy {
  min-width: 0;
}

.marketDataRecovery.is-actionable .marketDataRecoveryCopy > strong {
  display: block;
  margin-bottom: 2px;
  color: var(--destructive);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 18px;
}

.marketDataRecovery.is-actionable .statusPill {
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted-foreground);
  white-space: normal;
}

.marketDataRecovery.is-actionable .reconnectPrivateSourceButton {
  flex: 0 0 auto;
  border-color: color-mix(in srgb, var(--destructive), transparent 58%);
  background: var(--card);
  color: var(--destructive);
}

.marketDataRecovery.is-actionable .reconnectPrivateSourceButton:hover {
  border-color: var(--destructive);
  background: color-mix(in srgb, var(--destructive), transparent 94%);
}

.panelHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.panelHeader > div,
.modalHeader > div {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.panelHeader p {
  display: none;
  margin-top: 6px;
  line-height: 1.55;
}

.compactHeader {
  align-items: center;
  margin-bottom: 8px;
}

.compactHeader p {
  display: block;
  font-size: var(--text-sm);
  line-height: 18px;
}

.compactHeader .statusPill {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 16px;
}

.analysisPanel {
  margin-top: 14px;
}

.pastTradesPanel {
  margin-top: 14px;
  padding: 16px;
}

.tableWrap {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}

.analysisWrap,
.quotePanel .tableWrap {
  position: relative;
  z-index: 2;
}

.analysisWrap {
  margin-bottom: 10px;
  /* Keep the header row eligible to stick to the page viewport on desktop. */
  overflow: visible;
}

.pastTradesWrap {
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

caption {
  padding: 9px 12px;
  text-align: left;
  color: var(--card-foreground);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

th,
td {
  height: 48px;
  padding: 7px 8px;
  text-align: right;
  white-space: normal;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.emptyCell {
  height: 58px;
  text-align: center !important;
  color: var(--muted-foreground);
  font-weight: 400;
}

.analysisTable {
  /* Fill the scanner panel on desktop instead of forcing a needless scroll bar. */
  min-width: 100%;
}

.analysisTable th,
.analysisTable td {
  padding-right: 6px;
  padding-left: 6px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.analysisTable .numericCell {
  text-align: right !important;
}

.analysisTable .numericHeader {
  text-align: right !important;
}

/* Long scanner lists retain their column context beneath the sticky app bar. */
.analysisTable thead th {
  position: sticky;
  top: 68px;
  z-index: 20;
  background: var(--surface-subtle);
  box-shadow: inset 0 -1px 0 var(--border), 0 2px 3px rgba(25, 25, 25, .04);
}

.analysisTable th:nth-child(1),
.analysisTable td:nth-child(1) {
  width: 12%;
}

.analysisTable th:nth-child(2),
.analysisTable td:nth-child(2) {
  width: 6%;
}

.analysisTable th:nth-child(3),
.analysisTable td:nth-child(3) {
  width: 10%;
}

.analysisTable th:nth-child(4),
.analysisTable td:nth-child(4) {
  width: 10%;
}

.analysisTable th:nth-child(5),
.analysisTable td:nth-child(5) {
  width: 7%;
}

.analysisTable th:nth-child(6),
.analysisTable td:nth-child(6) {
  width: 10%;
}

.analysisTable th:nth-child(7),
.analysisTable td:nth-child(7) {
  width: 9%;
}

.analysisTable th:nth-child(8),
.analysisTable td:nth-child(8) {
  width: 9%;
}

.analysisTable th:nth-child(9),
.analysisTable td:nth-child(9) {
  width: 10%;
}

.analysisTable th:nth-child(11),
.analysisTable td:nth-child(11) {
  width: 10%;
}

.analysisTable th:nth-child(10),
.analysisTable td:nth-child(10) {
  width: 7%;
}

.pastTradesTable {
  width: 100%;
  min-width: 0;
}

.pastTradesTable th,
.pastTradesTable td {
  height: 48px;
  padding: 8px 12px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.pastTradesTable .numericHeader,
.pastTradesTable .numericCell {
  text-align: right !important;
}

.pastTradesSummary {
  display: grid;
  grid-template-columns: .82fr 1.08fr 1.08fr 1.35fr;
  gap: 8px;
  margin-top: 10px;
}

.pastTradesSummary article {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.pastTradesSummary article.performancePositive {
  border-color: color-mix(in srgb, var(--success), transparent 54%);
  background: linear-gradient(180deg, rgba(40, 127, 52, .1), rgba(40, 127, 52, .035));
}

.pastTradesSummary article.performanceNegative {
  border-color: color-mix(in srgb, var(--destructive), transparent 52%);
  background: linear-gradient(180deg, rgba(237, 28, 36, .105), rgba(237, 28, 36, .035));
}

.pastTradesSummary article.performanceNeutral {
  border-color: color-mix(in srgb, var(--primary), transparent 62%);
  background: var(--chart-4);
}

.pastTradesSummary span {
  display: block;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.pastTradesSummary strong {
  display: block;
  margin-top: 5px;
  color: var(--card-foreground);
  font-size: var(--value-md);
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
}

.usdPnl {
  font-weight: 700;
}

.usdPnlPending {
  color: var(--muted-foreground);
  font-weight: 500;
}

#pastTotalPnl {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  line-height: 24px;
}

#pastTotalPnl .arsPnl {
  font-size: 16px;
  font-weight: 500;
  color: inherit;
}

#pastTotalPnl .totalUsdPnl {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  color: inherit;
}

#pastTotalPnl .usdPnlPending {
  margin-left: 6px;
  font-size: var(--text-sm);
  line-height: 16px;
}

.pastTradesSummary .tradeStatLine {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pastTradesSummary .tradeStatLine > span:first-child {
  color: var(--card-foreground);
  font-size: var(--value-md);
  font-weight: 500;
  line-height: 24px;
}

.pastTradesSummary .statAverage {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 18px;
}

.pastTradesSummary .statAverage b {
  color: var(--card-foreground);
  font-weight: 500;
}

.pastTradesSummary strong.positive {
  color: var(--success);
}

.pastTradesSummary strong.negative {
  color: var(--destructive);
}

.pastTradesSummary .statAverage b.positive {
  color: var(--success);
}

.pastTradesSummary .statAverage b.negative {
  color: var(--destructive);
}

.pastTradesTable th:nth-child(1),
.pastTradesTable td:nth-child(1),
.pastTradesTable th:nth-child(2),
.pastTradesTable td:nth-child(2) {
  text-align: left;
}

.pastTradesTable th:nth-child(1),
.pastTradesTable td:nth-child(1) {
  width: 9%;
}

.pastTradesTable th:nth-child(2),
.pastTradesTable td:nth-child(2) {
  width: 11%;
}

.pastTradesTable th:nth-child(3),
.pastTradesTable td:nth-child(3),
.pastTradesTable th:nth-child(6),
.pastTradesTable td:nth-child(6) {
  width: 13%;
}

.pastTradesTable th:nth-child(4),
.pastTradesTable td:nth-child(4),
.pastTradesTable th:nth-child(5),
.pastTradesTable td:nth-child(5) {
  width: 10%;
}

.pastTradesTable th:nth-child(7),
.pastTradesTable td:nth-child(7) {
  width: 7%;
}

.pastTradesTable th:nth-child(8),
.pastTradesTable td:nth-child(8) {
  width: 27%;
}

.pastTradesTable .pnlCell {
  white-space: nowrap;
}

.pastTradesTable .pnlCell .usdPnl {
  margin-left: 2px;
  font-weight: 700;
}

.analysisTable .askBelowLast {
  background: var(--warning-soft);
  box-shadow: inset 3px 0 0 var(--warning);
}

.analysisTable tbody tr.callRow {
  background: #fbfdff;
}

.analysisTable tbody tr.putRow {
  background: #fffdf8;
}

.analysisTable tbody tr.callRow:hover {
  background: var(--chart-4);
}

.analysisTable tbody tr.putRow:hover {
  background: var(--warning-soft);
}

.analysisTable tbody tr.ownedOptionRow td {
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
}

.analysisTable tbody tr.ownedOptionRow td:first-child {
  border-left: 2px solid var(--primary);
}

.analysisTable tbody tr.ownedOptionRow td:last-child {
  border-right: 2px solid var(--primary);
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: hsl(0 0% 20% / .42);
}

.modalOverlay.open {
  display: flex;
}

.demoWelcomeModal {
  z-index: 260;
  padding: 24px;
  background: hsl(0 0% 20% / .5);
}

.demoWelcomeDialog {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: min(680px, 100%);
  padding: 30px;
  color: var(--card-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 56px hsl(0 0% 20% / .22);
}

.demoWelcomeArt {
  display: grid;
  place-items: center;
  min-height: 158px;
  padding: 12px;
  background: linear-gradient(135deg, #f5f9ff, #ffffff);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
}

.demoWelcomeArt svg {
  width: min(100%, 164px);
  height: auto;
  overflow: visible;
  fill: none;
  stroke: #3a3a3a;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.demoWelcomeArt circle { fill: #ffffff; stroke: var(--primary); stroke-width: 4; }
.demoWelcomeArt .demoWelcomeArtAccent { stroke: var(--primary); stroke-width: 4; }
.demoWelcomeCopy { min-width: 0; }
.demoWelcomeCopy h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 32px;
}
.demoWelcomeCopy p {
  margin: 14px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 21px;
}
.demoWelcomeCopy p.demoWelcomeNote { margin-top: 18px; color: var(--card-foreground); font-weight: 500; }
.demoWelcomeActions { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.demoWelcomePreference { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; line-height: 20px; cursor: pointer; }
.demoWelcomePreference input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.demoWelcomeCopy button { display: flex; align-items: center; justify-content: center; min-width: 154px; min-height: 40px; margin: 0; padding: 0 16px; }

.feedbackWidget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 180;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.feedbackButton {
  width: auto;
  min-height: 44px;
  padding: 0 17px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(26, 141, 255, .2);
}

.feedbackPanel {
  width: min(300px, calc(100vw - 32px));
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.feedbackPanel h2,
.feedbackPanel p {
  margin: 0;
}

.feedbackPanel h2 {
  margin-top: 2px;
  color: var(--card-foreground);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 24px;
}

.feedbackPanel > p:not(.feedbackEyebrow) {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.feedbackEyebrow {
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.feedbackAction {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  padding: 8px 11px;
  color: var(--card-foreground);
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  box-shadow: none;
}

.feedbackAction:hover { border-color: var(--primary); background: #f4f9ff; }
.modalCloseButton {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 70px;
  min-height: 32px;
  padding: 0 8px;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  box-shadow: none;
}

.modalCloseButton:hover { color: var(--card-foreground); background: var(--muted); border-color: var(--input); }

.feedbackForm {
  display: grid;
  width: 100%;
  gap: 14px;
}

.feedbackForm label {
  display: grid;
  gap: 6px;
  color: var(--card-foreground);
  font-size: var(--text-sm);
  font-weight: 600;
}

.feedbackForm select,
.feedbackForm textarea {
  width: 100%;
  color: var(--card-foreground);
  font: inherit;
  font-weight: 400;
  background: #ffffff;
  border: 1px solid var(--input);
  border-radius: var(--control-radius);
}

.feedbackForm select { min-height: 32px; padding: 0 8px; }
.feedbackForm textarea { min-height: 132px; padding: 10px; resize: vertical; }
.feedbackStatus { min-height: 20px; margin: -4px 0 0; color: var(--muted-foreground); font-size: var(--text-sm); }
.feedbackActions { min-width: 0; }
.modalDialog {
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.modalHeader,
.modalActions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modalHeader {
  margin-bottom: 16px;
}

.modalHeader h2 {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 600;
  line-height: 26px;
}

.modalHeader p {
  width: 100%;
  max-width: none;
  margin-top: 6px;
  color: var(--muted-foreground);
  font-size: var(--text-md);
  line-height: 20px;
}

.modalHeader .feedbackEyebrow {
  margin-top: 0;
  font-size: var(--text-xs);
  line-height: 16px;
}

/* Feedback is a short, focused task. Keep its dialog deliberately quieter
   and narrower than the trade-editor modal while retaining the shared tokens. */
.modalDialog.feedbackDialog {
  width: min(540px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 18px 42px hsl(0 0% 20% / .16);
}

.feedbackDialog .modalHeader {
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 20px;
}

.feedbackDialog .feedbackEyebrow {
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 14px;
}

.feedbackDialog .modalHeader h2 {
  margin: 3px 0 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -.01em;
}

.feedbackDialog .modalHeader p:not(.feedbackEyebrow) {
  max-width: 390px;
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 19px;
}

.feedbackDialog .modalCloseButton {
  min-width: 52px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
  letter-spacing: .01em;
}

.feedbackDialog .feedbackForm {
  gap: 16px;
}

.feedbackDialog .feedbackForm label {
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.feedbackDialog .feedbackForm select,
.feedbackDialog .feedbackForm textarea {
  border-color: var(--border);
  border-radius: var(--control-radius);
  font-size: 13px;
  line-height: 20px;
}

.feedbackDialog .feedbackForm select {
  min-height: 38px;
  padding: 0 10px;
}

.feedbackDialog .feedbackForm textarea {
  min-height: 118px;
  padding: 10px 11px;
}

.feedbackDialog .feedbackForm select:focus,
.feedbackDialog .feedbackForm textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 86%);
  outline: none;
}

.feedbackDialog .feedbackStatus {
  min-height: 16px;
  margin: -6px 0 0;
  font-size: 11px;
  line-height: 16px;
}

.feedbackDialog .feedbackActions {
  min-width: 0;
  margin-top: -2px;
}

.feedbackDialog .feedbackActions button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 13px;
}

.lotsEditor {
  flex: 1 1 auto;
  min-height: 150px;
  max-height: min(430px, calc(100vh - 318px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--card);
}

.lotHeader,
.lotRow {
  display: grid;
  grid-template-columns: minmax(132px, .95fr) minmax(180px, 1fr) minmax(152px, .72fr) 34px;
  gap: 12px;
  align-items: center;
}

.lotHeader {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  background: var(--surface-subtle);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.lotRow {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.lotRow.newLotRow {
  background: var(--chart-4);
  box-shadow: inset 4px 0 0 var(--primary);
}

.lotRow.newLotRow::before {
  content: "New";
  justify-self: start;
  grid-column: 1 / -1;
  margin: -2px 0 -1px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-transform: uppercase;
}

.lotRow label span {
  display: none;
}

.lotRow input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--input);
  border-radius: var(--control-radius);
  padding: 0 10px;
  color: var(--foreground);
  background: var(--card);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 18px;
}

.lotRow input[type="date"] {
  min-width: 152px;
  padding-right: 8px;
  font-size: var(--text-sm);
}

.deleteLotButton {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--destructive);
}

.modalSummaryBar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin: 0 0 12px;
}

.modalSummary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.modalSummary span {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: none;
}

.modalSummary b {
  display: block;
  margin-top: 4px;
  color: var(--card-foreground);
  font-size: var(--value-md);
  font-weight: 600;
  line-height: 24px;
  text-transform: none;
}

.modalActions {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 300px;
}

.modalActions > div {
  display: flex;
  gap: 8px;
}

.secondaryButton,
.ghostButton {
  color: var(--card-foreground);
  background: var(--secondary);
  border-color: var(--secondary);
  font-weight: 500;
  box-shadow: none;
}

.ghostButton {
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border);
}

.secondaryButton:hover,
.ghostButton:hover {
  color: var(--card-foreground);
  border-color: var(--input);
  background: var(--muted);
  box-shadow: none;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead {
  background: var(--surface-subtle);
}

thead th {
  min-width: 0;
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 16px;
}

thead th:first-child {
  min-width: 0;
}

tbody tr {
  background: var(--card);
}

tbody tr:hover {
  background: var(--chart-4);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--card-foreground);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: 20px;
}

.optionTypeBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
}

.optionTypeBadge.call {
  color: var(--primary-strong);
  background: var(--chart-4);
  border: 1px solid var(--chart-2);
}

.optionTypeBadge.put {
  color: #9f5c00;
  background: var(--warning-soft);
  border: 1px solid #ffd98a;
}

.quotePanel table th:nth-child(1),
.quotePanel table td:nth-child(1) {
  width: 8%;
}

.quotePanel table th:nth-child(2),
.quotePanel table td:nth-child(2),
.quotePanel table th:nth-child(3),
.quotePanel table td:nth-child(3),
.quotePanel table th:nth-child(4),
.quotePanel table td:nth-child(4),
.quotePanel table th:nth-child(5),
.quotePanel table td:nth-child(5) {
  width: 10%;
}

.quotePanel table th:nth-child(n + 6),
.quotePanel table td:nth-child(n + 6) {
  width: 8.66%;
}

.payoffToolbar {
  margin: 0 0 8px;
}

.chartStats {
  display: grid;
  /* Break-even carries both a price and a percentage, so it gets the extra room. */
  grid-template-columns: minmax(148px, 1.28fr) minmax(104px, .82fr) minmax(112px, .86fr) minmax(120px, 1fr);
  gap: 8px;
}

.chartStats span {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.chartStats b {
  display: block;
  color: var(--card-foreground);
  margin-top: 3px;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}

.payoffDetails {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--card);
}

.payoffDetails summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
  list-style: none;
  user-select: none;
}

.payoffDetails summary::-webkit-details-marker {
  display: none;
}

.payoffDetails[open] summary {
  border-bottom: 1px solid var(--border);
}

.payoffToggle::after {
  content: "Show chart";
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 600;
}

.payoffDetails[open] .payoffToggle::after {
  content: "Hide chart";
}

.payoffExpandable {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.chartControls {
  display: grid;
  grid-template-columns: max-content 170px minmax(220px, 1fr) max-content;
  grid-template-areas: "label input range zone";
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--card);
}

.chartControls label {
  grid-area: label;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.chartControls input[type="number"] {
  grid-area: input;
  height: 34px;
  min-width: 0;
  border: 1px solid var(--input);
  border-radius: var(--control-radius);
  padding: 0 12px;
  background: var(--card);
  color: var(--foreground);
  font-weight: 500;
  font-size: var(--text-md);
  line-height: 20px;
  outline: none;
}

.chartControls input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%);
}

.chartControls input[type="range"] {
  grid-area: range;
  width: 100%;
  height: 4px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.chartControls input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.chartControls input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
}

.chartControls input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.chartControls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
}

.scenarioResult {
  grid-area: zone;
  justify-self: end;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-family: inherit;
  font-size: var(--text-xs) !important;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.payoffSvg {
  display: block;
  width: 100%;
  height: clamp(360px, 42vh, 520px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.payoffSvg text {
  font-family: var(--font-sans);
}

.positive {
  color: var(--success) !important;
}

.negative {
  color: var(--destructive) !important;
}

.neutral {
  color: var(--muted-foreground) !important;
}

@media (max-width: 1180px) {
  h1 {
    font-size: 24px;
    line-height: 31px;
  }

  .hero {
    gap: 16px;
  }

  .summaryCard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summaryItem:nth-child(3n) {
    border-right: 0;
  }

  .positionCards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pastTradesSummary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Keep every scanner column legible only when the viewport is genuinely narrow. */
@media (max-width: 1160px) and (min-width: 761px) {
  .analysisWrap {
    overflow-x: auto;
    overflow-y: visible;
  }

  .analysisTable {
    min-width: 1120px;
  }
}

@media (max-width: 900px) {
  .chartStats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .chartStats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard {
    width: 100%;
    padding-top: 0;
  }

  h1 {
    font-size: 22px;
    line-height: 28px;
    white-space: normal;
  }

  h2 {
    font-size: 17px;
  }

  .hero,
  .panelHeader {
    flex-direction: column;
    align-items: stretch;
  }

  .statusPill {
    max-width: 100%;
    white-space: normal;
  }

  .heroActions {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .titleRow {
    align-items: flex-start;
  }

  .heroTitleBlock {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .hero {
    padding: 14px 10px 13px;
    border-radius: 0;
  }

  button {
    width: 100%;
  }

  .refreshButton {
    width: 34px;
    min-width: 34px;
  }

  .heroActions .secondaryButton {
    width: auto;
  }

  .iconButton {
    width: 30px;
  }

  .feedbackWidget { right: 16px; bottom: 16px; }

  .demoWelcomeModal { padding: 16px; }

  .demoWelcomeDialog {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px;
  }

  .demoWelcomeArt {
    min-height: 112px;
    padding: 8px;
  }

  .demoWelcomeArt svg { width: 132px; }
  .demoWelcomeCopy h2 { font-size: 23px; line-height: 29px; }
  .demoWelcomeActions { justify-content: center; gap: 12px; }
  .demoWelcomeCopy button { width: auto; min-width: 142px; }

  .modalActions {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .modalActions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .modalSummaryBar {
    grid-template-columns: 1fr;
  }

  .lotsEditor {
    max-height: calc(100vh - 380px);
  }

  .modalSummary,
  .lotHeader,
  .lotRow {
    grid-template-columns: 1fr;
  }

  .lotHeader {
    display: none;
  }

  .lotRow label span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted-foreground);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  .summaryCard,
  .positionCards {
    grid-template-columns: 1fr;
  }

  .pastTradesSummary {
    grid-template-columns: 1fr;
  }

  .analysisTable {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  .analysisTable th,
  .analysisTable td {
    padding: 7px 5px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analysisTable th:nth-child(n),
  .analysisTable td:nth-child(n) {
    width: auto;
  }

  .summaryItem {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .payoffSvg {
    height: 360px;
  }

  .chartControls {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "input"
      "range"
      "zone";
  }

  .scenarioResult {
    justify-self: start;
  }

  .chartControls strong {
    justify-self: start;
  }
}
