:root {
  color-scheme: light;
  --bg: #f7f8f9;
  --ink: #111820;
  --muted: #687482;
  --line: #d9dee5;
  --panel: #ffffff;
  --accent: #0c7a66;
  --accent-strong: #063f36;
  --accent-ink: #ffffff;
  --gold: #d7a631;
  --blue: #2555d9;
  --danger: #a13d2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(15, 107, 88, 0.2);
}

button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

button.tab {
  box-shadow: none;
}

button.tab.secondary {
  background: transparent;
}

button.danger {
  border: 1px solid rgba(164, 63, 53, 0.24);
  background: #a43f35;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(164, 63, 53, 0.18);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 104px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: min(520px, 64vw);
  height: min(132px, 18vw);
  object-fit: contain;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.public-nav a {
  color: #394552;
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.public-nav a:hover {
  color: var(--accent-strong);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1;
}

h2 {
  font-size: 1.05rem;
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.home {
  display: grid;
  gap: 22px;
  padding: 10px 0 44px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  gap: 38px;
  align-items: center;
  min-height: min(620px, calc(100vh - 112px));
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(12, 122, 102, 0.14), transparent 36%),
    linear-gradient(315deg, rgba(37, 85, 217, 0.12), transparent 32%),
    #ffffff;
  padding: clamp(24px, 4vw, 54px);
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(18, 29, 43, 0.09);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-copy h1 {
  font-size: clamp(3.1rem, 7vw, 6.1rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy h2 {
  max-width: 590px;
  margin-top: 14px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 540px;
  margin: 18px 0 24px;
  color: #3d4652;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-actions a {
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.trust-row span {
  border: 1px solid rgba(12, 122, 102, 0.18);
  border-radius: 999px;
  background: rgba(12, 122, 102, 0.08);
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-visual {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(17, 24, 32, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 250, 0.96)),
    #ffffff;
  box-shadow: 0 30px 90px rgba(17, 24, 32, 0.18);
  padding: 18px;
  backdrop-filter: blur(14px);
}

.screen-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.screen-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d7d0c2;
}

.screen-bar strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 0.82rem;
}

.sample-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 12px;
  border: 1px solid rgba(12, 122, 102, 0.18);
  border-radius: 999px;
  background: rgba(12, 122, 102, 0.08);
  color: var(--accent-strong);
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.summary-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  padding: 12px;
}

.summary-card.wide {
  grid-column: 1 / -1;
}

.summary-card span,
.journal-list span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.flow-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.flow-line i {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.sample-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.sample-metrics div {
  min-width: 0;
  border: 1px solid rgba(217, 222, 229, 0.9);
  border-radius: 8px;
  background: #ffffff;
  padding: 11px;
}

.sample-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.69rem;
  text-transform: uppercase;
}

.sample-metrics strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.preview-chart {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(244, 247, 249, 0.82)),
    #ffffff;
  padding: 12px;
}

.preview-chart svg {
  display: block;
  width: 100%;
  height: 212px;
}

.preview-grid {
  fill: none;
  stroke: rgba(104, 116, 130, 0.18);
  stroke-width: 1.2;
}

.preview-profit,
.preview-loss {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.preview-profit {
  stroke: var(--accent);
}

.preview-loss {
  stroke: rgba(161, 61, 45, 0.42);
}

.chart-key {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-key i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-key .net {
  background: var(--accent);
}

.chart-key .drawdown {
  background: rgba(161, 61, 45, 0.62);
}

.journal-list {
  display: grid;
  gap: 8px;
}

.journal-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px;
}

.journal-list b {
  color: var(--ink);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-band article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 18px 45px rgba(18, 29, 43, 0.06);
}

.feature-band span {
  color: var(--gold);
  font-weight: 850;
}

.feature-band h3 {
  margin: 10px 0 8px;
  font-size: 1.05rem;
}

.feature-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.marketing-grid article {
  border: 1px solid rgba(217, 222, 229, 0.92);
  border-radius: 12px;
  background: #ffffff;
  padding: 20px;
}

.marketing-grid h3 {
  font-size: 1rem;
}

.marketing-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.launch-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(17, 24, 32, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(12, 122, 102, 0.1), transparent 50%),
    #111820;
  color: #ffffff;
  padding: clamp(22px, 4vw, 34px);
}

.launch-panel .eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.launch-panel h3 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}

.launch-panel p {
  margin: 12px 0 0;
  max-width: 700px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.58;
}

.launch-list {
  display: grid;
  gap: 10px;
}

.launch-list span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 750;
}

.app-layout {
  display: grid;
  gap: 18px;
}

.app-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.app-tabs .tab {
  min-height: 36px;
}

