:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #059669;
  --green-soft: #e8f8f0;
  --red: #dc2626;
  --red-soft: #fff1f2;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4ee;
  --surface: #ffffff;
  --surface-alt: #f7fafc;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 24rem),
    #ffffff;
  transition: background 180ms ease, color 180ms ease;
}

body.modal-open {
  overflow: hidden;
}

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

body.dark-theme {
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --ink: #f9fafb;
  --muted: #d1d5db;
  --line: #4b5563;
  --surface: #1f2937;
  --surface-alt: #374151;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  background: #111827;
  color: #f9fafb;
  color-scheme: dark;
}

.app-shell {
  display: grid;
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.5rem;
}

.hero,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 180px;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  position: relative;
}

.hero::after {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(5, 150, 105, 0.14));
  border-radius: 999px;
  content: "";
  height: 15rem;
  position: absolute;
  right: -5rem;
  top: -7rem;
  width: 15rem;
}

.eyebrow {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

h1,
h2 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  color: #10203f;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  line-height: 1;
}

h2 {
  color: #10203f;
  font-size: 1.28rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.8rem 0 0;
}

.hero-stat {
  align-items: center;
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  display: grid;
  gap: 0.2rem;
  min-width: 150px;
  padding: 1rem;
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero-actions {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.theme-toggle {
  background: #eef6ff;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  color: var(--blue-dark);
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 160ms ease;
  white-space: nowrap;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.hero-stat span {
  color: var(--blue);
  font-size: 2.2rem;
  font-weight: 900;
}

.hero-stat small {
  color: var(--muted);
  font-weight: 800;
}

.private-beta-banner {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 190px;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.beta-banner-content {
  align-items: flex-start;
  display: flex;
  gap: 0.9rem;
  min-width: 0;
}

.beta-banner-icon {
  align-items: center;
  background: var(--green-soft);
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-radius: 14px;
  color: var(--green);
  display: flex;
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 900;
  height: 2.8rem;
  justify-content: center;
  width: 2.8rem;
}

.beta-banner-copy {
  min-width: 0;
}

.beta-banner-copy h2 {
  margin-bottom: 0.45rem;
}

.beta-banner-copy p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 0.45rem;
}

.beta-banner-lead {
  color: var(--ink) !important;
  font-weight: 900;
}

.beta-thanks {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.92rem;
  gap: 0.3rem 0.65rem;
  margin-top: 0.65rem;
}

.beta-thanks strong {
  color: var(--ink);
  flex-basis: 100%;
}

.beta-feedback-button {
  margin-top: 0.75rem;
}

.beta-banner-badge {
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  color: var(--blue-dark);
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  min-width: 150px;
  padding: 0.85rem 1rem;
  text-align: center;
  text-transform: uppercase;
}

.beta-banner-badge strong {
  font-size: 0.86rem;
  font-weight: 900;
}

.beta-banner-badge span {
  font-size: 0.78rem;
  font-weight: 900;
}

.tabs {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 0.45rem;
  padding: 0.45rem;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  width: fit-content;
}

.tab-button {
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  min-height: 44px;
  padding: 0.7rem 1rem;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.tab-button:hover {
  background: #f4f8ff;
  color: var(--blue-dark);
  transform: translateY(-1px);
}

.tab-button.is-active {
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
  color: #ffffff;
}

.tab-panel {
  animation: tabFade 180ms ease;
  display: none;
  min-width: 0;
}

.tab-panel.is-active {
  display: block;
}

@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.card {
  min-width: 0;
  padding: 1.25rem;
}

.trade-form {
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.trade-form.is-editing {
  border-color: #93c5fd;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.14);
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field span {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
}

.field-helper {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.read-only-field output {
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  display: flex;
  font-weight: 900;
  min-height: 48px;
  padding: 0.78rem 0.85rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
  width: 100%;
}

.field input,
.field select,
.field textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: var(--ink);
  min-height: 48px;
  padding: 0.78rem 0.85rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
  width: 100%;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
  outline: none;
}

.edit-status {
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  color: var(--blue-dark);
  font-weight: 900;
  margin: 0 0 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 0.85rem;
  transform: translateY(-0.35rem);
  transition: max-height 220ms ease, opacity 180ms ease, padding 180ms ease, transform 180ms ease;
}

.edit-status.is-visible {
  max-height: 4rem;
  opacity: 1;
  padding: 0.75rem 0.85rem;
  transform: translateY(0);
}

.success-message {
  background: var(--green-soft);
  border: 1px solid #bcebd5;
  border-radius: 12px;
  color: var(--green);
  font-weight: 900;
  margin: 0 0 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 0.85rem;
  transform: translateY(-0.35rem);
  transition: max-height 220ms ease, opacity 180ms ease, padding 180ms ease, transform 180ms ease;
}

.success-message.is-visible {
  max-height: 4rem;
  opacity: 1;
  padding: 0.75rem 0.85rem;
  transform: translateY(0);
}

.notes-field {
  grid-column: 1 / -1;
}

.option-fields {
  display: grid;
  gap: 1rem;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-0.35rem);
  transition: max-height 240ms ease, opacity 180ms ease, transform 180ms ease;
}

.option-fields.is-visible {
  max-height: 18rem;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  min-height: 48px;
  padding: 0.8rem 1.1rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
  color: #ffffff;
}

.primary:hover {
  background: var(--blue-dark);
}

.secondary {
  background: #eef6ff;
  color: var(--blue-dark);
}

.cancel-edit-button {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.summary-card {
  position: sticky;
  top: 1rem;
}

.metric-list {
  display: grid;
  gap: 0.85rem;
}

.metric {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
}

.option-metric {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  padding-top: 0;
  transform: translateY(-0.35rem);
  transition: max-height 240ms ease, opacity 180ms ease, padding 180ms ease, transform 180ms ease;
}

.option-metric.is-visible {
  max-height: 8rem;
  opacity: 1;
  padding-bottom: 1rem;
  padding-top: 1rem;
  transform: translateY(0);
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric strong {
  color: #10203f;
  font-size: 1.65rem;
  line-height: 1.1;
}

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

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

.muted-message {
  color: var(--muted) !important;
  font-size: 0.95rem !important;
  line-height: 1.35 !important;
}

.formula-note {
  background: var(--green-soft);
  border: 1px solid #bcebd5;
  border-radius: 14px;
  margin-top: 1rem;
  padding: 1rem;
}

.formula-note p {
  color: var(--green);
  font-weight: 900;
  margin: 0 0 0.25rem;
}

.formula-note span {
  color: #245548;
  display: block;
  line-height: 1.45;
}

.history-heading {
  gap: 1rem;
}

.history-card {
  overflow: hidden;
}

.history-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.sort-control {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.sort-control span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.sort-control select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.sort-control select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
  outline: none;
}

.history-total {
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: var(--blue-dark);
  font-weight: 900;
  margin: 0;
  padding: 0.55rem 0.85rem;
  white-space: nowrap;
}

.print-button {
  min-height: 42px;
  padding: 0.65rem 0.95rem;
}

.print-report-header {
  display: none;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  scrollbar-gutter: stable;
  width: 100%;
}

table {
  border-collapse: collapse;
  min-width: 1450px;
  table-layout: auto;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0.75rem;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
  vertical-align: top;
}

th {
  background: #f4f8ff;
  color: #31506f;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: #24364b;
  font-size: 0.92rem;
}

th:first-child,
td:first-child {
  min-width: 115px;
}

th:nth-child(2),
td:nth-child(2) {
  min-width: 125px;
}

th:nth-child(3),
td:nth-child(3) {
  min-width: 85px;
}

th:nth-child(4),
td:nth-child(4) {
  min-width: 120px;
}

th:nth-child(5),
td:nth-child(5) {
  min-width: 90px;
}

th:nth-child(6),
td:nth-child(6) {
  min-width: 115px;
}

th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8) {
  min-width: 120px;
}

th:nth-child(9),
td:nth-child(9) {
  min-width: 115px;
}

th:nth-child(10),
td:nth-child(10) {
  min-width: 90px;
}

th:nth-child(11),
td:nth-child(11) {
  min-width: 180px;
}

th:first-child,
td:first-child,
th:nth-child(3),
td:nth-child(3),
th:nth-child(5),
td:nth-child(5),
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9),
th:nth-child(10),
td:nth-child(10) {
  white-space: nowrap;
}

th:last-child,
td.action-cell {
  background: #ffffff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.06);
  min-width: 145px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  position: sticky;
  right: 0;
  width: 145px;
  z-index: 3;
}

th:last-child {
  background: #f4f8ff;
  z-index: 4;
}

.editing-row td.action-cell {
  background: #f4f8ff;
}

.editing-row {
  background: #f4f8ff;
}

.notes-cell {
  min-width: 180px;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.action-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-start;
  white-space: nowrap;
}

.edit-button,
.delete-button {
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  min-height: 2.1rem;
  padding: 0.42rem 0.55rem;
  white-space: nowrap;
}

.edit-button {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  color: var(--blue-dark);
}

.delete-button {
  background: var(--red-soft);
  border: 1px solid #fecdd3;
  color: var(--red);
}

.broker-badge {
  align-items: center;
  border: 1px solid;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  max-width: 100%;
  padding: 0.32rem 0.6rem;
  white-space: normal;
}

.broker-screen-label {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.broker-subline {
  font-size: 0.78em;
  opacity: 0.9;
}

.broker-print-label {
  display: none;
}

.broker-badge.broker-robinhood {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.broker-badge.broker-fidelity {
  background: #f0fdfa;
  border-color: #14b8a6;
  color: #0f766e;
}

.broker-badge.broker-schwab {
  background: #fff4e5;
  border-color: #f97316;
  color: #c2410c;
}

.broker-badge.broker-webull {
  background: #eef6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.broker-badge.broker-moomoo {
  background: #faf5ff;
  border-color: #a855f7;
  color: #7e22ce;
}

.broker-badge.broker-interactive-brokers {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

.broker-badge.broker-other {
  background: #f8fafc;
  border-color: #64748b;
  color: #475569;
}

.brokerage-analytics-row {
  border-left-width: 4px;
}

.brokerage-analytics-row.broker-robinhood {
  border-left-color: #10b981;
}

.brokerage-analytics-row.broker-fidelity {
  border-left-color: #15803d;
}

.brokerage-analytics-row.broker-schwab {
  border-left-color: #f97316;
}

.brokerage-analytics-row.broker-webull {
  border-left-color: #3b82f6;
}

.brokerage-analytics-row.broker-moomoo {
  border-left-color: #a855f7;
}

.brokerage-analytics-row.broker-interactive-brokers {
  border-left-color: #ef4444;
}

.brokerage-analytics-row.broker-other {
  border-left-color: #64748b;
}

.broker-dot {
  border-radius: 999px;
  display: inline-block;
  height: 0.62rem;
  margin-right: 0.45rem;
  width: 0.62rem;
}

.broker-dot.broker-robinhood {
  background: #10b981;
}

.broker-dot.broker-fidelity {
  background: #15803d;
}

.broker-dot.broker-schwab {
  background: #f97316;
}

.broker-dot.broker-webull {
  background: #3b82f6;
}

.broker-dot.broker-moomoo {
  background: #a855f7;
}

.broker-dot.broker-interactive-brokers {
  background: #ef4444;
}

.broker-dot.broker-other {
  background: #64748b;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 2rem 1rem 1rem;
  text-align: center;
}

.empty-state strong {
  color: #10203f;
}

.empty-state[hidden] {
  display: none;
}

.dashboard-card {
  overflow: hidden;
}

.dashboard-content[hidden],
.dashboard-empty[hidden] {
  display: none;
}

.dashboard-empty {
  align-items: center;
  background: var(--surface-alt);
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  display: grid;
  font-weight: 800;
  justify-items: center;
  min-height: 12rem;
  padding: 2rem;
  text-align: center;
}

.dashboard-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-metric {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 0.35rem;
  min-height: 8.25rem;
  padding: 1rem;
}

.dashboard-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-metric strong {
  color: #10203f;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  line-height: 1.1;
}

.analytics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.analytics-panel {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
  padding: 1rem;
}

.analytics-panel h3 {
  color: #10203f;
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0 0 0.8rem;
}

.best-strategy {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
}

.analytics-list {
  display: grid;
  gap: 0.55rem;
}

.analytics-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.72rem 0.8rem;
}

.analytics-row span {
  display: grid;
  gap: 0.15rem;
}

.analytics-row strong {
  color: var(--ink);
  font-weight: 900;
}

.analytics-row small,
.analytics-empty {
  color: var(--muted);
  font-weight: 800;
}

.analytics-empty {
  margin: 0;
}

.equity-panel {
  grid-column: 1 / -1;
}

.equity-chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 240px;
  overflow: hidden;
  padding: 0.5rem;
}

.equity-chart svg {
  display: block;
  height: auto;
  width: 100%;
}

.equity-axis {
  stroke: var(--line);
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.equity-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.equity-point {
  fill: var(--green);
  stroke: var(--surface);
  stroke-width: 2;
}

.equity-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-card,
.beta-card,
.coming-soon-card,
.contact-card {
  grid-column: span 2;
}

.version-badge {
  background: #f4f8ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 0.85rem;
  font-weight: 900;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.about-tagline {
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 900;
  margin: 0 0 0.8rem;
}

.about-copy,
.beta-card p,
.mission-card p,
.roadmap-note {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 0.8rem;
}

.founder-card,
.company-card,
.mission-card,
.coming-soon-card,
.contact-card {
  min-width: 0;
}

.identity-name {
  color: #10203f;
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 0.35rem;
}

.identity-role,
.identity-company {
  color: var(--muted);
  font-weight: 900;
  margin: 0 0 0.25rem;
}

.identity-company {
  color: var(--blue-dark);
}

.coming-soon-card h3 {
  color: #10203f;
  font-size: 1rem;
  letter-spacing: 0;
  margin: 1rem 0 0.7rem;
}

.feature-list,
.feedback-list,
.coming-soon-list,
.version-list {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

.feature-list li,
.feedback-list li,
.coming-soon-list li,
.version-list li {
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  display: flex;
  font-weight: 800;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
}

.feedback-list li::before {
  color: var(--green);
  content: "✓";
  font-weight: 900;
}

.feature-list span {
  color: var(--green);
  font-weight: 900;
}

.coming-soon-list span {
  color: var(--green);
  font-weight: 900;
}

.roadmap-note {
  margin: 1rem 0 0;
}

.support-email {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-dark);
  display: inline-flex;
  font-weight: 900;
  margin: 0.35rem 0 1rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.7rem 0.85rem;
  word-break: break-word;
}

.feedback-email-button {
  text-decoration: none;
}

.feedback-status {
  color: var(--muted);
  font-weight: 900;
  margin: 0.85rem 0 0;
  min-height: 1.4rem;
}

.feedback-status.success {
  color: var(--green);
}

.feedback-status.error {
  color: var(--red);
}

.about-footer {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  grid-column: span 2;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.about-footer strong {
  color: #10203f;
}

.modal-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.46);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.delete-modal,
.report-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  max-height: calc(100vh - 2rem);
  max-width: 480px;
  overflow-y: auto;
  padding: 1.25rem;
  position: relative;
  width: min(100%, 480px);
}

.report-modal {
  max-width: 560px;
  width: min(100%, 560px);
}

.delete-modal:focus,
.report-modal:focus {
  outline: none;
}

.modal-close-button {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: var(--blue-dark);
  cursor: pointer;
  display: flex;
  font-size: 1.2rem;
  font-weight: 900;
  height: 2.2rem;
  justify-content: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 2.2rem;
}

.modal-heading {
  padding-right: 2.75rem;
}

.delete-message {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
  margin: 1rem 0;
}

.delete-summary {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 1rem;
}

.delete-summary div {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.delete-summary dt {
  color: var(--muted);
  font-weight: 900;
}

.delete-summary dd {
  color: var(--ink);
  font-weight: 900;
  margin: 0;
  text-align: right;
}

.report-modal-description {
  color: var(--muted);
  line-height: 1.55;
  margin: 1rem 0;
}

.report-range-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-range-grid .field:first-child {
  grid-column: 1 / -1;
}

.report-error {
  color: var(--red);
  font-weight: 900;
  margin: 0.85rem 0 0;
  min-height: 1.35rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.danger {
  background: var(--red);
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
  color: #ffffff;
}

.danger:hover {
  background: #b91c1c;
}

.toast {
  background: var(--green-soft);
  border: 1px solid #bcebd5;
  border-radius: 12px;
  bottom: 1rem;
  box-shadow: var(--shadow);
  color: var(--green);
  font-weight: 900;
  left: 50%;
  max-width: min(92vw, 420px);
  opacity: 0;
  padding: 0.8rem 1rem;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 0.75rem);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 60;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.print-report {
  display: none;
}

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

  .summary-card {
    position: static;
  }

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

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

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

  .about-card,
  .beta-card,
  .coming-soon-card,
  .contact-card,
  .about-footer {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 1rem;
  }

  .tabs {
    flex-wrap: wrap;
    width: 100%;
  }

  .tab-button {
    flex: 1 1 calc(50% - 0.45rem);
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .hero {
    align-items: flex-start;
    display: grid;
    gap: 1rem;
  }

  .hero-actions {
    align-items: stretch;
    display: grid;
    width: 100%;
  }

  .hero-stat {
    min-width: 0;
    width: 100%;
  }

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

  .option-fields {
    grid-template-columns: 1fr;
    max-height: 0;
  }

  .option-fields.is-visible {
    max-height: 24rem;
  }

  .button {
    width: 100%;
  }

  .history-heading {
    align-items: flex-start;
    display: grid;
  }

  .history-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .sort-control {
    align-items: flex-start;
    display: grid;
    width: 100%;
  }

  .sort-control select {
    width: 100%;
  }

  .history-total {
    white-space: normal;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-metric {
    min-height: 0;
  }

  .private-beta-banner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .beta-banner-content {
    display: grid;
  }

  .beta-banner-badge {
    justify-self: stretch;
  }

  .report-range-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-row {
    align-items: flex-start;
    display: grid;
  }

  .feature-list,
  .coming-soon-list {
    grid-template-columns: 1fr;
  }

  .version-badge {
    margin-top: 0.75rem;
  }

  .modal-actions {
    display: grid;
  }
}

body.dark-theme .hero,
body.dark-theme .card,
body.dark-theme .tabs {
  background: #1f2937;
  border-color: #4b5563;
}

body.dark-theme .broker-badge.broker-robinhood {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  color: #34d399;
}

body.dark-theme .broker-badge.broker-fidelity {
  background: rgba(20, 184, 166, 0.16);
  border-color: #14b8a6;
  color: #2dd4bf;
}

body.dark-theme .broker-badge.broker-schwab {
  background: rgba(249, 115, 22, 0.16);
  border-color: #f97316;
  color: #fdba74;
}

body.dark-theme .broker-badge.broker-webull {
  background: rgba(37, 99, 235, 0.18);
  border-color: #3b82f6;
  color: #60a5fa;
}

body.dark-theme .broker-badge.broker-moomoo {
  background: rgba(168, 85, 247, 0.16);
  border-color: #a855f7;
  color: #c084fc;
}

body.dark-theme .broker-badge.broker-interactive-brokers {
  background: rgba(239, 68, 68, 0.16);
  border-color: #ef4444;
  color: #f87171;
}

body.dark-theme .broker-badge.broker-other {
  background: rgba(100, 116, 139, 0.16);
  border-color: #64748b;
  color: #cbd5e1;
}

body.dark-theme .hero::after {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(34, 197, 94, 0.16));
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme .metric strong,
body.dark-theme .empty-state strong,
body.dark-theme .dashboard-metric strong,
body.dark-theme .analytics-panel h3,
body.dark-theme .identity-name,
body.dark-theme .about-footer strong {
  color: #f9fafb;
}

body.dark-theme .subtitle,
body.dark-theme .beta-banner-copy p,
body.dark-theme .hero-stat small,
body.dark-theme .field span,
body.dark-theme .field-helper,
body.dark-theme .metric span,
body.dark-theme td,
body.dark-theme .empty-state,
body.dark-theme .muted-message,
body.dark-theme .dashboard-empty,
body.dark-theme .dashboard-metric span,
body.dark-theme .analytics-row small,
body.dark-theme .analytics-empty,
body.dark-theme .about-copy,
body.dark-theme .beta-card p,
body.dark-theme .mission-card p,
body.dark-theme .report-modal-description,
body.dark-theme .identity-role,
body.dark-theme .roadmap-note,
body.dark-theme .about-footer {
  color: #d1d5db !important;
}

body.dark-theme .hero-stat,
body.dark-theme .beta-banner-badge,
body.dark-theme .tab-button:hover,
body.dark-theme .history-total,
body.dark-theme .edit-status,
body.dark-theme .secondary,
body.dark-theme .theme-toggle,
body.dark-theme .edit-button,
body.dark-theme .version-badge {
  background: #374151;
  border-color: #4b5563;
}

body.dark-theme .hero-stat span,
body.dark-theme .beta-banner-badge,
body.dark-theme .tab-button:hover,
body.dark-theme .history-total,
body.dark-theme .secondary,
body.dark-theme .theme-toggle,
body.dark-theme .edit-button,
body.dark-theme .version-badge {
  color: #f9fafb;
}

body.dark-theme .field input,
body.dark-theme .field select,
body.dark-theme .field textarea,
body.dark-theme .sort-control select,
body.dark-theme .read-only-field output {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-theme .field input::placeholder,
body.dark-theme .field textarea::placeholder {
  color: #d1d5db;
}

body.dark-theme .metric,
body.dark-theme .dashboard-empty,
body.dark-theme .dashboard-metric,
body.dark-theme .analytics-panel,
body.dark-theme .delete-modal,
body.dark-theme .report-modal,
body.dark-theme .delete-summary,
body.dark-theme .feature-list li,
body.dark-theme .feedback-list li,
body.dark-theme .coming-soon-list li,
body.dark-theme .version-list li,
body.dark-theme .support-email,
body.dark-theme th,
body.dark-theme th:last-child,
body.dark-theme td.action-cell,
body.dark-theme .editing-row,
body.dark-theme .editing-row td.action-cell {
  background: #374151;
  border-color: #4b5563;
}

body.dark-theme th {
  color: #d1d5db;
}

body.dark-theme .success-message,
body.dark-theme .formula-note,
body.dark-theme .toast {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
}

body.dark-theme .formula-note span {
  color: #d1d5db;
}

body.dark-theme .modal-close-button {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-theme .delete-message,
body.dark-theme .delete-summary dd {
  color: #f9fafb;
}

body.dark-theme .delete-button {
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

body.dark-theme .trade-form.is-editing {
  border-color: #2563eb;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.22);
}

body.dark-theme .analytics-row,
body.dark-theme .equity-chart,
body.dark-theme .about-footer {
  background: #1f2937;
  border-color: #4b5563;
}

body.dark-theme .analytics-row strong,
body.dark-theme .best-strategy,
body.dark-theme .beta-banner-lead,
body.dark-theme .beta-thanks strong,
body.dark-theme .feature-list li,
body.dark-theme .feedback-list li,
body.dark-theme .coming-soon-list li,
body.dark-theme .identity-company,
body.dark-theme .support-email,
body.dark-theme .version-list li {
  color: #f9fafb;
}

body.dark-theme .equity-point {
  stroke: #1f2937;
}

body.dark-theme * {
  scrollbar-color: #4b5563 #1f2937;
}

body.dark-theme .table-wrap::-webkit-scrollbar {
  height: 0.75rem;
}

body.dark-theme .table-wrap::-webkit-scrollbar-track {
  background: #1f2937;
}

body.dark-theme .table-wrap::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 999px;
}

@media print {
  @page {
    margin: 0.4in;
    size: Letter landscape;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    min-height: 0;
  }

  body * {
    visibility: hidden;
  }

  #print-report,
  #print-report * {
    visibility: visible;
  }

  #print-report {
    background: #ffffff !important;
    color: #111111 !important;
    display: block !important;
    font-family: Arial, Helvetica, sans-serif;
    inset: 0;
    padding: 0;
    position: absolute;
    width: 100%;
  }

  #print-report * {
    box-shadow: none !important;
    color: #111111 !important;
    text-shadow: none !important;
  }

  .print-report-page {
    background: #ffffff !important;
    width: 100%;
  }

  .print-report-title {
    border-bottom: 2px solid #111111;
    margin: 0 0 0.14in;
    padding: 0 0 0.1in;
  }

  .print-report-title h1 {
    font-size: 20pt;
    line-height: 1.1;
    margin: 0 0 0.04in;
  }

  .print-report-title p {
    font-size: 8.5pt;
    line-height: 1.25;
    margin: 0 0 0.02in;
  }

  .print-summary {
    display: grid;
    gap: 0.06in;
    grid-template-columns: repeat(5, 1fr);
    margin: 0 0 0.14in;
  }

  .print-summary div {
    border: 1px solid #444444;
    padding: 0.05in;
  }

  .print-summary span {
    display: block;
    font-size: 6.8pt;
    font-weight: 700;
    margin: 0 0 0.02in;
    text-transform: uppercase;
  }

  .print-summary strong {
    display: block;
    font-size: 9pt;
    font-weight: 900;
  }

  .print-trade-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100% !important;
  }

  .print-trade-table thead {
    display: table-header-group;
  }

  .print-trade-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-trade-table th,
  .print-trade-table td {
    background: #ffffff !important;
    border: 1px solid #333333;
    font-size: 6.7pt;
    line-height: 1.2;
    padding: 0.035in;
    vertical-align: top;
    white-space: normal !important;
    word-break: break-word;
  }

  .print-trade-table th {
    font-weight: 900;
    text-transform: uppercase;
  }

  .print-trade-table th:nth-child(1) {
    width: 0.62in;
  }

  .print-trade-table th:nth-child(2) {
    width: 0.82in;
  }

  .print-trade-table th:nth-child(3) {
    width: 0.55in;
  }

  .print-trade-table th:nth-child(4) {
    width: 0.86in;
  }

  .print-trade-table th:nth-child(5),
  .print-trade-table th:nth-child(6),
  .print-trade-table th:nth-child(7),
  .print-trade-table th:nth-child(8),
  .print-trade-table th:nth-child(9),
  .print-trade-table th:nth-child(10),
  .print-trade-table th:nth-child(11) {
    width: 0.65in;
  }

  .print-trade-table th:nth-child(12) {
    width: 1.3in;
  }
}
