/* Orizont — stiluri fără dependențe, gândite pentru ecrane întunecate. */

:root {
  color-scheme: dark;
  --bg: #060913;
  --panel: rgba(13, 21, 40, 0.78);
  --panel-strong: #0b1223;
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.22);
  --text: #f6f7fb;
  --text-soft: #c8d2e4;
  --muted: #8b9ab1;
  --muted-2: #64738b;
  --coral: #ff9a62;
  --pink: #ff5f8f;
  --purple: #9b6cff;
  --violet: #9b87ff;
  --orange: #ffb36b;
  --blue: #6d9cff;
  --loss: #ff6b7f;
  --gradient: linear-gradient(115deg, #ff9a62 0%, #ff5f8f 46%, #9b6cff 100%);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-panel: 0 34px 90px -55px rgba(0, 0, 0, 0.95);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(900px 620px at 6% -8%, rgba(255, 95, 143, 0.16), transparent 62%),
    radial-gradient(840px 620px at 98% -4%, rgba(139, 92, 246, 0.18), transparent 62%),
    linear-gradient(180deg, #070b17 0%, #050810 55%, #070b16 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 68%);
}

::selection {
  background: rgba(255, 95, 143, 0.55);
  color: #fff;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: #101426;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.32;
}

.ambient-blob--coral {
  top: -220px;
  left: -150px;
  width: 560px;
  height: 560px;
  background: #ff5f8f;
}

.ambient-blob--violet {
  top: 80px;
  right: -220px;
  width: 640px;
  height: 640px;
  background: #7c3aed;
  opacity: 0.26;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
}

.brand:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 5px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 14px;
  background: var(--gradient);
  color: #1a0d16;
  box-shadow: 0 12px 28px -12px rgba(255, 95, 143, 0.8);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.currency-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.currency-button {
  min-width: 46px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.currency-button:hover {
  color: var(--text);
}

.currency-button.is-active {
  background: linear-gradient(120deg, #ffb36b, #ff5f8f);
  color: #1b0d16;
  box-shadow: 0 5px 16px -7px rgba(255, 95, 143, 0.9);
}

.currency-button:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 56px;
}

.hero {
  max-width: 900px;
  padding: 58px 0 38px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: #d1a9b8;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(255, 95, 143, 0.8);
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.45rem, 5.3vw, 4rem);
  font-weight: 760;
  letter-spacing: -0.052em;
  line-height: 1.02;
}

.gradient-text {
  background: linear-gradient(100deg, #ffc09c 0%, #ff6f9d 47%, #b79aff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  max-width: 610px;
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(340px, 402px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(21, 31, 56, 0.82), rgba(9, 15, 30, 0.82)),
    var(--panel);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.form-panel {
  padding: 26px;
}

.panel-head,
.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-head {
  margin-bottom: 24px;
}

.section-kicker {
  margin: 0 0 5px;
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel h2,
.results-head h2,
.section-heading h2 {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.pill {
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(255, 95, 143, 0.22);
  border-radius: 999px;
  background: rgba(255, 95, 143, 0.075);
  color: #ffb3c7;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.form-error {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 107, 127, 0.32);
  border-radius: 12px;
  background: rgba(255, 107, 127, 0.1);
  color: #ffb3bd;
  font-size: 0.78rem;
  line-height: 1.45;
}

.form-error:focus {
  outline: 2px solid rgba(255, 107, 127, 0.55);
  outline-offset: 2px;
}

.field-group {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.field-group--rates {
  margin-bottom: 24px;
}

.group-title {
  width: 100%;
  margin-bottom: 13px;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.group-note {
  margin: -5px 0 13px;
  color: var(--muted-2);
  font-size: 0.71rem;
  line-height: 1.5;
}

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

.field {
  min-width: 0;
}

.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
  color: #c8d3e5;
  font-size: 0.79rem;
  font-weight: 620;
  line-height: 1.25;
}

.label-hint {
  flex: none;
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell input {
  width: 100%;
  height: 50px;
  padding: 0 48px 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 13px;
  outline: none;
  background: rgba(3, 7, 16, 0.54);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.input-shell input:hover {
  border-color: rgba(148, 163, 184, 0.26);
}

.input-shell input:focus {
  border-color: rgba(255, 95, 143, 0.68);
  background: rgba(4, 9, 20, 0.78);
  box-shadow:
    0 0 0 3px rgba(255, 95, 143, 0.13),
    inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.unit {
  position: absolute;
  right: 13px;
  color: var(--muted-2);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  pointer-events: none;
}

.field.has-error .input-shell input {
  border-color: rgba(255, 107, 127, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 107, 127, 0.1);
}

.field-error {
  margin: 5px 0 0;
  color: #ff9ba8;
  font-size: 0.68rem;
  line-height: 1.35;
}

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

.rate-field {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
}

.tone-pessimistic {
  --tone: var(--violet);
}

.tone-base {
  --tone: var(--pink);
}

.tone-optimistic {
  --tone: var(--orange);
}

.rate-field label {
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.7rem;
}

.rate-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 9px color-mix(in srgb, var(--tone) 70%, transparent);
}

.rate-field .input-shell input {
  height: 42px;
  padding: 0 28px 0 10px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.rate-field .unit {
  right: 9px;
  font-size: 0.64rem;
}

.rate-field:focus-within {
  border-color: color-mix(in srgb, var(--tone) 48%, transparent);
  background: rgba(255, 255, 255, 0.035);
}

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  overflow: hidden;
  padding: 0 20px;
  border: 0;
  border-radius: 15px;
  background: var(--gradient);
  color: #1c0d16;
  font-size: 0.93rem;
  font-weight: 780;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow:
    0 16px 34px -16px rgba(255, 95, 143, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-button::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-18deg);
  transition: left 420ms ease;
}

.primary-button:hover {
  filter: saturate(1.08) brightness(1.03);
  transform: translateY(-1px);
  box-shadow:
    0 21px 42px -17px rgba(255, 95, 143, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-button:hover::after {
  left: 115%;
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible {
  outline: 2px solid #ffd0da;
  outline-offset: 3px;
}

.primary-button svg {
  width: 19px;
  height: 19px;
  flex: none;
}

.form-footnote {
  margin: 12px 1px 0;
  color: var(--muted-2);
  font-size: 0.67rem;
  line-height: 1.55;
  text-align: center;
}

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

.results-head {
  align-items: flex-end;
  margin: 0 2px 14px;
}

.results-note {
  max-width: 285px;
  margin: 0;
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: right;
}

.results-note.is-stale {
  color: #ffc28d;
}

.scenario-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 11px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.028);
}

.scenario-tab {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.scenario-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.scenario-tab.is-active {
  border-color: color-mix(in srgb, var(--tone) 48%, transparent);
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--tone) 13%, transparent), rgba(255, 255, 255, 0.025));
  color: var(--text);
}

.scenario-tab:focus-visible {
  outline: 2px solid var(--tone);
  outline-offset: 2px;
}

.tab-dot {
  grid-row: 1 / 3;
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
  opacity: 0.9;
}

.tab-name {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-rate {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-tab.is-active .tab-rate {
  color: color-mix(in srgb, var(--tone) 70%, #fff);
}

.result-hero {
  --hero-tone: var(--pink);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px 29px 24px;
  border: 1px solid color-mix(in srgb, var(--hero-tone) 28%, transparent);
  border-radius: 30px;
  background:
    radial-gradient(620px 320px at 100% -5%, color-mix(in srgb, var(--hero-tone) 20%, transparent), transparent 64%),
    radial-gradient(480px 300px at -8% 110%, rgba(124, 58, 237, 0.17), transparent 65%),
    linear-gradient(148deg, rgba(24, 33, 61, 0.94), rgba(8, 13, 28, 0.96));
  box-shadow:
    0 40px 100px -60px color-mix(in srgb, var(--hero-tone) 70%, #000),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.result-hero[data-tone="pessimistic"] {
  --hero-tone: var(--violet);
}

.result-hero[data-tone="base"] {
  --hero-tone: var(--pink);
}

.result-hero[data-tone="optimistic"] {
  --hero-tone: var(--orange);
}

.hero-glow {
  position: absolute;
  z-index: -1;
  top: -90px;
  right: -70px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: var(--hero-tone);
  filter: blur(95px);
  opacity: 0.14;
}

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

.hero-scenario {
  color: color-mix(in srgb, var(--hero-tone) 72%, #fff);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-rate {
  flex: none;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--hero-tone) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--hero-tone) 10%, transparent);
  color: #f2eaf0;
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.hero-label {
  margin: 25px 0 7px;
  color: #a9b5c9;
  font-size: 0.79rem;
}

.hero-value {
  margin: 0;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #ffffff 30%, #d9e1f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(2.25rem, 4.4vw, 3.65rem);
  font-weight: 770;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.058em;
  line-height: 1.03;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.hero-stat + .hero-stat {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-stat span {
  display: block;
  margin-bottom: 5px;
  color: #8391a8;
  font-size: 0.66rem;
  line-height: 1.35;
}

.hero-stat strong {
  display: block;
  color: #f2f5fb;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hero-stat strong.is-negative {
  color: #ff8f9e;
}

.hero-caption {
  margin: 16px 0 0;
  color: #7e8ca3;
  font-size: 0.7rem;
  line-height: 1.5;
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
}

.scenario-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 19px;
  background: rgba(10, 17, 33, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.scenario-card.is-selected {
  border-color: color-mix(in srgb, var(--tone) 42%, transparent);
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--tone) 9%, transparent), rgba(10, 17, 33, 0.66));
  box-shadow:
    0 16px 34px -30px color-mix(in srgb, var(--tone) 75%, #000),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.scenario-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.scenario-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d4dded;
  font-size: 0.72rem;
  font-weight: 700;
}

.scenario-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--tone);
}

.scenario-rate {
  color: var(--muted-2);
  font-size: 0.61rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scenario-final-label {
  margin: 14px 0 2px;
  color: var(--muted-2);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scenario-final {
  margin: 0;
  color: #f2f5fb;
  font-size: 1.2rem;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scenario-facts {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 11px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.scenario-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.scenario-fact dt {
  color: var(--muted-2);
  font-size: 0.64rem;
}

.scenario-fact dd {
  margin: 0;
  color: #c7d1e2;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.scenario-fact dd.is-negative {
  color: #ff8f9e;
}

.scenario-monthly {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  color: var(--muted-2);
  font-size: 0.61rem;
}

.scenario-monthly strong {
  color: #b9c5d8;
  font-size: 0.63rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.charts-section,
.method-section {
  margin-top: 56px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 17px;
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
}

.section-heading > p {
  max-width: 340px;
  margin: 0;
  color: var(--muted-2);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: right;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 23px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.chart-head h3 {
  margin: 0;
  color: #edf1f8;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.chart-head p {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.45;
}

.chart-badge {
  flex: none;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.61rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.comparison-chart {
  margin-top: 28px;
}

.compare-row + .compare-row {
  margin-top: 20px;
}

.compare-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.compare-label {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.compare-value {
  color: #e8edf6;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: right;
  overflow-wrap: anywhere;
}

.compare-value.is-negative {
  color: #ff8f9e;
}

.compare-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.compare-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  box-shadow: 0 0 16px -5px currentColor;
}

.compare-fill.tone-invested {
  background: linear-gradient(90deg, #4d7cf0, #8fb4ff);
  color: #6d9cff;
}

.compare-fill.tone-profit {
  background: linear-gradient(90deg, #ff9a62, #ff5f8f);
  color: #ff608d;
}

.compare-fill.tone-loss {
  background: linear-gradient(90deg, #ff5a70, #ff8a98);
  color: #ff6b7f;
}

.compare-fill.tone-final {
  background: linear-gradient(90deg, #8b5cf6, #ff5f8f 75%, #ff9a62);
  color: #b06cff;
}

.compare-zero {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.compare-axis {
  position: relative;
  height: 20px;
  margin-top: 7px;
}

.compare-axis-label {
  position: absolute;
  top: 3px;
  color: var(--muted-2);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
}

.compare-axis-label.is-start {
  transform: translateX(0);
}

.compare-axis-label.is-end {
  transform: translateX(-100%);
}

.chart-note {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted-2);
  font-size: 0.65rem;
  line-height: 1.5;
}

.comparison-insight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 17px;
}

.insight-metric {
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.insight-metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 0.6rem;
  line-height: 1.35;
}

.insight-metric strong {
  color: #dfe7f3;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.insight-metric strong.is-negative {
  color: #ff8f9e;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 18px 0 4px;
  padding: 0;
  list-style: none;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9ca9be;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 3px;
}

.legend-swatch--line {
  width: 17px;
  height: 0;
  border-radius: 0;
  border-top: 2px dashed var(--muted);
  background: none !important;
}

.chart-canvas {
  width: 100%;
  min-height: 290px;
}

.evolution-svg {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(148, 163, 184, 0.11);
  stroke-width: 1;
}

.chart-axis-text {
  fill: #7e8da6;
  font-family: var(--font);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chart-axis-unit {
  fill: #5f6e86;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.data-details {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.data-details summary {
  position: relative;
  padding-right: 24px;
  color: #aab6c9;
  font-size: 0.72rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.data-details summary::after {
  content: "+";
  position: absolute;
  top: -2px;
  right: 2px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

.data-details[open] summary::after {
  content: "−";
}

.data-details summary:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  border-radius: 4px;
}

.table-wrap {
  max-height: 310px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  scrollbar-width: thin;
}

.table-wrap table {
  width: 100%;
  min-width: 570px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table-wrap th,
.table-wrap td {
  padding: 8px 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.68rem;
  text-align: right;
  white-space: nowrap;
}

.table-wrap th:first-child {
  text-align: left;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0d1629;
  color: #9eabc0;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.table-wrap tbody th {
  color: #bdc9dc;
  font-weight: 650;
}

.table-wrap tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

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

.method-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(18, 27, 49, 0.64), rgba(8, 14, 28, 0.58));
}

.method-number {
  display: block;
  margin-bottom: 16px;
  background: linear-gradient(100deg, #ffb36b, #ff5f8f 55%, #b79aff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 1;
}

.method-card h3 {
  margin: 0 0 8px;
  color: #e9eef7;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.method-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.55;
}

.method-card em {
  color: var(--text-soft);
  font-style: italic;
}

.method-card code {
  display: block;
  overflow-x: auto;
  padding: 9px 11px;
  border: 1px solid rgba(255, 95, 143, 0.12);
  border-radius: 9px;
  background: rgba(255, 95, 143, 0.055);
  color: #ffb7c9;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
  white-space: nowrap;
  scrollbar-width: thin;
}

.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px dashed rgba(255, 154, 98, 0.2);
  border-radius: 14px;
  background: rgba(255, 154, 98, 0.035);
  color: var(--muted-2);
  font-size: 0.7rem;
  line-height: 1.55;
}

.disclaimer svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
  color: var(--coral);
}

.no-script {
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 154, 98, 0.25);
  border-radius: 12px;
  background: rgba(255, 154, 98, 0.08);
  color: #ffc9a5;
  font-size: 0.8rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 32px 34px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
  color: var(--muted-2);
  font-size: 0.66rem;
}

@media (max-width: 1080px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-panel {
    padding: 26px;
  }

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

  .results-head {
    margin-top: 2px;
  }
}

@media (max-width: 920px) {
  .charts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 760px) {
  .site-header {
    flex-wrap: wrap;
    padding: 20px 20px 0;
  }

  .currency-control {
    width: 100%;
    justify-content: space-between;
  }

  main {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    padding: 42px 0 28px;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 9.2vw, 3.1rem);
  }

  .hero-copy {
    font-size: 0.93rem;
  }

  .form-panel {
    padding: 20px;
  }

  .input-shell input {
    font-size: 16px;
  }

  .results-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .results-note {
    max-width: none;
    text-align: left;
  }

  .result-hero {
    padding: 22px 20px 20px;
  }

  .hero-stats {
    gap: 12px;
  }

  .hero-stat + .hero-stat {
    padding-left: 12px;
  }

  .scenario-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
    scrollbar-width: thin;
  }

  .scenario-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .section-heading > p {
    max-width: 520px;
    text-align: left;
  }

  .charts-section,
  .method-section {
    margin-top: 42px;
  }

  .chart-card {
    padding: 18px;
  }

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

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rate-grid {
    gap: 7px;
  }

  .rate-field {
    padding: 9px 8px;
  }

  .rate-field label {
    font-size: 0.66rem;
  }

  .scenario-tab {
    padding: 7px 8px;
    column-gap: 6px;
  }

  .tab-name {
    font-size: 0.71rem;
  }

  .tab-rate {
    font-size: 0.58rem;
  }

  .hero-value {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .hero-stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 20px;
    padding-top: 8px;
  }

  .hero-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
  }

  .hero-stat + .hero-stat {
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    border-left: 0;
  }

  .hero-stat span {
    margin: 0;
  }

  .hero-stat strong {
    text-align: right;
  }

  .scenario-card {
    flex-basis: 86%;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-head {
    flex-direction: column;
    gap: 8px;
  }

  .chart-badge {
    align-self: flex-start;
  }
}

@media (max-width: 400px) {
  .currency-label {
    display: none;
  }

  .currency-control {
    justify-content: flex-end;
  }

  .hero h1 {
    font-size: 2.05rem;
  }

  .form-panel {
    padding: 17px;
  }

  .result-hero {
    padding: 20px 17px 18px;
  }

  .compare-label {
    font-size: 0.72rem;
  }

  .compare-value {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
