:root {
  --bg: #090d14;
  --panel: #0f1623;
  --panel-2: #141d2b;
  --line: #273244;
  --line-soft: #1b2636;
  --text: #eef4ff;
  --muted: #8fa0b7;
  --faint: #5d6c80;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --red: #ef4444;
  --green: #22c55e;
  --amber: #f59e0b;
  --rail-bg: #070a10;
  --panel-bg: rgba(15, 22, 35, 0.96);
  --field-bg: rgba(20, 29, 43, 0.86);
  --field-bg-soft: rgba(20, 29, 43, 0.72);
  --input-bg: #090f1a;
  --button-bg: #101827;
  --bar-track: #253247;
  --main-bg: rgba(9, 13, 20, 0.72);
  --profit-red-bg: rgba(239, 68, 68, 0.16);
  --profit-green-bg: rgba(34, 197, 94, 0.15);
  --focus-ring: rgba(59, 130, 246, 0.18);
  --curve-axis: rgba(148, 163, 184, 0.24);
  --curve-grid: rgba(148, 163, 184, 0.10);
  --curve-line: #60a5fa;
  --curve-line-soft: rgba(96, 165, 250, 0.25);
  --curve-fill: rgba(59, 130, 246, 0.12);
  --curve-label: rgba(203, 213, 225, 0.62);
  --chart-vignette-left: rgba(9, 13, 20, 0.78);
  --chart-vignette-mid: rgba(9, 13, 20, 0.24);
  --chart-vignette-bottom: rgba(9, 13, 20, 0.70);
}

