@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/Inter-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/Inter-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "IBMPlexSans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBMPlexSans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --body-bg: #0c0d13;
  --aside-bg: #11161d;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-strong: rgba(255, 255, 255, 0.04);
  --field: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  --text: #f5f7fb;
  --muted: rgba(245, 247, 251, 0.54);
  --muted-weak: rgba(245, 247, 251, 0.36);
  --main: #00e5ff;
  --main-soft: rgba(0, 229, 255, 0.12);
  --green: #38d39f;
  --red: #ff7a7a;
  --amber: #f5c542;
  --radius: 1.22rem;
  --header-height: 6rem;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: max(62.5%, 10px);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--body-bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 1.6rem;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

button {
  appearance: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-frame {
  min-height: 100dvh;
}

.dashboard {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 13, 19, 0.96);
  backdrop-filter: blur(12px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 229, 255, 0.02);
  pointer-events: none;
}

h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.9rem, 1.5vw, 2.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 1.2rem;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 148rem);
  margin: 0 auto;
  padding: 1.2rem 2rem 4rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--field);
  font-size: 1.24rem;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--main);
  box-shadow: 0 0 0 0.38rem rgba(0, 229, 255, 0.08);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(31rem, 38rem) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.control-panel,
.result-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.control-panel {
  position: sticky;
  top: 7.2rem;
  display: grid;
  gap: 1.35rem;
  padding: 1.65rem;
}

.panel-head {
  display: grid;
  gap: 0.35rem;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.18rem;
}

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

label,
legend {
  color: var(--muted);
  font-size: 1.18rem;
  font-weight: 400;
}

.helper {
  margin: -0.1rem 0 0;
  color: var(--muted-weak);
  font-size: 1.1rem;
  line-height: 1.42;
}

input,
select {
  width: 100%;
  min-height: 4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.8rem;
  background: var(--field);
  color: #fff;
  padding: 0 1.2rem;
  outline: none;
  font-size: 1.28rem;
}

select {
  color-scheme: dark;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

input:focus,
select:focus {
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 0 0.15rem rgba(0, 229, 255, 0.08);
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented legend {
  grid-column: 1 / -1;
  margin-bottom: 0.15rem;
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 3.6rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--field);
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.18rem;
  font-weight: 600;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.segmented span:hover {
  border-color: rgba(0, 229, 255, 0.28);
  color: #fff;
}

.segmented input:checked + span {
  border-color: rgba(0, 229, 255, 0.38);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(56, 211, 159, 0.14));
  color: #e9ffff;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 4rem;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(56, 211, 159, 0.16));
  color: #d2ffff;
  cursor: pointer;
  font-size: 1.28rem;
  font-weight: 600;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.primary-action:hover {
  border-color: rgba(0, 229, 255, 0.48);
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.24), rgba(56, 211, 159, 0.2));
}

.primary-action:active {
  transform: translateY(1px) scale(0.99);
}

.primary-action svg {
  width: 1.8rem;
  height: 1.8rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.1rem;
}

.samples button,
.ghost-link {
  min-height: 3.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: rgba(255, 255, 255, 0.72);
  padding: 0 1rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 1.14rem;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.samples button:hover,
.ghost-link:hover {
  border-color: rgba(0, 229, 255, 0.28);
  color: #fff;
  background: rgba(0, 229, 255, 0.065);
}

.samples button:active,
.ghost-link:active {
  transform: translateY(1px) scale(0.98);
}

.result-panel {
  min-height: 61rem;
  padding: 1.65rem;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 56rem;
  max-width: 52rem;
}

.empty-state h2 {
  color: rgba(255, 255, 255, 0.86);
  font-size: 2.7rem;
  font-weight: 600;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: rgba(0, 229, 255, 0.72);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

.loading-state {
  display: grid;
  gap: 1.2rem;
}

.skeleton {
  min-height: 9.8rem;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.035) 25%, rgba(0, 229, 255, 0.075) 38%, rgba(255, 255, 255, 0.035) 52%);
  background-size: 220% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
}