.app-tabs .tab.active {
  background: var(--accent);
  color: #ffffff;
}

.app-view {
  display: grid;
  gap: 18px;
}

.manage-view {
  grid-template-columns: minmax(280px, 360px) 1fr;
  align-items: start;
}

.trade-list-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-label {
  min-width: 210px;
  margin: 0;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: rgba(164, 63, 53, 0.28);
}

.danger-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.delete-account-label {
  width: min(260px, 100%);
  margin: 0;
}

.danger-zone p {
  margin: 6px 0 0;
  color: var(--muted);
}

.dashboard-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  font-variant-numeric: tabular-nums;
}

.stat-card.positive strong,
.positive {
  color: #0f7a51;
}

.stat-card.negative strong,
.negative {
  color: #a43f35;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}

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

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.wide-chart-panel {
  grid-column: 1 / -1;
}

.guide-view {
  max-width: none;
}

.guide-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.guide-hero p,
.guide-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.guide-grid,
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.guide-card {
  min-width: 0;
}

.guide-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.guide-card ol,
.guide-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #3d4652;
  line-height: 1.58;
}

.guide-card li + li {
  margin-top: 8px;
}

.checklist-grid b {
  display: block;
  color: var(--ink);
}

.chart-panel {
  min-width: 0;
}

.chart-box {
  min-height: 260px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.chart-svg {
  width: 100%;
  height: 240px;
  overflow: visible;
}

.axis-chart {
  display: block;
}

.chart-plot-bg {
  fill: rgba(255, 255, 255, 0.48);
  stroke: var(--line);
  stroke-width: 1;
}

.chart-grid-line {
  stroke: rgba(42, 50, 57, 0.12);
  stroke-width: 1;
}

.chart-grid-line.vertical {
  stroke: rgba(42, 50, 57, 0.08);
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.negative {
  stroke: #a43f35;
}

.chart-line.positive {
  stroke: #0f7a51;
}

.chart-line.pressure {
  stroke: rgba(161, 61, 45, 0.78);
  stroke-dasharray: 8 7;
}

.chart-zero {
  stroke: rgba(12, 18, 24, 0.35);
  stroke-width: 1.3;
}

.chart-bar {
  background: var(--accent);
  fill: var(--accent);
  opacity: 0.84;
}

.chart-bar.negative {
  fill: #a43f35;
}

.chart-bar.positive {
  fill: #0f7a51;
}

.chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-caption strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  flex-wrap: wrap;
}

.chart-legend span,
.chart-legend strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.net {
  background: var(--accent);
}

.legend-dot.pressure {
  background: rgba(161, 61, 45, 0.78);
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.trade-list-panel .panel-header {
  align-items: start;
  flex-wrap: wrap;
}

.panel-header h3 {
  font-size: 1rem;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.trade-list-controls {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(240px, 1fr) 92px;
  align-items: end;
  gap: 10px;
  width: min(100%, 760px);
  min-width: 0;
}

.search-label,
.account-filter-label,
.page-size-label {
  margin: 0;
  min-width: 0;
}

.search-label,
.account-filter-label {
  width: auto;
}

.page-size-label {
  width: auto;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat-grid .stat-card {
  padding: 12px;
}

.mini-stat-grid .stat-card strong {
  font-size: 1.05rem;
}

.breakdown-list {
  display: grid;
  gap: 12px;
}

.breakdown-item {
  min-width: 0;
}

.breakdown-top,
.breakdown-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.breakdown-top {
  margin-bottom: 8px;
}

.breakdown-top strong,
.breakdown-top span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #ebe6dc;
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--muted);
}

.bar-track i.positive {
  background: linear-gradient(90deg, var(--accent), #22c55e);
}

.bar-track i.negative {
  background: linear-gradient(90deg, #a43f35, #f97316);
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

#importStatus {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

select,
input[type="file"],
input[type="search"],
input[type="text"],
input[type="date"] {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar,
  .manage-view,
  .hero,
  .home,
  .feature-band,
  .marketing-grid,
  .launch-panel,
  .analytics-grid,
  .chart-grid,
  .breakdown-grid,
  .dashboard-header,
  .danger-zone,
  .guide-hero,
  .guide-grid,
  .checklist-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 22px;
  }

  .public-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .hero-copy h1 {
    font-size: clamp(2.7rem, 16vw, 4.2rem);
  }

  .brand-logo {
    max-width: min(380px, 88vw);
    height: min(104px, 24vw);
  }

  .auth-actions {
    justify-content: start;
  }

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

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

  .preview-chart svg {
    height: 180px;
  }

  .trade-list-panel .panel-header,
  .trade-list-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .trade-list-controls {
    width: 100%;
  }

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