body[data-theme="light"] {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #d5deeb;
  --line-soft: #e8edf5;
  --text: #111827;
  --muted: #64748b;
  --faint: #94a3b8;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --red: #dc2626;
  --green: #16a34a;
  --rail-bg: #eaf0f8;
  --panel-bg: rgba(255, 255, 255, 0.96);
  --field-bg: #ffffff;
  --field-bg-soft: #f8fafc;
  --input-bg: #f8fafc;
  --button-bg: #f1f5f9;
  --bar-track: #dbe4f0;
  --main-bg: #eef3f8;
  --profit-red-bg: rgba(220, 38, 38, 0.12);
  --profit-green-bg: rgba(22, 163, 74, 0.12);
  --focus-ring: rgba(37, 99, 235, 0.14);
  --curve-axis: rgba(100, 116, 139, 0.30);
  --curve-grid: rgba(100, 116, 139, 0.13);
  --curve-line: #2563eb;
  --curve-line-soft: rgba(37, 99, 235, 0.20);
  --curve-fill: rgba(37, 99, 235, 0.09);
  --curve-label: rgba(71, 85, 105, 0.66);
  --chart-vignette-left: rgba(255, 255, 255, 0.82);
  --chart-vignette-mid: rgba(255, 255, 255, 0.30);
  --chart-vignette-bottom: rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .final-money {
  color: var(--text);
  text-shadow: none;
}

body[data-theme="light"] .profit-line {
  text-shadow: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.terminal {
  height: 100svh;
  display: grid;
  grid-template-columns: 76px 360px minmax(420px, 1fr) 370px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(148, 163, 184, 0.10) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

.rail {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 18px;
  padding: 18px 0;
  border-right: 1px solid var(--line);
  background: var(--rail-bg);
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.rail-word {
  writing-mode: vertical-rl;
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.rail-code {
  writing-mode: vertical-rl;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--panel-bg);
}

.panel-head {
  height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--blue-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1 {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

h2 {
  color: var(--text);
  font-size: 17px;
  font-weight: 880;
  letter-spacing: 0;
}

.mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 20px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.mode-btn {
  height: 42px;
  border: 0;
  background: var(--button-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 860;
}

.mode-btn.active {
  background: var(--blue);
  color: white;
}

.form {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 9px;
  padding: 12px 20px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.field {
  border: 1px solid var(--line);
  background: var(--field-bg);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 144px;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
}

label {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 860;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.input-wrap {
  position: relative;
  min-width: 0;
}

.input-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 10px;
  border: 1px solid #334155;
  outline: 0;
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 880;
  text-align: right;
}

.input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.unit {
  position: absolute;
  top: 50%;
  right: 11px;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
}

.slider-area {
  padding: 0 12px 10px;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  appearance: none;
  border-radius: 999px;
  background: var(--bar-track);
  outline: 0;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 3px solid #dbeafe;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.55);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #dbeafe;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.55);
}

.range-tip {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 820;
}

.preset {
  border: 1px solid var(--line);
  background: var(--field-bg-soft);
  padding: 14px;
}

.rate-field .field-row {
  padding-bottom: 8px;
}

.rate-field .slider-area {
  padding-bottom: 8px;
}

.rate-field .preset {
  margin: 0 12px 10px;
  border: 0;
  background: transparent;
  padding: 0;
}

body[data-theme="light"] .rate-field .preset {
  background: transparent;
}

.preset-label {
  display: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 1px solid var(--line-soft);
  background: rgba(7, 10, 16, 0.38);
}

body[data-theme="light"] .preset-row {
  background: rgba(226, 232, 240, 0.36);
}

.preset-btn {
  height: 38px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.preset-btn strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  font-weight: 920;
}

.preset-btn span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
}

.preset-btn.active,
.preset-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  color: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.42);
}

body[data-theme="light"] .preset-btn.active,
body[data-theme="light"] .preset-btn:hover {
  color: var(--blue-2);
}

.left-extras {
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  margin-top: auto;
  align-self: end;
  display: grid;
  gap: 0;
  width: 100%;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.08), transparent 42%),
    var(--field-bg-soft);
}

.visit-card,
.quote-card {
  border: 0;
  background: transparent;
  padding: 10px 12px;
}

.quote-card,
.copyright {
  border-top: 1px solid var(--line-soft);
}

.extra-head,
.visit-meta,
.copyright {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 830;
}

.extra-head b {
  color: var(--blue-2);
  font-size: 11px;
  font-weight: 900;
}

.visit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 7px;
  border: 0;
  background: var(--line-soft);
}

.visit-item {
  min-width: 0;
  background: rgba(7, 10, 16, 0.28);
  padding: 7px 9px;
}

body[data-theme="light"] .visit-item {
  background: rgba(248, 250, 252, 0.78);
}

.visit-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 830;
}

.visit-number {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-weight: 920;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-meta {
  margin-top: 7px;
  color: var(--faint);
}

.quote-text {
  color: var(--text);
  font-size: 12px;
  line-height: 1.42;
  font-weight: 820;
}

.quote-author {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-align: right;
}

.copyright {
  padding: 7px 12px;
  color: var(--faint);
  line-height: 1.4;
}

.stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 82px minmax(0, 1fr) 132px;
  background: var(--main-bg);
}

.stage-head {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.stage-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.year-pill {
  padding: 9px 12px;
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.screen {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(96, 165, 250, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent 42%);
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--chart-vignette-left) 0%, var(--chart-vignette-mid) 42%, transparent 74%),
    linear-gradient(180deg, transparent 0%, transparent 56%, var(--chart-vignette-bottom) 100%);
  opacity: 1;
  transition: opacity 0.28s ease;
}

.screen.is-adjusting::after {
  opacity: 0.42;
}

.amount-zone {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: grid;
  align-content: center;
  overflow: hidden;
  padding: clamp(22px, 3.2vw, 42px);
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
  transition:
    opacity 0.28s ease,
    filter 0.28s ease,
    transform 0.28s ease;
  will-change: opacity, filter, transform;
}

.screen.is-adjusting .amount-zone {
  opacity: 0.16;
  filter: blur(9px);
  transform: translateY(6px) scale(0.985);
}

.result-label {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.result-stack {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.result-row {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.result-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.final-money {
  display: block;
  width: 100%;
  min-width: 0;
  color: #fff;
  font-size: clamp(58px, 9vw, 132px);
  line-height: 0.92;
  font-weight: 920;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.profit-line {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--red);
  font-size: clamp(28px, 4.4vw, 58px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-line.negative {
  color: var(--green);
}

.curve-chart {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  filter: saturate(1) contrast(1);
  transition:
    opacity 0.28s ease,
    filter 0.28s ease;
}

.screen.is-adjusting .curve-chart {
  opacity: 1;
  filter: saturate(1.18) contrast(1.08);
}

.curve-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.curve-axis {
  stroke: var(--curve-axis);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.curve-grid {
  stroke: var(--curve-grid);
  stroke-width: 1;
  stroke-dasharray: 6 10;
  vector-effect: non-scaling-stroke;
}

.curve-fill {
  fill: url(#areaGradient);
  opacity: 1;
}

.curve-line-glow {
  fill: none;
  stroke: var(--curve-line-soft);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: url(#curveGlow);
}

.curve-line {
  fill: none;
  stroke: url(#curveGradient);
  stroke-width: 5.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: stroke-width 0.22s ease;
}

.screen.is-adjusting .curve-line {
  stroke-width: 6.8;
  animation: none;
}

.screen.is-adjusting .curve-fill {
  opacity: 1;
  animation: none;
}

.curve-end-arrow-bg,
.curve-end-arrow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.curve-end-arrow-bg {
  stroke: var(--curve-line);
  stroke-width: 13;
  opacity: 0.24;
  filter: url(#curveGlow);
}

.curve-end-arrow {
  stroke: rgba(239, 246, 255, 0.96);
  stroke-width: 4.8;
  opacity: 0.96;
  filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.72));
}

.curve-hover-line {
  stroke: rgba(191, 219, 254, 0.36);
  stroke-width: 1.6;
  stroke-dasharray: 6 8;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  transition: opacity 0.16s ease;
}

.curve-hover-dot {
  fill: rgba(9, 13, 20, 0.92);
  stroke: rgba(219, 234, 254, 0.96);
  stroke-width: 4;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.72));
  transition: opacity 0.16s ease;
}

.curve-hover-line.is-visible,
.curve-hover-dot.is-visible {
  opacity: 1;
}

.chart-hover-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  cursor: crosshair;
  pointer-events: auto;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 228px;
  width: min(280px, calc(100% - 24px));
  padding: 14px 15px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(8, 13, 24, 0.82);
  color: var(--text);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.28);
  -webkit-backdrop-filter: blur(18px) saturate(1.28);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
}

body[data-theme="light"] .chart-tooltip {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(100, 116, 139, 0.22);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.chart-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tooltip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 14px;
  font-weight: 900;
}

.tooltip-title span {
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 900;
}

.tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.tooltip-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 920;
  white-space: nowrap;
}

.tooltip-row.profit strong {
  color: var(--red);
}

.tooltip-row.loss strong {
  color: var(--green);
}

.tooltip-row.neutral strong {
  color: var(--muted);
}

.curve-label {
  fill: var(--curve-label);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.curve-end-value {
  fill: var(--text);
  font-size: 18px;
  font-weight: 900;
}

@keyframes drawCurve {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeArea {
  to { opacity: 1; }
}

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.flow-card,
.flow-arrow {
  min-width: 0;
  display: grid;
  align-content: center;
  background: var(--panel);
  padding: 18px 22px;
}

.flow-card small,
.metric-name {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.flow-card strong,
.metric-value {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(27px, 3.6vw, 44px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-arrow {
  place-items: center;
  padding: 0;
  color: var(--blue-2);
  font-size: 34px;
  font-weight: 900;
}

.insights {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 156px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 1px;
  background: var(--line);
  border-left: 1px solid var(--line);
}

.metric,
.composition,
.note {
  background: var(--panel-bg);
}

.metric {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: 22px;
}

.metric-value.good {
  color: var(--red);
}

.metric-value.bad {
  color: var(--green);
}

.composition {
  padding: 18px 20px;
}

.composition-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.composition-top h3 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.composition-top span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.split-bar {
  display: flex;
  height: 16px;
  overflow: hidden;
  background: #263244;
}

.principal-fill {
  width: 100%;
  background: #64748b;
  transition: width 0.2s ease;
}

.profit-fill {
  width: 0%;
  background: var(--red);
  transition: width 0.2s ease;
}

.profit-fill.negative-fill {
  background: var(--green);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

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

.legend i {
  width: 8px;
  height: 8px;
  background: #64748b;
}

.legend em {
  font-style: normal;
}

.legend .profit-dot {
  background: var(--red);
}

.legend .profit-dot.negative-dot {
  background: var(--green);
}

.note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  padding: 16px 20px;
}

@media (max-width: 1180px) {
  body {
    height: auto;
    overflow: auto;
  }

  .terminal {
    min-height: 100svh;
    height: auto;
    grid-template-columns: 64px minmax(310px, 360px) minmax(0, 1fr);
  }

  .insights {
    grid-column: 2 / 4;
    border-top: 1px solid var(--line);
    border-left: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    grid-auto-flow: dense;
  }

  .composition,
  .note {
    grid-column: 1 / 4;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  body {
    height: auto;
    overflow: auto;
  }

  .terminal {
    min-height: 100svh;
    height: auto;
  }

  .panel,
  .stage,
  .insights {
    min-height: 100svh;
  }

  .panel-head,
  .stage-head {
    height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .mode {
    margin-top: 12px;
  }

  .mode-btn {
    height: 38px;
  }

  .form {
    gap: 7px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .field-row {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .slider-area {
    padding-bottom: 8px;
  }

  .visit-card,
  .quote-card {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .visit-number {
    font-size: 20px;
  }

  .quote-text,
  .quote-author {
    font-size: 11px;
  }
}

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

  .rail {
    display: none;
  }

  .panel,
  .stage,
  .insights {
    border-right: 0;
    border-left: 0;
  }

  .stage {
    grid-template-rows: auto auto auto;
  }

  .stage-head {
    display: grid;
    padding: 16px;
  }

  .screen {
    padding: 0;
    min-height: 380px;
  }

  .amount-zone {
    padding: 22px 16px;
  }

  .final-money {
    font-size: clamp(42px, 14vw, 72px);
  }

  .profit-line {
    font-size: clamp(26px, 9vw, 44px);
  }

  .curve-chart {
    inset: 0;
  }

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

  .flow-arrow {
    height: 44px;
    font-size: 0;
  }

  .flow-arrow::before {
    content: "↓";
    font-size: 24px;
  }

  .insights {
    grid-column: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .composition,
  .note {
    grid-column: auto;
  }

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

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

  .form {
    overflow: visible;
  }

  .terminal > .left-extras {
    margin: 16px;
    align-self: auto;
    max-height: none;
    overflow: visible;
  }
}