.skeleton.wide {
  min-height: 7.6rem;
}

.skeleton.chart {
  min-height: 26rem;
}

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.error-state {
  border: 1px solid rgba(255, 122, 122, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 122, 122, 0.1);
  color: #ff9c9c;
  padding: 1.4rem;
  font-weight: 600;
}

.report-view {
  display: grid;
  gap: 1.6rem;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 1.8rem;
  align-items: start;
}

#reportToken {
  font-family: "IBMPlexSans", "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  text-transform: none;
}

.metric-grid,
.risk-list,
.range-row,
.context-grid {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line-soft);
}

.metric-grid,
.risk-list,
.range-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.metric,
.risk-list div,
.range-row div,
.fee-summary div,
.context-grid p {
  min-width: 0;
  background: rgba(255, 255, 255, 0.028);
  padding: 1.35rem;
}

.context-grid p {
  min-height: 7.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.45;
}

.fee-metric {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.07), rgba(56, 211, 159, 0.04));
}

.fee-metric strong {
  color: #d8ffff;
}

.metric span,
.risk-list span,
.range-row span,
.fee-summary span {
  display: block;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.25;
}

.metric strong,
.risk-list strong,
.range-row strong,
.fee-summary strong {
  display: block;
  margin-top: 0.55rem;
  color: #fff;
  font-family: "IBMPlexSans", "SFMono-Regular", Consolas, monospace;
  font-size: 1.62rem;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.risk-extreme,
.risk-high {
  color: var(--red) !important;
}

.risk-medium {
  color: var(--amber) !important;
}

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

.chart-wrap {
  height: 34rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
  overflow: hidden;
}

#priceChart {
  display: block;
  width: 100%;
  height: 100%;
}

.section-line {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}

.fee-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line-soft);
}

.fee-summary strong {
  font-size: 1.42rem;
}

.fee-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line-soft);
}

.fee-meta p {
  min-height: 6.2rem;
  margin: 0;
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  padding: 1.25rem;
  font-size: 1.18rem;
  line-height: 1.42;
}

.fee-tier-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.fee-tier-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.75fr) minmax(7rem, 1fr) minmax(7rem, 1fr) minmax(8rem, 1fr) minmax(10rem, 1.15fr);
  gap: 1rem;
  align-items: center;
  min-height: 4.2rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.025);
  padding: 0.9rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.18rem;
}

.fee-tier-row.best {
  border-color: rgba(0, 229, 255, 0.32);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(56, 211, 159, 0.08));
  color: #e8ffff;
}

.fee-tier-row strong {
  color: #fff;
  font-family: "IBMPlexSans", "SFMono-Regular", Consolas, monospace;
  font-size: 1.34rem;
  font-weight: 500;
}

.warning {
  margin: 1.2rem 0 0;
  border-left: 3px solid var(--amber);
  color: #ffd983;
  padding-left: 1rem;
  font-size: 1.22rem;
}

@media (max-width: 1024px) {
  :root {
    --header-height: 6.9rem;
  }

  .topbar {
    min-height: 6.9rem;
  }

  .app-shell {
    padding: 1.6rem;
  }

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

  .control-panel {
    position: static;
  }

}

@media (max-width: 720px) {
  body {
    font-size: 1.4rem;
  }

  .topbar {
    padding: 0 1.6rem;
  }

  .app-shell {
    padding: 1.2rem 1.6rem 3rem;
  }

  .form-grid,
  .metric-grid,
  .risk-list,
  .range-row,
  .fee-summary,
  .fee-meta,
  .context-grid {
    grid-template-columns: 1fr;
  }

  .fee-tier-row {
    grid-template-columns: 1fr 1fr;
  }

  .fee-metric {
    grid-column: auto;
  }

  .result-panel,
  .control-panel {
    padding: 1.35rem;
    border-radius: 1.4rem;
  }

  .empty-state {
    min-height: 34rem;
  }

  .empty-state h2 {
    font-size: 2.25rem;
  }

  .chart-wrap {
    height: 27rem;
  }

  .status-pill {
    font-size: 1.1rem;
  }
}
